DEPRECATED-mapbox-ios-sdk
DEPRECATED-mapbox-ios-sdk copied to clipboard
mapView minZoom only works on iPhone 5
[self.mapView setZoom:13.0f];
[self.mapView setMaxZoom:16.0f];
[self.mapView setMinZoom:13.0f];
These lines will set the zoom and constraints appropriately on a retina device (tested with iPhone 5), but setMinZoom is ignored entirely on non-retina devices.
Edit: I should point out, this is allowing me to zoom out further than the tilesource supports, but only on non-retina devices.
Edit 2: It doesn't seem to be retina causing the issue, it's the size difference with the iPhone 5. Zoom works properly on the iPhone 5, not on an iPhone 4S.
Hi,
I can reproduce this issue simply by rotating the device. The minZoom property is reset by the line :
self.minZoom = 0.0; // force new minZoom calculation in - (void)setFrame:(CGRect)frame (RMMapView.m).
Here's what the log says :
2013-08-21 22:11:08.057 New minZoom:16.100000 // when I assign the value
2013-08-21 22:11:27.821 New minZoom:2.000000 // after I rotate the device
This mechanism could be here to make sure that minZoom doesn't go below the clampedMinZoom value after a frame size change.
I fixed it by changing the line to :
self.minZoom = _minZoom;
which doesn't break the clampedMinZoom control.