Im implements a map application on an iPhone. I want the map closer to the user's current location. I would like to zoom in on the accuracy (emulating how the Maps application works).
Im implements this method:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
The problem I am facing is that CLLocation gives me accuracy with the horizontalAccuracy and verticalAccuracy properties, which in the end means meters. However, to center the map, I use this:
MKCoordinateRegion region; MKCoordinateSpan span; region.center = newLocation.coordinate; span.latitudeDelta=.005;
Im looking for a way to calculate latitudeDelta (represented in degrees) based on horizontal accuracy (represented in meters).
It does not have to be an exact conversion (Im not expecting a conversion formula that will require quite some calculation, including the current location), only some aprox values.
Any ideas?
Thanks. Gonso
gonso source share