diff options
author | Jesse Bounds <jesse@rebounds.net> | 2017-02-14 13:09:49 -0800 |
---|---|---|
committer | Jesse Bounds <jesse@rebounds.net> | 2017-02-23 15:07:43 -0800 |
commit | e860fa6f0a71805dafd03a1ac02980369b799f9e (patch) | |
tree | 812de69002c34a728a6b4a2beddcff5a28542702 /platform/darwin/src/MGLCircleStyleLayer.mm | |
parent | 76b3825360843f3270549a02aca96f9f11892aa1 (diff) | |
download | qtlocation-mapboxgl-e860fa6f0a71805dafd03a1ac02980369b799f9e.tar.gz |
[ios, macos] Recreate pending and raw layer ref when layer is removed
Diffstat (limited to 'platform/darwin/src/MGLCircleStyleLayer.mm')
-rw-r--r-- | platform/darwin/src/MGLCircleStyleLayer.mm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/platform/darwin/src/MGLCircleStyleLayer.mm b/platform/darwin/src/MGLCircleStyleLayer.mm index fc8e3a40c7..ad087c5d02 100644 --- a/platform/darwin/src/MGLCircleStyleLayer.mm +++ b/platform/darwin/src/MGLCircleStyleLayer.mm @@ -112,13 +112,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::CircleLayer>(self.identifier.UTF8String, self.sourceIdentifier.UTF8String); + _pendingLayer = std::move(originalLayer); + self.rawLayer = _pendingLayer.get(); mbgl::style::CircleLayer *layer = dynamic_cast<mbgl::style::CircleLayer *>(removedLayer.get()); if (!layer) { |