AGSPoint *currentPoint = [AGSPoint pointWithX:longValue y:latValue spatialReference:[AGSSpatialReference wgs84SpatialReference]]; currentPoint = (AGSPoint *)[[AGSGeometryEngine defaultGeometryEngine] projectGeometry:currentPoint toSpatialReference:[AGSSpatialReference webMercatorSpatialReference]]; //you could get the lat long back out like so double long = [currentPoint x]; double lat = [currentPoint y];
AGSPoint has x and y properties you can use to access lat/long.so from your example AGSPoint *currentPoint = [AGSPoint pointWithX:longValue y:latValue spatialReference:[AGSSpatialReference wgs84SpatialReference]]; currentPoint = (AGSPoint *)[[AGSGeometryEngine defaultGeometryEngine] projectGeometry:currentPoint toSpatialReference:[AGSSpatialReference webMercatorSpatialReference]]; //you could get the lat long back out like so double long = [currentPoint x]; double lat = [currentPoint y]; Sorry if i am misunderstanding this question.
currentPoint = (AGSPoint *)[[AGSGeometryEngine defaultGeometryEngine] projectGeometry:currentPoint toSpatialReference:[AGSSpatialReference wgs84SpatialReference]]; //these should now yield your original lat/long values. double long = [currentPoint x]; double lat = [currentPoint y];
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.