Selecting features on a map in an app

199
2
04-11-2018 10:55 PM
CoraColeman
New Contributor III

Using the "Feature layer selection" sample code, how does the zoom-in work where when I select a feature, it zooms to it a certain odd way? Is this part of the Envelope?

Tags (2)
0 Kudos
2 Replies
ShellyGill1
Esri Contributor

Hi Cora,

I think you may be referring to the line where the initial map extent is set - arcgis-runtime-samples-android/MainActivity.java at master · Esri/arcgis-runtime-samples-android · G...  - this line is just using a hardcoded Envelope to set the map extent to a suitable location and scale so that you can easily see individual features. There's nothing in the code that I can see that would zoom to a specific feature after having tapped it to select it - although that would be easy to add in, if required.

There is code that creates an Envelope around the tapped location and uses that to perform the query that selects the features - I believe this is just to make a sort of tolerance around the feature to make selection easier without needing to be so precise.

Hope this helps,

Shelly

0 Kudos
CoraColeman
New Contributor III

Thanks for your response! I have found that it oddly zooms to it anyway (though there appears to be no code that does this in the sample).

0 Kudos