diff options
Diffstat (limited to 'platform/qt/app')
-rw-r--r-- | platform/qt/app/mapwindow.cpp | 32 | ||||
-rw-r--r-- | platform/qt/app/mapwindow.hpp | 1 |
2 files changed, 5 insertions, 28 deletions
diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp index a72faf005e..03ca052ec4 100644 --- a/platform/qt/app/mapwindow.cpp +++ b/platform/qt/app/mapwindow.cpp @@ -79,8 +79,6 @@ void MapWindow::changeStyle() void MapWindow::keyPressEvent(QKeyEvent *ev) { - static const qint64 transitionDuration = 300; - switch (ev->key()) { case Qt::Key_S: changeStyle(); @@ -92,6 +90,9 @@ void MapWindow::keyPressEvent(QKeyEvent *ev) m_sourceAdded = true; + // Not in all styles, but will work on streets + QString before = "waterway-label"; + QFile geojson(":source1.geojson"); geojson.open(QIODevice::ReadOnly); @@ -106,7 +107,7 @@ void MapWindow::keyPressEvent(QKeyEvent *ev) routeCase["id"] = "routeCase"; routeCase["type"] = "line"; routeCase["source"] = "routeSource"; - m_map->addLayer(routeCase); + m_map->addLayer(routeCase, before); m_map->setPaintProperty("routeCase", "line-color", QColor("white")); m_map->setPaintProperty("routeCase", "line-width", 20.0); @@ -118,7 +119,7 @@ void MapWindow::keyPressEvent(QKeyEvent *ev) route["id"] = "route"; route["type"] = "line"; route["source"] = "routeSource"; - m_map->addLayer(route); + m_map->addLayer(route, before); m_map->setPaintProperty("route", "line-color", QColor("blue")); m_map->setPaintProperty("route", "line-width", 8.0); @@ -277,21 +278,6 @@ void MapWindow::keyPressEvent(QKeyEvent *ev) } } break; - case Qt::Key_4: { - if (m_styleSourcedAnnotationId.isNull()) { - QMapbox::Coordinate topLeft = m_map->coordinateForPixel({ 0, 0 }); - QMapbox::Coordinate topRight = m_map->coordinateForPixel({ 0, qreal(size().height()) }); - QMapbox::Coordinate bottomLeft = m_map->coordinateForPixel({ qreal(size().width()), 0 }); - QMapbox::Coordinate bottomRight = m_map->coordinateForPixel({ qreal(size().width()), qreal(size().height()) }); - QMapbox::CoordinatesCollections geometry { { { bottomLeft, bottomRight, topRight, topLeft, bottomLeft } } }; - QMapbox::StyleSourcedAnnotation styleSourced { { QMapbox::ShapeAnnotationGeometry::PolygonType, geometry }, "water" }; - m_styleSourcedAnnotationId = m_map->addAnnotation(QVariant::fromValue<QMapbox::StyleSourcedAnnotation>(styleSourced)); - } else { - m_map->removeAnnotation(m_styleSourcedAnnotationId.toUInt()); - m_styleSourcedAnnotationId.clear(); - } - } - break; case Qt::Key_5: { if (m_map->layerExists("circleLayer")) { m_map->removeLayer("circleLayer"); @@ -319,14 +305,6 @@ void MapWindow::keyPressEvent(QKeyEvent *ev) case Qt::Key_Tab: m_map->cycleDebugOptions(); break; - case Qt::Key_R: { - m_map->setTransitionOptions(transitionDuration); - if (m_map->hasClass("night")) { - m_map->removeClass("night"); - } else { - m_map->addClass("night"); - } - } break; default: break; } diff --git a/platform/qt/app/mapwindow.hpp b/platform/qt/app/mapwindow.hpp index 6b4b7fd1cc..c484114ec0 100644 --- a/platform/qt/app/mapwindow.hpp +++ b/platform/qt/app/mapwindow.hpp @@ -64,7 +64,6 @@ private: QVariant m_symbolAnnotationId; QVariant m_lineAnnotationId; QVariant m_fillAnnotationId; - QVariant m_styleSourcedAnnotationId; bool m_sourceAdded = false; }; |