select a polygon android

1227
2
02-17-2017 11:41 PM
mahshidfallah1
New Contributor

i need select a polygon in mapView. how i can do it? in android

Tags (1)
0 Kudos
2 Replies
mahshidfallah1
New Contributor

please help

0 Kudos
ShellyGill1
Esri Contributor

Hi Mahshid,

Is your Polygon a Graphic or a Feature? Both can be selected, but you will need to know what you are trying to select. 

Here's one example of selecting Features from a FeatureLayer by performing a spatial query - selecting all features within a certain buffer distance of a point - Edit features—ArcGIS Runtime SDK for Android | ArcGIS for Developers . 

If you are working with Graphics, there is no equivalent method that will query and select graphics in a GraphicsOverlay. However, you can use the Graphic.setSelected method to select an individual Graphic. You can get a reference the Graphic that a user tapped on as shown in this sample - Identify Graphics Hittest—ArcGIS Runtime SDK for Android | ArcGIS for Developers - so you could just add the call to setSelected to that sample code to see how it works.

Hope this helps,

Shelly