summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2018-06-19 16:33:44 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-07-26 13:38:02 +0000
commiteca7cc8a260538fcccde97fe59d9580250600bf1 (patch)
tree6a87cc4391b1e0dbf65ee011d0314cfae4c8b19f /src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
parentd6fc6ba0f84c4cda0ccc2e1250da4a68441dd6ba (diff)
downloadqtlocation-eca7cc8a260538fcccde97fe59d9580250600bf1.tar.gz
Introduce Map.visibleArea
This will allow moving the visible map area to a subregion of the viewport, allowing to maintain the desired visible region visible when overlaying controls on top of the map. Task-number: QTBUG-68966 Change-Id: Idf4b30f7c1e4062e5e1c0ddc01a31bc856c0bc0c Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp')
-rw-r--r--src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp41
1 files changed, 1 insertions, 40 deletions
diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
index 6c47d3ee..d9de5ba9 100644
--- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
+++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
@@ -186,8 +186,7 @@ QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleChange::addMapParamete
{
static const QStringList acceptedParameterTypes = QStringList()
<< QStringLiteral("paint") << QStringLiteral("layout") << QStringLiteral("filter")
- << QStringLiteral("layer") << QStringLiteral("source") << QStringLiteral("image")
- << QStringLiteral("margins");
+ << QStringLiteral("layer") << QStringLiteral("source") << QStringLiteral("image");
QList<QSharedPointer<QMapboxGLStyleChange>> changes;
@@ -213,9 +212,6 @@ QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleChange::addMapParamete
case 5: // image
changes << QMapboxGLStyleAddImage::fromMapParameter(param);
break;
- case 6: // margins
- changes << QMapboxGLMapMargins::fromMapParameter(param);
- break;
}
return changes;
@@ -641,38 +637,3 @@ QSharedPointer<QMapboxGLStyleChange> QMapboxGLStyleAddImage::fromMapParameter(QG
return QSharedPointer<QMapboxGLStyleChange>(image);
}
-
-// QMapboxGLMapMargins
-
-void QMapboxGLMapMargins::apply(QMapboxGL *map)
-{
- // FIXME: Qt projection handlers are not yet aware of these margins,
- // thus map items placement, {to,from}Coordinate, mouse area, etc.
- // will require manual fixups.
- map->setMargins(m_margins);
-}
-
-QSharedPointer<QMapboxGLStyleChange> QMapboxGLMapMargins::fromMapParameter(QGeoMapParameter *param)
-{
- Q_ASSERT(param->type() == "margins");
-
- auto mapMargins = new QMapboxGLMapMargins();
-
- QVariant leftMargin = param->property("left");
- if (leftMargin.isValid())
- mapMargins->m_margins.setLeft(leftMargin.toInt());
-
- QVariant topMargin = param->property("top");
- if (topMargin.isValid())
- mapMargins->m_margins.setTop(topMargin.toInt());
-
- QVariant rightMargin = param->property("right");
- if (rightMargin.isValid())
- mapMargins->m_margins.setRight(rightMargin.toInt());
-
- QVariant bottomMargin = param->property("bottom");
- if (bottomMargin.isValid())
- mapMargins->m_margins.setBottom(bottomMargin.toInt());
-
- return QSharedPointer<QMapboxGLStyleChange>(mapMargins);
-}