summaryrefslogtreecommitdiff
path: root/platform/macos/src/MGLMapView.mm
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.deoliveira@mapbox.com>2019-03-08 12:43:05 +0200
committerAnder Conselvan de Oliveira <ander.deoliveira@mapbox.com>2019-03-14 18:33:11 +0200
commit57334407473a31ff43baa645dafd2f5e1bd910fb (patch)
treee981f87c0040799a1ebc45f86d05b3ece6916aba /platform/macos/src/MGLMapView.mm
parent11de777628e9e2c4b219bae3f1a6eabd86f2a3c5 (diff)
downloadqtlocation-mapboxgl-57334407473a31ff43baa645dafd2f5e1bd910fb.tar.gz
[core] Group Map LatLngBounds, min and max zoom methods
Group bounds, minimum and maximum zoom related methods together using the new BoundOptions. v2: Document that getBounds() initializes all optional fields. - Add test for getBounds() on a map with default values.
Diffstat (limited to 'platform/macos/src/MGLMapView.mm')
-rw-r--r--platform/macos/src/MGLMapView.mm10
1 files changed, 5 insertions, 5 deletions
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm
index 054b91d44c..320abf740c 100644
--- a/platform/macos/src/MGLMapView.mm
+++ b/platform/macos/src/MGLMapView.mm
@@ -328,7 +328,7 @@ public:
mbgl::CameraOptions options;
options.center = mbgl::LatLng(0, 0);
options.padding = MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets);
- options.zoom = _mbglMap->getMinZoom();
+ options.zoom = *_mbglMap->getBounds().minZoom;
_mbglMap->jumpTo(options);
_pendingLatitude = NAN;
_pendingLongitude = NAN;
@@ -1094,21 +1094,21 @@ public:
- (void)setMinimumZoomLevel:(double)minimumZoomLevel
{
MGLLogDebug(@"Setting minimumZoomLevel: %f", minimumZoomLevel);
- _mbglMap->setMinZoom(minimumZoomLevel);
+ _mbglMap->setBounds(mbgl::BoundOptions().withMinZoom(minimumZoomLevel));
}
- (void)setMaximumZoomLevel:(double)maximumZoomLevel
{
MGLLogDebug(@"Setting maximumZoomLevel: %f", maximumZoomLevel);
- _mbglMap->setMaxZoom(maximumZoomLevel);
+ _mbglMap->setBounds(mbgl::BoundOptions().withMaxZoom(maximumZoomLevel));
}
- (double)maximumZoomLevel {
- return _mbglMap->getMaxZoom();
+ return *_mbglMap->getBounds().maxZoom;
}
- (double)minimumZoomLevel {
- return _mbglMap->getMinZoom();
+ return *_mbglMap->getBounds().minZoom;
}
/// Respond to a click on the zoom control.