_defaultSpatialRef = [AGSSpatialReference spatialReferenceWithWKID:3163]; AGSGeometryEngine *engine = [AGSGeometryEngine defaultGeometryEngine]; AGSPoint *point = [AGSPoint pointWithX:currentLocation.coordinate.latitude y:currentLocation.coordinate.longitude spatialReference:[AGSSpatialReference spatialReferenceWithWKID:WKID_WGS84]]; AGSPoint *projectedPoint= (AGSPoint*)[engine projectGeometry:point toSpatialReference:_defaultSpatialRef];
Solved! Go to Solution.
- Which way should I map X/Y to lat/long (in all other examples I saw X->lat and Y->lng but it does not give any result)
- Am I doing it the right way or missing anything?
- Which way should I map X/Y to lat/long (in all other examples I saw X->lat and Y->lng but it does not give any result)
- Am I doing it the right way or missing anything?
_defaultSpatialRef = [AGSSpatialReference spatialReferenceWithWKID:3163]; AGSGeometryEngine *engine = [AGSGeometryEngine defaultGeometryEngine]; AGSPoint *point = [AGSPoint pointWithX:currentLocation.coordinate.latitude y:currentLocation.coordinate.longitude spatialReference:[AGSSpatialReference spatialReferenceWithWKID:WKID_WGS84]]; AGSPoint *pointProjectedToWGS84 = (AGSPoint *)[engine projectGeometry:point toSpatialReference:[AGSSpatialReference spatialReferenceWithWKID:WKID_WGS84]]; AGSPoint *projectedPoint= (AGSPoint*)[engine projectGeometry:pointProjectedToWGS84 toSpatialReference:_defaultSpatialRef];