summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2019-02-27 17:49:01 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2019-03-04 14:45:32 +0200
commit02f2b9c75c4031c084c177a582f18d3e888596fa (patch)
treef8ee3cb99c0ad7b14613373407df539bfeddf1d5 /src
parent362231e2d02333e301b0ec70c85e5ac4e7741bf3 (diff)
downloadqtlocation-mapboxgl-02f2b9c75c4031c084c177a582f18d3e888596fa.tar.gz
[core] Added Map::scaleBy()
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/map/map.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 7c19375542..25c4b5398d 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -187,6 +187,11 @@ 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);
+ easeTo(CameraOptions().withZoom(zoom).withAnchor(anchor), animation);
+}
+
void Map::setZoom(double zoom, const AnimationOptions& animation) {
easeTo(CameraOptions().withZoom(zoom), animation);
}