diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-09-23 14:22:33 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-04-20 20:55:51 +0300 |
commit | 2d156ec6a91af9228f7b36d3e19eedf5ccbd7aa5 (patch) | |
tree | c7dce34e75c0f97c31f74583691cd75eba55486f | |
parent | c8c69f1d2a968dfc2556c3612e96ddba848ee885 (diff) | |
download | qtlocation-mapboxgl-2d156ec6a91af9228f7b36d3e19eedf5ccbd7aa5.tar.gz |
[Qt] Forward scale setter/getter
-rw-r--r-- | platform/qt/include/qmapboxgl.hpp | 3 | ||||
-rw-r--r-- | platform/qt/src/qmapboxgl.cpp | 10 |
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 ¢er = 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 ¢er, 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(); |