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 exampleAGSPoint *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];