summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@codesorcery.net>2015-03-17 17:46:33 -0700
committerJustin R. Miller <incanus@codesorcery.net>2015-03-17 17:46:33 -0700
commit02cccfe7e84a126770836d785e86fd78eace9694 (patch)
tree7abc37d5618e4c96fcfaf356ddfda6cc87dbb140 /src
parent76f8a3d8468c623956c291ac7837e322b317a8f3 (diff)
downloadqtlocation-mapboxgl-02cccfe7e84a126770836d785e86fd78eace9694.tar.gz
properly clean up tile annotations on delete
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/map/annotation.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mbgl/map/annotation.cpp b/src/mbgl/map/annotation.cpp
index b2a90f53c6..0d6da5781e 100644
--- a/src/mbgl/map/annotation.cpp
+++ b/src/mbgl/map/annotation.cpp
@@ -1,6 +1,7 @@
#include <mbgl/map/annotation.hpp>
#include <mbgl/map/map.hpp>
#include <mbgl/util/ptr.hpp>
+#include <mbgl/util/std.hpp>
#include <algorithm>
#include <memory>
@@ -109,6 +110,11 @@ std::vector<Tile::ID> AnnotationManager::removeAnnotations(std::vector<uint32_t>
if (annotation_it != annotations.end()) {
auto& annotation = annotation_it->second;
for (auto& tile_it : annotationTiles) {
+ auto& tileAnnotations = tile_it.second.first;
+ util::erase_if(tileAnnotations, tileAnnotations.begin(),
+ tileAnnotations.end(), [&](const uint32_t annotationID_) -> bool {
+ return (annotationID_ == annotationID);
+ });
auto features_it = annotation->tileFeatures.find(tile_it.first);
if (features_it != annotation->tileFeatures.end()) {
auto layer = tile_it.second.second->getMutableLayer(util::ANNOTATIONS_POINTS_LAYER_ID);