[core] Remove shape layers from the style (fixes #2405)

This commit is contained in:
John Firebaugh
2015-10-19 12:13:15 -07:00
parent c5b95032a5
commit 00a1c2343a
6 changed files with 58 additions and 13 deletions

View File

@@ -51,7 +51,7 @@ void AnnotationManager::removeAnnotations(const AnnotationIDs& ids) {
pointTree.remove(pointAnnotations.at(id));
pointAnnotations.erase(id);
} else if (shapeAnnotations.find(id) != shapeAnnotations.end()) {
// TODO: remove style layer
obsoleteShapeAnnotationLayers.push_back(shapeAnnotations.at(id)->layerID);
shapeAnnotations.erase(id);
}
}
@@ -132,6 +132,11 @@ void AnnotationManager::updateStyle(Style& style) {
shape.second->updateStyle(style);
}
for (const auto& layer : obsoleteShapeAnnotationLayers) {
style.removeLayer(layer);
}
obsoleteShapeAnnotationLayers.clear();
style.getSource(SourceID)->invalidateTiles();
}