Basically you want to use the projectGeometry
method from the AGSGeometryEngine class to convert from the GPS coordinate system to the coordinate system used by your map. Use the defaultGeometryEngine
for this.
Assuming your GPS is giving you WGS-84 coordinates you could do something like this:
CLLocation* gpsLocation = ....
// create a AGSPoint from the GPS coordinates
AGSPoint* gpsPoint = [[AGSPoint alloc] initWithX:gpsLocation.coordinate.longitude
y:gpsLocation.coordinate.latitude
spatialReference:[AGSSpatialReference wgs84SpatialReference]];
AGSGeometryEngine* engine = [AGSGeometryEngine defaultGeometryEngine];
// convert GPS WGS-84 coordinates to the map's spatial reference
// (assuming self.mapView is your AGSMapView for your map)
AGSPoint* mapPoint = (AGSPoint*) [engine projectGeometry:gpsPoint
toSpatialReference:self.mapView.spatialReference];
[AGSPoint pointWithX:[lon doubleValue] y:[lat doubleValue] spatialReference:self.mapView.spatialReference];