diff options
Diffstat (limited to 'src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp')
-rw-r--r-- | src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp index 30c01f8c..c7d5d3ee 100644 --- a/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp +++ b/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp @@ -38,9 +38,20 @@ #include "qgeoserviceproviderpluginmapboxgl.h" #include "qgeomappingmanagerenginemapboxgl.h" +#include <QtGui/QOpenGLContext> + +static void initResources() +{ + Q_INIT_RESOURCE(mapboxgl); +} QT_BEGIN_NAMESPACE +QGeoServiceProviderFactoryMapboxGL::QGeoServiceProviderFactoryMapboxGL() +{ + initResources(); +} + QGeoCodingManagerEngine *QGeoServiceProviderFactoryMapboxGL::createGeocodingManagerEngine( const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const { @@ -54,6 +65,15 @@ QGeoCodingManagerEngine *QGeoServiceProviderFactoryMapboxGL::createGeocodingMana QGeoMappingManagerEngine *QGeoServiceProviderFactoryMapboxGL::createMappingManagerEngine( const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const { +#ifdef Q_OS_WIN + if (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGLES) { + qWarning("The Mapbox GL plugin only supports OpenGL ES on Windows. \ + Try setting the environment variable QT_OPENGL to 'angle'."); + + return 0; + } +#endif + return new QGeoMappingManagerEngineMapboxGL(parameters, error, errorString); } |