AnsweredAssumed Answered

How do I create a point using lat/lon?

Question asked by thicks001 on Sep 24, 2012
Latest reply on Sep 24, 2012 by thicks001
I am new to ArcGIS iOS. It looks very promising, but I definitely need some help. I need to place images at points that are based on lat/lon. I found this code and tried it in CustomCalloutSample, but it placed my point off Africa instead of in Florida...

graphicPoint = [self agsPointFromLatitude:28.0833 longitude:-80.6083];

- (AGSPoint *)agsPointFromLatitude:(double)latitude longitude:(double)longitude     // found on Internet
{
    AGSSpatialReference *referenceGPS = [AGSSpatialReference wgs84SpatialReference];
    AGSGeometryEngine *ge = [AGSGeometryEngine defaultGeometryEngine];
    AGSPoint *graphicPoint = [AGSPoint pointWithX:longitude y:latitude spatialReference:referenceGPS];
    AGSGeometry *myPointReprojected = [ge projectGeometry:graphicPoint toSpatialReference:_mapView.spatialReference]; //[AGSSpatialReference webMercatorSpatialReference]
   
    return (AGSPoint *)myPointReprojected;
}

Outcomes