blob: af00f9710b5f1d00597e1845949a3ced1fe7f3af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#ifndef MBGL_STYLE_STYLE
#define MBGL_STYLE_STYLE
#include <mbgl/style/property_transition.hpp>
#include <mbgl/style/style_source.hpp>
#include <mbgl/util/uv.hpp>
#include <mbgl/util/ptr.hpp>
#include <cstdint>
#include <map>
#include <string>
#include <unordered_map>
#include <vector>
#include <set>
#include <chrono>
namespace mbgl {
class Sprite;
class StyleLayer;
class StyleLayerGroup;
class Style {
public:
struct exception : std::runtime_error { exception(const char *msg) : std::runtime_error(msg) {} };
Style();
~Style();
void loadJSON(const uint8_t *const data);
size_t layerCount() const;
void updateProperties(float z, std::chrono::steady_clock::time_point now);
void setDefaultTransitionDuration(std::chrono::steady_clock::duration duration = std::chrono::steady_clock::duration::zero());
void cascadeClasses(const std::vector<std::string>&);
bool hasTransitions() const;
const std::string &getSpriteURL() const;
util::ptr<StyleLayerGroup> layers;
std::vector<std::string> appliedClasses;
std::string glyph_url;
private:
std::string sprite_url;
PropertyTransition defaultTransition;
bool initial_render_complete = false;
std::unique_ptr<uv::rwlock> mtx;
};
}
#endif
|