summaryrefslogtreecommitdiff
path: root/src/mbgl/annotation/annotation_manager.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-05-22 13:28:09 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-05-26 11:21:56 -0700
commitaa216d00254c18f7b5903026ab1a489ae7797dd8 (patch)
tree7decb42cb0f8a8a5ae0e9d3bdcfdf69e76949e15 /src/mbgl/annotation/annotation_manager.hpp
parent6cf9d5cfbfe8120121d8d53cbbf8915cea8f4879 (diff)
downloadqtlocation-mapboxgl-aa216d00254c18f7b5903026ab1a489ae7797dd8.tar.gz
[core] Don't use a separate SpriteAtlas for annotation images
Instead, just add them to the Style as needed. Includes changes from #8905 and takes care to avoid regressing #3817.
Diffstat (limited to 'src/mbgl/annotation/annotation_manager.hpp')
-rw-r--r--src/mbgl/annotation/annotation_manager.hpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mbgl/annotation/annotation_manager.hpp b/src/mbgl/annotation/annotation_manager.hpp
index 4d22ac81f6..36f18e1aae 100644
--- a/src/mbgl/annotation/annotation_manager.hpp
+++ b/src/mbgl/annotation/annotation_manager.hpp
@@ -2,7 +2,7 @@
#include <mbgl/annotation/annotation.hpp>
#include <mbgl/annotation/symbol_annotation_impl.hpp>
-#include <mbgl/sprite/sprite_atlas.hpp>
+#include <mbgl/style/image.hpp>
#include <mbgl/map/update.hpp>
#include <mbgl/util/noncopyable.hpp>
@@ -21,7 +21,6 @@ class ShapeAnnotationImpl;
namespace style {
class Style;
-class Image;
} // namespace style
class AnnotationManager : private util::noncopyable {
@@ -36,7 +35,6 @@ public:
void addImage(std::unique_ptr<style::Image>);
void removeImage(const std::string&);
double getTopOffsetPixelsForImage(const std::string&);
- SpriteAtlas& getSpriteAtlas() { return spriteAtlas; }
void updateStyle(style::Style&);
void updateData();
@@ -67,16 +65,16 @@ private:
// <https://github.com/mapbox/mapbox-gl-native/issues/5691>
using SymbolAnnotationMap = std::map<AnnotationID, std::shared_ptr<SymbolAnnotationImpl>>;
using ShapeAnnotationMap = std::map<AnnotationID, std::unique_ptr<ShapeAnnotationImpl>>;
+ using ImageMap = std::unordered_map<std::string, style::Image>;
SymbolAnnotationTree symbolTree;
SymbolAnnotationMap symbolAnnotations;
ShapeAnnotationMap shapeAnnotations;
+ ImageMap images;
std::unordered_set<std::string> obsoleteShapeAnnotationLayers;
+ std::unordered_set<std::string> obsoleteImages;
std::unordered_set<AnnotationTile*> tiles;
- std::unordered_map<std::string, std::unique_ptr<style::Image>> spriteImages;
- SpriteAtlas spriteAtlas;
-
friend class AnnotationTile;
};