Note that there are some explanatory texts on larger screens.

plurals
  1. POSlight zoom on MKCoordinateRegion?
    primarykey
    data
    text
    <p>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:</p> <pre><code>// SMALL ZOOM region.span.latitudeDelta = (upper.latitude - lower.latitude) * 0.9; region.span.longitudeDelta = (upper.longitude - lower.longitude) * 0.9; </code></pre> <p>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.</p> <h1>EDIT:</h1> <p>Quick tests showing the results of different scaling factors on the region:</p> <pre><code> // SCALE FACTOR // V region.span.latitudeDelta = (upper.latitude - lower.latitude) * 0.9; region.span.longitudeDelta = (upper.longitude - lower.longitude) * 0.9; </code></pre> <p>Here are the results:</p> <ul> <li>x0.5 region too small, some annotations off screen</li> <li>x0.6 Same as using 1.0</li> <li>x0.7 Same as using 1.0</li> <li>x0.8 Same as using 1.0</li> <li>x0.9 Same as using 1.0</li> <li>x1.0 Original fit</li> <li>x1.1 region too big, annotations too small on screen</li> </ul> <p>My point is that very small adjustments (e.g. 0.6 to 0.9) don't seem to make any difference.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload