summaryrefslogtreecommitdiff
path: root/include/mbgl/map
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 /include/mbgl/map
parenta43940afb2208c61b487bfd8729bbde1bd674794 (diff)
downloadqtlocation-mapboxgl-d7e1ecd19e321afaba631f9365b31e0a728a61c3.tar.gz
[core] Generalize Map::{add,remove}CustomLayer
Diffstat (limited to 'include/mbgl/map')
-rw-r--r--include/mbgl/map/map.hpp11
-rw-r--r--include/mbgl/map/view.hpp4
2 files changed, 5 insertions, 10 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index a728e2dd62..aadfdf9ada 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -9,7 +9,6 @@
#include <mbgl/util/feature.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/annotation/annotation.hpp>
-#include <mbgl/style/types.hpp>
#include <mbgl/style/property_transition.hpp>
#include <cstdint>
@@ -23,6 +22,7 @@ namespace mbgl {
class FileSource;
class View;
class SpriteImage;
+class Layer;
struct CameraOptions;
struct AnimationOptions;
@@ -146,13 +146,8 @@ public:
AnnotationIDs getPointAnnotationsInBounds(const LatLngBounds&);
- void addCustomLayer(const std::string& id,
- CustomLayerInitializeFunction,
- CustomLayerRenderFunction,
- CustomLayerDeinitializeFunction,
- void* context,
- const char* before = nullptr);
- void removeCustomLayer(const std::string& id);
+ void addLayer(std::unique_ptr<Layer>, const optional<std::string>& beforeLayerID = {});
+ void removeLayer(const std::string& layerID);
// Feature queries
std::vector<Feature> queryRenderedFeatures(const ScreenCoordinate&, const optional<std::vector<std::string>>& layerIDs = {});
diff --git a/include/mbgl/map/view.hpp b/include/mbgl/map/view.hpp
index 4431e2b33c..9f12ee5fb6 100644
--- a/include/mbgl/map/view.hpp
+++ b/include/mbgl/map/view.hpp
@@ -36,8 +36,8 @@ public:
// as a matched pair, in four situations:
//
// 1. When releasing GL resources during Map destruction
- // 2. When calling a CustomLayerInitializeFunction, during Map::addCustomLayer
- // 3. When calling a CustomLayerDeinitializeFunction, during Map::removeCustomLayer
+ // 2. When calling a CustomLayerInitializeFunction, during Map::addLayer
+ // 3. When calling a CustomLayerDeinitializeFunction, during Map::removeLayer
// 4. When rendering for Map::renderStill
//
// They are *not* called for Map::render; it is assumed that the correct context is already