diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-02-27 19:01:29 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-03-04 14:45:32 +0200 |
commit | f5f10ec11989ccb403c2cd4261db74c44b263558 (patch) | |
tree | 8c88ee24819281609206e36c719eef617acb52b6 /src | |
parent | 491fce68790e05cd0a876815751dc5cb72a2761e (diff) | |
download | qtlocation-mapboxgl-f5f10ec11989ccb403c2cd4261db74c44b263558.tar.gz |
[core] Remove map zoom setters/getters
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/map/map.cpp | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index ab4ccb2007..b02d784e75 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -188,34 +188,10 @@ void Map::resetPosition(const EdgeInsets& padding) { #pragma mark - Zoom void Map::scaleBy(double scale, optional<ScreenCoordinate> anchor, const AnimationOptions& animation) { - double zoom = getZoom() + impl->transform.getState().scaleZoom(scale); + const double zoom = impl->transform.getZoom() + impl->transform.getState().scaleZoom(scale); easeTo(CameraOptions().withZoom(zoom).withAnchor(anchor), animation); } -void Map::setZoom(double zoom, const AnimationOptions& animation) { - easeTo(CameraOptions().withZoom(zoom), animation); -} - -void Map::setZoom(double zoom, optional<ScreenCoordinate> anchor, const AnimationOptions& animation) { - easeTo(CameraOptions().withZoom(zoom).withAnchor(anchor), animation); -} - -void Map::setZoom(double zoom, const EdgeInsets& padding, const AnimationOptions& animation) { - easeTo(CameraOptions().withZoom(zoom).withPadding(padding), animation); -} - -double Map::getZoom() const { - return impl->transform.getZoom(); -} - -void Map::setLatLngZoom(const LatLng& latLng, double zoom, const AnimationOptions& animation) { - easeTo(CameraOptions().withCenter(latLng).withZoom(zoom), animation); -} - -void Map::setLatLngZoom(const LatLng& latLng, double zoom, const EdgeInsets& padding, const AnimationOptions& animation) { - easeTo(CameraOptions().withCenter(latLng).withZoom(zoom).withPadding(padding), animation); -} - CameraOptions Map::cameraForLatLngBounds(const LatLngBounds& bounds, const EdgeInsets& padding, optional<double> bearing, optional<double> pitch) const { return cameraForLatLngs({ bounds.northwest(), @@ -312,11 +288,6 @@ LatLngBounds Map::latLngBoundsForCamera(const CameraOptions& camera) const { ); } -void Map::resetZoom() { - impl->cameraMutated = true; - setZoom(0); -} - #pragma mark - Pitch void Map::pitchBy(double pitch, const AnimationOptions& animation) { @@ -337,8 +308,8 @@ void Map::setLatLngBounds(optional<LatLngBounds> bounds) { void Map::setMinZoom(const double minZoom) { impl->transform.setMinZoom(minZoom); - if (getZoom() < minZoom) { - setZoom(minZoom); + if (impl->transform.getZoom() < minZoom) { + jumpTo(CameraOptions().withZoom(minZoom)); } } @@ -348,8 +319,8 @@ double Map::getMinZoom() const { void Map::setMaxZoom(const double maxZoom) { impl->transform.setMaxZoom(maxZoom); - if (getZoom() > maxZoom) { - setZoom(maxZoom); + if (impl->transform.getZoom() > maxZoom) { + jumpTo(CameraOptions().withZoom(maxZoom)); } } |