diff options
Diffstat (limited to 'platform/qt/app/mapwindow.cpp')
-rw-r--r-- | platform/qt/app/mapwindow.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp index da8a9767ce..bc83e2d972 100644 --- a/platform/qt/app/mapwindow.cpp +++ b/platform/qt/app/mapwindow.cpp @@ -1,7 +1,9 @@ #include "mapwindow.hpp" #include <QApplication> +#include <QColor> #include <QDebug> +#include <QFile> #include <QIcon> #include <QKeyEvent> #include <QMouseEvent> @@ -73,6 +75,33 @@ void MapWindow::keyPressEvent(QKeyEvent *ev) case Qt::Key_S: changeStyle(); break; + case Qt::Key_L: { + m_map.setPaintProperty("water", "fill-color", QColor(255, 0, 0)); + m_map.setPaintProperty("building", "fill-color", "red"); + m_map.setPaintProperty("road-secondary-tertiary", "line-color", "red"); + + m_map.setLayoutProperty("road-label-small", "symbol-placement", "point"); + m_map.setLayoutProperty("road-label-medium", "symbol-placement", "point"); + m_map.setLayoutProperty("road-label-large", "symbol-placement", "point"); + + QFile geojson(":source.geojson"); + geojson.open(QIODevice::ReadOnly); + + QVariantMap testSource; + testSource["type"] = "geojson"; + testSource["data"] = geojson.readAll(); + + m_map.addSource("testSource", testSource); + + QVariantMap testLayer; + testLayer["id"] = "testLayer"; + testLayer["type"] = "fill"; + testLayer["source"] = "testSource"; + + m_map.addLayer(testLayer); + m_map.setPaintProperty("testLayer", "fill-color", QColor("blue")); + } + break; case Qt::Key_Tab: m_map.cycleDebugOptions(); break; |