[Qt] Added viewport mode
Qt Quick requires third-party rendering codes to follow its standards with regards to viewport transform. Qt 5.6 adds a 'mirrorVertically' property but that only solves the solution for that version of Qt onwards. Telling Mapbox GL core to flip the Y axis makes QQuickMapboxGL item available for Qt 5.2 onwards. Qt 'mirrorVertically' property documentation: http://doc.qt.io/qt-5/qquickframebufferobject.html#mirrorVertically-prop Fixes #4866.
This commit is contained in:
@@ -16,6 +16,7 @@ QQuickMapboxGLRenderer::QQuickMapboxGLRenderer()
|
||||
settings.setAccessToken(qgetenv("MAPBOX_ACCESS_TOKEN"));
|
||||
settings.setCacheDatabasePath("/tmp/mbgl-cache.db");
|
||||
settings.setCacheDatabaseMaximumSize(20 * 1024 * 1024);
|
||||
settings.setViewportMode(QMapboxGLSettings::FlippedYViewport);
|
||||
|
||||
m_map.reset(new QMapboxGL(nullptr, settings));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user