| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <mbgl/style/transition_options.hpp> |
| 4 | #include <mbgl/map/camera.hpp> |
| 5 | #include <mbgl/util/geo.hpp> |
| 6 | |
| 7 | #include <string> |
| 8 | #include <vector> |
| 9 | #include <memory> |
| 10 | |
| 11 | namespace mbgl { |
| 12 | |
| 13 | class FileSource; |
| 14 | class Scheduler; |
| 15 | |
| 16 | namespace style { |
| 17 | |
| 18 | class Light; |
| 19 | class Image; |
| 20 | class Source; |
| 21 | class Layer; |
| 22 | |
| 23 | class Style { |
| 24 | public: |
| 25 | Style(Scheduler&, FileSource&, float pixelRatio); |
| 26 | ~Style(); |
| 27 | |
| 28 | void loadJSON(const std::string&); |
| 29 | void loadURL(const std::string&); |
| 30 | |
| 31 | std::string getJSON() const; |
| 32 | std::string getURL() const; |
| 33 | |
| 34 | // Defaults |
| 35 | std::string getName() const; |
| 36 | CameraOptions getDefaultCamera() const; |
| 37 | |
| 38 | // TransitionOptions |
| 39 | TransitionOptions getTransitionOptions() const; |
| 40 | void setTransitionOptions(const TransitionOptions&); |
| 41 | |
| 42 | // Light |
| 43 | Light* getLight(); |
| 44 | const Light* getLight() const; |
| 45 | |
| 46 | void setLight(std::unique_ptr<Light>); |
| 47 | |
| 48 | // Images |
| 49 | const Image* getImage(const std::string&) const; |
| 50 | void addImage(std::unique_ptr<Image>); |
| 51 | void removeImage(const std::string&); |
| 52 | |
| 53 | // Sources |
| 54 | std::vector< Source*> getSources(); |
| 55 | std::vector<const Source*> getSources() const; |
| 56 | |
| 57 | Source* getSource(const std::string&); |
| 58 | const Source* getSource(const std::string&) const; |
| 59 | |
| 60 | void addSource(std::unique_ptr<Source>); |
| 61 | std::unique_ptr<Source> removeSource(const std::string& sourceID); |
| 62 | |
| 63 | // Layers |
| 64 | std::vector< Layer*> getLayers(); |
| 65 | std::vector<const Layer*> getLayers() const; |
| 66 | |
| 67 | Layer* getLayer(const std::string&); |
| 68 | const Layer* getLayer(const std::string&) const; |
| 69 | |
| 70 | void addLayer(std::unique_ptr<Layer>, const optional<std::string>& beforeLayerID = {}); |
| 71 | std::unique_ptr<Layer> removeLayer(const std::string& layerID); |
| 72 | |
| 73 | // Private implementation |
| 74 | class Impl; |
| 75 | const std::unique_ptr<Impl> impl; |
| 76 | }; |
| 77 | |
| 78 | } // namespace style |
| 79 | } // namespace mbgl |
| 80 |
