diff options
Diffstat (limited to 'platform/qt/include')
-rw-r--r-- | platform/qt/include/qmapbox.hpp | 12 | ||||
-rw-r--r-- | platform/qt/include/qmapboxgl.hpp | 5 |
2 files changed, 9 insertions, 8 deletions
diff --git a/platform/qt/include/qmapbox.hpp b/platform/qt/include/qmapbox.hpp index 5a5198108c..369890343f 100644 --- a/platform/qt/include/qmapbox.hpp +++ b/platform/qt/include/qmapbox.hpp @@ -112,12 +112,16 @@ struct Q_MAPBOXGL_EXPORT CustomLayerRenderParameters { double zoom; double bearing; double pitch; - double altitude; + double fieldOfView; }; -typedef void (*CustomLayerInitializeFunction)(void* context) ; -typedef void (*CustomLayerRenderFunction)(void* context, const CustomLayerRenderParameters&); -typedef void (*CustomLayerDeinitializeFunction)(void* context); +class Q_MAPBOXGL_EXPORT CustomLayerHostInterface { +public: + virtual ~CustomLayerHostInterface() = default; + virtual void initialize() = 0; + virtual void render(const CustomLayerRenderParameters&) = 0; + virtual void deinitialize() = 0; +}; } // namespace QMapbox diff --git a/platform/qt/include/qmapboxgl.hpp b/platform/qt/include/qmapboxgl.hpp index b5676fbedd..79eb672d1f 100644 --- a/platform/qt/include/qmapboxgl.hpp +++ b/platform/qt/include/qmapboxgl.hpp @@ -230,10 +230,7 @@ public: void removeImage(const QString &name); void addCustomLayer(const QString &id, - QMapbox::CustomLayerInitializeFunction, - QMapbox::CustomLayerRenderFunction, - QMapbox::CustomLayerDeinitializeFunction, - void* context, + QScopedPointer<QMapbox::CustomLayerHostInterface>& host, const QString& before = QString()); void addLayer(const QVariantMap ¶ms, const QString& before = QString()); bool layerExists(const QString &id); |