diff options
-rw-r--r-- | include/mbgl/map/map.hpp | 1 | ||||
-rw-r--r-- | src/mbgl/map/map.cpp | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index c80420371d..c51d7e9ffd 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -98,6 +98,7 @@ public: void setScale(double scale, optional<ScreenCoordinate> = {}, const Duration& = Duration::zero()); double getScale() const; void setZoom(double zoom, const Duration& = Duration::zero()); + void setZoom(double zoom, optional<ScreenCoordinate>, const Duration& = Duration::zero()); void setZoom(double zoom, optional<EdgeInsets>, const Duration& = Duration::zero()); double getZoom() const; void setLatLngZoom(const LatLng&, double zoom, const Duration& = Duration::zero()); diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 727fdf6d40..bd69ce50f4 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -537,7 +537,13 @@ double Map::getScale() const { void Map::setZoom(double zoom, const Duration& duration) { impl->cameraMutated = true; - setZoom(zoom, {}, duration); + setZoom(zoom, optional<EdgeInsets> {}, duration); +} + +void Map::setZoom(double zoom, optional<ScreenCoordinate> anchor, const Duration& duration) { + impl->cameraMutated = true; + impl->transform.setZoom(zoom, anchor, duration); + impl->onUpdate(Update::RecalculateStyle); } void Map::setZoom(double zoom, optional<EdgeInsets> padding, const Duration& duration) { |