summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-08-23 12:49:47 -0700
committerGitHub <noreply@github.com>2016-08-23 12:49:47 -0700
commit63cce78cf1597ba5879227f2298bda52e91e4e04 (patch)
treece01f8c70d8dc707469e08c892fd6a8c43d69ecd
parentfcb710fafecdafd511c2a09207b2de3077caa644 (diff)
downloadqtlocation-mapboxgl-63cce78cf1597ba5879227f2298bda52e91e4e04.tar.gz
[core] Add static getters for property default values (#6124)
-rw-r--r--include/mbgl/style/layers/background_layer.hpp3
-rw-r--r--include/mbgl/style/layers/circle_layer.hpp7
-rw-r--r--include/mbgl/style/layers/fill_layer.hpp7
-rw-r--r--include/mbgl/style/layers/layer.hpp.ejs2
-rw-r--r--include/mbgl/style/layers/line_layer.hpp14
-rw-r--r--include/mbgl/style/layers/raster_layer.hpp7
-rw-r--r--include/mbgl/style/layers/symbol_layer.hpp48
-rw-r--r--scripts/generate-style-code.js16
-rw-r--r--src/mbgl/style/layers/background_layer.cpp12
-rw-r--r--src/mbgl/style/layers/circle_layer.cpp28
-rw-r--r--src/mbgl/style/layers/fill_layer.cpp28
-rw-r--r--src/mbgl/style/layers/layer.cpp.ejs8
-rw-r--r--src/mbgl/style/layers/layer_properties.hpp.ejs8
-rw-r--r--src/mbgl/style/layers/line_layer.cpp56
-rw-r--r--src/mbgl/style/layers/raster_layer.cpp28
-rw-r--r--src/mbgl/style/layers/symbol_layer.cpp192
16 files changed, 455 insertions, 9 deletions
diff --git a/include/mbgl/style/layers/background_layer.hpp b/include/mbgl/style/layers/background_layer.hpp
index ac97ec2e6d..68aebfd37c 100644
--- a/include/mbgl/style/layers/background_layer.hpp
+++ b/include/mbgl/style/layers/background_layer.hpp
@@ -18,12 +18,15 @@ public:
// Paint properties
+ static PropertyValue<Color> getDefaultBackgroundColor();
PropertyValue<Color> getBackgroundColor() const;
void setBackgroundColor(PropertyValue<Color>, const optional<std::string>& klass = {});
+ static PropertyValue<std::string> getDefaultBackgroundPattern();
PropertyValue<std::string> getBackgroundPattern() const;
void setBackgroundPattern(PropertyValue<std::string>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultBackgroundOpacity();
PropertyValue<float> getBackgroundOpacity() const;
void setBackgroundOpacity(PropertyValue<float>, const optional<std::string>& klass = {});
diff --git a/include/mbgl/style/layers/circle_layer.hpp b/include/mbgl/style/layers/circle_layer.hpp
index 873f95bcff..39ea61c5f3 100644
--- a/include/mbgl/style/layers/circle_layer.hpp
+++ b/include/mbgl/style/layers/circle_layer.hpp
@@ -26,24 +26,31 @@ public:
// Paint properties
+ static PropertyValue<float> getDefaultCircleRadius();
PropertyValue<float> getCircleRadius() const;
void setCircleRadius(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<Color> getDefaultCircleColor();
PropertyValue<Color> getCircleColor() const;
void setCircleColor(PropertyValue<Color>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultCircleBlur();
PropertyValue<float> getCircleBlur() const;
void setCircleBlur(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultCircleOpacity();
PropertyValue<float> getCircleOpacity() const;
void setCircleOpacity(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<std::array<float, 2>> getDefaultCircleTranslate();
PropertyValue<std::array<float, 2>> getCircleTranslate() const;
void setCircleTranslate(PropertyValue<std::array<float, 2>>, const optional<std::string>& klass = {});
+ static PropertyValue<TranslateAnchorType> getDefaultCircleTranslateAnchor();
PropertyValue<TranslateAnchorType> getCircleTranslateAnchor() const;
void setCircleTranslateAnchor(PropertyValue<TranslateAnchorType>, const optional<std::string>& klass = {});
+ static PropertyValue<CirclePitchScaleType> getDefaultCirclePitchScale();
PropertyValue<CirclePitchScaleType> getCirclePitchScale() const;
void setCirclePitchScale(PropertyValue<CirclePitchScaleType>, const optional<std::string>& klass = {});
diff --git a/include/mbgl/style/layers/fill_layer.hpp b/include/mbgl/style/layers/fill_layer.hpp
index e70d67f538..72bb7c498f 100644
--- a/include/mbgl/style/layers/fill_layer.hpp
+++ b/include/mbgl/style/layers/fill_layer.hpp
@@ -26,24 +26,31 @@ public:
// Paint properties
+ static PropertyValue<bool> getDefaultFillAntialias();
PropertyValue<bool> getFillAntialias() const;
void setFillAntialias(PropertyValue<bool>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultFillOpacity();
PropertyValue<float> getFillOpacity() const;
void setFillOpacity(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<Color> getDefaultFillColor();
PropertyValue<Color> getFillColor() const;
void setFillColor(PropertyValue<Color>, const optional<std::string>& klass = {});
+ static PropertyValue<Color> getDefaultFillOutlineColor();
PropertyValue<Color> getFillOutlineColor() const;
void setFillOutlineColor(PropertyValue<Color>, const optional<std::string>& klass = {});
+ static PropertyValue<std::array<float, 2>> getDefaultFillTranslate();
PropertyValue<std::array<float, 2>> getFillTranslate() const;
void setFillTranslate(PropertyValue<std::array<float, 2>>, const optional<std::string>& klass = {});
+ static PropertyValue<TranslateAnchorType> getDefaultFillTranslateAnchor();
PropertyValue<TranslateAnchorType> getFillTranslateAnchor() const;
void setFillTranslateAnchor(PropertyValue<TranslateAnchorType>, const optional<std::string>& klass = {});
+ static PropertyValue<std::string> getDefaultFillPattern();
PropertyValue<std::string> getFillPattern() const;
void setFillPattern(PropertyValue<std::string>, const optional<std::string>& klass = {});
diff --git a/include/mbgl/style/layers/layer.hpp.ejs b/include/mbgl/style/layers/layer.hpp.ejs
index aaae30287c..9d542b75b6 100644
--- a/include/mbgl/style/layers/layer.hpp.ejs
+++ b/include/mbgl/style/layers/layer.hpp.ejs
@@ -45,6 +45,7 @@ public:
// Layout properties
<% for (const property of layoutProperties) { -%>
+ static PropertyValue<<%- propertyType(property) %>> getDefault<%- camelize(property.name) %>();
PropertyValue<<%- propertyType(property) %>> get<%- camelize(property.name) %>() const;
void set<%- camelize(property.name) %>(PropertyValue<<%- propertyType(property) %>>);
@@ -53,6 +54,7 @@ public:
// Paint properties
<% for (const property of paintProperties) { -%>
+ static PropertyValue<<%- propertyType(property) %>> getDefault<%- camelize(property.name) %>();
PropertyValue<<%- propertyType(property) %>> get<%- camelize(property.name) %>() const;
void set<%- camelize(property.name) %>(PropertyValue<<%- propertyType(property) %>>, const optional<std::string>& klass = {});
diff --git a/include/mbgl/style/layers/line_layer.hpp b/include/mbgl/style/layers/line_layer.hpp
index abcb425b96..8549ad0a6c 100644
--- a/include/mbgl/style/layers/line_layer.hpp
+++ b/include/mbgl/style/layers/line_layer.hpp
@@ -28,47 +28,61 @@ public:
// Layout properties
+ static PropertyValue<LineCapType> getDefaultLineCap();
PropertyValue<LineCapType> getLineCap() const;
void setLineCap(PropertyValue<LineCapType>);
+ static PropertyValue<LineJoinType> getDefaultLineJoin();
PropertyValue<LineJoinType> getLineJoin() const;
void setLineJoin(PropertyValue<LineJoinType>);
+ static PropertyValue<float> getDefaultLineMiterLimit();
PropertyValue<float> getLineMiterLimit() const;
void setLineMiterLimit(PropertyValue<float>);
+ static PropertyValue<float> getDefaultLineRoundLimit();
PropertyValue<float> getLineRoundLimit() const;
void setLineRoundLimit(PropertyValue<float>);
// Paint properties
+ static PropertyValue<float> getDefaultLineOpacity();
PropertyValue<float> getLineOpacity() const;
void setLineOpacity(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<Color> getDefaultLineColor();
PropertyValue<Color> getLineColor() const;
void setLineColor(PropertyValue<Color>, const optional<std::string>& klass = {});
+ static PropertyValue<std::array<float, 2>> getDefaultLineTranslate();
PropertyValue<std::array<float, 2>> getLineTranslate() const;
void setLineTranslate(PropertyValue<std::array<float, 2>>, const optional<std::string>& klass = {});
+ static PropertyValue<TranslateAnchorType> getDefaultLineTranslateAnchor();
PropertyValue<TranslateAnchorType> getLineTranslateAnchor() const;
void setLineTranslateAnchor(PropertyValue<TranslateAnchorType>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultLineWidth();
PropertyValue<float> getLineWidth() const;
void setLineWidth(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultLineGapWidth();
PropertyValue<float> getLineGapWidth() const;
void setLineGapWidth(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultLineOffset();
PropertyValue<float> getLineOffset() const;
void setLineOffset(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultLineBlur();
PropertyValue<float> getLineBlur() const;
void setLineBlur(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<std::vector<float>> getDefaultLineDasharray();
PropertyValue<std::vector<float>> getLineDasharray() const;
void setLineDasharray(PropertyValue<std::vector<float>>, const optional<std::string>& klass = {});
+ static PropertyValue<std::string> getDefaultLinePattern();
PropertyValue<std::string> getLinePattern() const;
void setLinePattern(PropertyValue<std::string>, const optional<std::string>& klass = {});
diff --git a/include/mbgl/style/layers/raster_layer.hpp b/include/mbgl/style/layers/raster_layer.hpp
index dea0c26bf3..c5479bd2ab 100644
--- a/include/mbgl/style/layers/raster_layer.hpp
+++ b/include/mbgl/style/layers/raster_layer.hpp
@@ -21,24 +21,31 @@ public:
// Paint properties
+ static PropertyValue<float> getDefaultRasterOpacity();
PropertyValue<float> getRasterOpacity() const;
void setRasterOpacity(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultRasterHueRotate();
PropertyValue<float> getRasterHueRotate() const;
void setRasterHueRotate(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultRasterBrightnessMin();
PropertyValue<float> getRasterBrightnessMin() const;
void setRasterBrightnessMin(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultRasterBrightnessMax();
PropertyValue<float> getRasterBrightnessMax() const;
void setRasterBrightnessMax(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultRasterSaturation();
PropertyValue<float> getRasterSaturation() const;
void setRasterSaturation(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultRasterContrast();
PropertyValue<float> getRasterContrast() const;
void setRasterContrast(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultRasterFadeDuration();
PropertyValue<float> getRasterFadeDuration() const;
void setRasterFadeDuration(PropertyValue<float>, const optional<std::string>& klass = {});
diff --git a/include/mbgl/style/layers/symbol_layer.hpp b/include/mbgl/style/layers/symbol_layer.hpp
index 77b63d9b91..5d1882fd4b 100644
--- a/include/mbgl/style/layers/symbol_layer.hpp
+++ b/include/mbgl/style/layers/symbol_layer.hpp
@@ -28,149 +28,197 @@ public:
// 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 PropertyValue<float> getDefaultIconSize();
PropertyValue<float> getIconSize() const;
void setIconSize(PropertyValue<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 PropertyValue<std::string> getDefaultIconImage();
PropertyValue<std::string> getIconImage() const;
void setIconImage(PropertyValue<std::string>);
+ static PropertyValue<float> getDefaultIconRotate();
PropertyValue<float> getIconRotate() const;
void setIconRotate(PropertyValue<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 PropertyValue<std::array<float, 2>> getDefaultIconOffset();
PropertyValue<std::array<float, 2>> getIconOffset() const;
void setIconOffset(PropertyValue<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 PropertyValue<std::string> getDefaultTextField();
PropertyValue<std::string> getTextField() const;
void setTextField(PropertyValue<std::string>);
+ static PropertyValue<std::vector<std::string>> getDefaultTextFont();
PropertyValue<std::vector<std::string>> getTextFont() const;
void setTextFont(PropertyValue<std::vector<std::string>>);
+ static PropertyValue<float> getDefaultTextSize();
PropertyValue<float> getTextSize() const;
void setTextSize(PropertyValue<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 PropertyValue<float> getDefaultTextRotate();
PropertyValue<float> getTextRotate() const;
void setTextRotate(PropertyValue<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 PropertyValue<TextTransformType> getDefaultTextTransform();
PropertyValue<TextTransformType> getTextTransform() const;
void setTextTransform(PropertyValue<TextTransformType>);
+ static PropertyValue<std::array<float, 2>> getDefaultTextOffset();
PropertyValue<std::array<float, 2>> getTextOffset() const;
void setTextOffset(PropertyValue<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 PropertyValue<float> getDefaultIconOpacity();
PropertyValue<float> getIconOpacity() const;
void setIconOpacity(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<Color> getDefaultIconColor();
PropertyValue<Color> getIconColor() const;
void setIconColor(PropertyValue<Color>, const optional<std::string>& klass = {});
+ static PropertyValue<Color> getDefaultIconHaloColor();
PropertyValue<Color> getIconHaloColor() const;
void setIconHaloColor(PropertyValue<Color>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultIconHaloWidth();
PropertyValue<float> getIconHaloWidth() const;
void setIconHaloWidth(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultIconHaloBlur();
PropertyValue<float> getIconHaloBlur() const;
void setIconHaloBlur(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<std::array<float, 2>> getDefaultIconTranslate();
PropertyValue<std::array<float, 2>> getIconTranslate() const;
void setIconTranslate(PropertyValue<std::array<float, 2>>, const optional<std::string>& klass = {});
+ static PropertyValue<TranslateAnchorType> getDefaultIconTranslateAnchor();
PropertyValue<TranslateAnchorType> getIconTranslateAnchor() const;
void setIconTranslateAnchor(PropertyValue<TranslateAnchorType>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultTextOpacity();
PropertyValue<float> getTextOpacity() const;
void setTextOpacity(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<Color> getDefaultTextColor();
PropertyValue<Color> getTextColor() const;
void setTextColor(PropertyValue<Color>, const optional<std::string>& klass = {});
+ static PropertyValue<Color> getDefaultTextHaloColor();
PropertyValue<Color> getTextHaloColor() const;
void setTextHaloColor(PropertyValue<Color>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultTextHaloWidth();
PropertyValue<float> getTextHaloWidth() const;
void setTextHaloWidth(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<float> getDefaultTextHaloBlur();
PropertyValue<float> getTextHaloBlur() const;
void setTextHaloBlur(PropertyValue<float>, const optional<std::string>& klass = {});
+ static PropertyValue<std::array<float, 2>> getDefaultTextTranslate();
PropertyValue<std::array<float, 2>> getTextTranslate() const;
void setTextTranslate(PropertyValue<std::array<float, 2>>, const optional<std::string>& klass = {});
+ static PropertyValue<TranslateAnchorType> getDefaultTextTranslateAnchor();
PropertyValue<TranslateAnchorType> getTextTranslateAnchor() const;
void setTextTranslateAnchor(PropertyValue<TranslateAnchorType>, const optional<std::string>& klass = {});
diff --git a/scripts/generate-style-code.js b/scripts/generate-style-code.js
index 2a25f37112..4c5f148a00 100644
--- a/scripts/generate-style-code.js
+++ b/scripts/generate-style-code.js
@@ -58,6 +58,10 @@ global.defaultValue = function (property) {
return 1;
}
+ if (property.name === 'fill-outline-color') {
+ return '{}';
+ }
+
switch (property.type) {
case 'number':
return property.default;
@@ -70,7 +74,17 @@ global.defaultValue = function (property) {
return `${propertyType(property)}::${camelize(property.default)}`;
}
case 'color':
- return `{ ${parseCSSColor(property.default).join(', ')} }`
+ var color = parseCSSColor(property.default).join(', ');
+ switch (color) {
+ case '0, 0, 0, 0':
+ return '{}';
+ case '0, 0, 0, 1':
+ return 'Color::black()';
+ case '1, 1, 1, 1':
+ return 'Color::white()';
+ default:
+ return `{ ${color} }`;
+ }
case 'array':
const defaults = (property.default || []).map((e) => defaultValue({ type: property.value, default: e }));
if (property.length) {
diff --git a/src/mbgl/style/layers/background_layer.cpp b/src/mbgl/style/layers/background_layer.cpp
index 42cd76d01f..e5747e07ce 100644
--- a/src/mbgl/style/layers/background_layer.cpp
+++ b/src/mbgl/style/layers/background_layer.cpp
@@ -37,6 +37,10 @@ std::unique_ptr<Layer> BackgroundLayer::Impl::cloneRef(const std::string& id_) c
// Paint properties
+PropertyValue<Color> BackgroundLayer::getDefaultBackgroundColor() {
+ return { Color::black() };
+}
+
PropertyValue<Color> BackgroundLayer::getBackgroundColor() const {
return impl->paint.backgroundColor.get();
}
@@ -45,6 +49,10 @@ void BackgroundLayer::setBackgroundColor(PropertyValue<Color> value, const optio
impl->paint.backgroundColor.set(value, klass);
}
+PropertyValue<std::string> BackgroundLayer::getDefaultBackgroundPattern() {
+ return { "" };
+}
+
PropertyValue<std::string> BackgroundLayer::getBackgroundPattern() const {
return impl->paint.backgroundPattern.get();
}
@@ -53,6 +61,10 @@ void BackgroundLayer::setBackgroundPattern(PropertyValue<std::string> value, con
impl->paint.backgroundPattern.set(value, klass);
}
+PropertyValue<float> BackgroundLayer::getDefaultBackgroundOpacity() {
+ return { 1 };
+}
+
PropertyValue<float> BackgroundLayer::getBackgroundOpacity() const {
return impl->paint.backgroundOpacity.get();
}
diff --git a/src/mbgl/style/layers/circle_layer.cpp b/src/mbgl/style/layers/circle_layer.cpp
index 96cc0b610c..271a573f0b 100644
--- a/src/mbgl/style/layers/circle_layer.cpp
+++ b/src/mbgl/style/layers/circle_layer.cpp
@@ -61,6 +61,10 @@ const Filter& CircleLayer::getFilter() const {
// Paint properties
+PropertyValue<float> CircleLayer::getDefaultCircleRadius() {
+ return { 5 };
+}
+
PropertyValue<float> CircleLayer::getCircleRadius() const {
return impl->paint.circleRadius.get();
}
@@ -69,6 +73,10 @@ void CircleLayer::setCircleRadius(PropertyValue<float> value, const optional<std
impl->paint.circleRadius.set(value, klass);
}
+PropertyValue<Color> CircleLayer::getDefaultCircleColor() {
+ return { Color::black() };
+}
+
PropertyValue<Color> CircleLayer::getCircleColor() const {
return impl->paint.circleColor.get();
}
@@ -77,6 +85,10 @@ void CircleLayer::setCircleColor(PropertyValue<Color> value, const optional<std:
impl->paint.circleColor.set(value, klass);
}
+PropertyValue<float> CircleLayer::getDefaultCircleBlur() {
+ return { 0 };
+}
+
PropertyValue<float> CircleLayer::getCircleBlur() const {
return impl->paint.circleBlur.get();
}
@@ -85,6 +97,10 @@ void CircleLayer::setCircleBlur(PropertyValue<float> value, const optional<std::
impl->paint.circleBlur.set(value, klass);
}
+PropertyValue<float> CircleLayer::getDefaultCircleOpacity() {
+ return { 1 };
+}
+
PropertyValue<float> CircleLayer::getCircleOpacity() const {
return impl->paint.circleOpacity.get();
}
@@ -93,6 +109,10 @@ void CircleLayer::setCircleOpacity(PropertyValue<float> value, const optional<st
impl->paint.circleOpacity.set(value, klass);
}
+PropertyValue<std::array<float, 2>> CircleLayer::getDefaultCircleTranslate() {
+ return { {{ 0, 0 }} };
+}
+
PropertyValue<std::array<float, 2>> CircleLayer::getCircleTranslate() const {
return impl->paint.circleTranslate.get();
}
@@ -101,6 +121,10 @@ void CircleLayer::setCircleTranslate(PropertyValue<std::array<float, 2>> value,
impl->paint.circleTranslate.set(value, klass);
}
+PropertyValue<TranslateAnchorType> CircleLayer::getDefaultCircleTranslateAnchor() {
+ return { TranslateAnchorType::Map };
+}
+
PropertyValue<TranslateAnchorType> CircleLayer::getCircleTranslateAnchor() const {
return impl->paint.circleTranslateAnchor.get();
}
@@ -109,6 +133,10 @@ void CircleLayer::setCircleTranslateAnchor(PropertyValue<TranslateAnchorType> va
impl->paint.circleTranslateAnchor.set(value, klass);
}
+PropertyValue<CirclePitchScaleType> CircleLayer::getDefaultCirclePitchScale() {
+ return { CirclePitchScaleType::Map };
+}
+
PropertyValue<CirclePitchScaleType> CircleLayer::getCirclePitchScale() const {
return impl->paint.circlePitchScale.get();
}
diff --git a/src/mbgl/style/layers/fill_layer.cpp b/src/mbgl/style/layers/fill_layer.cpp
index 44894aff33..36febd77e8 100644
--- a/src/mbgl/style/layers/fill_layer.cpp
+++ b/src/mbgl/style/layers/fill_layer.cpp
@@ -61,6 +61,10 @@ const Filter& FillLayer::getFilter() const {
// Paint properties
+PropertyValue<bool> FillLayer::getDefaultFillAntialias() {
+ return { true };
+}
+
PropertyValue<bool> FillLayer::getFillAntialias() const {
return impl->paint.fillAntialias.get();
}
@@ -69,6 +73,10 @@ void FillLayer::setFillAntialias(PropertyValue<bool> value, const optional<std::
impl->paint.fillAntialias.set(value, klass);
}
+PropertyValue<float> FillLayer::getDefaultFillOpacity() {
+ return { 1 };
+}
+
PropertyValue<float> FillLayer::getFillOpacity() const {
return impl->paint.fillOpacity.get();
}
@@ -77,6 +85,10 @@ void FillLayer::setFillOpacity(PropertyValue<float> value, const optional<std::s
impl->paint.fillOpacity.set(value, klass);
}
+PropertyValue<Color> FillLayer::getDefaultFillColor() {
+ return { Color::black() };
+}
+
PropertyValue<Color> FillLayer::getFillColor() const {
return impl->paint.fillColor.get();
}
@@ -85,6 +97,10 @@ void FillLayer::setFillColor(PropertyValue<Color> value, const optional<std::str
impl->paint.fillColor.set(value, klass);
}
+PropertyValue<Color> FillLayer::getDefaultFillOutlineColor() {
+ return { {} };
+}
+
PropertyValue<Color> FillLayer::getFillOutlineColor() const {
return impl->paint.fillOutlineColor.get();
}
@@ -93,6 +109,10 @@ void FillLayer::setFillOutlineColor(PropertyValue<Color> value, const optional<s
impl->paint.fillOutlineColor.set(value, klass);
}
+PropertyValue<std::array<float, 2>> FillLayer::getDefaultFillTranslate() {
+ return { {{ 0, 0 }} };
+}
+
PropertyValue<std::array<float, 2>> FillLayer::getFillTranslate() const {
return impl->paint.fillTranslate.get();
}
@@ -101,6 +121,10 @@ void FillLayer::setFillTranslate(PropertyValue<std::array<float, 2>> value, cons
impl->paint.fillTranslate.set(value, klass);
}
+PropertyValue<TranslateAnchorType> FillLayer::getDefaultFillTranslateAnchor() {
+ return { TranslateAnchorType::Map };
+}
+
PropertyValue<TranslateAnchorType> FillLayer::getFillTranslateAnchor() const {
return impl->paint.fillTranslateAnchor.get();
}
@@ -109,6 +133,10 @@ void FillLayer::setFillTranslateAnchor(PropertyValue<TranslateAnchorType> value,
impl->paint.fillTranslateAnchor.set(value, klass);
}
+PropertyValue<std::string> FillLayer::getDefaultFillPattern() {
+ return { "" };
+}
+
PropertyValue<std::string> FillLayer::getFillPattern() const {
return impl->paint.fillPattern.get();
}
diff --git a/src/mbgl/style/layers/layer.cpp.ejs b/src/mbgl/style/layers/layer.cpp.ejs
index 017691c8ec..16a137a008 100644
--- a/src/mbgl/style/layers/layer.cpp.ejs
+++ b/src/mbgl/style/layers/layer.cpp.ejs
@@ -76,6 +76,10 @@ const Filter& <%- camelize(type) %>Layer::getFilter() const {
// Layout properties
<% for (const property of layoutProperties) { -%>
+PropertyValue<<%- propertyType(property) %>> <%- camelize(type) %>Layer::getDefault<%- camelize(property.name) %>() {
+ return { <%- defaultValue(property) %> };
+}
+
PropertyValue<<%- propertyType(property) %>> <%- camelize(type) %>Layer::get<%- camelize(property.name) %>() const {
return impl->layout.<%- camelizeWithLeadingLowercase(property.name) %>.get();
}
@@ -87,6 +91,10 @@ void <%- camelize(type) %>Layer::set<%- camelize(property.name) %>(PropertyValue
// Paint properties
<% for (const property of paintProperties) { %>
+PropertyValue<<%- propertyType(property) %>> <%- camelize(type) %>Layer::getDefault<%- camelize(property.name) %>() {
+ return { <%- defaultValue(property) %> };
+}
+
PropertyValue<<%- propertyType(property) %>> <%- camelize(type) %>Layer::get<%- camelize(property.name) %>() const {
return impl->paint.<%- camelizeWithLeadingLowercase(property.name) %>.get();
}
diff --git a/src/mbgl/style/layers/layer_properties.hpp.ejs b/src/mbgl/style/layers/layer_properties.hpp.ejs
index 6ec92703f1..0c91ecba8c 100644
--- a/src/mbgl/style/layers/layer_properties.hpp.ejs
+++ b/src/mbgl/style/layers/layer_properties.hpp.ejs
@@ -36,14 +36,6 @@ public:
<% for (const property of paintProperties) { -%>
<% if (/-pattern$/.test(property.name) || property.name === 'line-dasharray') { -%>
PaintProperty<<%- propertyType(property) %>, CrossFadedPropertyEvaluator> <%- camelizeWithLeadingLowercase(property.name) %> { <%- defaultValue(property) %> };
-<% } else if (property.name === 'fill-outline-color') { -%>
- PaintProperty<<%- propertyType(property) %>> <%- camelizeWithLeadingLowercase(property.name) %> { {} };
-<% } else if (property.name.endsWith('color') && defaultValue(property) === '{ 0, 0, 0, 0 }') { -%>
- PaintProperty<<%- propertyType(property) %>> <%- camelizeWithLeadingLowercase(property.name) %> { {} };
-<% } else if (property.name.endsWith('color') && defaultValue(property) === '{ 0, 0, 0, 1 }') { -%>
- PaintProperty<<%- propertyType(property) %>> <%- camelizeWithLeadingLowercase(property.name) %> { Color::black() };
-<% } else if (property.name.endsWith('color') && defaultValue(property) === '{ 1, 1, 1, 1 }') { -%>
- PaintProperty<<%- propertyType(property) %>> <%- camelizeWithLeadingLowercase(property.name) %> { Color::white() };
<% } else { -%>
PaintProperty<<%- propertyType(property) %>> <%- camelizeWithLeadingLowercase(property.name) %> { <%- defaultValue(property) %> };
<% } -%>
diff --git a/src/mbgl/style/layers/line_layer.cpp b/src/mbgl/style/layers/line_layer.cpp
index 3ad72cda16..1594985b6b 100644
--- a/src/mbgl/style/layers/line_layer.cpp
+++ b/src/mbgl/style/layers/line_layer.cpp
@@ -58,6 +58,10 @@ const Filter& LineLayer::getFilter() const {
// Layout properties
+PropertyValue<LineCapType> LineLayer::getDefaultLineCap() {
+ return { LineCapType::Butt };
+}
+
PropertyValue<LineCapType> LineLayer::getLineCap() const {
return impl->layout.lineCap.get();
}
@@ -65,6 +69,10 @@ PropertyValue<LineCapType> LineLayer::getLineCap() const {
void LineLayer::setLineCap(PropertyValue<LineCapType> value) {
impl->layout.lineCap.set(value);
}
+PropertyValue<LineJoinType> LineLayer::getDefaultLineJoin() {
+ return { LineJoinType::Miter };
+}
+
PropertyValue<LineJoinType> LineLayer::getLineJoin() const {
return impl->layout.lineJoin.get();
}
@@ -72,6 +80,10 @@ PropertyValue<LineJoinType> LineLayer::getLineJoin() const {
void LineLayer::setLineJoin(PropertyValue<LineJoinType> value) {
impl->layout.lineJoin.set(value);
}
+PropertyValue<float> LineLayer::getDefaultLineMiterLimit() {
+ return { 2 };
+}
+
PropertyValue<float> LineLayer::getLineMiterLimit() const {
return impl->layout.lineMiterLimit.get();
}
@@ -79,6 +91,10 @@ PropertyValue<float> LineLayer::getLineMiterLimit() const {
void LineLayer::setLineMiterLimit(PropertyValue<float> value) {
impl->layout.lineMiterLimit.set(value);
}
+PropertyValue<float> LineLayer::getDefaultLineRoundLimit() {
+ return { 1 };
+}
+
PropertyValue<float> LineLayer::getLineRoundLimit() const {
return impl->layout.lineRoundLimit.get();
}
@@ -89,6 +105,10 @@ void LineLayer::setLineRoundLimit(PropertyValue<float> value) {
// Paint properties
+PropertyValue<float> LineLayer::getDefaultLineOpacity() {
+ return { 1 };
+}
+
PropertyValue<float> LineLayer::getLineOpacity() const {
return impl->paint.lineOpacity.get();
}
@@ -97,6 +117,10 @@ void LineLayer::setLineOpacity(PropertyValue<float> value, const optional<std::s
impl->paint.lineOpacity.set(value, klass);
}
+PropertyValue<Color> LineLayer::getDefaultLineColor() {
+ return { Color::black() };
+}
+
PropertyValue<Color> LineLayer::getLineColor() const {
return impl->paint.lineColor.get();
}
@@ -105,6 +129,10 @@ void LineLayer::setLineColor(PropertyValue<Color> value, const optional<std::str
impl->paint.lineColor.set(value, klass);
}
+PropertyValue<std::array<float, 2>> LineLayer::getDefaultLineTranslate() {
+ return { {{ 0, 0 }} };
+}
+
PropertyValue<std::array<float, 2>> LineLayer::getLineTranslate() const {
return impl->paint.lineTranslate.get();
}
@@ -113,6 +141,10 @@ void LineLayer::setLineTranslate(PropertyValue<std::array<float, 2>> value, cons
impl->paint.lineTranslate.set(value, klass);
}
+PropertyValue<TranslateAnchorType> LineLayer::getDefaultLineTranslateAnchor() {
+ return { TranslateAnchorType::Map };
+}
+
PropertyValue<TranslateAnchorType> LineLayer::getLineTranslateAnchor() const {
return impl->paint.lineTranslateAnchor.get();
}
@@ -121,6 +153,10 @@ void LineLayer::setLineTranslateAnchor(PropertyValue<TranslateAnchorType> value,
impl->paint.lineTranslateAnchor.set(value, klass);
}
+PropertyValue<float> LineLayer::getDefaultLineWidth() {
+ return { 1 };
+}
+
PropertyValue<float> LineLayer::getLineWidth() const {
return impl->paint.lineWidth.get();
}
@@ -129,6 +165,10 @@ void LineLayer::setLineWidth(PropertyValue<float> value, const optional<std::str
impl->paint.lineWidth.set(value, klass);
}
+PropertyValue<float> LineLayer::getDefaultLineGapWidth() {
+ return { 0 };
+}
+
PropertyValue<float> LineLayer::getLineGapWidth() const {
return impl->paint.lineGapWidth.get();
}
@@ -137,6 +177,10 @@ void LineLayer::setLineGapWidth(PropertyValue<float> value, const optional<std::
impl->paint.lineGapWidth.set(value, klass);
}
+PropertyValue<float> LineLayer::getDefaultLineOffset() {
+ return { 0 };
+}
+
PropertyValue<float> LineLayer::getLineOffset() const {
return impl->paint.lineOffset.get();
}
@@ -145,6 +189,10 @@ void LineLayer::setLineOffset(PropertyValue<float> value, const optional<std::st
impl->paint.lineOffset.set(value, klass);
}
+PropertyValue<float> LineLayer::getDefaultLineBlur() {
+ return { 0 };
+}
+
PropertyValue<float> LineLayer::getLineBlur() const {
return impl->paint.lineBlur.get();
}
@@ -153,6 +201,10 @@ void LineLayer::setLineBlur(PropertyValue<float> value, const optional<std::stri
impl->paint.lineBlur.set(value, klass);
}
+PropertyValue<std::vector<float>> LineLayer::getDefaultLineDasharray() {
+ return { { } };
+}
+
PropertyValue<std::vector<float>> LineLayer::getLineDasharray() const {
return impl->paint.lineDasharray.get();
}
@@ -161,6 +213,10 @@ void LineLayer::setLineDasharray(PropertyValue<std::vector<float>> value, const
impl->paint.lineDasharray.set(value, klass);
}
+PropertyValue<std::string> LineLayer::getDefaultLinePattern() {
+ return { "" };
+}
+
PropertyValue<std::string> LineLayer::getLinePattern() const {
return impl->paint.linePattern.get();
}
diff --git a/src/mbgl/style/layers/raster_layer.cpp b/src/mbgl/style/layers/raster_layer.cpp
index d4e121babe..fc966f2239 100644
--- a/src/mbgl/style/layers/raster_layer.cpp
+++ b/src/mbgl/style/layers/raster_layer.cpp
@@ -44,6 +44,10 @@ const std::string& RasterLayer::getSourceID() const {
// Paint properties
+PropertyValue<float> RasterLayer::getDefaultRasterOpacity() {
+ return { 1 };
+}
+
PropertyValue<float> RasterLayer::getRasterOpacity() const {
return impl->paint.rasterOpacity.get();
}
@@ -52,6 +56,10 @@ void RasterLayer::setRasterOpacity(PropertyValue<float> value, const optional<st
impl->paint.rasterOpacity.set(value, klass);
}
+PropertyValue<float> RasterLayer::getDefaultRasterHueRotate() {
+ return { 0 };
+}
+
PropertyValue<float> RasterLayer::getRasterHueRotate() const {
return impl->paint.rasterHueRotate.get();
}
@@ -60,6 +68,10 @@ void RasterLayer::setRasterHueRotate(PropertyValue<float> value, const optional<
impl->paint.rasterHueRotate.set(value, klass);
}
+PropertyValue<float> RasterLayer::getDefaultRasterBrightnessMin() {
+ return { 0 };
+}
+
PropertyValue<float> RasterLayer::getRasterBrightnessMin() const {
return impl->paint.rasterBrightnessMin.get();
}
@@ -68,6 +80,10 @@ void RasterLayer::setRasterBrightnessMin(PropertyValue<float> value, const optio
impl->paint.rasterBrightnessMin.set(value, klass);
}
+PropertyValue<float> RasterLayer::getDefaultRasterBrightnessMax() {
+ return { 1 };
+}
+
PropertyValue<float> RasterLayer::getRasterBrightnessMax() const {
return impl->paint.rasterBrightnessMax.get();
}
@@ -76,6 +92,10 @@ void RasterLayer::setRasterBrightnessMax(PropertyValue<float> value, const optio
impl->paint.rasterBrightnessMax.set(value, klass);
}
+PropertyValue<float> RasterLayer::getDefaultRasterSaturation() {
+ return { 0 };
+}
+
PropertyValue<float> RasterLayer::getRasterSaturation() const {
return impl->paint.rasterSaturation.get();
}
@@ -84,6 +104,10 @@ void RasterLayer::setRasterSaturation(PropertyValue<float> value, const optional
impl->paint.rasterSaturation.set(value, klass);
}
+PropertyValue<float> RasterLayer::getDefaultRasterContrast() {
+ return { 0 };
+}
+
PropertyValue<float> RasterLayer::getRasterContrast() const {
return impl->paint.rasterContrast.get();
}
@@ -92,6 +116,10 @@ void RasterLayer::setRasterContrast(PropertyValue<float> value, const optional<s
impl->paint.rasterContrast.set(value, klass);
}
+PropertyValue<float> RasterLayer::getDefaultRasterFadeDuration() {
+ return { 300 };
+}
+
PropertyValue<float> RasterLayer::getRasterFadeDuration() const {
return impl->paint.rasterFadeDuration.get();
}
diff --git a/src/mbgl/style/layers/symbol_layer.cpp b/src/mbgl/style/layers/symbol_layer.cpp
index c26123f0ec..7852969f7b 100644
--- a/src/mbgl/style/layers/symbol_layer.cpp
+++ b/src/mbgl/style/layers/symbol_layer.cpp
@@ -58,6 +58,10 @@ const Filter& SymbolLayer::getFilter() const {
// Layout properties
+PropertyValue<SymbolPlacementType> SymbolLayer::getDefaultSymbolPlacement() {
+ return { SymbolPlacementType::Point };
+}
+
PropertyValue<SymbolPlacementType> SymbolLayer::getSymbolPlacement() const {
return impl->layout.symbolPlacement.get();
}
@@ -65,6 +69,10 @@ PropertyValue<SymbolPlacementType> SymbolLayer::getSymbolPlacement() const {
void SymbolLayer::setSymbolPlacement(PropertyValue<SymbolPlacementType> value) {
impl->layout.symbolPlacement.set(value);
}
+PropertyValue<float> SymbolLayer::getDefaultSymbolSpacing() {
+ return { 250 };
+}
+
PropertyValue<float> SymbolLayer::getSymbolSpacing() const {
return impl->layout.symbolSpacing.get();
}
@@ -72,6 +80,10 @@ PropertyValue<float> SymbolLayer::getSymbolSpacing() const {
void SymbolLayer::setSymbolSpacing(PropertyValue<float> value) {
impl->layout.symbolSpacing.set(value);
}
+PropertyValue<bool> SymbolLayer::getDefaultSymbolAvoidEdges() {
+ return { false };
+}
+
PropertyValue<bool> SymbolLayer::getSymbolAvoidEdges() const {
return impl->layout.symbolAvoidEdges.get();
}
@@ -79,6 +91,10 @@ PropertyValue<bool> SymbolLayer::getSymbolAvoidEdges() const {
void SymbolLayer::setSymbolAvoidEdges(PropertyValue<bool> value) {
impl->layout.symbolAvoidEdges.set(value);
}
+PropertyValue<bool> SymbolLayer::getDefaultIconAllowOverlap() {
+ return { false };
+}
+
PropertyValue<bool> SymbolLayer::getIconAllowOverlap() const {
return impl->layout.iconAllowOverlap.get();
}
@@ -86,6 +102,10 @@ PropertyValue<bool> SymbolLayer::getIconAllowOverlap() const {
void SymbolLayer::setIconAllowOverlap(PropertyValue<bool> value) {
impl->layout.iconAllowOverlap.set(value);
}
+PropertyValue<bool> SymbolLayer::getDefaultIconIgnorePlacement() {
+ return { false };
+}
+
PropertyValue<bool> SymbolLayer::getIconIgnorePlacement() const {
return impl->layout.iconIgnorePlacement.get();
}
@@ -93,6 +113,10 @@ PropertyValue<bool> SymbolLayer::getIconIgnorePlacement() const {
void SymbolLayer::setIconIgnorePlacement(PropertyValue<bool> value) {
impl->layout.iconIgnorePlacement.set(value);
}
+PropertyValue<bool> SymbolLayer::getDefaultIconOptional() {
+ return { false };
+}
+
PropertyValue<bool> SymbolLayer::getIconOptional() const {
return impl->layout.iconOptional.get();
}
@@ -100,6 +124,10 @@ PropertyValue<bool> SymbolLayer::getIconOptional() const {
void SymbolLayer::setIconOptional(PropertyValue<bool> value) {
impl->layout.iconOptional.set(value);
}
+PropertyValue<AlignmentType> SymbolLayer::getDefaultIconRotationAlignment() {
+ return { AlignmentType::Viewport };
+}
+
PropertyValue<AlignmentType> SymbolLayer::getIconRotationAlignment() const {
return impl->layout.iconRotationAlignment.get();
}
@@ -107,6 +135,10 @@ PropertyValue<AlignmentType> SymbolLayer::getIconRotationAlignment() const {
void SymbolLayer::setIconRotationAlignment(PropertyValue<AlignmentType> value) {
impl->layout.iconRotationAlignment.set(value);
}
+PropertyValue<float> SymbolLayer::getDefaultIconSize() {
+ return { 1 };
+}
+
PropertyValue<float> SymbolLayer::getIconSize() const {
return impl->layout.iconSize.get();
}
@@ -114,6 +146,10 @@ PropertyValue<float> SymbolLayer::getIconSize() const {
void SymbolLayer::setIconSize(PropertyValue<float> value) {
impl->layout.iconSize.set(value);
}
+PropertyValue<IconTextFitType> SymbolLayer::getDefaultIconTextFit() {
+ return { IconTextFitType::None };
+}
+
PropertyValue<IconTextFitType> SymbolLayer::getIconTextFit() const {
return impl->layout.iconTextFit.get();
}
@@ -121,6 +157,10 @@ PropertyValue<IconTextFitType> SymbolLayer::getIconTextFit() const {
void SymbolLayer::setIconTextFit(PropertyValue<IconTextFitType> value) {
impl->layout.iconTextFit.set(value);
}
+PropertyValue<std::array<float, 4>> SymbolLayer::getDefaultIconTextFitPadding() {
+ return { {{ 0, 0, 0, 0 }} };
+}
+
PropertyValue<std::array<float, 4>> SymbolLayer::getIconTextFitPadding() const {
return impl->layout.iconTextFitPadding.get();
}
@@ -128,6 +168,10 @@ PropertyValue<std::array<float, 4>> SymbolLayer::getIconTextFitPadding() const {
void SymbolLayer::setIconTextFitPadding(PropertyValue<std::array<float, 4>> value) {
impl->layout.iconTextFitPadding.set(value);
}
+PropertyValue<std::string> SymbolLayer::getDefaultIconImage() {
+ return { "" };
+}
+
PropertyValue<std::string> SymbolLayer::getIconImage() const {
return impl->layout.iconImage.get();
}
@@ -135,6 +179,10 @@ PropertyValue<std::string> SymbolLayer::getIconImage() const {
void SymbolLayer::setIconImage(PropertyValue<std::string> value) {
impl->layout.iconImage.set(value);
}
+PropertyValue<float> SymbolLayer::getDefaultIconRotate() {
+ return { 0 };
+}
+
PropertyValue<float> SymbolLayer::getIconRotate() const {
return impl->layout.iconRotate.get();
}
@@ -142,6 +190,10 @@ PropertyValue<float> SymbolLayer::getIconRotate() const {
void SymbolLayer::setIconRotate(PropertyValue<float> value) {
impl->layout.iconRotate.set(value);
}
+PropertyValue<float> SymbolLayer::getDefaultIconPadding() {
+ return { 2 };
+}
+
PropertyValue<float> SymbolLayer::getIconPadding() const {
return impl->layout.iconPadding.get();
}
@@ -149,6 +201,10 @@ PropertyValue<float> SymbolLayer::getIconPadding() const {
void SymbolLayer::setIconPadding(PropertyValue<float> value) {
impl->layout.iconPadding.set(value);
}
+PropertyValue<bool> SymbolLayer::getDefaultIconKeepUpright() {
+ return { false };
+}
+
PropertyValue<bool> SymbolLayer::getIconKeepUpright() const {
return impl->layout.iconKeepUpright.get();
}
@@ -156,6 +212,10 @@ PropertyValue<bool> SymbolLayer::getIconKeepUpright() const {
void SymbolLayer::setIconKeepUpright(PropertyValue<bool> value) {
impl->layout.iconKeepUpright.set(value);
}
+PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultIconOffset() {
+ return { {{ 0, 0 }} };
+}
+
PropertyValue<std::array<float, 2>> SymbolLayer::getIconOffset() const {
return impl->layout.iconOffset.get();
}
@@ -163,6 +223,10 @@ PropertyValue<std::array<float, 2>> SymbolLayer::getIconOffset() const {
void SymbolLayer::setIconOffset(PropertyValue<std::array<float, 2>> value) {
impl->layout.iconOffset.set(value);
}
+PropertyValue<AlignmentType> SymbolLayer::getDefaultTextPitchAlignment() {
+ return { AlignmentType::Undefined };
+}
+
PropertyValue<AlignmentType> SymbolLayer::getTextPitchAlignment() const {
return impl->layout.textPitchAlignment.get();
}
@@ -170,6 +234,10 @@ PropertyValue<AlignmentType> SymbolLayer::getTextPitchAlignment() const {
void SymbolLayer::setTextPitchAlignment(PropertyValue<AlignmentType> value) {
impl->layout.textPitchAlignment.set(value);
}
+PropertyValue<AlignmentType> SymbolLayer::getDefaultTextRotationAlignment() {
+ return { AlignmentType::Viewport };
+}
+
PropertyValue<AlignmentType> SymbolLayer::getTextRotationAlignment() const {
return impl->layout.textRotationAlignment.get();
}
@@ -177,6 +245,10 @@ PropertyValue<AlignmentType> SymbolLayer::getTextRotationAlignment() const {
void SymbolLayer::setTextRotationAlignment(PropertyValue<AlignmentType> value) {
impl->layout.textRotationAlignment.set(value);
}
+PropertyValue<std::string> SymbolLayer::getDefaultTextField() {
+ return { "" };
+}
+
PropertyValue<std::string> SymbolLayer::getTextField() const {
return impl->layout.textField.get();
}
@@ -184,6 +256,10 @@ PropertyValue<std::string> SymbolLayer::getTextField() const {
void SymbolLayer::setTextField(PropertyValue<std::string> value) {
impl->layout.textField.set(value);
}
+PropertyValue<std::vector<std::string>> SymbolLayer::getDefaultTextFont() {
+ return { { "Open Sans Regular", "Arial Unicode MS Regular" } };
+}
+
PropertyValue<std::vector<std::string>> SymbolLayer::getTextFont() const {
return impl->layout.textFont.get();
}
@@ -191,6 +267,10 @@ PropertyValue<std::vector<std::string>> SymbolLayer::getTextFont() const {
void SymbolLayer::setTextFont(PropertyValue<std::vector<std::string>> value) {
impl->layout.textFont.set(value);
}
+PropertyValue<float> SymbolLayer::getDefaultTextSize() {
+ return { 16 };
+}
+
PropertyValue<float> SymbolLayer::getTextSize() const {
return impl->layout.textSize.get();
}
@@ -198,6 +278,10 @@ PropertyValue<float> SymbolLayer::getTextSize() const {
void SymbolLayer::setTextSize(PropertyValue<float> value) {
impl->layout.textSize.set(value);
}
+PropertyValue<float> SymbolLayer::getDefaultTextMaxWidth() {
+ return { 10 };
+}
+
PropertyValue<float> SymbolLayer::getTextMaxWidth() const {
return impl->layout.textMaxWidth.get();
}
@@ -205,6 +289,10 @@ PropertyValue<float> SymbolLayer::getTextMaxWidth() const {
void SymbolLayer::setTextMaxWidth(PropertyValue<float> value) {
impl->layout.textMaxWidth.set(value);
}
+PropertyValue<float> SymbolLayer::getDefaultTextLineHeight() {
+ return { 1.2 };
+}
+
PropertyValue<float> SymbolLayer::getTextLineHeight() const {
return impl->layout.textLineHeight.get();
}
@@ -212,6 +300,10 @@ PropertyValue<float> SymbolLayer::getTextLineHeight() const {
void SymbolLayer::setTextLineHeight(PropertyValue<float> value) {
impl->layout.textLineHeight.set(value);
}
+PropertyValue<float> SymbolLayer::getDefaultTextLetterSpacing() {
+ return { 0 };
+}
+
PropertyValue<float> SymbolLayer::getTextLetterSpacing() const {
return impl->layout.textLetterSpacing.get();
}
@@ -219,6 +311,10 @@ PropertyValue<float> SymbolLayer::getTextLetterSpacing() const {
void SymbolLayer::setTextLetterSpacing(PropertyValue<float> value) {
impl->layout.textLetterSpacing.set(value);
}
+PropertyValue<TextJustifyType> SymbolLayer::getDefaultTextJustify() {
+ return { TextJustifyType::Center };
+}
+
PropertyValue<TextJustifyType> SymbolLayer::getTextJustify() const {
return impl->layout.textJustify.get();
}
@@ -226,6 +322,10 @@ PropertyValue<TextJustifyType> SymbolLayer::getTextJustify() const {
void SymbolLayer::setTextJustify(PropertyValue<TextJustifyType> value) {
impl->layout.textJustify.set(value);
}
+PropertyValue<TextAnchorType> SymbolLayer::getDefaultTextAnchor() {
+ return { TextAnchorType::Center };
+}
+
PropertyValue<TextAnchorType> SymbolLayer::getTextAnchor() const {
return impl->layout.textAnchor.get();
}
@@ -233,6 +333,10 @@ PropertyValue<TextAnchorType> SymbolLayer::getTextAnchor() const {
void SymbolLayer::setTextAnchor(PropertyValue<TextAnchorType> value) {
impl->layout.textAnchor.set(value);
}
+PropertyValue<float> SymbolLayer::getDefaultTextMaxAngle() {
+ return { 45 };
+}
+
PropertyValue<float> SymbolLayer::getTextMaxAngle() const {
return impl->layout.textMaxAngle.get();
}
@@ -240,6 +344,10 @@ PropertyValue<float> SymbolLayer::getTextMaxAngle() const {
void SymbolLayer::setTextMaxAngle(PropertyValue<float> value) {
impl->layout.textMaxAngle.set(value);
}
+PropertyValue<float> SymbolLayer::getDefaultTextRotate() {
+ return { 0 };
+}
+
PropertyValue<float> SymbolLayer::getTextRotate() const {
return impl->layout.textRotate.get();
}
@@ -247,6 +355,10 @@ PropertyValue<float> SymbolLayer::getTextRotate() const {
void SymbolLayer::setTextRotate(PropertyValue<float> value) {
impl->layout.textRotate.set(value);
}
+PropertyValue<float> SymbolLayer::getDefaultTextPadding() {
+ return { 2 };
+}
+
PropertyValue<float> SymbolLayer::getTextPadding() const {
return impl->layout.textPadding.get();
}
@@ -254,6 +366,10 @@ PropertyValue<float> SymbolLayer::getTextPadding() const {
void SymbolLayer::setTextPadding(PropertyValue<float> value) {
impl->layout.textPadding.set(value);
}
+PropertyValue<bool> SymbolLayer::getDefaultTextKeepUpright() {
+ return { true };
+}
+
PropertyValue<bool> SymbolLayer::getTextKeepUpright() const {
return impl->layout.textKeepUpright.get();
}
@@ -261,6 +377,10 @@ PropertyValue<bool> SymbolLayer::getTextKeepUpright() const {
void SymbolLayer::setTextKeepUpright(PropertyValue<bool> value) {
impl->layout.textKeepUpright.set(value);
}
+PropertyValue<TextTransformType> SymbolLayer::getDefaultTextTransform() {
+ return { TextTransformType::None };
+}
+
PropertyValue<TextTransformType> SymbolLayer::getTextTransform() const {
return impl->layout.textTransform.get();
}
@@ -268,6 +388,10 @@ PropertyValue<TextTransformType> SymbolLayer::getTextTransform() const {
void SymbolLayer::setTextTransform(PropertyValue<TextTransformType> value) {
impl->layout.textTransform.set(value);
}
+PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultTextOffset() {
+ return { {{ 0, 0 }} };
+}
+
PropertyValue<std::array<float, 2>> SymbolLayer::getTextOffset() const {
return impl->layout.textOffset.get();
}
@@ -275,6 +399,10 @@ PropertyValue<std::array<float, 2>> SymbolLayer::getTextOffset() const {
void SymbolLayer::setTextOffset(PropertyValue<std::array<float, 2>> value) {
impl->layout.textOffset.set(value);
}
+PropertyValue<bool> SymbolLayer::getDefaultTextAllowOverlap() {
+ return { false };
+}
+
PropertyValue<bool> SymbolLayer::getTextAllowOverlap() const {
return impl->layout.textAllowOverlap.get();
}
@@ -282,6 +410,10 @@ PropertyValue<bool> SymbolLayer::getTextAllowOverlap() const {
void SymbolLayer::setTextAllowOverlap(PropertyValue<bool> value) {
impl->layout.textAllowOverlap.set(value);
}
+PropertyValue<bool> SymbolLayer::getDefaultTextIgnorePlacement() {
+ return { false };
+}
+
PropertyValue<bool> SymbolLayer::getTextIgnorePlacement() const {
return impl->layout.textIgnorePlacement.get();
}
@@ -289,6 +421,10 @@ PropertyValue<bool> SymbolLayer::getTextIgnorePlacement() const {
void SymbolLayer::setTextIgnorePlacement(PropertyValue<bool> value) {
impl->layout.textIgnorePlacement.set(value);
}
+PropertyValue<bool> SymbolLayer::getDefaultTextOptional() {
+ return { false };
+}
+
PropertyValue<bool> SymbolLayer::getTextOptional() const {
return impl->layout.textOptional.get();
}
@@ -299,6 +435,10 @@ void SymbolLayer::setTextOptional(PropertyValue<bool> value) {
// Paint properties
+PropertyValue<float> SymbolLayer::getDefaultIconOpacity() {
+ return { 1 };
+}
+
PropertyValue<float> SymbolLayer::getIconOpacity() const {
return impl->paint.iconOpacity.get();
}
@@ -307,6 +447,10 @@ void SymbolLayer::setIconOpacity(PropertyValue<float> value, const optional<std:
impl->paint.iconOpacity.set(value, klass);
}
+PropertyValue<Color> SymbolLayer::getDefaultIconColor() {
+ return { Color::black() };
+}
+
PropertyValue<Color> SymbolLayer::getIconColor() const {
return impl->paint.iconColor.get();
}
@@ -315,6 +459,10 @@ void SymbolLayer::setIconColor(PropertyValue<Color> value, const optional<std::s
impl->paint.iconColor.set(value, klass);
}
+PropertyValue<Color> SymbolLayer::getDefaultIconHaloColor() {
+ return { {} };
+}
+
PropertyValue<Color> SymbolLayer::getIconHaloColor() const {
return impl->paint.iconHaloColor.get();
}
@@ -323,6 +471,10 @@ void SymbolLayer::setIconHaloColor(PropertyValue<Color> value, const optional<st
impl->paint.iconHaloColor.set(value, klass);
}
+PropertyValue<float> SymbolLayer::getDefaultIconHaloWidth() {
+ return { 0 };
+}
+
PropertyValue<float> SymbolLayer::getIconHaloWidth() const {
return impl->paint.iconHaloWidth.get();
}
@@ -331,6 +483,10 @@ void SymbolLayer::setIconHaloWidth(PropertyValue<float> value, const optional<st
impl->paint.iconHaloWidth.set(value, klass);
}
+PropertyValue<float> SymbolLayer::getDefaultIconHaloBlur() {
+ return { 0 };
+}
+
PropertyValue<float> SymbolLayer::getIconHaloBlur() const {
return impl->paint.iconHaloBlur.get();
}
@@ -339,6 +495,10 @@ void SymbolLayer::setIconHaloBlur(PropertyValue<float> value, const optional<std
impl->paint.iconHaloBlur.set(value, klass);
}
+PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultIconTranslate() {
+ return { {{ 0, 0 }} };
+}
+
PropertyValue<std::array<float, 2>> SymbolLayer::getIconTranslate() const {
return impl->paint.iconTranslate.get();
}
@@ -347,6 +507,10 @@ void SymbolLayer::setIconTranslate(PropertyValue<std::array<float, 2>> value, co
impl->paint.iconTranslate.set(value, klass);
}
+PropertyValue<TranslateAnchorType> SymbolLayer::getDefaultIconTranslateAnchor() {
+ return { TranslateAnchorType::Map };
+}
+
PropertyValue<TranslateAnchorType> SymbolLayer::getIconTranslateAnchor() const {
return impl->paint.iconTranslateAnchor.get();
}
@@ -355,6 +519,10 @@ void SymbolLayer::setIconTranslateAnchor(PropertyValue<TranslateAnchorType> valu
impl->paint.iconTranslateAnchor.set(value, klass);
}
+PropertyValue<float> SymbolLayer::getDefaultTextOpacity() {
+ return { 1 };
+}
+
PropertyValue<float> SymbolLayer::getTextOpacity() const {
return impl->paint.textOpacity.get();
}
@@ -363,6 +531,10 @@ void SymbolLayer::setTextOpacity(PropertyValue<float> value, const optional<std:
impl->paint.textOpacity.set(value, klass);
}
+PropertyValue<Color> SymbolLayer::getDefaultTextColor() {
+ return { Color::black() };
+}
+
PropertyValue<Color> SymbolLayer::getTextColor() const {
return impl->paint.textColor.get();
}
@@ -371,6 +543,10 @@ void SymbolLayer::setTextColor(PropertyValue<Color> value, const optional<std::s
impl->paint.textColor.set(value, klass);
}
+PropertyValue<Color> SymbolLayer::getDefaultTextHaloColor() {
+ return { {} };
+}
+
PropertyValue<Color> SymbolLayer::getTextHaloColor() const {
return impl->paint.textHaloColor.get();
}
@@ -379,6 +555,10 @@ void SymbolLayer::setTextHaloColor(PropertyValue<Color> value, const optional<st
impl->paint.textHaloColor.set(value, klass);
}
+PropertyValue<float> SymbolLayer::getDefaultTextHaloWidth() {
+ return { 0 };
+}
+
PropertyValue<float> SymbolLayer::getTextHaloWidth() const {
return impl->paint.textHaloWidth.get();
}
@@ -387,6 +567,10 @@ void SymbolLayer::setTextHaloWidth(PropertyValue<float> value, const optional<st
impl->paint.textHaloWidth.set(value, klass);
}
+PropertyValue<float> SymbolLayer::getDefaultTextHaloBlur() {
+ return { 0 };
+}
+
PropertyValue<float> SymbolLayer::getTextHaloBlur() const {
return impl->paint.textHaloBlur.get();
}
@@ -395,6 +579,10 @@ void SymbolLayer::setTextHaloBlur(PropertyValue<float> value, const optional<std
impl->paint.textHaloBlur.set(value, klass);
}
+PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultTextTranslate() {
+ return { {{ 0, 0 }} };
+}
+
PropertyValue<std::array<float, 2>> SymbolLayer::getTextTranslate() const {
return impl->paint.textTranslate.get();
}
@@ -403,6 +591,10 @@ void SymbolLayer::setTextTranslate(PropertyValue<std::array<float, 2>> value, co
impl->paint.textTranslate.set(value, klass);
}
+PropertyValue<TranslateAnchorType> SymbolLayer::getDefaultTextTranslateAnchor() {
+ return { TranslateAnchorType::Map };
+}
+
PropertyValue<TranslateAnchorType> SymbolLayer::getTextTranslateAnchor() const {
return impl->paint.textTranslateAnchor.get();
}