summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-12-15 21:04:15 -0800
committerMinh Nguyễn <mxn@1ec5.org>2015-12-15 21:04:15 -0800
commite304033552fd423db5324545216f9cf3a1e62150 (patch)
treea7e162af70b10e440a515d43b6fef9e618decf6a /src
parent0f37b670bac6aace6b83148ccee3b63e42a6896c (diff)
downloadqtlocation-mapboxgl-e304033552fd423db5324545216f9cf3a1e62150.tar.gz
[core] Fixed annotation icon replacement
Another pass at #3146, including a unit test.
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/map/map.cpp2
-rw-r--r--src/mbgl/sprite/sprite_atlas.cpp5
2 files changed, 3 insertions, 4 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index c07eda6b46..5e22e8aeef 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -392,7 +392,7 @@ void Map::addAnnotationIcon(const std::string& name, std::shared_ptr<const Sprit
}
void Map::removeAnnotationIcon(const std::string& name) {
- removeAnnotationIcon(name);
+ context->invoke(&MapContext::removeAnnotationIcon, name);
}
double Map::getTopOffsetPixelsForAnnotationIcon(const std::string& symbol) {
diff --git a/src/mbgl/sprite/sprite_atlas.cpp b/src/mbgl/sprite/sprite_atlas.cpp
index 202218f51c..d09330e17b 100644
--- a/src/mbgl/sprite/sprite_atlas.cpp
+++ b/src/mbgl/sprite/sprite_atlas.cpp
@@ -189,11 +189,10 @@ void SpriteAtlas::updateDirty() {
holder.texture = spriteIterator->second;
if (holder.texture != nullptr) {
copy(holder, imageIterator->first.second);
+ ++imageIterator;
} else {
- images.erase(imageIterator);
+ images.erase(imageIterator++);
}
-
- ++imageIterator;
// Don't advance the spriteIterator because there might be another sprite with the same
// name, but a different wrap value.
}