summaryrefslogtreecommitdiff
path: root/platform/qt/src/qmapboxgl.cpp
diff options
context:
space:
mode:
authorSudarsana Babu Nagineni <sudarsana.babu@mapbox.com>2019-03-27 19:17:04 +0200
committerSudarsana Babu Nagineni <sudarsana.babu@mapbox.com>2019-03-28 16:41:15 +0200
commit7af00a404f22742fed4a83e9a36d023d7515025f (patch)
treeac050d12346d81030969f88607dbfd59ca33be11 /platform/qt/src/qmapboxgl.cpp
parentf5064e710884d5b822e59d05e51c127c8b3e852b (diff)
downloadqtlocation-mapboxgl-7af00a404f22742fed4a83e9a36d023d7515025f.tar.gz
[core] Include pixelRatio property in MapOptions
Move pixelRatio property from Map constructor to MapOptions.
Diffstat (limited to 'platform/qt/src/qmapboxgl.cpp')
-rw-r--r--platform/qt/src/qmapboxgl.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index ff6a4498dc..4f79525257 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -1705,9 +1705,10 @@ void QMapboxGL::connectionEstablished()
\a copyrightsHtml is a string with a HTML snippet.
*/
-mbgl::MapOptions mapOptionsFromQMapboxGLSettings(const QMapboxGLSettings &settings, const QSize &size) {
+mbgl::MapOptions mapOptionsFromQMapboxGLSettings(const QMapboxGLSettings &settings, const QSize &size, qreal pixelRatio) {
return std::move(mbgl::MapOptions()
.withSize(sanitizedSize(size))
+ .withPixelRatio(pixelRatio)
.withMapMode(static_cast<mbgl::MapMode>(settings.mapMode()))
.withConstrainMode(static_cast<mbgl::ConstrainMode>(settings.constrainMode()))
.withViewportMode(static_cast<mbgl::ViewportMode>(settings.viewportMode())));
@@ -1741,8 +1742,9 @@ QMapboxGLPrivate::QMapboxGLPrivate(QMapboxGL *q, const QMapboxGLSettings &settin
auto resourceOptions = resourceOptionsFromQMapboxGLSettings(settings);
// Setup the Map object.
- mapObj = std::make_unique<mbgl::Map>(*this, *m_mapObserver, m_pixelRatio, *m_threadPool,
- mapOptionsFromQMapboxGLSettings(settings, size), resourceOptions);
+ mapObj = std::make_unique<mbgl::Map>(*this, *m_mapObserver, *m_threadPool,
+ mapOptionsFromQMapboxGLSettings(settings, size, m_pixelRatio),
+ resourceOptions);
if (settings.resourceTransform()) {
m_resourceTransform = std::make_unique<mbgl::Actor<mbgl::ResourceTransform>>(*mbgl::Scheduler::GetCurrent(),