[ios, android] Add methods to remove a custom layer
This commit is contained in:
@@ -449,6 +449,10 @@ void Map::addCustomLayer(const std::string& id,
|
||||
before ? std::string(before) : mapbox::util::optional<std::string>());
|
||||
}
|
||||
|
||||
void Map::removeCustomLayer(const std::string& id) {
|
||||
context->invoke(&MapContext::removeLayer, id);
|
||||
}
|
||||
|
||||
#pragma mark - Toggles
|
||||
|
||||
void Map::setDebug(MapDebugOptions mode) {
|
||||
|
||||
@@ -289,6 +289,12 @@ void MapContext::addLayer(std::unique_ptr<StyleLayer> layer, mapbox::util::optio
|
||||
asyncUpdate.send();
|
||||
}
|
||||
|
||||
void MapContext::removeLayer(const std::string& id) {
|
||||
style->removeLayer(id);
|
||||
updateFlags |= Update::Classes;
|
||||
asyncUpdate.send();
|
||||
}
|
||||
|
||||
void MapContext::setSourceTileCacheSize(size_t size) {
|
||||
assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
|
||||
if (size != sourceCacheSize) {
|
||||
|
||||
@@ -59,6 +59,7 @@ public:
|
||||
// Style API
|
||||
void addLayer(std::unique_ptr<StyleLayer>,
|
||||
const mapbox::util::optional<std::string> before);
|
||||
void removeLayer(const std::string& id);
|
||||
|
||||
void setSourceTileCacheSize(size_t size);
|
||||
void onLowMemory();
|
||||
|
||||
Reference in New Issue
Block a user