summaryrefslogtreecommitdiff
path: root/include/mbgl/style
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-04-21 13:35:34 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-06-22 08:04:39 -0700
commit1520a56813f82bbe875774fdc2b3df26392278d6 (patch)
treed8f6ccc10e118bd2be6a954951c037f9c2fc1384 /include/mbgl/style
parentbe7e9bbb8d54c775127f53d793c117c4bf5e2764 (diff)
downloadqtlocation-mapboxgl-1520a56813f82bbe875774fdc2b3df26392278d6.tar.gz
[all] Promote Style to public API
Diffstat (limited to 'include/mbgl/style')
-rw-r--r--include/mbgl/style/style.hpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/include/mbgl/style/style.hpp b/include/mbgl/style/style.hpp
new file mode 100644
index 0000000000..82ff1b3078
--- /dev/null
+++ b/include/mbgl/style/style.hpp
@@ -0,0 +1,75 @@
+#pragma once
+
+#include <mbgl/style/transition_options.hpp>
+#include <mbgl/util/geo.hpp>
+
+#include <string>
+#include <vector>
+#include <memory>
+
+namespace mbgl {
+
+class FileSource;
+class Scheduler;
+
+namespace style {
+
+class Light;
+class Image;
+class Source;
+class Layer;
+
+class Style {
+public:
+ Style(Scheduler&, FileSource&, float pixelRatio);
+ ~Style();
+
+ // Defaults
+ std::string getName() const;
+ LatLng getDefaultLatLng() const;
+ double getDefaultZoom() const;
+ double getDefaultBearing() const;
+ double getDefaultPitch() const;
+
+ // TransitionOptions
+ TransitionOptions getTransitionOptions() const;
+ void setTransitionOptions(const TransitionOptions&);
+
+ // Light
+ Light* getLight();
+ const Light* getLight() const;
+
+ void setLight(std::unique_ptr<Light>);
+
+ // Images
+ const Image* getImage(const std::string&) const;
+ void addImage(std::unique_ptr<Image>);
+ void removeImage(const std::string&);
+
+ // Sources
+ std::vector< Source*> getSources();
+ std::vector<const Source*> getSources() const;
+
+ Source* getSource(const std::string&);
+ const Source* getSource(const std::string&) const;
+
+ void addSource(std::unique_ptr<Source>);
+ std::unique_ptr<Source> removeSource(const std::string& sourceID);
+
+ // Layers
+ std::vector< Layer*> getLayers();
+ std::vector<const Layer*> getLayers() const;
+
+ Layer* getLayer(const std::string&);
+ const Layer* getLayer(const std::string&) const;
+
+ void addLayer(std::unique_ptr<Layer>, const optional<std::string>& beforeLayerID = {});
+ std::unique_ptr<Layer> removeLayer(const std::string& layerID);
+
+ // Private implementation
+ class Impl;
+ const std::unique_ptr<Impl> impl;
+};
+
+} // namespace style
+} // namespace mbgl