summaryrefslogtreecommitdiff
path: root/platform/qt/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-04-25 13:14:34 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-02 14:51:39 -0700
commitd7e1ecd19e321afaba631f9365b31e0a728a61c3 (patch)
treef3a91c82c42151d43a88330da0d00f02857456b4 /platform/qt/src
parenta43940afb2208c61b487bfd8729bbde1bd674794 (diff)
downloadqtlocation-mapboxgl-d7e1ecd19e321afaba631f9365b31e0a728a61c3.tar.gz
[core] Generalize Map::{add,remove}CustomLayer
Diffstat (limited to 'platform/qt/src')
-rw-r--r--platform/qt/src/qmapboxgl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index 1f8657c044..4354eac75d 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -4,6 +4,7 @@
#include <mbgl/gl/gl.hpp>
#include <mbgl/map/camera.hpp>
#include <mbgl/map/map.hpp>
+#include <mbgl/layer/custom_layer.hpp>
#include <mbgl/sprite/sprite_image.hpp>
#include <mbgl/storage/network_status.hpp>
#include <mbgl/util/constants.hpp>
@@ -556,20 +557,20 @@ void QMapboxGL::addCustomLayer(const QString &id,
void *context_,
char *before)
{
- d_ptr->mapObj->addCustomLayer(
+ d_ptr->mapObj->addLayer(std::make_unique<mbgl::CustomLayer>(
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);
+ context_),
+ before ? mbgl::optional<std::string>(before) : mbgl::optional<std::string>());
}
void QMapboxGL::removeCustomLayer(const QString& id)
{
- d_ptr->mapObj->removeCustomLayer(id.toStdString());
+ d_ptr->mapObj->removeLayer(id.toStdString());
}
void QMapboxGL::render()