AnsweredAssumed Answered

Query() issue

Question asked by MRKomp on Dec 28, 2015
Latest reply on Dec 28, 2015 by rscheitlin

Hello All,

 

I'm trying to execute a query to a selection to display data that intersects another feature layer only. For some reason, my query still returns all the shapes from the layer I am querying. Thanks in advance for your help! Here is the code:

 

               var featureLayer = new FeatureLayer("URL", {

                    mode: FeatureLayer.MODE_SNAPSHOT,

                    outFields: ["*"],

                    infoTemplate: template

                });

                featureLayer.setDefinitionExpression("Cooperator like 'John%'");

       

                var pondLayer = new FeatureLayer("URL", {

                    mode: FeatureLayer.Mode_Selection,

                    outFields: ["*"],

                });           

               

                var PondQuery = new Query();

                PondQuery.geometry = featureLayer.geometry;

                PondQuery.spatialRelationship = Query.SPATIAL_REL_INTERSECTS;

                PondQuery.outFields=["*"];

                PondQuery.returnGeometry = true;

               

                pondLayer.selectFeatures(PondQuery, FeatureLayer.SELECTION_NEW);

Outcomes