summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/symbol_layer_properties.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/layers/symbol_layer_properties.hpp')
-rw-r--r--src/mbgl/style/layers/symbol_layer_properties.hpp280
1 files changed, 140 insertions, 140 deletions
diff --git a/src/mbgl/style/layers/symbol_layer_properties.hpp b/src/mbgl/style/layers/symbol_layer_properties.hpp
index 6e3fa54241..7b630a1ca3 100644
--- a/src/mbgl/style/layers/symbol_layer_properties.hpp
+++ b/src/mbgl/style/layers/symbol_layer_properties.hpp
@@ -14,39 +14,34 @@
namespace mbgl {
namespace style {
-struct SymbolPlacement : LayoutProperty<SymbolPlacementType> {
- static constexpr const char *name() { return "symbol-placement"; }
- static SymbolPlacementType defaultValue() { return SymbolPlacementType::Point; }
+struct IconAllowOverlap : LayoutProperty<bool> {
+ static constexpr const char *name() { return "icon-allow-overlap"; }
+ static bool defaultValue() { return false; }
};
-struct SymbolSpacing : LayoutProperty<float> {
- static constexpr const char *name() { return "symbol-spacing"; }
- static float defaultValue() { return 250; }
+struct IconAnchor : DataDrivenLayoutProperty<SymbolAnchorType> {
+ static constexpr const char *name() { return "icon-anchor"; }
+ static SymbolAnchorType defaultValue() { return SymbolAnchorType::Center; }
};
-struct SymbolAvoidEdges : LayoutProperty<bool> {
- static constexpr const char *name() { return "symbol-avoid-edges"; }
+struct IconIgnorePlacement : LayoutProperty<bool> {
+ static constexpr const char *name() { return "icon-ignore-placement"; }
static bool defaultValue() { return false; }
};
-struct SymbolSortKey : DataDrivenLayoutProperty<float> {
- static constexpr const char *name() { return "symbol-sort-key"; }
- static float defaultValue() { return 0; }
-};
-
-struct SymbolZOrder : LayoutProperty<SymbolZOrderType> {
- static constexpr const char *name() { return "symbol-z-order"; }
- static SymbolZOrderType defaultValue() { return SymbolZOrderType::Auto; }
+struct IconImage : DataDrivenLayoutProperty<std::string> {
+ static constexpr const char *name() { return "icon-image"; }
+ static std::string defaultValue() { return ""; }
};
-struct IconAllowOverlap : LayoutProperty<bool> {
- static constexpr const char *name() { return "icon-allow-overlap"; }
+struct IconKeepUpright : LayoutProperty<bool> {
+ static constexpr const char *name() { return "icon-keep-upright"; }
static bool defaultValue() { return false; }
};
-struct IconIgnorePlacement : LayoutProperty<bool> {
- static constexpr const char *name() { return "icon-ignore-placement"; }
- static bool defaultValue() { return false; }
+struct IconOffset : DataDrivenLayoutProperty<std::array<float, 2>> {
+ static constexpr const char *name() { return "icon-offset"; }
+ static std::array<float, 2> defaultValue() { return {{ 0, 0 }}; }
};
struct IconOptional : LayoutProperty<bool> {
@@ -54,6 +49,21 @@ struct IconOptional : LayoutProperty<bool> {
static bool defaultValue() { return false; }
};
+struct IconPadding : LayoutProperty<float> {
+ static constexpr const char *name() { return "icon-padding"; }
+ static float defaultValue() { return 2; }
+};
+
+struct IconPitchAlignment : LayoutProperty<AlignmentType> {
+ static constexpr const char *name() { return "icon-pitch-alignment"; }
+ static AlignmentType defaultValue() { return AlignmentType::Auto; }
+};
+
+struct IconRotate : DataDrivenLayoutProperty<float> {
+ static constexpr const char *name() { return "icon-rotate"; }
+ static float defaultValue() { return 0; }
+};
+
struct IconRotationAlignment : LayoutProperty<AlignmentType> {
static constexpr const char *name() { return "icon-rotation-alignment"; }
static AlignmentType defaultValue() { return AlignmentType::Auto; }
@@ -74,49 +84,39 @@ struct IconTextFitPadding : LayoutProperty<std::array<float, 4>> {
static std::array<float, 4> defaultValue() { return {{ 0, 0, 0, 0 }}; }
};
-struct IconImage : DataDrivenLayoutProperty<std::string> {
- static constexpr const char *name() { return "icon-image"; }
- static std::string defaultValue() { return ""; }
-};
-
-struct IconRotate : DataDrivenLayoutProperty<float> {
- static constexpr const char *name() { return "icon-rotate"; }
- static float defaultValue() { return 0; }
-};
-
-struct IconPadding : LayoutProperty<float> {
- static constexpr const char *name() { return "icon-padding"; }
- static float defaultValue() { return 2; }
+struct SymbolAvoidEdges : LayoutProperty<bool> {
+ static constexpr const char *name() { return "symbol-avoid-edges"; }
+ static bool defaultValue() { return false; }
};
-struct IconKeepUpright : LayoutProperty<bool> {
- static constexpr const char *name() { return "icon-keep-upright"; }
- static bool defaultValue() { return false; }
+struct SymbolPlacement : LayoutProperty<SymbolPlacementType> {
+ static constexpr const char *name() { return "symbol-placement"; }
+ static SymbolPlacementType defaultValue() { return SymbolPlacementType::Point; }
};
-struct IconOffset : DataDrivenLayoutProperty<std::array<float, 2>> {
- static constexpr const char *name() { return "icon-offset"; }
- static std::array<float, 2> defaultValue() { return {{ 0, 0 }}; }
+struct SymbolSortKey : DataDrivenLayoutProperty<float> {
+ static constexpr const char *name() { return "symbol-sort-key"; }
+ static float defaultValue() { return 0; }
};
-struct IconAnchor : DataDrivenLayoutProperty<SymbolAnchorType> {
- static constexpr const char *name() { return "icon-anchor"; }
- static SymbolAnchorType defaultValue() { return SymbolAnchorType::Center; }
+struct SymbolSpacing : LayoutProperty<float> {
+ static constexpr const char *name() { return "symbol-spacing"; }
+ static float defaultValue() { return 250; }
};
-struct IconPitchAlignment : LayoutProperty<AlignmentType> {
- static constexpr const char *name() { return "icon-pitch-alignment"; }
- static AlignmentType defaultValue() { return AlignmentType::Auto; }
+struct SymbolZOrder : LayoutProperty<SymbolZOrderType> {
+ static constexpr const char *name() { return "symbol-z-order"; }
+ static SymbolZOrderType defaultValue() { return SymbolZOrderType::Auto; }
};
-struct TextPitchAlignment : LayoutProperty<AlignmentType> {
- static constexpr const char *name() { return "text-pitch-alignment"; }
- static AlignmentType defaultValue() { return AlignmentType::Auto; }
+struct TextAllowOverlap : LayoutProperty<bool> {
+ static constexpr const char *name() { return "text-allow-overlap"; }
+ static bool defaultValue() { return false; }
};
-struct TextRotationAlignment : LayoutProperty<AlignmentType> {
- static constexpr const char *name() { return "text-rotation-alignment"; }
- static AlignmentType defaultValue() { return AlignmentType::Auto; }
+struct TextAnchor : DataDrivenLayoutProperty<SymbolAnchorType> {
+ static constexpr const char *name() { return "text-anchor"; }
+ static SymbolAnchorType defaultValue() { return SymbolAnchorType::Center; }
};
struct TextField : DataDrivenLayoutProperty<expression::Formatted> {
@@ -129,19 +129,19 @@ struct TextFont : DataDrivenLayoutProperty<std::vector<std::string>> {
static std::vector<std::string> defaultValue() { return { "Open Sans Regular", "Arial Unicode MS Regular" }; }
};
-struct TextSize : DataDrivenLayoutProperty<float> {
- static constexpr const char *name() { return "text-size"; }
- static float defaultValue() { return 16; }
+struct TextIgnorePlacement : LayoutProperty<bool> {
+ static constexpr const char *name() { return "text-ignore-placement"; }
+ static bool defaultValue() { return false; }
};
-struct TextMaxWidth : DataDrivenLayoutProperty<float> {
- static constexpr const char *name() { return "text-max-width"; }
- static float defaultValue() { return 10; }
+struct TextJustify : DataDrivenLayoutProperty<TextJustifyType> {
+ static constexpr const char *name() { return "text-justify"; }
+ static TextJustifyType defaultValue() { return TextJustifyType::Center; }
};
-struct TextLineHeight : LayoutProperty<float> {
- static constexpr const char *name() { return "text-line-height"; }
- static float defaultValue() { return 1.2; }
+struct TextKeepUpright : LayoutProperty<bool> {
+ static constexpr const char *name() { return "text-keep-upright"; }
+ static bool defaultValue() { return true; }
};
struct TextLetterSpacing : DataDrivenLayoutProperty<float> {
@@ -149,34 +149,29 @@ struct TextLetterSpacing : DataDrivenLayoutProperty<float> {
static float defaultValue() { return 0; }
};
-struct TextJustify : DataDrivenLayoutProperty<TextJustifyType> {
- static constexpr const char *name() { return "text-justify"; }
- static TextJustifyType defaultValue() { return TextJustifyType::Center; }
-};
-
-struct TextRadialOffset : DataDrivenLayoutProperty<float> {
- static constexpr const char *name() { return "text-radial-offset"; }
- static float defaultValue() { return 0; }
+struct TextLineHeight : LayoutProperty<float> {
+ static constexpr const char *name() { return "text-line-height"; }
+ static float defaultValue() { return 1.2; }
};
-struct TextVariableAnchor : LayoutProperty<std::vector<TextVariableAnchorType>> {
- static constexpr const char *name() { return "text-variable-anchor"; }
- static std::vector<TextVariableAnchorType> defaultValue() { return { }; }
+struct TextMaxAngle : LayoutProperty<float> {
+ static constexpr const char *name() { return "text-max-angle"; }
+ static float defaultValue() { return 45; }
};
-struct TextAnchor : DataDrivenLayoutProperty<SymbolAnchorType> {
- static constexpr const char *name() { return "text-anchor"; }
- static SymbolAnchorType defaultValue() { return SymbolAnchorType::Center; }
+struct TextMaxWidth : DataDrivenLayoutProperty<float> {
+ static constexpr const char *name() { return "text-max-width"; }
+ static float defaultValue() { return 10; }
};
-struct TextMaxAngle : LayoutProperty<float> {
- static constexpr const char *name() { return "text-max-angle"; }
- static float defaultValue() { return 45; }
+struct TextOffset : DataDrivenLayoutProperty<std::array<float, 2>> {
+ static constexpr const char *name() { return "text-offset"; }
+ static std::array<float, 2> defaultValue() { return {{ 0, 0 }}; }
};
-struct TextRotate : DataDrivenLayoutProperty<float> {
- static constexpr const char *name() { return "text-rotate"; }
- static float defaultValue() { return 0; }
+struct TextOptional : LayoutProperty<bool> {
+ static constexpr const char *name() { return "text-optional"; }
+ static bool defaultValue() { return false; }
};
struct TextPadding : LayoutProperty<float> {
@@ -184,44 +179,49 @@ struct TextPadding : LayoutProperty<float> {
static float defaultValue() { return 2; }
};
-struct TextKeepUpright : LayoutProperty<bool> {
- static constexpr const char *name() { return "text-keep-upright"; }
- static bool defaultValue() { return true; }
+struct TextPitchAlignment : LayoutProperty<AlignmentType> {
+ static constexpr const char *name() { return "text-pitch-alignment"; }
+ static AlignmentType defaultValue() { return AlignmentType::Auto; }
};
-struct TextTransform : DataDrivenLayoutProperty<TextTransformType> {
- static constexpr const char *name() { return "text-transform"; }
- static TextTransformType defaultValue() { return TextTransformType::None; }
+struct TextRadialOffset : DataDrivenLayoutProperty<float> {
+ static constexpr const char *name() { return "text-radial-offset"; }
+ static float defaultValue() { return 0; }
};
-struct TextOffset : DataDrivenLayoutProperty<std::array<float, 2>> {
- static constexpr const char *name() { return "text-offset"; }
- static std::array<float, 2> defaultValue() { return {{ 0, 0 }}; }
+struct TextRotate : DataDrivenLayoutProperty<float> {
+ static constexpr const char *name() { return "text-rotate"; }
+ static float defaultValue() { return 0; }
};
-struct TextAllowOverlap : LayoutProperty<bool> {
- static constexpr const char *name() { return "text-allow-overlap"; }
- static bool defaultValue() { return false; }
+struct TextRotationAlignment : LayoutProperty<AlignmentType> {
+ static constexpr const char *name() { return "text-rotation-alignment"; }
+ static AlignmentType defaultValue() { return AlignmentType::Auto; }
};
-struct TextIgnorePlacement : LayoutProperty<bool> {
- static constexpr const char *name() { return "text-ignore-placement"; }
- static bool defaultValue() { return false; }
+struct TextSize : DataDrivenLayoutProperty<float> {
+ static constexpr const char *name() { return "text-size"; }
+ static float defaultValue() { return 16; }
};
-struct TextOptional : LayoutProperty<bool> {
- static constexpr const char *name() { return "text-optional"; }
- static bool defaultValue() { return false; }
+struct TextTransform : DataDrivenLayoutProperty<TextTransformType> {
+ static constexpr const char *name() { return "text-transform"; }
+ static TextTransformType defaultValue() { return TextTransformType::None; }
};
-struct IconOpacity : DataDrivenPaintProperty<float, attributes::opacity, uniforms::opacity> {
- static float defaultValue() { return 1; }
+struct TextVariableAnchor : LayoutProperty<std::vector<TextVariableAnchorType>> {
+ static constexpr const char *name() { return "text-variable-anchor"; }
+ static std::vector<TextVariableAnchorType> defaultValue() { return { }; }
};
struct IconColor : DataDrivenPaintProperty<Color, attributes::fill_color, uniforms::fill_color> {
static Color defaultValue() { return Color::black(); }
};
+struct IconHaloBlur : DataDrivenPaintProperty<float, attributes::halo_blur, uniforms::halo_blur> {
+ static float defaultValue() { return 0; }
+};
+
struct IconHaloColor : DataDrivenPaintProperty<Color, attributes::halo_color, uniforms::halo_color> {
static Color defaultValue() { return {}; }
};
@@ -230,8 +230,8 @@ struct IconHaloWidth : DataDrivenPaintProperty<float, attributes::halo_width, un
static float defaultValue() { return 0; }
};
-struct IconHaloBlur : DataDrivenPaintProperty<float, attributes::halo_blur, uniforms::halo_blur> {
- static float defaultValue() { return 0; }
+struct IconOpacity : DataDrivenPaintProperty<float, attributes::opacity, uniforms::opacity> {
+ static float defaultValue() { return 1; }
};
struct IconTranslate : PaintProperty<std::array<float, 2>> {
@@ -242,10 +242,6 @@ struct IconTranslateAnchor : PaintProperty<TranslateAnchorType> {
static TranslateAnchorType defaultValue() { return TranslateAnchorType::Map; }
};
-struct TextOpacity : DataDrivenPaintProperty<float, attributes::opacity, uniforms::opacity> {
- static float defaultValue() { return 1; }
-};
-
struct TextColor : DataDrivenPaintProperty<Color, attributes::fill_color, uniforms::fill_color, true> {
static Color defaultValue() { return Color::black(); }
static constexpr const char *name() { return "text-color"; }
@@ -253,6 +249,10 @@ struct TextColor : DataDrivenPaintProperty<Color, attributes::fill_color, unifor
template<typename T> static bool hasOverride(const T& t) { return !!t.textColor; };
};
+struct TextHaloBlur : DataDrivenPaintProperty<float, attributes::halo_blur, uniforms::halo_blur> {
+ static float defaultValue() { return 0; }
+};
+
struct TextHaloColor : DataDrivenPaintProperty<Color, attributes::halo_color, uniforms::halo_color> {
static Color defaultValue() { return {}; }
};
@@ -261,8 +261,8 @@ struct TextHaloWidth : DataDrivenPaintProperty<float, attributes::halo_width, un
static float defaultValue() { return 0; }
};
-struct TextHaloBlur : DataDrivenPaintProperty<float, attributes::halo_blur, uniforms::halo_blur> {
- static float defaultValue() { return 0; }
+struct TextOpacity : DataDrivenPaintProperty<float, attributes::opacity, uniforms::opacity> {
+ static float defaultValue() { return 1; }
};
struct TextTranslate : PaintProperty<std::array<float, 2>> {
@@ -274,61 +274,61 @@ struct TextTranslateAnchor : PaintProperty<TranslateAnchorType> {
};
class SymbolLayoutProperties : public Properties<
- SymbolPlacement,
- SymbolSpacing,
- SymbolAvoidEdges,
- SymbolSortKey,
- SymbolZOrder,
IconAllowOverlap,
+ IconAnchor,
IconIgnorePlacement,
+ IconImage,
+ IconKeepUpright,
+ IconOffset,
IconOptional,
+ IconPadding,
+ IconPitchAlignment,
+ IconRotate,
IconRotationAlignment,
IconSize,
IconTextFit,
IconTextFitPadding,
- IconImage,
- IconRotate,
- IconPadding,
- IconKeepUpright,
- IconOffset,
- IconAnchor,
- IconPitchAlignment,
- TextPitchAlignment,
- TextRotationAlignment,
+ SymbolAvoidEdges,
+ SymbolPlacement,
+ SymbolSortKey,
+ SymbolSpacing,
+ SymbolZOrder,
+ TextAllowOverlap,
+ TextAnchor,
TextField,
TextFont,
- TextSize,
- TextMaxWidth,
- TextLineHeight,
- TextLetterSpacing,
+ TextIgnorePlacement,
TextJustify,
- TextRadialOffset,
- TextVariableAnchor,
- TextAnchor,
+ TextKeepUpright,
+ TextLetterSpacing,
+ TextLineHeight,
TextMaxAngle,
- TextRotate,
+ TextMaxWidth,
+ TextOffset,
+ TextOptional,
TextPadding,
- TextKeepUpright,
+ TextPitchAlignment,
+ TextRadialOffset,
+ TextRotate,
+ TextRotationAlignment,
+ TextSize,
TextTransform,
- TextOffset,
- TextAllowOverlap,
- TextIgnorePlacement,
- TextOptional
+ TextVariableAnchor
> {};
class SymbolPaintProperties : public Properties<
- IconOpacity,
IconColor,
+ IconHaloBlur,
IconHaloColor,
IconHaloWidth,
- IconHaloBlur,
+ IconOpacity,
IconTranslate,
IconTranslateAnchor,
- TextOpacity,
TextColor,
+ TextHaloBlur,
TextHaloColor,
TextHaloWidth,
- TextHaloBlur,
+ TextOpacity,
TextTranslate,
TextTranslateAnchor
> {};