summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2015-09-23 14:22:33 +0300
committerThiago Marcos P. Santos <thiago@mapbox.com>2016-04-20 20:55:51 +0300
commit2d156ec6a91af9228f7b36d3e19eedf5ccbd7aa5 (patch)
treec7dce34e75c0f97c31f74583691cd75eba55486f
parentc8c69f1d2a968dfc2556c3612e96ddba848ee885 (diff)
downloadqtlocation-mapboxgl-2d156ec6a91af9228f7b36d3e19eedf5ccbd7aa5.tar.gz
[Qt] Forward scale setter/getter
-rw-r--r--platform/qt/include/qmapboxgl.hpp3
-rw-r--r--platform/qt/src/qmapboxgl.cpp10
2 files changed, 13 insertions, 0 deletions
diff --git a/platform/qt/include/qmapboxgl.hpp b/platform/qt/include/qmapboxgl.hpp
index 09537963c0..5a123a59c6 100644
--- a/platform/qt/include/qmapboxgl.hpp
+++ b/platform/qt/include/qmapboxgl.hpp
@@ -60,6 +60,9 @@ public:
double longitude() const;
void setLongitude(double longitude);
+ double scale() const;
+ void setScale(double scale, const QPointF &center = QPointF(), int milliseconds = 0);
+
double zoom() const;
void setZoom(double zoom, int milliseconds = 0);
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index e648354e54..9dd7babd62 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -105,6 +105,16 @@ void QMapboxGL::setLongitude(double longitude_)
d_ptr->mapObj->setLatLng(mbgl::LatLng { latitude(), longitude_ });
}
+double QMapboxGL::scale() const
+{
+ return d_ptr->mapObj->getScale();
+}
+
+void QMapboxGL::setScale(double scale_, const QPointF &center, int milliseconds)
+{
+ d_ptr->mapObj->setScale(scale_, mbgl::ScreenCoordinate{ center.x(), center.y() }, std::chrono::milliseconds(milliseconds));
+}
+
double QMapboxGL::zoom() const
{
return d_ptr->mapObj->getZoom();