Hi,
is there any posibility to select only the Features located inside the Selection-Geometry?
The Method featureLayer.selectFeatures(query,FeatureLayer.SELECTION_NEW) as well takes
the Features intersecting the shape of the Selection-Geometry
Chris
Solved! Go to Solution.
You're correct. That should have been SPATIAL_REL_CONTAINS
You can set the spatialRelationship method of the Query task. By default, it's SPATIAL_REL_INTERSECTS
, but you can set it to SPATIAL_REL_WITHIN
.
Hi, |
thank you for the response. Your Suggestion works in the wrong direction.
I want to select all PolygonFeatures from FLayer located completly in
a handdrawn Polygon called geo.
SPATIAL_REL_WITHIN gives a result if geo is complete located in one Feature
of FLayer.
function clipFLayer(geo) {
var selectionQuery = new esri.tasks.Query();
selectionQuery.spatialRelationship = esri.tasks.Query.SPATIAL_REL_WITHIN;
selectionQuery.geometry = geo;
FLayer = new esri.layers.FeatureLayer(theService, {outFields: ["*"]});
FLayer.selectFeatures(selectionQuery,esri.layers.FeatureLayer.SELECTION_NEW);
FLayer.on("selection-complete", findRelatedRecords);
}
You're correct. That should have been SPATIAL_REL_CONTAINS
Thank you!