summaryrefslogtreecommitdiff
path: root/src/mbgl/style/style_impl.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/style_impl.hpp')
-rw-r--r--src/mbgl/style/style_impl.hpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/mbgl/style/style_impl.hpp b/src/mbgl/style/style_impl.hpp
index c16b82e90b..b0eaf82786 100644
--- a/src/mbgl/style/style_impl.hpp
+++ b/src/mbgl/style/style_impl.hpp
@@ -11,6 +11,7 @@
#include <mbgl/style/source.hpp>
#include <mbgl/style/layer.hpp>
#include <mbgl/style/collection.hpp>
+#include <mbgl/annotation/annotation_manager.hpp>
#include <mbgl/map/camera.hpp>
@@ -22,6 +23,7 @@
#include <string>
#include <vector>
#include <unordered_map>
+#include <set>
namespace mbgl {
@@ -31,14 +33,14 @@ class SpriteLoader;
namespace style {
-class Style::Impl : public SpriteLoaderObserver,
+class StyleImpl : public SpriteLoaderObserver,
public SourceObserver,
public LayerObserver,
public LightObserver,
public util::noncopyable {
public:
- Impl(std::shared_ptr<FileSource>, float pixelRatio);
- ~Impl() override;
+ StyleImpl(std::shared_ptr<FileSource>, float pixelRatio);
+ ~StyleImpl() override;
void loadJSON(const std::string&);
void loadURL(const std::string&);
@@ -46,7 +48,8 @@ public:
std::string getJSON() const;
std::string getURL() const;
- void setObserver(Observer*);
+ void addObserver(Observer* observer);
+ void removeObserver(Observer* observer);
bool isLoaded() const;
@@ -91,15 +94,17 @@ public:
void dumpDebugLogs() const;
+private:
+ void parse(const std::string&);
+public:
bool mutated = false;
bool loaded = false;
bool spriteLoaded = false;
-
-private:
- void parse(const std::string&);
-
+ AnnotationManager annotationManager; // ToDo: move annotations into an own style, stackable inside the View (=Map), so that
+ // they can change independently of the rest of the style and be combined with different styles arbitrarily.
std::shared_ptr<FileSource> fileSource;
+private:
std::string url;
std::string json;
@@ -116,6 +121,7 @@ private:
// Defaults
std::string name;
CameraOptions defaultCamera;
+ std::set<Observer*> observers;
// SpriteLoaderObserver implementation.
void onSpriteLoaded(std::vector<Immutable<style::Image::Impl>>) override;
@@ -133,9 +139,6 @@ private:
// LightObserver implementation.
void onLightChanged(const Light&) override;
- Observer nullObserver;
- Observer* observer = &nullObserver;
-
std::exception_ptr lastError;
};