summaryrefslogtreecommitdiff
path: root/include/mbgl/style/layers/symbol_layer.hpp
blob: 8158f267c9bc2e492c9b9fd606448b7084a817ad (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
// This file is generated. Do not edit.

#pragma once

#include <mbgl/style/layer.hpp>
#include <mbgl/style/filter.hpp>
#include <mbgl/style/property_value.hpp>
#include <mbgl/style/data_driven_property_value.hpp>

#include <mbgl/util/color.hpp>

#include <vector>

namespace mbgl {
namespace style {

class TransitionOptions;

class SymbolLayer : public Layer {
public:
    SymbolLayer(const std::string& layerID, const std::string& sourceID);
    ~SymbolLayer() final;

    // Source
    const std::string& getSourceID() const;
    const std::string& getSourceLayer() const;
    void setSourceLayer(const std::string& sourceLayer);

    void setFilter(const Filter&);
    const Filter& getFilter() const;

    // Visibility
    void setVisibility(VisibilityType) final;

    // Zoom range
    void setMinZoom(float) final;
    void setMaxZoom(float) final;

    // Layout properties

    static PropertyValue<SymbolPlacementType> getDefaultSymbolPlacement();
    PropertyValue<SymbolPlacementType> getSymbolPlacement() const;
    void setSymbolPlacement(PropertyValue<SymbolPlacementType>);

    static PropertyValue<float> getDefaultSymbolSpacing();
    PropertyValue<float> getSymbolSpacing() const;
    void setSymbolSpacing(PropertyValue<float>);

    static PropertyValue<bool> getDefaultSymbolAvoidEdges();
    PropertyValue<bool> getSymbolAvoidEdges() const;
    void setSymbolAvoidEdges(PropertyValue<bool>);

    static PropertyValue<bool> getDefaultIconAllowOverlap();
    PropertyValue<bool> getIconAllowOverlap() const;
    void setIconAllowOverlap(PropertyValue<bool>);

    static PropertyValue<bool> getDefaultIconIgnorePlacement();
    PropertyValue<bool> getIconIgnorePlacement() const;
    void setIconIgnorePlacement(PropertyValue<bool>);

    static PropertyValue<bool> getDefaultIconOptional();
    PropertyValue<bool> getIconOptional() const;
    void setIconOptional(PropertyValue<bool>);

    static PropertyValue<AlignmentType> getDefaultIconRotationAlignment();
    PropertyValue<AlignmentType> getIconRotationAlignment() const;
    void setIconRotationAlignment(PropertyValue<AlignmentType>);

    static DataDrivenPropertyValue<float> getDefaultIconSize();
    DataDrivenPropertyValue<float> getIconSize() const;
    void setIconSize(DataDrivenPropertyValue<float>);

    static PropertyValue<IconTextFitType> getDefaultIconTextFit();
    PropertyValue<IconTextFitType> getIconTextFit() const;
    void setIconTextFit(PropertyValue<IconTextFitType>);

    static PropertyValue<std::array<float, 4>> getDefaultIconTextFitPadding();
    PropertyValue<std::array<float, 4>> getIconTextFitPadding() const;
    void setIconTextFitPadding(PropertyValue<std::array<float, 4>>);

    static DataDrivenPropertyValue<std::string> getDefaultIconImage();
    DataDrivenPropertyValue<std::string> getIconImage() const;
    void setIconImage(DataDrivenPropertyValue<std::string>);

    static DataDrivenPropertyValue<float> getDefaultIconRotate();
    DataDrivenPropertyValue<float> getIconRotate() const;
    void setIconRotate(DataDrivenPropertyValue<float>);

    static PropertyValue<float> getDefaultIconPadding();
    PropertyValue<float> getIconPadding() const;
    void setIconPadding(PropertyValue<float>);

    static PropertyValue<bool> getDefaultIconKeepUpright();
    PropertyValue<bool> getIconKeepUpright() const;
    void setIconKeepUpright(PropertyValue<bool>);

    static DataDrivenPropertyValue<std::array<float, 2>> getDefaultIconOffset();
    DataDrivenPropertyValue<std::array<float, 2>> getIconOffset() const;
    void setIconOffset(DataDrivenPropertyValue<std::array<float, 2>>);

    static PropertyValue<AlignmentType> getDefaultTextPitchAlignment();
    PropertyValue<AlignmentType> getTextPitchAlignment() const;
    void setTextPitchAlignment(PropertyValue<AlignmentType>);

    static PropertyValue<AlignmentType> getDefaultTextRotationAlignment();
    PropertyValue<AlignmentType> getTextRotationAlignment() const;
    void setTextRotationAlignment(PropertyValue<AlignmentType>);

    static DataDrivenPropertyValue<std::string> getDefaultTextField();
    DataDrivenPropertyValue<std::string> getTextField() const;
    void setTextField(DataDrivenPropertyValue<std::string>);

    static PropertyValue<std::vector<std::string>> getDefaultTextFont();
    PropertyValue<std::vector<std::string>> getTextFont() const;
    void setTextFont(PropertyValue<std::vector<std::string>>);

    static DataDrivenPropertyValue<float> getDefaultTextSize();
    DataDrivenPropertyValue<float> getTextSize() const;
    void setTextSize(DataDrivenPropertyValue<float>);

    static PropertyValue<float> getDefaultTextMaxWidth();
    PropertyValue<float> getTextMaxWidth() const;
    void setTextMaxWidth(PropertyValue<float>);

    static PropertyValue<float> getDefaultTextLineHeight();
    PropertyValue<float> getTextLineHeight() const;
    void setTextLineHeight(PropertyValue<float>);

    static PropertyValue<float> getDefaultTextLetterSpacing();
    PropertyValue<float> getTextLetterSpacing() const;
    void setTextLetterSpacing(PropertyValue<float>);

    static PropertyValue<TextJustifyType> getDefaultTextJustify();
    PropertyValue<TextJustifyType> getTextJustify() const;
    void setTextJustify(PropertyValue<TextJustifyType>);

    static PropertyValue<TextAnchorType> getDefaultTextAnchor();
    PropertyValue<TextAnchorType> getTextAnchor() const;
    void setTextAnchor(PropertyValue<TextAnchorType>);

    static PropertyValue<float> getDefaultTextMaxAngle();
    PropertyValue<float> getTextMaxAngle() const;
    void setTextMaxAngle(PropertyValue<float>);

    static DataDrivenPropertyValue<float> getDefaultTextRotate();
    DataDrivenPropertyValue<float> getTextRotate() const;
    void setTextRotate(DataDrivenPropertyValue<float>);

    static PropertyValue<float> getDefaultTextPadding();
    PropertyValue<float> getTextPadding() const;
    void setTextPadding(PropertyValue<float>);

    static PropertyValue<bool> getDefaultTextKeepUpright();
    PropertyValue<bool> getTextKeepUpright() const;
    void setTextKeepUpright(PropertyValue<bool>);

    static DataDrivenPropertyValue<TextTransformType> getDefaultTextTransform();
    DataDrivenPropertyValue<TextTransformType> getTextTransform() const;
    void setTextTransform(DataDrivenPropertyValue<TextTransformType>);

    static DataDrivenPropertyValue<std::array<float, 2>> getDefaultTextOffset();
    DataDrivenPropertyValue<std::array<float, 2>> getTextOffset() const;
    void setTextOffset(DataDrivenPropertyValue<std::array<float, 2>>);

    static PropertyValue<bool> getDefaultTextAllowOverlap();
    PropertyValue<bool> getTextAllowOverlap() const;
    void setTextAllowOverlap(PropertyValue<bool>);

    static PropertyValue<bool> getDefaultTextIgnorePlacement();
    PropertyValue<bool> getTextIgnorePlacement() const;
    void setTextIgnorePlacement(PropertyValue<bool>);

    static PropertyValue<bool> getDefaultTextOptional();
    PropertyValue<bool> getTextOptional() const;
    void setTextOptional(PropertyValue<bool>);

    // Paint properties

    static DataDrivenPropertyValue<float> getDefaultIconOpacity();
    DataDrivenPropertyValue<float> getIconOpacity() const;
    void setIconOpacity(DataDrivenPropertyValue<float>);
    void setIconOpacityTransition(const TransitionOptions&);
    TransitionOptions getIconOpacityTransition() const;

    static DataDrivenPropertyValue<Color> getDefaultIconColor();
    DataDrivenPropertyValue<Color> getIconColor() const;
    void setIconColor(DataDrivenPropertyValue<Color>);
    void setIconColorTransition(const TransitionOptions&);
    TransitionOptions getIconColorTransition() const;

    static DataDrivenPropertyValue<Color> getDefaultIconHaloColor();
    DataDrivenPropertyValue<Color> getIconHaloColor() const;
    void setIconHaloColor(DataDrivenPropertyValue<Color>);
    void setIconHaloColorTransition(const TransitionOptions&);
    TransitionOptions getIconHaloColorTransition() const;

    static DataDrivenPropertyValue<float> getDefaultIconHaloWidth();
    DataDrivenPropertyValue<float> getIconHaloWidth() const;
    void setIconHaloWidth(DataDrivenPropertyValue<float>);
    void setIconHaloWidthTransition(const TransitionOptions&);
    TransitionOptions getIconHaloWidthTransition() const;

    static DataDrivenPropertyValue<float> getDefaultIconHaloBlur();
    DataDrivenPropertyValue<float> getIconHaloBlur() const;
    void setIconHaloBlur(DataDrivenPropertyValue<float>);
    void setIconHaloBlurTransition(const TransitionOptions&);
    TransitionOptions getIconHaloBlurTransition() const;

    static PropertyValue<std::array<float, 2>> getDefaultIconTranslate();
    PropertyValue<std::array<float, 2>> getIconTranslate() const;
    void setIconTranslate(PropertyValue<std::array<float, 2>>);
    void setIconTranslateTransition(const TransitionOptions&);
    TransitionOptions getIconTranslateTransition() const;

    static PropertyValue<TranslateAnchorType> getDefaultIconTranslateAnchor();
    PropertyValue<TranslateAnchorType> getIconTranslateAnchor() const;
    void setIconTranslateAnchor(PropertyValue<TranslateAnchorType>);
    void setIconTranslateAnchorTransition(const TransitionOptions&);
    TransitionOptions getIconTranslateAnchorTransition() const;

    static DataDrivenPropertyValue<float> getDefaultTextOpacity();
    DataDrivenPropertyValue<float> getTextOpacity() const;
    void setTextOpacity(DataDrivenPropertyValue<float>);
    void setTextOpacityTransition(const TransitionOptions&);
    TransitionOptions getTextOpacityTransition() const;

    static DataDrivenPropertyValue<Color> getDefaultTextColor();
    DataDrivenPropertyValue<Color> getTextColor() const;
    void setTextColor(DataDrivenPropertyValue<Color>);
    void setTextColorTransition(const TransitionOptions&);
    TransitionOptions getTextColorTransition() const;

    static DataDrivenPropertyValue<Color> getDefaultTextHaloColor();
    DataDrivenPropertyValue<Color> getTextHaloColor() const;
    void setTextHaloColor(DataDrivenPropertyValue<Color>);
    void setTextHaloColorTransition(const TransitionOptions&);
    TransitionOptions getTextHaloColorTransition() const;

    static DataDrivenPropertyValue<float> getDefaultTextHaloWidth();
    DataDrivenPropertyValue<float> getTextHaloWidth() const;
    void setTextHaloWidth(DataDrivenPropertyValue<float>);
    void setTextHaloWidthTransition(const TransitionOptions&);
    TransitionOptions getTextHaloWidthTransition() const;

    static DataDrivenPropertyValue<float> getDefaultTextHaloBlur();
    DataDrivenPropertyValue<float> getTextHaloBlur() const;
    void setTextHaloBlur(DataDrivenPropertyValue<float>);
    void setTextHaloBlurTransition(const TransitionOptions&);
    TransitionOptions getTextHaloBlurTransition() const;

    static PropertyValue<std::array<float, 2>> getDefaultTextTranslate();
    PropertyValue<std::array<float, 2>> getTextTranslate() const;
    void setTextTranslate(PropertyValue<std::array<float, 2>>);
    void setTextTranslateTransition(const TransitionOptions&);
    TransitionOptions getTextTranslateTransition() const;

    static PropertyValue<TranslateAnchorType> getDefaultTextTranslateAnchor();
    PropertyValue<TranslateAnchorType> getTextTranslateAnchor() const;
    void setTextTranslateAnchor(PropertyValue<TranslateAnchorType>);
    void setTextTranslateAnchorTransition(const TransitionOptions&);
    TransitionOptions getTextTranslateAnchorTransition() const;

    // Private implementation

    class Impl;
    const Impl& impl() const;

    Mutable<Impl> mutableImpl() const;
    SymbolLayer(Immutable<Impl>);
    std::unique_ptr<Layer> cloneRef(const std::string& id) const final;
};

template <>
inline bool Layer::is<SymbolLayer>() const {
    return getType() == LayerType::Symbol;
}

} // namespace style
} // namespace mbgl