summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2017-11-21 13:10:58 -0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2017-11-23 14:52:26 -0200
commit6aea382b023fdbaeb82d466e898e392f5716a363 (patch)
treeca3dccc6cb0afc3e4a2c351fce609022a3d6d580
parent572822c8ca15be190b43afbf7f91d132e988bf21 (diff)
downloadqtlocation-mapboxgl-6aea382b023fdbaeb82d466e898e392f5716a363.tar.gz
Build on Windows with MinGW
-rw-r--r--README.md32
-rwxr-xr-xmapbox-gl-native.pngbin0 -> 763543 bytes
-rw-r--r--mapbox-gl-native.pro42
-rw-r--r--platform/qt/app/main.cpp25
-rw-r--r--platform/qt/app/mapwindow.cpp427
-rw-r--r--platform/qt/app/mapwindow.hpp71
-rwxr-xr-xplatform/qt/resources/common.qrc10
-rwxr-xr-xplatform/qt/resources/default_marker.svg10
-rwxr-xr-xplatform/qt/resources/icon.pngbin0 -> 35662 bytes
-rwxr-xr-xplatform/qt/resources/label-arrow.svg97
-rwxr-xr-xplatform/qt/resources/label-background.svg25
-rwxr-xr-xplatform/qt/resources/source1.geojson1172
-rwxr-xr-xplatform/qt/resources/source2.geojson92
-rwxr-xr-x[-rw-r--r--]platform/qt/src/logging_qt.cpp (renamed from platform/default/logging_stderr.cpp)4
-rw-r--r--src/mbgl/gl/context.hpp5
15 files changed, 1987 insertions, 25 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000..bac0efab4c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,32 @@
+# Mapbox GL Qt on Windows
+
+![Mapbox GL Qt on Windows](mapbox-gl-native.png "Mapbox GL Qt on Windows")
+
+## Testing environment
+
+- Qt 5.9.3 for Windows with MinGW 32-bits (won't build with MSVC)
+- Qt Creator
+- Windows 10
+- DirectX 11
+
+
+## Building instructions
+
+1. Open the ```mapbox-gl-native.pro``` project file with Qt Creator
+2. Select the **Release** configuration
+3. Hit the **Play** button or **CTRL+R** to build and run the project
+
+
+## Demo app instructions
+
+- Press **S** to change the style
+- Press **L** to add the 3D buildings layer and add a custom source over Helsinki
+- Hold shift and drag with the mouse left button to tilt the map
+- Drag with the mouse left button to pan the map
+- Drag with the mouse right button to rotate the map
+
+## OpenGL and software rendering
+
+- Qt will select the best OpenGL implementation available automatically
+- Running with ANGLE will require DirectX installed
+- Software rendenring can be forced by uncommenting this [line](https://github.com/tmpsantos/mapbox-gl-native/blob/tmpsantos-qt_windows/platform/qt/app/main.cpp#L8)
diff --git a/mapbox-gl-native.png b/mapbox-gl-native.png
new file mode 100755
index 0000000000..4b42cf7abf
--- /dev/null
+++ b/mapbox-gl-native.png
Binary files differ
diff --git a/mapbox-gl-native.pro b/mapbox-gl-native.pro
index bfbf0622d5..67e1e02a49 100644
--- a/mapbox-gl-native.pro
+++ b/mapbox-gl-native.pro
@@ -1,12 +1,8 @@
TARGET = qmapboxgl
-load(qt_helper_lib)
+CONFIG += qt c++14 exceptions warn_off object_parallel_to_source
-CONFIG += qt c++14 exceptions warn_off staticlib object_parallel_to_source
-
-QT += network-private \
- gui-private \
- sql-private
+QT += widgets network gui sql
QMAKE_CXXFLAGS += \
-DNDEBUG \
@@ -19,6 +15,9 @@ QMAKE_CXXFLAGS += \
-fvisibility-inlines-hidden \
-fvisibility=hidden
+LIBS += \
+ -lz
+
android|win32|darwin {
SOURCES += \
platform/qt/src/thread.cpp
@@ -40,24 +39,12 @@ win32 {
-D_USE_MATH_DEFINES
}
-qtConfig(system-zlib) {
- QMAKE_USE_PRIVATE += zlib
-} else {
- QT_PRIVATE += zlib-private
-}
-
# QTBUG-59035
TR_EXCLUDE += $$PWD/*
-qtConfig(icu) {
- QMAKE_USE_PRIVATE += icu
-
- SOURCES += \
- platform/default/bidi.cpp
-} else {
- SOURCES += \
- platform/qt/src/bidi.cpp
-}
+# Do not use ICU
+SOURCES += \
+ platform/qt/src/bidi.cpp
SOURCES += \
platform/qt/src/async_task.cpp \
@@ -74,6 +61,7 @@ SOURCES += \
platform/qt/src/thread_local.cpp \
platform/qt/src/timer.cpp \
platform/qt/src/utf.cpp \
+ platform/qt/src/logging_qt.cpp \
src/csscolorparser/csscolorparser.cpp \
src/mbgl/actor/mailbox.cpp \
src/mbgl/actor/scheduler.cpp \
@@ -319,7 +307,6 @@ SOURCES += \
platform/default/default_file_source.cpp \
platform/default/file_source_request.cpp \
platform/default/local_file_source.cpp \
- platform/default/logging_stderr.cpp \
platform/default/mbgl/storage/offline.cpp \
platform/default/mbgl/storage/offline_database.cpp \
platform/default/mbgl/storage/offline_download.cpp \
@@ -385,3 +372,14 @@ INCLUDEPATH += \
QMAKE_CXXFLAGS += \
-DMBGL_VERSION_REV=\\\"qt-v1.1.1\\\"
+
+# The demo application
+SOURCES += \
+ platform/qt/app/main.cpp \
+ platform/qt/app/mapwindow.cpp
+
+HEADERS += \
+ platform/qt/app/mapwindow.hpp
+
+RESOURCES += \
+ platform/qt/resources/common.qrc
diff --git a/platform/qt/app/main.cpp b/platform/qt/app/main.cpp
new file mode 100644
index 0000000000..426a94e047
--- /dev/null
+++ b/platform/qt/app/main.cpp
@@ -0,0 +1,25 @@
+#include "mapwindow.hpp"
+
+#include <QApplication>
+
+int main(int argc, char **argv)
+{
+ // Uncomment for software rendering:
+ //QApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
+
+ QApplication app(argc, argv);
+
+ QMapboxGLSettings settings;
+ settings.setAccessToken("pk.eyJ1IjoidG1wc2FudG9zIiwiYSI6ImNqMWVzZWthbDAwMGIyd3M3ZDR0aXl3cnkifQ.FNxMeWCZgmujeiHjl44G9Q");
+
+ MapWindow window(settings);
+
+ window.resize(800, 600);
+ window.show();
+
+ if (argc == 2 && QString("--test") == argv[1]) {
+ window.selfTest();
+ }
+
+ return app.exec();
+}
diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp
new file mode 100644
index 0000000000..c4efbfa318
--- /dev/null
+++ b/platform/qt/app/mapwindow.cpp
@@ -0,0 +1,427 @@
+#include "mapwindow.hpp"
+
+#include <QApplication>
+#include <QColor>
+#include <QDebug>
+#include <QFile>
+#include <QIcon>
+#include <QKeyEvent>
+#include <QMouseEvent>
+#include <QString>
+
+#if QT_VERSION >= 0x050000
+#include <QWindow>
+#endif
+
+int kAnimationDuration = 10000;
+
+
+MapWindow::MapWindow(const QMapboxGLSettings &settings)
+ : m_settings(settings)
+{
+ setWindowIcon(QIcon(":icon.png"));
+}
+
+void MapWindow::selfTest()
+{
+ if (m_bearingAnimation) {
+ m_bearingAnimation->setDuration(kAnimationDuration);
+ m_bearingAnimation->setEndValue(m_map->bearing() + 360 * 4);
+ m_bearingAnimation->start();
+ }
+
+ if (m_zoomAnimation) {
+ m_zoomAnimation->setDuration(kAnimationDuration);
+ m_zoomAnimation->setEndValue(m_map->zoom() + 3);
+ m_zoomAnimation->start();
+ }
+}
+
+qreal MapWindow::pixelRatio() {
+#if QT_VERSION >= 0x050600
+ return devicePixelRatioF();
+#elif QT_VERSION >= 0x050000
+ return devicePixelRatio();
+#else
+ return 1;
+#endif
+}
+
+
+void MapWindow::animationFinished()
+{
+ qDebug() << "Animation ticks/s: " << m_animationTicks / static_cast<float>(kAnimationDuration) * 1000.;
+ qDebug() << "Frame draws/s: " << m_frameDraws / static_cast<float>(kAnimationDuration) * 1000.;
+
+ qApp->quit();
+}
+
+void MapWindow::animationValueChanged()
+{
+ m_animationTicks++;
+}
+
+void MapWindow::changeStyle()
+{
+ static uint8_t currentStyleIndex;
+
+ auto& styles = QMapbox::defaultStyles();
+
+ m_map->setStyleUrl(styles[currentStyleIndex].first);
+ setWindowTitle(QString("Mapbox GL: ") + styles[currentStyleIndex].second);
+
+ if (++currentStyleIndex == styles.size()) {
+ currentStyleIndex = 0;
+ }
+
+ m_sourceAdded = false;
+}
+
+void MapWindow::keyPressEvent(QKeyEvent *ev)
+{
+ switch (ev->key()) {
+ case Qt::Key_S:
+ changeStyle();
+ break;
+ case Qt::Key_L: {
+ if (m_sourceAdded) {
+ return;
+ }
+
+ m_sourceAdded = true;
+
+ // Not in all styles, but will work on streets
+ QString before = "waterway-label";
+
+ QFile geojson(":source1.geojson");
+ geojson.open(QIODevice::ReadOnly);
+
+ // The data source for the route line and markers
+ QVariantMap routeSource;
+ routeSource["type"] = "geojson";
+ routeSource["data"] = geojson.readAll();
+ m_map->addSource("routeSource", routeSource);
+
+ // The route case, painted before the route
+ QVariantMap routeCase;
+ routeCase["id"] = "routeCase";
+ routeCase["type"] = "line";
+ routeCase["source"] = "routeSource";
+ m_map->addLayer(routeCase, before);
+
+ m_map->setPaintProperty("routeCase", "line-color", QColor("white"));
+ m_map->setPaintProperty("routeCase", "line-width", 20.0);
+ m_map->setLayoutProperty("routeCase", "line-join", "round");
+ m_map->setLayoutProperty("routeCase", "line-cap", "round");
+
+ // The route, painted on top of the route case
+ QVariantMap route;
+ route["id"] = "route";
+ route["type"] = "line";
+ route["source"] = "routeSource";
+ m_map->addLayer(route, before);
+
+ m_map->setPaintProperty("route", "line-color", QColor("blue"));
+ m_map->setPaintProperty("route", "line-width", 8.0);
+ m_map->setLayoutProperty("route", "line-join", "round");
+ m_map->setLayoutProperty("route", "line-cap", "round");
+
+ QVariantList lineDashArray;
+ lineDashArray.append(1);
+ lineDashArray.append(2);
+
+ m_map->setPaintProperty("route", "line-dasharray", lineDashArray);
+
+ // Markers at the beginning and end of the route
+ m_map->addImage("label-arrow", QImage(":label-arrow.svg"));
+ m_map->addImage("label-background", QImage(":label-background.svg"));
+
+ QVariantMap markerArrow;
+ markerArrow["id"] = "markerArrow";
+ markerArrow["type"] = "symbol";
+ markerArrow["source"] = "routeSource";
+ m_map->addLayer(markerArrow);
+
+ m_map->setLayoutProperty("markerArrow", "icon-image", "label-arrow");
+ m_map->setLayoutProperty("markerArrow", "icon-size", 0.5);
+ m_map->setLayoutProperty("markerArrow", "icon-ignore-placement", true);
+
+ QVariantList arrowOffset;
+ arrowOffset.append(0.0);
+ arrowOffset.append(-15.0);
+ m_map->setLayoutProperty("markerArrow", "icon-offset", arrowOffset);
+
+ QVariantMap markerBackground;
+ markerBackground["id"] = "markerBackground";
+ markerBackground["type"] = "symbol";
+ markerBackground["source"] = "routeSource";
+ m_map->addLayer(markerBackground);
+
+ m_map->setLayoutProperty("markerBackground", "icon-image", "label-background");
+ m_map->setLayoutProperty("markerBackground", "text-field", "{name}");
+ m_map->setLayoutProperty("markerBackground", "icon-text-fit", "both");
+ m_map->setLayoutProperty("markerBackground", "icon-ignore-placement", true);
+ m_map->setLayoutProperty("markerBackground", "text-ignore-placement", true);
+ m_map->setLayoutProperty("markerBackground", "text-anchor", "left");
+ m_map->setLayoutProperty("markerBackground", "text-size", 16.0);
+ m_map->setLayoutProperty("markerBackground", "text-padding", 0.0);
+ m_map->setLayoutProperty("markerBackground", "text-line-height", 1.0);
+ m_map->setLayoutProperty("markerBackground", "text-max-width", 8.0);
+
+ QVariantList iconTextFitPadding;
+ iconTextFitPadding.append(15.0);
+ iconTextFitPadding.append(10.0);
+ iconTextFitPadding.append(15.0);
+ iconTextFitPadding.append(10.0);
+ m_map->setLayoutProperty("markerBackground", "icon-text-fit-padding", iconTextFitPadding);
+
+ QVariantList backgroundOffset;
+ backgroundOffset.append(-0.5);
+ backgroundOffset.append(-1.5);
+ m_map->setLayoutProperty("markerBackground", "text-offset", backgroundOffset);
+
+ m_map->setPaintProperty("markerBackground", "text-color", QColor("white"));
+
+ QVariantList filterExpression;
+ filterExpression.append("==");
+ filterExpression.append("$type");
+ filterExpression.append("Point");
+
+ QVariantList filter;
+ filter.append(filterExpression);
+
+ m_map->setFilter("markerArrow", filter);
+ m_map->setFilter("markerBackground", filter);
+
+ // Tilt the labels when tilting the map and make them larger
+ m_map->setLayoutProperty("road-label-large", "text-size", 30.0);
+ m_map->setLayoutProperty("road-label-large", "text-pitch-alignment", "viewport");
+
+ m_map->setLayoutProperty("road-label-medium", "text-size", 30.0);
+ m_map->setLayoutProperty("road-label-medium", "text-pitch-alignment", "viewport");
+
+ m_map->setLayoutProperty("road-label-small", "text-pitch-alignment", "viewport");
+ m_map->setLayoutProperty("road-label-small", "text-size", 30.0);
+
+ // Buildings extrusion
+ QVariantMap buildings;
+ buildings["id"] = "3d-buildings";
+ buildings["source"] = "composite";
+ buildings["source-layer"] = "building";
+ buildings["type"] = "fill-extrusion";
+ buildings["minzoom"] = 15.0;
+ m_map->addLayer(buildings);
+
+ QVariantList buildingsFilterExpression;
+ buildingsFilterExpression.append("==");
+ buildingsFilterExpression.append("extrude");
+ buildingsFilterExpression.append("true");
+
+ QVariantList buildingsFilter;
+ buildingsFilter.append(buildingsFilterExpression);
+
+ m_map->setFilter("3d-buildings", buildingsFilterExpression);
+
+ m_map->setPaintProperty("3d-buildings", "fill-extrusion-color", "#aaa");
+ m_map->setPaintProperty("3d-buildings", "fill-extrusion-opacity", .6);
+
+ QVariantMap extrusionHeight;
+ extrusionHeight["type"] = "identity";
+ extrusionHeight["property"] = "height";
+
+ m_map->setPaintProperty("3d-buildings", "fill-extrusion-height", extrusionHeight);
+
+ QVariantMap extrusionBase;
+ extrusionBase["type"] = "identity";
+ extrusionBase["property"] = "min_height";
+
+ m_map->setPaintProperty("3d-buildings", "fill-extrusion-base", extrusionBase);
+ }
+ break;
+ case Qt::Key_1: {
+ if (m_symbolAnnotationId.isNull()) {
+ QMapbox::Coordinate coordinate = m_map->coordinate();
+ QMapbox::SymbolAnnotation symbol { coordinate, "default_marker" };
+ m_map->addAnnotationIcon("default_marker", QImage(":default_marker.svg"));
+ m_symbolAnnotationId = m_map->addAnnotation(QVariant::fromValue<QMapbox::SymbolAnnotation>(symbol));
+ } else {
+ m_map->removeAnnotation(m_symbolAnnotationId.toUInt());
+ m_symbolAnnotationId.clear();
+ }
+ }
+ break;
+ case Qt::Key_2: {
+ if (m_lineAnnotationId.isNull()) {
+ QMapbox::Coordinate topLeft = m_map->coordinateForPixel({ 0, 0 });
+ QMapbox::Coordinate bottomRight = m_map->coordinateForPixel({ qreal(size().width()), qreal(size().height()) });
+ QMapbox::CoordinatesCollections lineGeometry { { { topLeft, bottomRight } } };
+ QMapbox::ShapeAnnotationGeometry annotationGeometry { QMapbox::ShapeAnnotationGeometry::LineStringType, lineGeometry };
+ QMapbox::LineAnnotation line;
+ line.geometry = annotationGeometry;
+ line.opacity = 0.5f;
+ line.width = 1.0f;
+ line.color = Qt::red;
+ m_lineAnnotationId = m_map->addAnnotation(QVariant::fromValue<QMapbox::LineAnnotation>(line));
+ } else {
+ m_map->removeAnnotation(m_lineAnnotationId.toUInt());
+ m_lineAnnotationId.clear();
+ }
+ }
+ break;
+ case Qt::Key_3: {
+ if (m_fillAnnotationId.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 fillGeometry { { { bottomLeft, bottomRight, topRight, topLeft, bottomLeft } } };
+ QMapbox::ShapeAnnotationGeometry annotationGeometry { QMapbox::ShapeAnnotationGeometry::PolygonType, fillGeometry };
+ QMapbox::FillAnnotation fill;
+ fill.geometry = annotationGeometry;
+ fill.opacity = 0.5f;
+ fill.color = Qt::green;
+ fill.outlineColor = QVariant::fromValue<QColor>(QColor(Qt::black));
+ m_fillAnnotationId = m_map->addAnnotation(QVariant::fromValue<QMapbox::FillAnnotation>(fill));
+ } else {
+ m_map->removeAnnotation(m_fillAnnotationId.toUInt());
+ m_fillAnnotationId.clear();
+ }
+ }
+ break;
+ case Qt::Key_5: {
+ if (m_map->layerExists("circleLayer")) {
+ m_map->removeLayer("circleLayer");
+ m_map->removeSource("circleSource");
+ } else {
+ QMapbox::CoordinatesCollections point { { { m_map->coordinate() } } };
+ QMapbox::Feature feature { QMapbox::Feature::PointType, point, {}, {} };
+
+ QVariantMap circleSource;
+ circleSource["type"] = "geojson";
+ circleSource["data"] = QVariant::fromValue<QMapbox::Feature>(feature);
+ m_map->addSource("circleSource", circleSource);
+
+ QVariantMap circle;
+ circle["id"] = "circleLayer";
+ circle["type"] = "circle";
+ circle["source"] = "circleSource";
+ m_map->addLayer(circle);
+
+ m_map->setPaintProperty("circleLayer", "circle-radius", 10.0);
+ m_map->setPaintProperty("circleLayer", "circle-color", QColor("black"));
+ }
+ }
+ break;
+ case Qt::Key_Tab:
+ m_map->cycleDebugOptions();
+ break;
+ default:
+ break;
+ }
+
+ ev->accept();
+}
+
+void MapWindow::mousePressEvent(QMouseEvent *ev)
+{
+#if QT_VERSION < 0x050000
+ m_lastPos = ev->posF();
+#else
+ m_lastPos = ev->localPos();
+#endif
+
+ if (ev->type() == QEvent::MouseButtonPress) {
+ if (ev->buttons() == (Qt::LeftButton | Qt::RightButton)) {
+ changeStyle();
+ }
+ }
+
+ if (ev->type() == QEvent::MouseButtonDblClick) {
+ if (ev->buttons() == Qt::LeftButton) {
+ m_map->scaleBy(2.0, m_lastPos);
+ } else if (ev->buttons() == Qt::RightButton) {
+ m_map->scaleBy(0.5, m_lastPos);
+ }
+ }
+
+ ev->accept();
+}
+
+void MapWindow::mouseMoveEvent(QMouseEvent *ev)
+{
+#if QT_VERSION < 0x050000
+ QPointF delta = ev->posF() - m_lastPos;
+#else
+ QPointF delta = ev->localPos() - m_lastPos;
+#endif
+
+ if (!delta.isNull()) {
+ if (ev->buttons() == Qt::LeftButton && ev->modifiers() & Qt::ShiftModifier) {
+ m_map->setPitch(m_map->pitch() - delta.y());
+ } else if (ev->buttons() == Qt::LeftButton) {
+ m_map->moveBy(delta);
+ } else if (ev->buttons() == Qt::RightButton) {
+#if QT_VERSION < 0x050000
+ m_map->rotateBy(m_lastPos, ev->posF());
+#else
+ m_map->rotateBy(m_lastPos, ev->localPos());
+#endif
+ }
+ }
+
+#if QT_VERSION < 0x050000
+ m_lastPos = ev->posF();
+#else
+ m_lastPos = ev->localPos();
+#endif
+ ev->accept();
+}
+
+void MapWindow::wheelEvent(QWheelEvent *ev)
+{
+ if (ev->orientation() == Qt::Horizontal) {
+ return;
+ }
+
+ float factor = ev->delta() / 1200.;
+ if (ev->delta() < 0) {
+ factor = factor > -1 ? factor : 1 / factor;
+ }
+
+ m_map->scaleBy(1 + factor, ev->pos());
+ ev->accept();
+}
+
+void MapWindow::initializeGL()
+{
+ m_map.reset(new QMapboxGL(nullptr, m_settings, size(), pixelRatio()));
+ connect(m_map.data(), SIGNAL(needsRendering()), this, SLOT(update()));
+
+ // Set default location to Helsinki.
+ m_map->setCoordinateZoom(QMapbox::Coordinate(60.170448, 24.942046), 14);
+
+ QString styleUrl = qgetenv("MAPBOX_STYLE_URL");
+ if (styleUrl.isEmpty()) {
+ changeStyle();
+ } else {
+ m_map->setStyleUrl(styleUrl);
+ setWindowTitle(QString("Mapbox GL: ") + styleUrl);
+ }
+
+ m_bearingAnimation = new QPropertyAnimation(m_map.data(), "bearing");
+ m_zoomAnimation = new QPropertyAnimation(m_map.data(), "zoom");
+
+ connect(m_zoomAnimation, SIGNAL(finished()), this, SLOT(animationFinished()));
+ connect(m_zoomAnimation, SIGNAL(valueChanged(const QVariant&)), this, SLOT(animationValueChanged()));
+}
+
+void MapWindow::paintGL()
+{
+ m_frameDraws++;
+ m_map->resize(size(), size() * pixelRatio());
+#if QT_VERSION >= 0x050400
+ // When we're using QOpenGLWidget, we need to tell Mapbox GL about the framebuffer we're using.
+ m_map->setFramebufferObject(defaultFramebufferObject());
+#endif
+ m_map->render();
+}
diff --git a/platform/qt/app/mapwindow.hpp b/platform/qt/app/mapwindow.hpp
new file mode 100644
index 0000000000..c484114ec0
--- /dev/null
+++ b/platform/qt/app/mapwindow.hpp
@@ -0,0 +1,71 @@
+#ifndef MAPWINDOW_H
+#define MAPWINDOW_H
+
+#include <QMapboxGL>
+
+#include <QtGlobal>
+
+// XXX http://stackoverflow.com/questions/24899558/how-to-check-qt-version-to-include-different-header#comment59591604_29887388
+#if QT_VERSION >= 0x050400
+#include <QOpenGLWidget>
+#else
+#include <QGLWidget>
+#endif // QT_VERSION
+
+#include <QPropertyAnimation>
+#include <QScopedPointer>
+
+class QKeyEvent;
+class QMouseEvent;
+class QWheelEvent;
+
+#if QT_VERSION >= 0x050400
+class MapWindow : public QOpenGLWidget
+#else
+class MapWindow : public QGLWidget
+#endif // QT_VERSION
+{
+ Q_OBJECT
+
+public:
+ MapWindow(const QMapboxGLSettings &);
+
+ void selfTest();
+
+protected slots:
+ void animationValueChanged();
+ void animationFinished();
+
+private:
+ void changeStyle();
+ qreal pixelRatio();
+
+ // QWidget implementation.
+ void keyPressEvent(QKeyEvent *ev) final;
+ void mousePressEvent(QMouseEvent *ev) final;
+ void mouseMoveEvent(QMouseEvent *ev) final;
+ void wheelEvent(QWheelEvent *ev) final;
+
+ // Q{,Open}GLWidget implementation.
+ void initializeGL() final;
+ void paintGL() final;
+
+ QPointF m_lastPos;
+
+ QMapboxGLSettings m_settings;
+ QScopedPointer<QMapboxGL> m_map;
+
+ QPropertyAnimation *m_bearingAnimation;
+ QPropertyAnimation *m_zoomAnimation;
+
+ unsigned m_animationTicks = 0;
+ unsigned m_frameDraws = 0;
+
+ QVariant m_symbolAnnotationId;
+ QVariant m_lineAnnotationId;
+ QVariant m_fillAnnotationId;
+
+ bool m_sourceAdded = false;
+};
+
+#endif
diff --git a/platform/qt/resources/common.qrc b/platform/qt/resources/common.qrc
new file mode 100755
index 0000000000..8845992d78
--- /dev/null
+++ b/platform/qt/resources/common.qrc
@@ -0,0 +1,10 @@
+<RCC>
+ <qresource prefix="/">
+ <file>icon.png</file>
+ <file>default_marker.svg</file>
+ <file>source1.geojson</file>
+ <file>source2.geojson</file>
+ <file>label-arrow.svg</file>
+ <file>label-background.svg</file>
+ </qresource>
+</RCC>
diff --git a/platform/qt/resources/default_marker.svg b/platform/qt/resources/default_marker.svg
new file mode 100755
index 0000000000..08ae2d76d6
--- /dev/null
+++ b/platform/qt/resources/default_marker.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="20px" height="56px" viewBox="0 0 20 56" enable-background="new 0 0 20 56" xml:space="preserve">
+<ellipse opacity="0.2" fill="#262626" cx="10" cy="27" rx="9" ry="5"/>
+<path id="path5359" fill="#F84D4D" stroke="#951212" stroke-width="1.0229" stroke-linecap="round" stroke-linejoin="round" d="
+ M19.5,10.4c0,6.3-9.5,17.1-9.5,17.1S0.5,16.6,0.5,10.4c0-5.5,4.3-9.9,9.5-9.9S19.5,4.9,19.5,10.4z"/>
+<circle id="path5990" fill="#FFFFFF" stroke="#7C2525" stroke-linecap="round" stroke-linejoin="round" cx="10" cy="10" r="3.8"/>
+</svg>
diff --git a/platform/qt/resources/icon.png b/platform/qt/resources/icon.png
new file mode 100755
index 0000000000..0a9bc1cdea
--- /dev/null
+++ b/platform/qt/resources/icon.png
Binary files differ
diff --git a/platform/qt/resources/label-arrow.svg b/platform/qt/resources/label-arrow.svg
new file mode 100755
index 0000000000..c1c9d2b77d
--- /dev/null
+++ b/platform/qt/resources/label-arrow.svg
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="40"
+ height="40"
+ id="svg3840"
+ version="1.1"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="New document 3">
+ <defs
+ id="defs3842" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="3.8146973"
+ inkscape:cx="26.909082"
+ inkscape:cy="41.484288"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false" />
+ <metadata
+ id="metadata3845">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1012.3622)">
+ <g
+ id="g3811"
+ transform="translate(0,1012.3622)">
+ <g
+ id="g3802">
+ <g
+ id="g3794">
+ <g
+ transform="translate(0,-1012.3622)"
+ id="layer1-7">
+ <g
+ style="stroke-width:0;stroke-miterlimit:4"
+ stroke-miterlimit="4"
+ id="g3763">
+ <path
+ inkscape:connector-curvature="0"
+ id="path2987"
+ transform="translate(0,1012.3622)"
+ d="M 5,0 18.03125,30.40625 A 5,5 0 0 0 15,35 5,5 0 0 0 25,35 5,5 0 0 0 21.96875,30.40625 L 35,0 5,0 z"
+ style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;enable-background:accumulate" />
+ <path
+ inkscape:connector-curvature="0"
+ transform="matrix(0.39999698,0,0,0.39999698,12.00006,1033.3623)"
+ d="m 25,35 a 5,5 0 1 1 -10,0 5,5 0 1 1 10,0 z"
+ style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;enable-background:accumulate"
+ id="path3759" />
+ <rect
+ x="0"
+ y="0"
+ width="40"
+ height="40"
+ transform="translate(0,1012.3622)"
+ style="color:#000000;fill-opacity:0;enable-background:accumulate"
+ id="rect3761" />
+ </g>
+ </g>
+ <rect
+ y="0"
+ x="0"
+ height="40"
+ width="40"
+ id="rect3792"
+ style="color:#000000;fill:#000000;fill-opacity:0;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ </g>
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/platform/qt/resources/label-background.svg b/platform/qt/resources/label-background.svg
new file mode 100755
index 0000000000..af3e471230
--- /dev/null
+++ b/platform/qt/resources/label-background.svg
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg id="svg3926" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="40" width="120" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <defs id="defs3928">
+ <linearGradient id="linearGradient3793" y2="5" gradientUnits="userSpaceOnUse" x2="40" y1="30" x1="40">
+ <stop id="stop3789" stop-color="#000" offset="0"/>
+ <stop id="stop3791" stop-color="#000" stop-opacity="0.50196081" offset="1"/>
+ </linearGradient>
+ </defs>
+ <metadata id="metadata3931">
+ <rdf:RDF>
+ <cc:Work rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ <dc:title/>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g id="layer1" transform="translate(0,-1012.3622)">
+ <g id="g3788" transform="translate(-40,1012.3622)">
+ <rect id="rect2991" style="enable-background:accumulate;color:#000000;" fill-rule="nonzero" ry="3" height="30" width="120" y="5" x="40" fill="url(#linearGradient3793)"/>
+ <rect id="rect3018" style="enable-background:accumulate;color:#000000;" fill-opacity="0" height="40" width="120" y="0" x="40"/>
+ </g>
+ </g>
+</svg>
diff --git a/platform/qt/resources/source1.geojson b/platform/qt/resources/source1.geojson
new file mode 100755
index 0000000000..1d270ba189
--- /dev/null
+++ b/platform/qt/resources/source1.geojson
@@ -0,0 +1,1172 @@
+{
+ "type": "FeatureCollection",
+ "features": [
+ {
+ "type": "Feature",
+ "properties": {
+ "type": "label",
+ "name": "Start"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ 24.934420000000003,
+ 60.163500000000006
+ ]
+ }
+ },
+ {
+ "type": "Feature",
+ "properties": {
+ "type": "label",
+ "name": "End"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ 24.943690000000004,
+ 60.155280000000005
+ ]
+ }
+ },
+ {
+ "type": "Feature",
+ "properties": {
+ "type": "label",
+ "name": "Gas station"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ 24.915920000000003,
+ 60.17544
+ ]
+ }
+ },
+ {
+ "type": "Feature",
+ "properties": {
+ "type": "label",
+ "name": "Construction"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ 24.94884,
+ 60.18657
+ ]
+ }
+ },
+ {
+ "type": "Feature",
+ "properties": {
+ "name": "Route"
+ },
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [
+ 24.934420000000003,
+ 60.163500000000006
+ ],
+ [
+ 24.934500000000003,
+ 60.16344000000001
+ ],
+ [
+ 24.93338246049353,
+ 60.16305251411869
+ ],
+ [
+ 24.932264947341018,
+ 60.162665018830225
+ ],
+ [
+ 24.931147460542068,
+ 60.16227751413501
+ ],
+ [
+ 24.930030000000002,
+ 60.16189000000001
+ ],
+ [
+ 24.929800000000004,
+ 60.16180000000001
+ ],
+ [
+ 24.929550000000003,
+ 60.16178000000001
+ ],
+ [
+ 24.92931,
+ 60.16180000000001
+ ],
+ [
+ 24.929280000000002,
+ 60.16172
+ ],
+ [
+ 24.928800000000003,
+ 60.161730000000006
+ ],
+ [
+ 24.927669986590868,
+ 60.161340004809425
+ ],
+ [
+ 24.926540000000003,
+ 60.16095000000001
+ ],
+ [
+ 24.92632,
+ 60.16089
+ ],
+ [
+ 24.925890000000003,
+ 60.16086000000001
+ ],
+ [
+ 24.925520000000002,
+ 60.16089
+ ],
+ [
+ 24.92472,
+ 60.16105
+ ],
+ [
+ 24.924270000000003,
+ 60.161210000000004
+ ],
+ [
+ 24.923490008921945,
+ 60.16159500239787
+ ],
+ [
+ 24.922710000000002,
+ 60.16198000000001
+ ],
+ [
+ 24.922390000000004,
+ 60.16221
+ ],
+ [
+ 24.922050000000002,
+ 60.16228
+ ],
+ [
+ 24.921770000000002,
+ 60.16236000000001
+ ],
+ [
+ 24.921580000000002,
+ 60.16243000000001
+ ],
+ [
+ 24.921010000000003,
+ 60.16284
+ ],
+ [
+ 24.92094,
+ 60.16328000000001
+ ],
+ [
+ 24.920890000000004,
+ 60.16342
+ ],
+ [
+ 24.92087,
+ 60.16344000000001
+ ],
+ [
+ 24.920830000000002,
+ 60.16362
+ ],
+ [
+ 24.920820000000003,
+ 60.16371
+ ],
+ [
+ 24.920840000000002,
+ 60.16376
+ ],
+ [
+ 24.92077,
+ 60.164320000000004
+ ],
+ [
+ 24.92077,
+ 60.164500000000004
+ ],
+ [
+ 24.92085,
+ 60.16467000000001
+ ],
+ [
+ 24.92086,
+ 60.16479
+ ],
+ [
+ 24.92086,
+ 60.164860000000004
+ ],
+ [
+ 24.92096,
+ 60.165090000000006
+ ],
+ [
+ 24.920920000000002,
+ 60.165420000000005
+ ],
+ [
+ 24.92096,
+ 60.16561000000001
+ ],
+ [
+ 24.920885001120794,
+ 60.16610000000575
+ ],
+ [
+ 24.920810000000003,
+ 60.16659000000001
+ ],
+ [
+ 24.920800000000003,
+ 60.166790000000006
+ ],
+ [
+ 24.920840000000002,
+ 60.166900000000005
+ ],
+ [
+ 24.920990000000003,
+ 60.167
+ ],
+ [
+ 24.920895002461783,
+ 60.16785500012713
+ ],
+ [
+ 24.920800000000003,
+ 60.168710000000004
+ ],
+ [
+ 24.920740000000002,
+ 60.16913
+ ],
+ [
+ 24.920620000000003,
+ 60.16971
+ ],
+ [
+ 24.920520000000003,
+ 60.1698
+ ],
+ [
+ 24.92049,
+ 60.169900000000005
+ ],
+ [
+ 24.92041,
+ 60.169920000000005
+ ],
+ [
+ 24.919000036342872,
+ 60.17034334830489
+ ],
+ [
+ 24.91759003634794,
+ 60.17076668163695
+ ],
+ [
+ 24.91618,
+ 60.17119
+ ],
+ [
+ 24.916240000000002,
+ 60.171290000000006
+ ],
+ [
+ 24.916220000000003,
+ 60.17134000000001
+ ],
+ [
+ 24.916150000000002,
+ 60.171530000000004
+ ],
+ [
+ 24.916,
+ 60.17181000000001
+ ],
+ [
+ 24.915840000000003,
+ 60.172000000000004
+ ],
+ [
+ 24.915390000000002,
+ 60.17239000000001
+ ],
+ [
+ 24.91524,
+ 60.17257000000001
+ ],
+ [
+ 24.914990000000003,
+ 60.172990000000006
+ ],
+ [
+ 24.914910000000003,
+ 60.173190000000005
+ ],
+ [
+ 24.914830000000002,
+ 60.17352
+ ],
+ [
+ 24.914820000000002,
+ 60.17365
+ ],
+ [
+ 24.915090000000003,
+ 60.17452000000001
+ ],
+ [
+ 24.91512,
+ 60.17457
+ ],
+ [
+ 24.91562,
+ 60.17486
+ ],
+ [
+ 24.915770000000002,
+ 60.174980000000005
+ ],
+ [
+ 24.915860000000002,
+ 60.175090000000004
+ ],
+ [
+ 24.915930000000003,
+ 60.17526
+ ],
+ [
+ 24.915940000000003,
+ 60.17533
+ ],
+ [
+ 24.915920000000003,
+ 60.17544
+ ],
+ [
+ 24.91581,
+ 60.17564000000001
+ ],
+ [
+ 24.9174,
+ 60.175850000000004
+ ],
+ [
+ 24.91786,
+ 60.17593000000001
+ ],
+ [
+ 24.919449989456812,
+ 60.17614500950065
+ ],
+ [
+ 24.92104,
+ 60.17636
+ ],
+ [
+ 24.922050000000002,
+ 60.176570000000005
+ ],
+ [
+ 24.922120000000003,
+ 60.17683
+ ],
+ [
+ 24.921950000000002,
+ 60.17681
+ ],
+ [
+ 24.921770000000002,
+ 60.17681
+ ],
+ [
+ 24.922120000000003,
+ 60.17683
+ ],
+ [
+ 24.922050000000002,
+ 60.176570000000005
+ ],
+ [
+ 24.92207,
+ 60.176570000000005
+ ],
+ [
+ 24.922140000000002,
+ 60.17658000000001
+ ],
+ [
+ 24.922110000000004,
+ 60.176520000000004
+ ],
+ [
+ 24.923530000000003,
+ 60.17681
+ ],
+ [
+ 24.925056651315714,
+ 60.17697335086663
+ ],
+ [
+ 24.92658331781631,
+ 60.17713668418224
+ ],
+ [
+ 24.928110000000004,
+ 60.1773
+ ],
+ [
+ 24.928300000000004,
+ 60.177330000000005
+ ],
+ [
+ 24.92856,
+ 60.17738000000001
+ ],
+ [
+ 24.92978,
+ 60.17752000000001
+ ],
+ [
+ 24.929520000000004,
+ 60.17797
+ ],
+ [
+ 24.929240000000004,
+ 60.17855000000001
+ ],
+ [
+ 24.929840000000002,
+ 60.178610000000006
+ ],
+ [
+ 24.930080000000004,
+ 60.1786
+ ],
+ [
+ 24.93081,
+ 60.17866000000001
+ ],
+ [
+ 24.93081,
+ 60.178720000000006
+ ],
+ [
+ 24.930840000000003,
+ 60.178830000000005
+ ],
+ [
+ 24.931040000000003,
+ 60.17929
+ ],
+ [
+ 24.931060000000002,
+ 60.179410000000004
+ ],
+ [
+ 24.93111,
+ 60.180170000000004
+ ],
+ [
+ 24.931130000000003,
+ 60.18099000000001
+ ],
+ [
+ 24.931160000000002,
+ 60.18117
+ ],
+ [
+ 24.93137,
+ 60.181670000000004
+ ],
+ [
+ 24.931620000000002,
+ 60.18218
+ ],
+ [
+ 24.931710000000002,
+ 60.182410000000004
+ ],
+ [
+ 24.93173,
+ 60.18253000000001
+ ],
+ [
+ 24.93173,
+ 60.18263
+ ],
+ [
+ 24.93166,
+ 60.18280000000001
+ ],
+ [
+ 24.931410000000003,
+ 60.182990000000004
+ ],
+ [
+ 24.931520000000003,
+ 60.18309000000001
+ ],
+ [
+ 24.93177999609094,
+ 60.183585000274455
+ ],
+ [
+ 24.93204,
+ 60.18408
+ ],
+ [
+ 24.93221,
+ 60.184450000000005
+ ],
+ [
+ 24.932250000000003,
+ 60.18451
+ ],
+ [
+ 24.93242,
+ 60.18462
+ ],
+ [
+ 24.932660000000002,
+ 60.184670000000004
+ ],
+ [
+ 24.93428,
+ 60.184900000000006
+ ],
+ [
+ 24.93574999134566,
+ 60.18509500814494
+ ],
+ [
+ 24.937220000000003,
+ 60.18529
+ ],
+ [
+ 24.93774,
+ 60.18538
+ ],
+ [
+ 24.939459986412267,
+ 60.185640011141956
+ ],
+ [
+ 24.941180000000003,
+ 60.185900000000004
+ ],
+ [
+ 24.941160000000004,
+ 60.185930000000006
+ ],
+ [
+ 24.941750000000003,
+ 60.186020000000006
+ ],
+ [
+ 24.942120000000003,
+ 60.18609000000001
+ ],
+ [
+ 24.943450000000002,
+ 60.186280000000004
+ ],
+ [
+ 24.943720000000003,
+ 60.1863
+ ],
+ [
+ 24.94433,
+ 60.18634000000001
+ ],
+ [
+ 24.94583332994822,
+ 60.186376683681516
+ ],
+ [
+ 24.94733666325508,
+ 60.186413350347536
+ ],
+ [
+ 24.94884,
+ 60.18645000000001
+ ],
+ [
+ 24.94884,
+ 60.18657
+ ],
+ [
+ 24.95034,
+ 60.186600000000006
+ ],
+ [
+ 24.95033,
+ 60.18666
+ ],
+ [
+ 24.95034,
+ 60.186600000000006
+ ],
+ [
+ 24.950400000000002,
+ 60.18661
+ ],
+ [
+ 24.95072,
+ 60.186640000000004
+ ],
+ [
+ 24.95097,
+ 60.1867
+ ],
+ [
+ 24.95107,
+ 60.1867
+ ],
+ [
+ 24.95108,
+ 60.186640000000004
+ ],
+ [
+ 24.951130000000003,
+ 60.18659
+ ],
+ [
+ 24.951310000000003,
+ 60.18647000000001
+ ],
+ [
+ 24.95137,
+ 60.18636000000001
+ ],
+ [
+ 24.95144,
+ 60.185790000000004
+ ],
+ [
+ 24.95152000182123,
+ 60.18504000008196
+ ],
+ [
+ 24.951600000000003,
+ 60.184290000000004
+ ],
+ [
+ 24.951610000000002,
+ 60.184050000000006
+ ],
+ [
+ 24.95164,
+ 60.183960000000006
+ ],
+ [
+ 24.95174,
+ 60.183870000000006
+ ],
+ [
+ 24.952,
+ 60.183730000000004
+ ],
+ [
+ 24.95287,
+ 60.18339
+ ],
+ [
+ 24.952990000000003,
+ 60.18334000000001
+ ],
+ [
+ 24.95322,
+ 60.183310000000006
+ ],
+ [
+ 24.95451501994334,
+ 60.182800006380525
+ ],
+ [
+ 24.955810000000003,
+ 60.18229
+ ],
+ [
+ 24.955840000000002,
+ 60.182230000000004
+ ],
+ [
+ 24.95588,
+ 60.18222000000001
+ ],
+ [
+ 24.956170000000004,
+ 60.182050000000004
+ ],
+ [
+ 24.957440000000002,
+ 60.181490000000004
+ ],
+ [
+ 24.958235008897837,
+ 60.1811250023513
+ ],
+ [
+ 24.959030000000002,
+ 60.18076000000001
+ ],
+ [
+ 24.9587,
+ 60.180580000000006
+ ],
+ [
+ 24.958460000000002,
+ 60.180510000000005
+ ],
+ [
+ 24.957690000000003,
+ 60.18009000000001
+ ],
+ [
+ 24.957320000000003,
+ 60.17987000000001
+ ],
+ [
+ 24.95689,
+ 60.17974
+ ],
+ [
+ 24.956770000000002,
+ 60.17969000000001
+ ],
+ [
+ 24.95634,
+ 60.17929
+ ],
+ [
+ 24.95633,
+ 60.179140000000004
+ ],
+ [
+ 24.95654,
+ 60.17907
+ ],
+ [
+ 24.956590000000002,
+ 60.17902000000001
+ ],
+ [
+ 24.95661,
+ 60.178940000000004
+ ],
+ [
+ 24.956895004072333,
+ 60.178465000388556
+ ],
+ [
+ 24.95718,
+ 60.17799000000001
+ ],
+ [
+ 24.957240000000002,
+ 60.177800000000005
+ ],
+ [
+ 24.957305000964798,
+ 60.17730000020621
+ ],
+ [
+ 24.95737,
+ 60.17680000000001
+ ],
+ [
+ 24.957440000000002,
+ 60.17665
+ ],
+ [
+ 24.957520000000002,
+ 60.17654
+ ],
+ [
+ 24.95774,
+ 60.176390000000005
+ ],
+ [
+ 24.9581,
+ 60.176260000000006
+ ],
+ [
+ 24.95867,
+ 60.176190000000005
+ ],
+ [
+ 24.959410000000002,
+ 60.1762
+ ],
+ [
+ 24.959410000000002,
+ 60.17627
+ ],
+ [
+ 24.95999,
+ 60.17627
+ ],
+ [
+ 24.96028,
+ 60.17625
+ ],
+ [
+ 24.960610000000003,
+ 60.176190000000005
+ ],
+ [
+ 24.96113,
+ 60.17598
+ ],
+ [
+ 24.961430000000004,
+ 60.17582
+ ],
+ [
+ 24.961570000000002,
+ 60.175700000000006
+ ],
+ [
+ 24.961660000000002,
+ 60.17557000000001
+ ],
+ [
+ 24.96168,
+ 60.17551
+ ],
+ [
+ 24.961820000000003,
+ 60.17551
+ ],
+ [
+ 24.961920001933628,
+ 60.17487500003499
+ ],
+ [
+ 24.962020000000003,
+ 60.174240000000005
+ ],
+ [
+ 24.96189,
+ 60.17401
+ ],
+ [
+ 24.961509982032023,
+ 60.17323333442284
+ ],
+ [
+ 24.961129982033466,
+ 60.17245666775814
+ ],
+ [
+ 24.96075,
+ 60.17168
+ ],
+ [
+ 24.960810000000002,
+ 60.171670000000006
+ ],
+ [
+ 24.960880000000003,
+ 60.17181000000001
+ ],
+ [
+ 24.960880000000003,
+ 60.171800000000005
+ ],
+ [
+ 24.960810000000002,
+ 60.171670000000006
+ ],
+ [
+ 24.96075,
+ 60.17168
+ ],
+ [
+ 24.960429987467663,
+ 60.17103666743907
+ ],
+ [
+ 24.960109987468513,
+ 60.170393334106876
+ ],
+ [
+ 24.95979,
+ 60.16975000000001
+ ],
+ [
+ 24.95971,
+ 60.16967
+ ],
+ [
+ 24.95961,
+ 60.16962
+ ],
+ [
+ 24.95953,
+ 60.169610000000006
+ ],
+ [
+ 24.958840000000002,
+ 60.16959000000001
+ ],
+ [
+ 24.9587,
+ 60.169540000000005
+ ],
+ [
+ 24.958640000000003,
+ 60.16946000000001
+ ],
+ [
+ 24.958650000000002,
+ 60.169000000000004
+ ],
+ [
+ 24.95859,
+ 60.16892000000001
+ ],
+ [
+ 24.95795,
+ 60.16852000000001
+ ],
+ [
+ 24.95794,
+ 60.16848
+ ],
+ [
+ 24.95737,
+ 60.16809000000001
+ ],
+ [
+ 24.957390000000004,
+ 60.168060000000004
+ ],
+ [
+ 24.95728,
+ 60.16798000000001
+ ],
+ [
+ 24.956850000000003,
+ 60.167910000000006
+ ],
+ [
+ 24.956010000000003,
+ 60.167880000000004
+ ],
+ [
+ 24.955890000000004,
+ 60.167860000000005
+ ],
+ [
+ 24.954429998196012,
+ 60.16782000802667
+ ],
+ [
+ 24.95297,
+ 60.16778000000001
+ ],
+ [
+ 24.952630000000003,
+ 60.16772
+ ],
+ [
+ 24.952550000000002,
+ 60.167680000000004
+ ],
+ [
+ 24.952520000000003,
+ 60.16762000000001
+ ],
+ [
+ 24.9526,
+ 60.16675000000001
+ ],
+ [
+ 24.95266,
+ 60.16673000000001
+ ],
+ [
+ 24.953120000000002,
+ 60.166740000000004
+ ],
+ [
+ 24.95314,
+ 60.16662
+ ],
+ [
+ 24.953170000000004,
+ 60.166320000000006
+ ],
+ [
+ 24.95315,
+ 60.16608000000001
+ ],
+ [
+ 24.953080000000003,
+ 60.16581000000001
+ ],
+ [
+ 24.95313,
+ 60.165290000000006
+ ],
+ [
+ 24.95285,
+ 60.16528
+ ],
+ [
+ 24.952910000000003,
+ 60.16467000000001
+ ],
+ [
+ 24.953030000000002,
+ 60.16438000000001
+ ],
+ [
+ 24.95324,
+ 60.164100000000005
+ ],
+ [
+ 24.953470000000003,
+ 60.16389
+ ],
+ [
+ 24.954400035687588,
+ 60.16326000649468
+ ],
+ [
+ 24.955330035716912,
+ 60.16263000647425
+ ],
+ [
+ 24.95626,
+ 60.162000000000006
+ ],
+ [
+ 24.95652,
+ 60.16174
+ ],
+ [
+ 24.956760000000003,
+ 60.161300000000004
+ ],
+ [
+ 24.956640000000004,
+ 60.161280000000005
+ ],
+ [
+ 24.956400000000002,
+ 60.16131000000001
+ ],
+ [
+ 24.95626,
+ 60.161280000000005
+ ],
+ [
+ 24.956200000000003,
+ 60.16124000000001
+ ],
+ [
+ 24.95597,
+ 60.16091000000001
+ ],
+ [
+ 24.956010000000003,
+ 60.160830000000004
+ ],
+ [
+ 24.955930000000002,
+ 60.16075000000001
+ ],
+ [
+ 24.955604994572663,
+ 60.16020500033396
+ ],
+ [
+ 24.955280000000002,
+ 60.15966
+ ],
+ [
+ 24.955070000000003,
+ 60.159290000000006
+ ],
+ [
+ 24.95493,
+ 60.159020000000005
+ ],
+ [
+ 24.954860000000004,
+ 60.158930000000005
+ ],
+ [
+ 24.954780000000003,
+ 60.158950000000004
+ ],
+ [
+ 24.954860000000004,
+ 60.158930000000005
+ ],
+ [
+ 24.95428499256551,
+ 60.158505001245636
+ ],
+ [
+ 24.95371,
+ 60.158080000000005
+ ],
+ [
+ 24.952809982572653,
+ 60.157445003022275
+ ],
+ [
+ 24.95191,
+ 60.15681000000001
+ ],
+ [
+ 24.951030000000003,
+ 60.156200000000005
+ ],
+ [
+ 24.95089,
+ 60.15614000000001
+ ],
+ [
+ 24.950260000000004,
+ 60.15605000000001
+ ],
+ [
+ 24.948617471181432,
+ 60.15585753049101
+ ],
+ [
+ 24.94697496159803,
+ 60.15566504065723
+ ],
+ [
+ 24.94533247125144,
+ 60.15547253049904
+ ],
+ [
+ 24.943690000000004,
+ 60.155280000000005
+ ]
+ ]
+ }
+ }
+ ]
+}
diff --git a/platform/qt/resources/source2.geojson b/platform/qt/resources/source2.geojson
new file mode 100755
index 0000000000..df300d1040
--- /dev/null
+++ b/platform/qt/resources/source2.geojson
@@ -0,0 +1,92 @@
+{
+ "type": "FeatureCollection",
+ "features": [
+ {
+ "type": "Feature",
+ "properties": {
+ "type": "label",
+ "name": "Start"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ 24.943320751190186,
+ 60.166471893909794
+ ]
+ }
+ },
+ {
+ "type": "Feature",
+ "properties": {
+ "type": "label",
+ "name": "End"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ 24.942440986633297,
+ 60.16715507391703
+ ]
+ }
+ },
+ {
+ "type": "Feature",
+ "properties": {
+ "type": "label",
+ "name": "Traffic Accident"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [
+ 24.94018793106079,
+ 60.16696293097573
+ ]
+ }
+ },
+ {
+ "type": "Feature",
+ "properties": {},
+ "geometry": {
+ "type": "LineString",
+ "coordinates": [
+ [
+ 24.943320751190186,
+ 60.166471893909794
+ ],
+ [
+ 24.934544563293453,
+ 60.16347213858629
+ ],
+ [
+ 24.93321418762207,
+ 60.16446497048834
+ ],
+ [
+ 24.94018793106079,
+ 60.16696293097573
+ ],
+ [
+ 24.93875026702881,
+ 60.16806240040351
+ ],
+ [
+ 24.937891960144043,
+ 60.16777419352904
+ ],
+ [
+ 24.936089515686035,
+ 60.169033745694826
+ ],
+ [
+ 24.9384069442749,
+ 60.16984495711831
+ ],
+ [
+ 24.942440986633297,
+ 60.16715507391703
+ ]
+ ]
+ }
+ }
+ ]
+}
diff --git a/platform/default/logging_stderr.cpp b/platform/qt/src/logging_qt.cpp
index 41585fb7bb..acbe9562d0 100644..100755
--- a/platform/default/logging_stderr.cpp
+++ b/platform/qt/src/logging_qt.cpp
@@ -1,12 +1,12 @@
#include <mbgl/util/logging.hpp>
#include <mbgl/util/enum.hpp>
-#include <iostream>
+#include <QDebug>
namespace mbgl {
void Log::platformRecord(EventSeverity severity, const std::string &msg) {
- std::cerr << "[" << Enum<EventSeverity>::toString(severity) << "] " << msg << std::endl;
+ qWarning() << "[" << Enum<EventSeverity>::toString(severity) << "] " << QString::fromStdString(msg);
}
} // namespace mbgl
diff --git a/src/mbgl/gl/context.hpp b/src/mbgl/gl/context.hpp
index 528113cbba..d29988e4a6 100644
--- a/src/mbgl/gl/context.hpp
+++ b/src/mbgl/gl/context.hpp
@@ -281,8 +281,11 @@ private:
std::vector<RenderbufferID> abandonedRenderbuffers;
public:
- // For testing
+#if defined(_WINDOWS)
+ bool disableVAOExtension = true;
+#else
bool disableVAOExtension = false;
+#endif
};
} // namespace gl