diff options
Diffstat (limited to 'platform/qt/include')
-rw-r--r-- | platform/qt/include/QQuickMapboxGL | 1 | ||||
-rw-r--r-- | platform/qt/include/QQuickMapboxGLMapParameter | 1 | ||||
-rw-r--r-- | platform/qt/include/qmapbox.hpp | 28 | ||||
-rw-r--r-- | platform/qt/include/qmapboxgl.hpp | 12 |
4 files changed, 28 insertions, 14 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 d138f4057b..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,13 +26,14 @@ typedef QList<Coordinates> CoordinatesCollection; typedef QList<CoordinatesCollection> CoordinatesCollections; -struct Q_DECL_EXPORT Feature { +struct Q_MAPBOXGL_EXPORT Feature { enum Type { PointType = 1, LineStringType, PolygonType }; + /*! Class constructor. */ Feature(Type type_ = PointType, const CoordinatesCollections& geometry_ = CoordinatesCollections(), const QVariantMap& properties_ = QVariantMap(), const QVariant& id_ = QVariant()) : type(type_), geometry(geometry_), properties(properties_), id(id_) {} @@ -37,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, @@ -45,6 +52,7 @@ struct Q_DECL_EXPORT ShapeAnnotationGeometry { MultiPolygonType }; + /*! Class constructor. */ ShapeAnnotationGeometry(Type type_ = LineStringType, const CoordinatesCollections& geometry_ = CoordinatesCollections()) : type(type_), geometry(geometry_) {} @@ -52,12 +60,13 @@ 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) : geometry(geometry_), opacity(opacity_), width(width_), color(color_) {} @@ -68,7 +77,8 @@ 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()) : geometry(geometry_), opacity(opacity_), color(color_), outlineColor(outlineColor_) {} @@ -88,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 e2fb283989..8b319b0453 100644 --- a/platform/qt/include/qmapboxgl.hpp +++ b/platform/qt/include/qmapboxgl.hpp @@ -10,11 +10,13 @@ #include <QString> #include <QStringList> +#include <functional> + 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(); @@ -59,6 +61,9 @@ public: QString apiBaseUrl() const; void setApiBaseUrl(const QString &); + std::function<std::string(const std::string &&)> resourceTransform() const; + void setResourceTransform(const std::function<std::string(const std::string &&)> &); + private: GLContextMode m_contextMode; ConstrainMode m_constrainMode; @@ -69,9 +74,10 @@ private: QString m_assetPath; QString m_accessToken; QString m_apiBaseUrl; + 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 @@ -79,7 +85,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) |