From d7e1ecd19e321afaba631f9365b31e0a728a61c3 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 25 Apr 2016 13:14:34 -0700 Subject: [core] Generalize Map::{add,remove}CustomLayer --- include/mbgl/map/map.hpp | 11 +++-------- include/mbgl/map/view.hpp | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'include/mbgl/map') 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 #include #include -#include #include #include @@ -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, const optional& beforeLayerID = {}); + void removeLayer(const std::string& layerID); // Feature queries std::vector queryRenderedFeatures(const ScreenCoordinate&, const optional>& 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 -- cgit v1.2.1