summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLFillStyleLayer.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLFillStyleLayer.mm')
-rw-r--r--platform/darwin/src/MGLFillStyleLayer.mm7
1 files changed, 4 insertions, 3 deletions
diff --git a/platform/darwin/src/MGLFillStyleLayer.mm b/platform/darwin/src/MGLFillStyleLayer.mm
index 6212bce410..ffd55884c4 100644
--- a/platform/darwin/src/MGLFillStyleLayer.mm
+++ b/platform/darwin/src/MGLFillStyleLayer.mm
@@ -107,13 +107,14 @@ namespace mbgl {
- (void)removeFromMapView:(MGLMapView *)mapView
{
- _pendingLayer = nullptr;
- self.rawLayer = nullptr;
-
auto removedLayer = mapView.mbglMap->removeLayer(self.identifier.UTF8String);
if (!removedLayer) {
return;
}
+
+ auto originalLayer = std::make_unique<mbgl::style::FillLayer>(self.identifier.UTF8String, self.sourceIdentifier.UTF8String);
+ _pendingLayer = std::move(originalLayer);
+ self.rawLayer = _pendingLayer.get();
mbgl::style::FillLayer *layer = dynamic_cast<mbgl::style::FillLayer *>(removedLayer.get());
if (!layer) {