how can I share/send a location?

698
3
09-06-2017 07:05 AM
Radheshsoni
New Contributor

I want to share/ send my location (Coordinates and place name) on longpress function. how i can i do ?

0 Kudos
3 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.  Now depending on what location you are interested in grabbing, you can either call MapView.identifyLayersAsync to identify a layer on the map and send that to an ACTION_SEND intent or if you are interested in getting the physical x, y of the location (in terms of the projection used) you can use MapView.screenToLocation(point) and the point is the point you get from the OnLongPress listener motionevent.  Then you can reverse geocode that point to get an address.

I hope this helps!

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

Locking this thread as it is a duplicate

0 Kudos