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];
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.