kramea

AGSPoint spatial reference

Discussion created by kramea on May 13, 2011
Latest reply on May 16, 2011 by njarecha-esristaff
Hi All,

I am having trouble in projecting the AGSPoint marker location to the right place.

I have this spatial reference for the map:

AGSSpatialReference *sr = [AGSSpatialReference spatialReferenceWithWKID:4326];
AGSEnvelope *env = [AGSEnvelope envelopeWithXmin:-125.33203125 ymin:-1.58203125 xmax:-69.08203125 ymax:79.27734375 spatialReference:sr];

It takes in the latitude longitude values well and draws the US map. But, when I give the AGSPoint location with latitude longitude, it locates it somewhere near Africa:

AGSPoint *myMarkerPoint =
[AGSPoint pointWithX:-121.78555
                                     y:38.549122 spatialReference:sr];

It is able to locate the right location if I give this code below:


   AGSPoint *myMarkerPoint =
[AGSPoint pointWithX:-13626513.829723023
                       y:4549088.827634182 spatialReference:sr];

I'm not sure what these numbers refer to (or how to convert lat, long to this). I am confused as to why AGSPoint is not identifying the lat, long location but with the same spatial reference, AGSEnvelope is drawing correctly.

Please help!

Thanks,
Kalai

Outcomes