summaryrefslogtreecommitdiff
path: root/src/mbgl/annotation
diff options
context:
space:
mode:
authorRomain Quidet <romain.quidet.ext@mappy.com>2015-11-30 14:18:10 +0100
committerMinh Nguyễn <mxn@1ec5.org>2015-12-15 16:36:17 -0800
commitaf45d87e54e36f9899507d31c4b79669a254350e (patch)
tree0840dcb2a9b9736e28e32473b750a2687ade3743 /src/mbgl/annotation
parent02a32b55e4ec392d213d435354bbcd2f33cef40c (diff)
downloadqtlocation-mapboxgl-af45d87e54e36f9899507d31c4b79669a254350e.tar.gz
2210: Sprites can be removed / updated correctly
Diffstat (limited to 'src/mbgl/annotation')
-rw-r--r--src/mbgl/annotation/annotation_manager.cpp5
-rw-r--r--src/mbgl/annotation/annotation_manager.hpp1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/mbgl/annotation/annotation_manager.cpp b/src/mbgl/annotation/annotation_manager.cpp
index a85021b774..6538cb8e9e 100644
--- a/src/mbgl/annotation/annotation_manager.cpp
+++ b/src/mbgl/annotation/annotation_manager.cpp
@@ -159,6 +159,11 @@ void AnnotationManager::addIcon(const std::string& name, std::shared_ptr<const S
spriteStore.setSprite(name, sprite);
spriteAtlas.updateDirty();
}
+
+void AnnotationManager::removeIcon(const std::string& name) {
+ spriteStore.removeSprite(name);
+ spriteAtlas.updateDirty();
+}
double AnnotationManager::getTopOffsetPixelsForIcon(const std::string& name) {
auto sprite = spriteStore.getSprite(name);
diff --git a/src/mbgl/annotation/annotation_manager.hpp b/src/mbgl/annotation/annotation_manager.hpp
index eee4c0a0cc..bc3f73e2ca 100644
--- a/src/mbgl/annotation/annotation_manager.hpp
+++ b/src/mbgl/annotation/annotation_manager.hpp
@@ -34,6 +34,7 @@ public:
LatLngBounds getBoundsForAnnotations(const AnnotationIDs&) const;
void addIcon(const std::string& name, std::shared_ptr<const SpriteImage>);
+ void removeIcon(const std::string& name);
double getTopOffsetPixelsForIcon(const std::string& name);
SpriteAtlas& getSpriteAtlas() { return spriteAtlas; }