find string value (place name ) of coordinates..?

900
4
09-07-2017 09:17 AM
Radheshsoni
New Contributor

I want to display name of the place where i touch on map instead of displaying coordinates.. 

0 Kudos
4 Replies
AlexanderNohe1
Occasional Contributor III

Extend the DefaultMapViewTouchListener (DefaultMapViewOnTouchListener| arcgis-android ) and then override the onLongPress(MotionEvent event) method to include the details in grabbing the location. Get the physical x, y of the location and use MapView.screenToLocation(point) and take that point and use it in the reverse geocode to change that point to an address.

 

I hope this helps!

Radheshsoni
New Contributor

Sorry Sir i am not getting you. 
Can you share a example/Source Code for arcgis 10.2.9 android sdk ?

0 Kudos
Radheshsoni
New Contributor
@Override
public void onSingleTap(float x, float y) {

unable to pass onSingleTap(MotionEvent point){

what should i do ???

i am using arcgis 10.2.9 android sdk.

0 Kudos
AlexanderNohe1
Occasional Contributor III

The documentation I sent you is for runtime 100 which is the newer version of the runtime.

Inside your onSingleTap override, do this:

Use the toMapPoint method of the mapview, convert the screen point (x,y) to map coordinates :
MapView | ArcGIS Android 10.2.9 API 

Then you can use reverse geocoding to generate an address / place name:
https://developers.arcgis.com/android/10-2/api-reference/reference/com/esri/core/tasks/geocode/Locat...