I am zooming an MKMapView to fit the bounding region of a collection of pins, however when the pins are displayed I have noticed that the zoom could ideally do with being a little tighter. My proposed solution to this was to make the region deltas slightly smaller:
// SMALL ZOOM
region.span.latitudeDelta = (upper.latitude - lower.latitude) * 0.9;
region.span.longitudeDelta = (upper.longitude - lower.longitude) * 0.9;
However I have noticed that fine adjustments don't seem to translate to a small zoom increase, is there some form of snapping on the zoom? Really small values work, as do really big ones, but just adjusting the region size by a few percent does not seem to work with the view nearly always jumping/zooming in to far and clipping my pins.
EDIT:
Quick tests showing the results of different scaling factors on the region:
// SCALE FACTOR
// V
region.span.latitudeDelta = (upper.latitude - lower.latitude) * 0.9;
region.span.longitudeDelta = (upper.longitude - lower.longitude) * 0.9;
Here are the results:
- x0.5 region too small, some annotations off screen
- x0.6 Same as using 1.0
- x0.7 Same as using 1.0
- x0.8 Same as using 1.0
- x0.9 Same as using 1.0
- x1.0 Original fit
- x1.1 region too big, annotations too small on screen
My point is that very small adjustments (e.g. 0.6 to 0.9) don't seem to make any difference.