summaryrefslogtreecommitdiff
path: root/platform/qt/include
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2018-02-24 18:52:57 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2018-02-24 21:15:48 +0200
commit13d7f66c71eb94d0dbf6604da352605ed0f547da (patch)
tree5ebf27c566d433fdf785856cfc6811fb6f8c87c4 /platform/qt/include
parent8c1be4ec01ef46bf453856531ebf53b48ce3dbe7 (diff)
downloadqtlocation-mapboxgl-13d7f66c71eb94d0dbf6604da352605ed0f547da.tar.gz
Bump Mapbox GL Native
mapbox-gl-native @ 5de373fff0e71496b6aa11ecb6556f958a28d80b
Diffstat (limited to 'platform/qt/include')
-rw-r--r--platform/qt/include/QQuickMapboxGL1
-rw-r--r--platform/qt/include/QQuickMapboxGLMapParameter1
-rw-r--r--platform/qt/include/qmapbox.hpp24
-rw-r--r--platform/qt/include/qmapboxgl.hpp30
4 files changed, 40 insertions, 16 deletions
diff --git a/platform/qt/include/QQuickMapboxGL b/platform/qt/include/QQuickMapboxGL
deleted file mode 100644
index db109a1d3a..0000000000
--- a/platform/qt/include/QQuickMapboxGL
+++ /dev/null
@@ -1 +0,0 @@
-#include "qquickmapboxgl.hpp"
diff --git a/platform/qt/include/QQuickMapboxGLMapParameter b/platform/qt/include/QQuickMapboxGLMapParameter
deleted file mode 100644
index 603fb2bd51..0000000000
--- a/platform/qt/include/QQuickMapboxGLMapParameter
+++ /dev/null
@@ -1 +0,0 @@
-#include "qquickmapboxglmapparameter.hpp"
diff --git a/platform/qt/include/qmapbox.hpp b/platform/qt/include/qmapbox.hpp
index 2bb5d8705c..5a5198108c 100644
--- a/platform/qt/include/qmapbox.hpp
+++ b/platform/qt/include/qmapbox.hpp
@@ -9,6 +9,12 @@
// This header follows the Qt coding style: https://wiki.qt.io/Qt_Coding_Style
+#if defined(QT_BUILD_MAPBOXGL_LIB)
+ #define Q_MAPBOXGL_EXPORT Q_DECL_EXPORT
+#else
+ #define Q_MAPBOXGL_EXPORT Q_DECL_IMPORT
+#endif
+
namespace QMapbox {
typedef QPair<double, double> Coordinate;
@@ -20,7 +26,7 @@ typedef QList<Coordinates> CoordinatesCollection;
typedef QList<CoordinatesCollection> CoordinatesCollections;
-struct Q_DECL_EXPORT Feature {
+struct Q_MAPBOXGL_EXPORT Feature {
enum Type {
PointType = 1,
LineStringType,
@@ -38,7 +44,7 @@ struct Q_DECL_EXPORT Feature {
QVariant id;
};
-struct Q_DECL_EXPORT ShapeAnnotationGeometry {
+struct Q_MAPBOXGL_EXPORT ShapeAnnotationGeometry {
enum Type {
LineStringType = 1,
PolygonType,
@@ -54,12 +60,12 @@ struct Q_DECL_EXPORT ShapeAnnotationGeometry {
CoordinatesCollections geometry;
};
-struct Q_DECL_EXPORT SymbolAnnotation {
+struct Q_MAPBOXGL_EXPORT SymbolAnnotation {
Coordinate geometry;
QString icon;
};
-struct Q_DECL_EXPORT LineAnnotation {
+struct Q_MAPBOXGL_EXPORT LineAnnotation {
/*! Class constructor. */
LineAnnotation(const ShapeAnnotationGeometry& geometry_ = ShapeAnnotationGeometry(), float opacity_ = 1.0f,
float width_ = 1.0f, const QColor& color_ = Qt::black)
@@ -71,7 +77,7 @@ struct Q_DECL_EXPORT LineAnnotation {
QColor color;
};
-struct Q_DECL_EXPORT FillAnnotation {
+struct Q_MAPBOXGL_EXPORT FillAnnotation {
/*! Class constructor. */
FillAnnotation(const ShapeAnnotationGeometry& geometry_ = ShapeAnnotationGeometry(), float opacity_ = 1.0f,
const QColor& color_ = Qt::black, const QVariant& outlineColor_ = QVariant())
@@ -92,13 +98,13 @@ enum NetworkMode {
Offline,
};
-Q_DECL_EXPORT QList<QPair<QString, QString> >& defaultStyles();
+Q_MAPBOXGL_EXPORT QList<QPair<QString, QString> >& defaultStyles();
-Q_DECL_EXPORT NetworkMode networkMode();
-Q_DECL_EXPORT void setNetworkMode(NetworkMode);
+Q_MAPBOXGL_EXPORT NetworkMode networkMode();
+Q_MAPBOXGL_EXPORT void setNetworkMode(NetworkMode);
// This struct is a 1:1 copy of mbgl::CustomLayerRenderParameters.
-struct Q_DECL_EXPORT CustomLayerRenderParameters {
+struct Q_MAPBOXGL_EXPORT CustomLayerRenderParameters {
double width;
double height;
double latitude;
diff --git a/platform/qt/include/qmapboxgl.hpp b/platform/qt/include/qmapboxgl.hpp
index ebbd949921..bc18eaba59 100644
--- a/platform/qt/include/qmapboxgl.hpp
+++ b/platform/qt/include/qmapboxgl.hpp
@@ -16,7 +16,7 @@ class QMapboxGLPrivate;
// This header follows the Qt coding style: https://wiki.qt.io/Qt_Coding_Style
-class Q_DECL_EXPORT QMapboxGLSettings
+class Q_MAPBOXGL_EXPORT QMapboxGLSettings
{
public:
QMapboxGLSettings();
@@ -26,6 +26,11 @@ public:
SharedGLContext
};
+ enum MapMode {
+ Continuous = 0,
+ Static
+ };
+
enum ConstrainMode {
NoConstrain = 0,
ConstrainHeightOnly,
@@ -40,6 +45,9 @@ public:
GLContextMode contextMode() const;
void setContextMode(GLContextMode);
+ MapMode mapMode() const;
+ void setMapMode(MapMode);
+
ConstrainMode constrainMode() const;
void setConstrainMode(ConstrainMode);
@@ -66,6 +74,7 @@ public:
private:
GLContextMode m_contextMode;
+ MapMode m_mapMode;
ConstrainMode m_constrainMode;
ViewportMode m_viewportMode;
@@ -77,7 +86,7 @@ private:
std::function<std::string(const std::string &&)> m_resourceTransform;
};
-struct Q_DECL_EXPORT QMapboxGLCameraOptions {
+struct Q_MAPBOXGL_EXPORT QMapboxGLCameraOptions {
QVariant center; // Coordinate
QVariant anchor; // QPointF
QVariant zoom; // double
@@ -85,7 +94,7 @@ struct Q_DECL_EXPORT QMapboxGLCameraOptions {
QVariant pitch; // double
};
-class Q_DECL_EXPORT QMapboxGL : public QObject
+class Q_MAPBOXGL_EXPORT QMapboxGL : public QObject
{
Q_OBJECT
Q_PROPERTY(double latitude READ latitude WRITE setLatitude)
@@ -191,8 +200,7 @@ public:
void scaleBy(double scale, const QPointF &center = QPointF());
void rotateBy(const QPointF &first, const QPointF &second);
- void resize(const QSize &size, const QSize &framebufferSize);
- void setFramebufferObject(quint32 fbo);
+ void resize(const QSize &size);
double metersPerPixelAtLatitude(double latitude, double zoom) const;
QMapbox::ProjectedMeters projectedMetersForCoordinate(const QMapbox::Coordinate &) const;
@@ -226,15 +234,27 @@ public:
void setFilter(const QString &layer, const QVariant &filter);
+ // When rendering on a different thread,
+ // should be called on the render thread.
+ void createRenderer();
+ void destroyRenderer();
+ void setFramebufferObject(quint32 fbo, const QSize &size);
+
public slots:
void render();
void connectionEstablished();
+ // Commit changes, load all the resources
+ // and renders the map when completed.
+ void startStaticRender();
+
signals:
void needsRendering();
void mapChanged(QMapboxGL::MapChange);
void copyrightsChanged(const QString &copyrightsHtml);
+ void staticRenderFinished(const QString &error);
+
private:
Q_DISABLE_COPY(QMapboxGL)