diff options
author | Sudarsana Babu Nagineni <sudarsana.babu@mapbox.com> | 2019-03-26 00:00:37 +0200 |
---|---|---|
committer | Sudarsana Babu Nagineni <sudarsana.babu@mapbox.com> | 2019-03-28 16:41:15 +0200 |
commit | 1cc1d4ea08ae02c3cc9b4dd1474845456c17d1bc (patch) | |
tree | d7de92e01ef1b1bf654ff8784534e534608a352f /platform/qt | |
parent | 11afef7825d622a237fa026e45e6d61b4de94068 (diff) | |
download | qtlocation-mapboxgl-1cc1d4ea08ae02c3cc9b4dd1474845456c17d1bc.tar.gz |
[core] Add setter/getter for size property in MapOptions
Diffstat (limited to 'platform/qt')
-rw-r--r-- | platform/qt/src/qmapboxgl.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp index 313860890c..ff6a4498dc 100644 --- a/platform/qt/src/qmapboxgl.cpp +++ b/platform/qt/src/qmapboxgl.cpp @@ -1127,7 +1127,7 @@ void QMapboxGL::resize(const QSize& size_) { auto size = sanitizedSize(size_); - if (d_ptr->mapObj->getSize() == size) + if (d_ptr->mapObj->getMapOptions().size() == size) return; d_ptr->mapObj->setSize(size); @@ -1705,8 +1705,9 @@ void QMapboxGL::connectionEstablished() \a copyrightsHtml is a string with a HTML snippet. */ -mbgl::MapOptions mapOptionsFromQMapboxGLSettings(const QMapboxGLSettings &settings) { +mbgl::MapOptions mapOptionsFromQMapboxGLSettings(const QMapboxGLSettings &settings, const QSize &size) { return std::move(mbgl::MapOptions() + .withSize(sanitizedSize(size)) .withMapMode(static_cast<mbgl::MapMode>(settings.mapMode())) .withConstrainMode(static_cast<mbgl::ConstrainMode>(settings.constrainMode())) .withViewportMode(static_cast<mbgl::ViewportMode>(settings.viewportMode()))); @@ -1740,8 +1741,8 @@ QMapboxGLPrivate::QMapboxGLPrivate(QMapboxGL *q, const QMapboxGLSettings &settin auto resourceOptions = resourceOptionsFromQMapboxGLSettings(settings); // Setup the Map object. - mapObj = std::make_unique<mbgl::Map>(*this, *m_mapObserver, sanitizedSize(size), m_pixelRatio, *m_threadPool, - mapOptionsFromQMapboxGLSettings(settings), resourceOptions); + mapObj = std::make_unique<mbgl::Map>(*this, *m_mapObserver, m_pixelRatio, *m_threadPool, + mapOptionsFromQMapboxGLSettings(settings, size), resourceOptions); if (settings.resourceTransform()) { m_resourceTransform = std::make_unique<mbgl::Actor<mbgl::ResourceTransform>>(*mbgl::Scheduler::GetCurrent(), |