diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-03-22 12:04:34 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-04-20 20:55:51 +0300 |
commit | 8ff17ffc9af865b1a1735e4759d234c7e62ba79e (patch) | |
tree | 20eaa3c1a97ddd99aa99267c62482ee43bc4fa27 /platform/qt/src | |
parent | 0d4ccd4e441b7b777e191d47157f51678d448292 (diff) | |
download | qtlocation-mapboxgl-8ff17ffc9af865b1a1735e4759d234c7e62ba79e.tar.gz |
[Qt] Expose {add,remove}CustomLayer
Diffstat (limited to 'platform/qt/src')
-rw-r--r-- | platform/qt/src/qmapboxgl.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp index e904c38947..df0e89a53d 100644 --- a/platform/qt/src/qmapboxgl.cpp +++ b/platform/qt/src/qmapboxgl.cpp @@ -542,6 +542,29 @@ QMargins QMapboxGL::margins() const ); } +void QMapboxGL::addCustomLayer(const QString &id, + QMapbox::CustomLayerInitializeFunction initFn, + QMapbox::CustomLayerRenderFunction renderFn, + QMapbox::CustomLayerDeinitializeFunction deinitFn, + void *context_, + char *before) +{ + d_ptr->mapObj->addCustomLayer( + id.toStdString(), + reinterpret_cast<mbgl::CustomLayerInitializeFunction>(initFn), + // This cast is safe as long as both mbgl:: and QMapbox:: + // CustomLayerRenderParameters members remains the same. + (mbgl::CustomLayerRenderFunction)renderFn, + reinterpret_cast<mbgl::CustomLayerDeinitializeFunction>(deinitFn), + context_, + before == NULL ? nullptr : before); +} + +void QMapboxGL::removeCustomLayer(const QString& id) +{ + d_ptr->mapObj->removeCustomLayer(id.toStdString()); +} + void QMapboxGL::render() { d_ptr->mapObj->render(); |