coordinates singletap mapview

1600
3
Jump to solution
07-28-2016 07:49 AM
MohamedEzzerI
New Contributor III

How to get coordinates on singletap mapview ?

0 Kudos
1 Solution

Accepted Solutions
AlexanderNohe1
Occasional Contributor III
mMapView.setOnSingleTapListener(new OnSingleTapListener() {
  @Override public void onSingleTap(float v, float v1) {
  Point p = mMapView.toMapPoint(v,v1);
   Point newPoint =
  (Point) GeometryEngine.project(p, mMapView.getSpatialReference(), SpatialReference.create(4326));
   Log.e("NewPointCoords", "" + newPoint.getX() + " " + newPoint.getY());
  }
});



This would give you the coordinates in spatial reference 4326

View solution in original post

3 Replies
AlexanderNohe1
Occasional Contributor III
mMapView.setOnSingleTapListener(new OnSingleTapListener() {
  @Override public void onSingleTap(float v, float v1) {
  Point p = mMapView.toMapPoint(v,v1);
   Point newPoint =
  (Point) GeometryEngine.project(p, mMapView.getSpatialReference(), SpatialReference.create(4326));
   Log.e("NewPointCoords", "" + newPoint.getX() + " " + newPoint.getY());
  }
});



This would give you the coordinates in spatial reference 4326

NikhilPawar
New Contributor

Hello,

Can you provide an alternate method for the setOnSingleTapListener in ArcGis 100 in Android?

0 Kudos
AlexanderNohe1
Occasional Contributor III

Hi Mohamed EzzerI​,

Did the previous example help resolve your issue?  If so, would you please mark it as correct?

Thanks.

0 Kudos