summaryrefslogtreecommitdiff
path: root/src/mbgl/annotation/annotation_manager.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-08-27 15:26:15 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-08-29 08:08:44 -0700
commite126dc3a5a3857b24246432153b0554d630b6234 (patch)
tree55cfde3bb7ed61dba029537f030a4d43f2d4c9c2 /src/mbgl/annotation/annotation_manager.cpp
parentd9f63c6d76ff33dfbefa57eb124efe10d5c7592a (diff)
downloadqtlocation-mapboxgl-e126dc3a5a3857b24246432153b0554d630b6234.tar.gz
[core] Fix updates of line and fill annotations
Diffstat (limited to 'src/mbgl/annotation/annotation_manager.cpp')
-rw-r--r--src/mbgl/annotation/annotation_manager.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mbgl/annotation/annotation_manager.cpp b/src/mbgl/annotation/annotation_manager.cpp
index 4e837d370d..f1ddf99602 100644
--- a/src/mbgl/annotation/annotation_manager.cpp
+++ b/src/mbgl/annotation/annotation_manager.cpp
@@ -42,7 +42,7 @@ void AnnotationManager::removeAnnotation(const AnnotationID& id) {
symbolTree.remove(symbolAnnotations.at(id));
symbolAnnotations.erase(id);
} else if (shapeAnnotations.find(id) != shapeAnnotations.end()) {
- obsoleteShapeAnnotationLayers.push_back(shapeAnnotations.at(id)->layerID);
+ obsoleteShapeAnnotationLayers.insert(shapeAnnotations.at(id)->layerID);
shapeAnnotations.erase(id);
}
}
@@ -54,18 +54,21 @@ void AnnotationManager::add(const AnnotationID& id, const SymbolAnnotation& anno
}
void AnnotationManager::add(const AnnotationID& id, const LineAnnotation& annotation, const uint8_t maxZoom) {
- shapeAnnotations.emplace(id,
- std::make_unique<LineAnnotationImpl>(id, annotation, maxZoom));
+ ShapeAnnotationImpl& impl = *shapeAnnotations.emplace(id,
+ std::make_unique<LineAnnotationImpl>(id, annotation, maxZoom)).first->second;
+ obsoleteShapeAnnotationLayers.erase(impl.layerID);
}
void AnnotationManager::add(const AnnotationID& id, const FillAnnotation& annotation, const uint8_t maxZoom) {
- shapeAnnotations.emplace(id,
- std::make_unique<FillAnnotationImpl>(id, annotation, maxZoom));
+ ShapeAnnotationImpl& impl = *shapeAnnotations.emplace(id,
+ std::make_unique<FillAnnotationImpl>(id, annotation, maxZoom)).first->second;
+ obsoleteShapeAnnotationLayers.erase(impl.layerID);
}
void AnnotationManager::add(const AnnotationID& id, const StyleSourcedAnnotation& annotation, const uint8_t maxZoom) {
- shapeAnnotations.emplace(id,
- std::make_unique<StyleSourcedAnnotationImpl>(id, annotation, maxZoom));
+ ShapeAnnotationImpl& impl = *shapeAnnotations.emplace(id,
+ std::make_unique<StyleSourcedAnnotationImpl>(id, annotation, maxZoom)).first->second;
+ obsoleteShapeAnnotationLayers.erase(impl.layerID);
}
Update AnnotationManager::update(const AnnotationID& id, const SymbolAnnotation& annotation, const uint8_t maxZoom) {