summaryrefslogtreecommitdiff
path: root/platform/qt
diff options
context:
space:
mode:
authorSudarsana Babu Nagineni <sudarsana.babu@mapbox.com>2019-03-07 14:29:19 +0200
committerSudarsana Babu Nagineni <sudarsana.babu@mapbox.com>2019-03-08 18:20:55 +0200
commit5e2b6bf636472a4464e6ab3ae0d9d01c68de041b (patch)
treed4a924f2ac4174a034448388fb65b033b801a83d /platform/qt
parentc4115f0539be1834db40b318eb4ebb9e27d1eafb (diff)
downloadqtlocation-mapboxgl-5e2b6bf636472a4464e6ab3ae0d9d01c68de041b.tar.gz
[core] Add MapOptions to define properties of Map
To simplify the Map constructor, introduce MapOptions interface to define the properties that can be set on a Map.
Diffstat (limited to 'platform/qt')
-rw-r--r--platform/qt/src/qmapboxgl.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index fd4a210229..49b0dc021c 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -1767,15 +1767,18 @@ QMapboxGLPrivate::QMapboxGLPrivate(QMapboxGL *q, const QMapboxGLSettings &settin
connect(m_mapObserver.get(), SIGNAL(mapLoadingFailed(QMapboxGL::MapLoadingFailure,QString)), q, SIGNAL(mapLoadingFailed(QMapboxGL::MapLoadingFailure,QString)));
connect(m_mapObserver.get(), SIGNAL(copyrightsChanged(QString)), q, SIGNAL(copyrightsChanged(QString)));
+ mbgl::MapOptions options;
+ options.withMapMode(static_cast<mbgl::MapMode>(settings.mapMode()))
+ .withConstrainMode(static_cast<mbgl::ConstrainMode>(settings.constrainMode()))
+ .withViewportMode(static_cast<mbgl::ViewportMode>(settings.viewportMode()));
+
// Setup the Map object
mapObj = std::make_unique<mbgl::Map>(
*this, // RendererFrontend
*m_mapObserver,
sanitizedSize(size),
m_pixelRatio, *m_fileSourceObj, *m_threadPool,
- static_cast<mbgl::MapMode>(settings.mapMode()),
- static_cast<mbgl::ConstrainMode>(settings.constrainMode()),
- static_cast<mbgl::ViewportMode>(settings.viewportMode()));
+ options);
// Needs to be Queued to give time to discard redundant draw calls via the `renderQueued` flag.
connect(this, SIGNAL(needsRendering()), q, SIGNAL(needsRendering()), Qt::QueuedConnection);