Hi, I'm trying to use esri map for the first time in my iOS app POC. I have instantiated the map object but I seem to have a problem zooming to user current location using AGSEnvelope object. Here is code: CLLocation *location = self.myLocationManager.location; float extentDelta = 0.025; AGSEnvelope *envelope = [AGSEnvelope envelopeWithXmin:(location.coordinate.longitude - extentDelta) ymin:(location.coordinate.latitude - extentDelta) xmax:(location.coordinate.longitude + extentDelta) ymax:(location.coordinate.latitude + extentDelta) spatialReference:[AGSSpatialReference wgs84SpatialReference]]; [self.ibMapView zoomToEnvelope:envelope animated:YES]; It is zooming into North Sea near UK. I am sure the CLLocation is coming with my current location. Please help. |
Solved! Go to Solution.
Can you double check the spatial reference of the map view? This usually happens if the the spatial reference of the envelope is different from the map view.
Also, you should look into this sample, it shows you how to use `AGSLocationDisplay` to achieve the same result.
Can you double check the spatial reference of the map view? This usually happens if the the spatial reference of the envelope is different from the map view.
Also, you should look into this sample, it shows you how to use `AGSLocationDisplay` to achieve the same result.