obtain longitude and latitude in onSingleTap

2100
2
Jump to solution
09-30-2012 01:31 AM
josejavier
New Contributor
Hello,

for obtain point for the map from a coordenas, I use:   (center: longitude and latitude)

Point centerPt3 = (Point) GeometryEngine
    .project(center,SpatialReference.create(4326),mapa.getSpatialReference());

now I want the opposite, from point obtain coordinates :
      public void onSingleTap(float x, float y) {    
         Point pnt = mapa.toMapPoint(x, y);


but Pnt is not correct  longitude and latitude

thanks
0 Kudos
1 Solution

Accepted Solutions
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
I'm not sure if I am reading this correct, but can you simply project your point location in the reverse of what you are doing to center?

public void onSingleTap(float x, float y) {  Point pnt = (Point) GeometryEngine.project(mapa.toMapPoint(x, y),mapa.getSpatialReference(),SpatialReference.create(4326));

View solution in original post

0 Kudos
2 Replies
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
I'm not sure if I am reading this correct, but can you simply project your point location in the reverse of what you are doing to center?

public void onSingleTap(float x, float y) {  Point pnt = (Point) GeometryEngine.project(mapa.toMapPoint(x, y),mapa.getSpatialReference(),SpatialReference.create(4326));
0 Kudos
josejavier
New Contributor
OK, very thanks
0 Kudos