Get Current coordinate on the map

3143
1
Jump to solution
12-15-2013 04:44 PM
JonathanAng
New Contributor
hi i would like to get the current coordinate of the user on the mapview.
i tried using AGSGeometryEngine to convert the coordinate i got from CLLocationManager as shown:

AGSPoint* gpsPoint = [[AGSPoint alloc] initWithX:location.coordinate.longitude                                                        y:location.coordinate.latitude                                         spatialReference:[AGSSpatialReference wgs84SpatialReference]];                  AGSGeometryEngine* engine = [AGSGeometryEngine defaultGeometryEngine];                  AGSPoint* mapPoint = (AGSPoint*) [engine projectGeometry:gpsPoint                                               toSpatialReference:self.mapView.spatialReference];


My question is how do i get the x and y coordinate in NSString instead of AGSPoint or AGSGeometry?

Is there another way to get the current coordinate?

Thanks!
0 Kudos
1 Solution

Accepted Solutions
JonathanAng
New Contributor
Hi i manage to solve my own problem.

      
 double x =mapPoint.x; double y =mapPoint.y;


allow you to get x and y coordinate from AGSPoint. Thanks

View solution in original post

0 Kudos
1 Reply
JonathanAng
New Contributor
Hi i manage to solve my own problem.

      
 double x =mapPoint.x; double y =mapPoint.y;


allow you to get x and y coordinate from AGSPoint. Thanks
0 Kudos