summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/symbol_layer_properties.hpp
blob: 772445f051fb70e45a18002034c932061cb045b5 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.

#pragma once

#include <mbgl/style/layout_property.hpp>
#include <mbgl/style/paint_property.hpp>
#include <mbgl/util/rapidjson.hpp>

namespace mbgl {
namespace style {

class CascadeParameters;
class CalculationParameters;

class SymbolLayoutProperties {
public:
    void parse(const JSValue&);
    void recalculate(const CalculationParameters&);

    LayoutProperty<SymbolPlacementType> symbolPlacement { SymbolPlacementType::Point };
    LayoutProperty<float> symbolSpacing { 250 };
    LayoutProperty<bool> symbolAvoidEdges { false };
    LayoutProperty<bool> iconAllowOverlap { false };
    LayoutProperty<bool> iconIgnorePlacement { false };
    LayoutProperty<bool> iconOptional { false };
    LayoutProperty<AlignmentType> iconRotationAlignment { AlignmentType::Viewport };
    LayoutProperty<float> iconSize { 1 };
    LayoutProperty<std::string> iconImage { "" };
    LayoutProperty<float> iconRotate { 0 };
    LayoutProperty<float> iconPadding { 2 };
    LayoutProperty<bool> iconKeepUpright { false };
    LayoutProperty<std::array<float, 2>> iconOffset { {{ 0, 0 }} };
    LayoutProperty<AlignmentType> textPitchAlignment { AlignmentType::Undefined };
    LayoutProperty<AlignmentType> textRotationAlignment { AlignmentType::Viewport };
    LayoutProperty<std::string> textField { "" };
    LayoutProperty<std::vector<std::string>> textFont { { "Open Sans Regular", "Arial Unicode MS Regular" } };
    LayoutProperty<float> textSize { 16 };
    LayoutProperty<float> textMaxWidth { 10 };
    LayoutProperty<float> textLineHeight { 1.2 };
    LayoutProperty<float> textLetterSpacing { 0 };
    LayoutProperty<TextJustifyType> textJustify { TextJustifyType::Center };
    LayoutProperty<TextAnchorType> textAnchor { TextAnchorType::Center };
    LayoutProperty<float> textMaxAngle { 45 };
    LayoutProperty<float> textRotate { 0 };
    LayoutProperty<float> textPadding { 2 };
    LayoutProperty<bool> textKeepUpright { true };
    LayoutProperty<TextTransformType> textTransform { TextTransformType::None };
    LayoutProperty<std::array<float, 2>> textOffset { {{ 0, 0 }} };
    LayoutProperty<bool> textAllowOverlap { false };
    LayoutProperty<bool> textIgnorePlacement { false };
    LayoutProperty<bool> textOptional { false };
};

class SymbolPaintProperties {
public:
    void parse(const JSValue&);
    void cascade(const CascadeParameters&);
    bool recalculate(const CalculationParameters&);

    PaintProperty<float> iconOpacity { 1 };
    PaintProperty<Color> iconColor { { 0, 0, 0, 1 } };
    PaintProperty<Color> iconHaloColor { { 0, 0, 0, 0 } };
    PaintProperty<float> iconHaloWidth { 0 };
    PaintProperty<float> iconHaloBlur { 0 };
    PaintProperty<std::array<float, 2>> iconTranslate { {{ 0, 0 }} };
    PaintProperty<TranslateAnchorType> iconTranslateAnchor { TranslateAnchorType::Map };
    PaintProperty<float> textOpacity { 1 };
    PaintProperty<Color> textColor { { 0, 0, 0, 1 } };
    PaintProperty<Color> textHaloColor { { 0, 0, 0, 0 } };
    PaintProperty<float> textHaloWidth { 0 };
    PaintProperty<float> textHaloBlur { 0 };
    PaintProperty<std::array<float, 2>> textTranslate { {{ 0, 0 }} };
    PaintProperty<TranslateAnchorType> textTranslateAnchor { TranslateAnchorType::Map };
};

} // namespace style
} // namespace mbgl