diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2015-12-15 21:04:15 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2015-12-15 21:04:15 -0800 |
commit | e304033552fd423db5324545216f9cf3a1e62150 (patch) | |
tree | a7e162af70b10e440a515d43b6fef9e618decf6a /src | |
parent | 0f37b670bac6aace6b83148ccee3b63e42a6896c (diff) | |
download | qtlocation-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.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/sprite/sprite_atlas.cpp | 5 |
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. } |