Select to view content in your preferred language

Selecting features from a feature layer

650
1
01-21-2013 02:48 AM
ab1
by
Deactivated User
Hello,

I'd like to select features on a map click from a feature layer.
I'm using the selectFeatures() function of the featureLayer.
So in a mapClick event handler I wrote the following code:
query.geometry = event.mapPoint;
query.relationParam = com.esri.ags.tasks.supportClasses.Query.SPATIAL_REL_INTERSECTS;
featureLayer.selectFeatures(query);
Alert.show("Selection performed");

When I click on a feature from the featureLayer, the response is empty (as it appears in firebug). And the feature is not selected on the map.
Am I missing something?
Is there any example that I could follow?

Regards.
Tags (2)
0 Kudos
1 Reply
DasaPaddock
Esri Regular Contributor
This should work if the geometry type of the layer is polygon; otherwise you'll need to turn the point into a small extent so that it can search for line or point features that intersect that extent.
0 Kudos