From 63cce78cf1597ba5879227f2298bda52e91e4e04 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 23 Aug 2016 12:49:47 -0700 Subject: [PATCH] [core] Add static getters for property default values (#6124) --- .../mbgl/style/layers/background_layer.hpp | 3 + include/mbgl/style/layers/circle_layer.hpp | 7 + include/mbgl/style/layers/fill_layer.hpp | 7 + include/mbgl/style/layers/layer.hpp.ejs | 2 + include/mbgl/style/layers/line_layer.hpp | 14 ++ include/mbgl/style/layers/raster_layer.hpp | 7 + include/mbgl/style/layers/symbol_layer.hpp | 48 +++++ scripts/generate-style-code.js | 16 +- src/mbgl/style/layers/background_layer.cpp | 12 ++ src/mbgl/style/layers/circle_layer.cpp | 28 +++ src/mbgl/style/layers/fill_layer.cpp | 28 +++ src/mbgl/style/layers/layer.cpp.ejs | 8 + .../style/layers/layer_properties.hpp.ejs | 8 - src/mbgl/style/layers/line_layer.cpp | 56 +++++ src/mbgl/style/layers/raster_layer.cpp | 28 +++ src/mbgl/style/layers/symbol_layer.cpp | 192 ++++++++++++++++++ 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 ac97ec2e6..68aebfd37 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 getDefaultBackgroundColor(); PropertyValue getBackgroundColor() const; void setBackgroundColor(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultBackgroundPattern(); PropertyValue getBackgroundPattern() const; void setBackgroundPattern(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultBackgroundOpacity(); PropertyValue getBackgroundOpacity() const; void setBackgroundOpacity(PropertyValue, const optional& klass = {}); diff --git a/include/mbgl/style/layers/circle_layer.hpp b/include/mbgl/style/layers/circle_layer.hpp index 873f95bcf..39ea61c5f 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 getDefaultCircleRadius(); PropertyValue getCircleRadius() const; void setCircleRadius(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultCircleColor(); PropertyValue getCircleColor() const; void setCircleColor(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultCircleBlur(); PropertyValue getCircleBlur() const; void setCircleBlur(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultCircleOpacity(); PropertyValue getCircleOpacity() const; void setCircleOpacity(PropertyValue, const optional& klass = {}); + static PropertyValue> getDefaultCircleTranslate(); PropertyValue> getCircleTranslate() const; void setCircleTranslate(PropertyValue>, const optional& klass = {}); + static PropertyValue getDefaultCircleTranslateAnchor(); PropertyValue getCircleTranslateAnchor() const; void setCircleTranslateAnchor(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultCirclePitchScale(); PropertyValue getCirclePitchScale() const; void setCirclePitchScale(PropertyValue, const optional& klass = {}); diff --git a/include/mbgl/style/layers/fill_layer.hpp b/include/mbgl/style/layers/fill_layer.hpp index e70d67f53..72bb7c498 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 getDefaultFillAntialias(); PropertyValue getFillAntialias() const; void setFillAntialias(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultFillOpacity(); PropertyValue getFillOpacity() const; void setFillOpacity(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultFillColor(); PropertyValue getFillColor() const; void setFillColor(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultFillOutlineColor(); PropertyValue getFillOutlineColor() const; void setFillOutlineColor(PropertyValue, const optional& klass = {}); + static PropertyValue> getDefaultFillTranslate(); PropertyValue> getFillTranslate() const; void setFillTranslate(PropertyValue>, const optional& klass = {}); + static PropertyValue getDefaultFillTranslateAnchor(); PropertyValue getFillTranslateAnchor() const; void setFillTranslateAnchor(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultFillPattern(); PropertyValue getFillPattern() const; void setFillPattern(PropertyValue, const optional& klass = {}); diff --git a/include/mbgl/style/layers/layer.hpp.ejs b/include/mbgl/style/layers/layer.hpp.ejs index aaae30287..9d542b75b 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& klass = {}); diff --git a/include/mbgl/style/layers/line_layer.hpp b/include/mbgl/style/layers/line_layer.hpp index abcb425b9..8549ad0a6 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 getDefaultLineCap(); PropertyValue getLineCap() const; void setLineCap(PropertyValue); + static PropertyValue getDefaultLineJoin(); PropertyValue getLineJoin() const; void setLineJoin(PropertyValue); + static PropertyValue getDefaultLineMiterLimit(); PropertyValue getLineMiterLimit() const; void setLineMiterLimit(PropertyValue); + static PropertyValue getDefaultLineRoundLimit(); PropertyValue getLineRoundLimit() const; void setLineRoundLimit(PropertyValue); // Paint properties + static PropertyValue getDefaultLineOpacity(); PropertyValue getLineOpacity() const; void setLineOpacity(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultLineColor(); PropertyValue getLineColor() const; void setLineColor(PropertyValue, const optional& klass = {}); + static PropertyValue> getDefaultLineTranslate(); PropertyValue> getLineTranslate() const; void setLineTranslate(PropertyValue>, const optional& klass = {}); + static PropertyValue getDefaultLineTranslateAnchor(); PropertyValue getLineTranslateAnchor() const; void setLineTranslateAnchor(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultLineWidth(); PropertyValue getLineWidth() const; void setLineWidth(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultLineGapWidth(); PropertyValue getLineGapWidth() const; void setLineGapWidth(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultLineOffset(); PropertyValue getLineOffset() const; void setLineOffset(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultLineBlur(); PropertyValue getLineBlur() const; void setLineBlur(PropertyValue, const optional& klass = {}); + static PropertyValue> getDefaultLineDasharray(); PropertyValue> getLineDasharray() const; void setLineDasharray(PropertyValue>, const optional& klass = {}); + static PropertyValue getDefaultLinePattern(); PropertyValue getLinePattern() const; void setLinePattern(PropertyValue, const optional& klass = {}); diff --git a/include/mbgl/style/layers/raster_layer.hpp b/include/mbgl/style/layers/raster_layer.hpp index dea0c26bf..c5479bd2a 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 getDefaultRasterOpacity(); PropertyValue getRasterOpacity() const; void setRasterOpacity(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultRasterHueRotate(); PropertyValue getRasterHueRotate() const; void setRasterHueRotate(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultRasterBrightnessMin(); PropertyValue getRasterBrightnessMin() const; void setRasterBrightnessMin(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultRasterBrightnessMax(); PropertyValue getRasterBrightnessMax() const; void setRasterBrightnessMax(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultRasterSaturation(); PropertyValue getRasterSaturation() const; void setRasterSaturation(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultRasterContrast(); PropertyValue getRasterContrast() const; void setRasterContrast(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultRasterFadeDuration(); PropertyValue getRasterFadeDuration() const; void setRasterFadeDuration(PropertyValue, const optional& klass = {}); diff --git a/include/mbgl/style/layers/symbol_layer.hpp b/include/mbgl/style/layers/symbol_layer.hpp index 77b63d9b9..5d1882fd4 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 getDefaultSymbolPlacement(); PropertyValue getSymbolPlacement() const; void setSymbolPlacement(PropertyValue); + static PropertyValue getDefaultSymbolSpacing(); PropertyValue getSymbolSpacing() const; void setSymbolSpacing(PropertyValue); + static PropertyValue getDefaultSymbolAvoidEdges(); PropertyValue getSymbolAvoidEdges() const; void setSymbolAvoidEdges(PropertyValue); + static PropertyValue getDefaultIconAllowOverlap(); PropertyValue getIconAllowOverlap() const; void setIconAllowOverlap(PropertyValue); + static PropertyValue getDefaultIconIgnorePlacement(); PropertyValue getIconIgnorePlacement() const; void setIconIgnorePlacement(PropertyValue); + static PropertyValue getDefaultIconOptional(); PropertyValue getIconOptional() const; void setIconOptional(PropertyValue); + static PropertyValue getDefaultIconRotationAlignment(); PropertyValue getIconRotationAlignment() const; void setIconRotationAlignment(PropertyValue); + static PropertyValue getDefaultIconSize(); PropertyValue getIconSize() const; void setIconSize(PropertyValue); + static PropertyValue getDefaultIconTextFit(); PropertyValue getIconTextFit() const; void setIconTextFit(PropertyValue); + static PropertyValue> getDefaultIconTextFitPadding(); PropertyValue> getIconTextFitPadding() const; void setIconTextFitPadding(PropertyValue>); + static PropertyValue getDefaultIconImage(); PropertyValue getIconImage() const; void setIconImage(PropertyValue); + static PropertyValue getDefaultIconRotate(); PropertyValue getIconRotate() const; void setIconRotate(PropertyValue); + static PropertyValue getDefaultIconPadding(); PropertyValue getIconPadding() const; void setIconPadding(PropertyValue); + static PropertyValue getDefaultIconKeepUpright(); PropertyValue getIconKeepUpright() const; void setIconKeepUpright(PropertyValue); + static PropertyValue> getDefaultIconOffset(); PropertyValue> getIconOffset() const; void setIconOffset(PropertyValue>); + static PropertyValue getDefaultTextPitchAlignment(); PropertyValue getTextPitchAlignment() const; void setTextPitchAlignment(PropertyValue); + static PropertyValue getDefaultTextRotationAlignment(); PropertyValue getTextRotationAlignment() const; void setTextRotationAlignment(PropertyValue); + static PropertyValue getDefaultTextField(); PropertyValue getTextField() const; void setTextField(PropertyValue); + static PropertyValue> getDefaultTextFont(); PropertyValue> getTextFont() const; void setTextFont(PropertyValue>); + static PropertyValue getDefaultTextSize(); PropertyValue getTextSize() const; void setTextSize(PropertyValue); + static PropertyValue getDefaultTextMaxWidth(); PropertyValue getTextMaxWidth() const; void setTextMaxWidth(PropertyValue); + static PropertyValue getDefaultTextLineHeight(); PropertyValue getTextLineHeight() const; void setTextLineHeight(PropertyValue); + static PropertyValue getDefaultTextLetterSpacing(); PropertyValue getTextLetterSpacing() const; void setTextLetterSpacing(PropertyValue); + static PropertyValue getDefaultTextJustify(); PropertyValue getTextJustify() const; void setTextJustify(PropertyValue); + static PropertyValue getDefaultTextAnchor(); PropertyValue getTextAnchor() const; void setTextAnchor(PropertyValue); + static PropertyValue getDefaultTextMaxAngle(); PropertyValue getTextMaxAngle() const; void setTextMaxAngle(PropertyValue); + static PropertyValue getDefaultTextRotate(); PropertyValue getTextRotate() const; void setTextRotate(PropertyValue); + static PropertyValue getDefaultTextPadding(); PropertyValue getTextPadding() const; void setTextPadding(PropertyValue); + static PropertyValue getDefaultTextKeepUpright(); PropertyValue getTextKeepUpright() const; void setTextKeepUpright(PropertyValue); + static PropertyValue getDefaultTextTransform(); PropertyValue getTextTransform() const; void setTextTransform(PropertyValue); + static PropertyValue> getDefaultTextOffset(); PropertyValue> getTextOffset() const; void setTextOffset(PropertyValue>); + static PropertyValue getDefaultTextAllowOverlap(); PropertyValue getTextAllowOverlap() const; void setTextAllowOverlap(PropertyValue); + static PropertyValue getDefaultTextIgnorePlacement(); PropertyValue getTextIgnorePlacement() const; void setTextIgnorePlacement(PropertyValue); + static PropertyValue getDefaultTextOptional(); PropertyValue getTextOptional() const; void setTextOptional(PropertyValue); // Paint properties + static PropertyValue getDefaultIconOpacity(); PropertyValue getIconOpacity() const; void setIconOpacity(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultIconColor(); PropertyValue getIconColor() const; void setIconColor(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultIconHaloColor(); PropertyValue getIconHaloColor() const; void setIconHaloColor(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultIconHaloWidth(); PropertyValue getIconHaloWidth() const; void setIconHaloWidth(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultIconHaloBlur(); PropertyValue getIconHaloBlur() const; void setIconHaloBlur(PropertyValue, const optional& klass = {}); + static PropertyValue> getDefaultIconTranslate(); PropertyValue> getIconTranslate() const; void setIconTranslate(PropertyValue>, const optional& klass = {}); + static PropertyValue getDefaultIconTranslateAnchor(); PropertyValue getIconTranslateAnchor() const; void setIconTranslateAnchor(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultTextOpacity(); PropertyValue getTextOpacity() const; void setTextOpacity(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultTextColor(); PropertyValue getTextColor() const; void setTextColor(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultTextHaloColor(); PropertyValue getTextHaloColor() const; void setTextHaloColor(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultTextHaloWidth(); PropertyValue getTextHaloWidth() const; void setTextHaloWidth(PropertyValue, const optional& klass = {}); + static PropertyValue getDefaultTextHaloBlur(); PropertyValue getTextHaloBlur() const; void setTextHaloBlur(PropertyValue, const optional& klass = {}); + static PropertyValue> getDefaultTextTranslate(); PropertyValue> getTextTranslate() const; void setTextTranslate(PropertyValue>, const optional& klass = {}); + static PropertyValue getDefaultTextTranslateAnchor(); PropertyValue getTextTranslateAnchor() const; void setTextTranslateAnchor(PropertyValue, const optional& klass = {}); diff --git a/scripts/generate-style-code.js b/scripts/generate-style-code.js index 2a25f3711..4c5f148a0 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 42cd76d01..e5747e07c 100644 --- a/src/mbgl/style/layers/background_layer.cpp +++ b/src/mbgl/style/layers/background_layer.cpp @@ -37,6 +37,10 @@ std::unique_ptr BackgroundLayer::Impl::cloneRef(const std::string& id_) c // Paint properties +PropertyValue BackgroundLayer::getDefaultBackgroundColor() { + return { Color::black() }; +} + PropertyValue BackgroundLayer::getBackgroundColor() const { return impl->paint.backgroundColor.get(); } @@ -45,6 +49,10 @@ void BackgroundLayer::setBackgroundColor(PropertyValue value, const optio impl->paint.backgroundColor.set(value, klass); } +PropertyValue BackgroundLayer::getDefaultBackgroundPattern() { + return { "" }; +} + PropertyValue BackgroundLayer::getBackgroundPattern() const { return impl->paint.backgroundPattern.get(); } @@ -53,6 +61,10 @@ void BackgroundLayer::setBackgroundPattern(PropertyValue value, con impl->paint.backgroundPattern.set(value, klass); } +PropertyValue BackgroundLayer::getDefaultBackgroundOpacity() { + return { 1 }; +} + PropertyValue 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 96cc0b610..271a573f0 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 CircleLayer::getDefaultCircleRadius() { + return { 5 }; +} + PropertyValue CircleLayer::getCircleRadius() const { return impl->paint.circleRadius.get(); } @@ -69,6 +73,10 @@ void CircleLayer::setCircleRadius(PropertyValue value, const optionalpaint.circleRadius.set(value, klass); } +PropertyValue CircleLayer::getDefaultCircleColor() { + return { Color::black() }; +} + PropertyValue CircleLayer::getCircleColor() const { return impl->paint.circleColor.get(); } @@ -77,6 +85,10 @@ void CircleLayer::setCircleColor(PropertyValue value, const optionalpaint.circleColor.set(value, klass); } +PropertyValue CircleLayer::getDefaultCircleBlur() { + return { 0 }; +} + PropertyValue CircleLayer::getCircleBlur() const { return impl->paint.circleBlur.get(); } @@ -85,6 +97,10 @@ void CircleLayer::setCircleBlur(PropertyValue value, const optionalpaint.circleBlur.set(value, klass); } +PropertyValue CircleLayer::getDefaultCircleOpacity() { + return { 1 }; +} + PropertyValue CircleLayer::getCircleOpacity() const { return impl->paint.circleOpacity.get(); } @@ -93,6 +109,10 @@ void CircleLayer::setCircleOpacity(PropertyValue value, const optionalpaint.circleOpacity.set(value, klass); } +PropertyValue> CircleLayer::getDefaultCircleTranslate() { + return { {{ 0, 0 }} }; +} + PropertyValue> CircleLayer::getCircleTranslate() const { return impl->paint.circleTranslate.get(); } @@ -101,6 +121,10 @@ void CircleLayer::setCircleTranslate(PropertyValue> value, impl->paint.circleTranslate.set(value, klass); } +PropertyValue CircleLayer::getDefaultCircleTranslateAnchor() { + return { TranslateAnchorType::Map }; +} + PropertyValue CircleLayer::getCircleTranslateAnchor() const { return impl->paint.circleTranslateAnchor.get(); } @@ -109,6 +133,10 @@ void CircleLayer::setCircleTranslateAnchor(PropertyValue va impl->paint.circleTranslateAnchor.set(value, klass); } +PropertyValue CircleLayer::getDefaultCirclePitchScale() { + return { CirclePitchScaleType::Map }; +} + PropertyValue 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 44894aff3..36febd77e 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 FillLayer::getDefaultFillAntialias() { + return { true }; +} + PropertyValue FillLayer::getFillAntialias() const { return impl->paint.fillAntialias.get(); } @@ -69,6 +73,10 @@ void FillLayer::setFillAntialias(PropertyValue value, const optionalpaint.fillAntialias.set(value, klass); } +PropertyValue FillLayer::getDefaultFillOpacity() { + return { 1 }; +} + PropertyValue FillLayer::getFillOpacity() const { return impl->paint.fillOpacity.get(); } @@ -77,6 +85,10 @@ void FillLayer::setFillOpacity(PropertyValue value, const optionalpaint.fillOpacity.set(value, klass); } +PropertyValue FillLayer::getDefaultFillColor() { + return { Color::black() }; +} + PropertyValue FillLayer::getFillColor() const { return impl->paint.fillColor.get(); } @@ -85,6 +97,10 @@ void FillLayer::setFillColor(PropertyValue value, const optionalpaint.fillColor.set(value, klass); } +PropertyValue FillLayer::getDefaultFillOutlineColor() { + return { {} }; +} + PropertyValue FillLayer::getFillOutlineColor() const { return impl->paint.fillOutlineColor.get(); } @@ -93,6 +109,10 @@ void FillLayer::setFillOutlineColor(PropertyValue value, const optionalpaint.fillOutlineColor.set(value, klass); } +PropertyValue> FillLayer::getDefaultFillTranslate() { + return { {{ 0, 0 }} }; +} + PropertyValue> FillLayer::getFillTranslate() const { return impl->paint.fillTranslate.get(); } @@ -101,6 +121,10 @@ void FillLayer::setFillTranslate(PropertyValue> value, cons impl->paint.fillTranslate.set(value, klass); } +PropertyValue FillLayer::getDefaultFillTranslateAnchor() { + return { TranslateAnchorType::Map }; +} + PropertyValue FillLayer::getFillTranslateAnchor() const { return impl->paint.fillTranslateAnchor.get(); } @@ -109,6 +133,10 @@ void FillLayer::setFillTranslateAnchor(PropertyValue value, impl->paint.fillTranslateAnchor.set(value, klass); } +PropertyValue FillLayer::getDefaultFillPattern() { + return { "" }; +} + PropertyValue 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 017691c8e..16a137a00 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 6ec92703f..0c91ecba8 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 3ad72cda1..1594985b6 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 LineLayer::getDefaultLineCap() { + return { LineCapType::Butt }; +} + PropertyValue LineLayer::getLineCap() const { return impl->layout.lineCap.get(); } @@ -65,6 +69,10 @@ PropertyValue LineLayer::getLineCap() const { void LineLayer::setLineCap(PropertyValue value) { impl->layout.lineCap.set(value); } +PropertyValue LineLayer::getDefaultLineJoin() { + return { LineJoinType::Miter }; +} + PropertyValue LineLayer::getLineJoin() const { return impl->layout.lineJoin.get(); } @@ -72,6 +80,10 @@ PropertyValue LineLayer::getLineJoin() const { void LineLayer::setLineJoin(PropertyValue value) { impl->layout.lineJoin.set(value); } +PropertyValue LineLayer::getDefaultLineMiterLimit() { + return { 2 }; +} + PropertyValue LineLayer::getLineMiterLimit() const { return impl->layout.lineMiterLimit.get(); } @@ -79,6 +91,10 @@ PropertyValue LineLayer::getLineMiterLimit() const { void LineLayer::setLineMiterLimit(PropertyValue value) { impl->layout.lineMiterLimit.set(value); } +PropertyValue LineLayer::getDefaultLineRoundLimit() { + return { 1 }; +} + PropertyValue LineLayer::getLineRoundLimit() const { return impl->layout.lineRoundLimit.get(); } @@ -89,6 +105,10 @@ void LineLayer::setLineRoundLimit(PropertyValue value) { // Paint properties +PropertyValue LineLayer::getDefaultLineOpacity() { + return { 1 }; +} + PropertyValue LineLayer::getLineOpacity() const { return impl->paint.lineOpacity.get(); } @@ -97,6 +117,10 @@ void LineLayer::setLineOpacity(PropertyValue value, const optionalpaint.lineOpacity.set(value, klass); } +PropertyValue LineLayer::getDefaultLineColor() { + return { Color::black() }; +} + PropertyValue LineLayer::getLineColor() const { return impl->paint.lineColor.get(); } @@ -105,6 +129,10 @@ void LineLayer::setLineColor(PropertyValue value, const optionalpaint.lineColor.set(value, klass); } +PropertyValue> LineLayer::getDefaultLineTranslate() { + return { {{ 0, 0 }} }; +} + PropertyValue> LineLayer::getLineTranslate() const { return impl->paint.lineTranslate.get(); } @@ -113,6 +141,10 @@ void LineLayer::setLineTranslate(PropertyValue> value, cons impl->paint.lineTranslate.set(value, klass); } +PropertyValue LineLayer::getDefaultLineTranslateAnchor() { + return { TranslateAnchorType::Map }; +} + PropertyValue LineLayer::getLineTranslateAnchor() const { return impl->paint.lineTranslateAnchor.get(); } @@ -121,6 +153,10 @@ void LineLayer::setLineTranslateAnchor(PropertyValue value, impl->paint.lineTranslateAnchor.set(value, klass); } +PropertyValue LineLayer::getDefaultLineWidth() { + return { 1 }; +} + PropertyValue LineLayer::getLineWidth() const { return impl->paint.lineWidth.get(); } @@ -129,6 +165,10 @@ void LineLayer::setLineWidth(PropertyValue value, const optionalpaint.lineWidth.set(value, klass); } +PropertyValue LineLayer::getDefaultLineGapWidth() { + return { 0 }; +} + PropertyValue LineLayer::getLineGapWidth() const { return impl->paint.lineGapWidth.get(); } @@ -137,6 +177,10 @@ void LineLayer::setLineGapWidth(PropertyValue value, const optionalpaint.lineGapWidth.set(value, klass); } +PropertyValue LineLayer::getDefaultLineOffset() { + return { 0 }; +} + PropertyValue LineLayer::getLineOffset() const { return impl->paint.lineOffset.get(); } @@ -145,6 +189,10 @@ void LineLayer::setLineOffset(PropertyValue value, const optionalpaint.lineOffset.set(value, klass); } +PropertyValue LineLayer::getDefaultLineBlur() { + return { 0 }; +} + PropertyValue LineLayer::getLineBlur() const { return impl->paint.lineBlur.get(); } @@ -153,6 +201,10 @@ void LineLayer::setLineBlur(PropertyValue value, const optionalpaint.lineBlur.set(value, klass); } +PropertyValue> LineLayer::getDefaultLineDasharray() { + return { { } }; +} + PropertyValue> LineLayer::getLineDasharray() const { return impl->paint.lineDasharray.get(); } @@ -161,6 +213,10 @@ void LineLayer::setLineDasharray(PropertyValue> value, const impl->paint.lineDasharray.set(value, klass); } +PropertyValue LineLayer::getDefaultLinePattern() { + return { "" }; +} + PropertyValue 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 d4e121bab..fc966f223 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 RasterLayer::getDefaultRasterOpacity() { + return { 1 }; +} + PropertyValue RasterLayer::getRasterOpacity() const { return impl->paint.rasterOpacity.get(); } @@ -52,6 +56,10 @@ void RasterLayer::setRasterOpacity(PropertyValue value, const optionalpaint.rasterOpacity.set(value, klass); } +PropertyValue RasterLayer::getDefaultRasterHueRotate() { + return { 0 }; +} + PropertyValue RasterLayer::getRasterHueRotate() const { return impl->paint.rasterHueRotate.get(); } @@ -60,6 +68,10 @@ void RasterLayer::setRasterHueRotate(PropertyValue value, const optional< impl->paint.rasterHueRotate.set(value, klass); } +PropertyValue RasterLayer::getDefaultRasterBrightnessMin() { + return { 0 }; +} + PropertyValue RasterLayer::getRasterBrightnessMin() const { return impl->paint.rasterBrightnessMin.get(); } @@ -68,6 +80,10 @@ void RasterLayer::setRasterBrightnessMin(PropertyValue value, const optio impl->paint.rasterBrightnessMin.set(value, klass); } +PropertyValue RasterLayer::getDefaultRasterBrightnessMax() { + return { 1 }; +} + PropertyValue RasterLayer::getRasterBrightnessMax() const { return impl->paint.rasterBrightnessMax.get(); } @@ -76,6 +92,10 @@ void RasterLayer::setRasterBrightnessMax(PropertyValue value, const optio impl->paint.rasterBrightnessMax.set(value, klass); } +PropertyValue RasterLayer::getDefaultRasterSaturation() { + return { 0 }; +} + PropertyValue RasterLayer::getRasterSaturation() const { return impl->paint.rasterSaturation.get(); } @@ -84,6 +104,10 @@ void RasterLayer::setRasterSaturation(PropertyValue value, const optional impl->paint.rasterSaturation.set(value, klass); } +PropertyValue RasterLayer::getDefaultRasterContrast() { + return { 0 }; +} + PropertyValue RasterLayer::getRasterContrast() const { return impl->paint.rasterContrast.get(); } @@ -92,6 +116,10 @@ void RasterLayer::setRasterContrast(PropertyValue value, const optionalpaint.rasterContrast.set(value, klass); } +PropertyValue RasterLayer::getDefaultRasterFadeDuration() { + return { 300 }; +} + PropertyValue 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 c26123f0e..7852969f7 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 SymbolLayer::getDefaultSymbolPlacement() { + return { SymbolPlacementType::Point }; +} + PropertyValue SymbolLayer::getSymbolPlacement() const { return impl->layout.symbolPlacement.get(); } @@ -65,6 +69,10 @@ PropertyValue SymbolLayer::getSymbolPlacement() const { void SymbolLayer::setSymbolPlacement(PropertyValue value) { impl->layout.symbolPlacement.set(value); } +PropertyValue SymbolLayer::getDefaultSymbolSpacing() { + return { 250 }; +} + PropertyValue SymbolLayer::getSymbolSpacing() const { return impl->layout.symbolSpacing.get(); } @@ -72,6 +80,10 @@ PropertyValue SymbolLayer::getSymbolSpacing() const { void SymbolLayer::setSymbolSpacing(PropertyValue value) { impl->layout.symbolSpacing.set(value); } +PropertyValue SymbolLayer::getDefaultSymbolAvoidEdges() { + return { false }; +} + PropertyValue SymbolLayer::getSymbolAvoidEdges() const { return impl->layout.symbolAvoidEdges.get(); } @@ -79,6 +91,10 @@ PropertyValue SymbolLayer::getSymbolAvoidEdges() const { void SymbolLayer::setSymbolAvoidEdges(PropertyValue value) { impl->layout.symbolAvoidEdges.set(value); } +PropertyValue SymbolLayer::getDefaultIconAllowOverlap() { + return { false }; +} + PropertyValue SymbolLayer::getIconAllowOverlap() const { return impl->layout.iconAllowOverlap.get(); } @@ -86,6 +102,10 @@ PropertyValue SymbolLayer::getIconAllowOverlap() const { void SymbolLayer::setIconAllowOverlap(PropertyValue value) { impl->layout.iconAllowOverlap.set(value); } +PropertyValue SymbolLayer::getDefaultIconIgnorePlacement() { + return { false }; +} + PropertyValue SymbolLayer::getIconIgnorePlacement() const { return impl->layout.iconIgnorePlacement.get(); } @@ -93,6 +113,10 @@ PropertyValue SymbolLayer::getIconIgnorePlacement() const { void SymbolLayer::setIconIgnorePlacement(PropertyValue value) { impl->layout.iconIgnorePlacement.set(value); } +PropertyValue SymbolLayer::getDefaultIconOptional() { + return { false }; +} + PropertyValue SymbolLayer::getIconOptional() const { return impl->layout.iconOptional.get(); } @@ -100,6 +124,10 @@ PropertyValue SymbolLayer::getIconOptional() const { void SymbolLayer::setIconOptional(PropertyValue value) { impl->layout.iconOptional.set(value); } +PropertyValue SymbolLayer::getDefaultIconRotationAlignment() { + return { AlignmentType::Viewport }; +} + PropertyValue SymbolLayer::getIconRotationAlignment() const { return impl->layout.iconRotationAlignment.get(); } @@ -107,6 +135,10 @@ PropertyValue SymbolLayer::getIconRotationAlignment() const { void SymbolLayer::setIconRotationAlignment(PropertyValue value) { impl->layout.iconRotationAlignment.set(value); } +PropertyValue SymbolLayer::getDefaultIconSize() { + return { 1 }; +} + PropertyValue SymbolLayer::getIconSize() const { return impl->layout.iconSize.get(); } @@ -114,6 +146,10 @@ PropertyValue SymbolLayer::getIconSize() const { void SymbolLayer::setIconSize(PropertyValue value) { impl->layout.iconSize.set(value); } +PropertyValue SymbolLayer::getDefaultIconTextFit() { + return { IconTextFitType::None }; +} + PropertyValue SymbolLayer::getIconTextFit() const { return impl->layout.iconTextFit.get(); } @@ -121,6 +157,10 @@ PropertyValue SymbolLayer::getIconTextFit() const { void SymbolLayer::setIconTextFit(PropertyValue value) { impl->layout.iconTextFit.set(value); } +PropertyValue> SymbolLayer::getDefaultIconTextFitPadding() { + return { {{ 0, 0, 0, 0 }} }; +} + PropertyValue> SymbolLayer::getIconTextFitPadding() const { return impl->layout.iconTextFitPadding.get(); } @@ -128,6 +168,10 @@ PropertyValue> SymbolLayer::getIconTextFitPadding() const { void SymbolLayer::setIconTextFitPadding(PropertyValue> value) { impl->layout.iconTextFitPadding.set(value); } +PropertyValue SymbolLayer::getDefaultIconImage() { + return { "" }; +} + PropertyValue SymbolLayer::getIconImage() const { return impl->layout.iconImage.get(); } @@ -135,6 +179,10 @@ PropertyValue SymbolLayer::getIconImage() const { void SymbolLayer::setIconImage(PropertyValue value) { impl->layout.iconImage.set(value); } +PropertyValue SymbolLayer::getDefaultIconRotate() { + return { 0 }; +} + PropertyValue SymbolLayer::getIconRotate() const { return impl->layout.iconRotate.get(); } @@ -142,6 +190,10 @@ PropertyValue SymbolLayer::getIconRotate() const { void SymbolLayer::setIconRotate(PropertyValue value) { impl->layout.iconRotate.set(value); } +PropertyValue SymbolLayer::getDefaultIconPadding() { + return { 2 }; +} + PropertyValue SymbolLayer::getIconPadding() const { return impl->layout.iconPadding.get(); } @@ -149,6 +201,10 @@ PropertyValue SymbolLayer::getIconPadding() const { void SymbolLayer::setIconPadding(PropertyValue value) { impl->layout.iconPadding.set(value); } +PropertyValue SymbolLayer::getDefaultIconKeepUpright() { + return { false }; +} + PropertyValue SymbolLayer::getIconKeepUpright() const { return impl->layout.iconKeepUpright.get(); } @@ -156,6 +212,10 @@ PropertyValue SymbolLayer::getIconKeepUpright() const { void SymbolLayer::setIconKeepUpright(PropertyValue value) { impl->layout.iconKeepUpright.set(value); } +PropertyValue> SymbolLayer::getDefaultIconOffset() { + return { {{ 0, 0 }} }; +} + PropertyValue> SymbolLayer::getIconOffset() const { return impl->layout.iconOffset.get(); } @@ -163,6 +223,10 @@ PropertyValue> SymbolLayer::getIconOffset() const { void SymbolLayer::setIconOffset(PropertyValue> value) { impl->layout.iconOffset.set(value); } +PropertyValue SymbolLayer::getDefaultTextPitchAlignment() { + return { AlignmentType::Undefined }; +} + PropertyValue SymbolLayer::getTextPitchAlignment() const { return impl->layout.textPitchAlignment.get(); } @@ -170,6 +234,10 @@ PropertyValue SymbolLayer::getTextPitchAlignment() const { void SymbolLayer::setTextPitchAlignment(PropertyValue value) { impl->layout.textPitchAlignment.set(value); } +PropertyValue SymbolLayer::getDefaultTextRotationAlignment() { + return { AlignmentType::Viewport }; +} + PropertyValue SymbolLayer::getTextRotationAlignment() const { return impl->layout.textRotationAlignment.get(); } @@ -177,6 +245,10 @@ PropertyValue SymbolLayer::getTextRotationAlignment() const { void SymbolLayer::setTextRotationAlignment(PropertyValue value) { impl->layout.textRotationAlignment.set(value); } +PropertyValue SymbolLayer::getDefaultTextField() { + return { "" }; +} + PropertyValue SymbolLayer::getTextField() const { return impl->layout.textField.get(); } @@ -184,6 +256,10 @@ PropertyValue SymbolLayer::getTextField() const { void SymbolLayer::setTextField(PropertyValue value) { impl->layout.textField.set(value); } +PropertyValue> SymbolLayer::getDefaultTextFont() { + return { { "Open Sans Regular", "Arial Unicode MS Regular" } }; +} + PropertyValue> SymbolLayer::getTextFont() const { return impl->layout.textFont.get(); } @@ -191,6 +267,10 @@ PropertyValue> SymbolLayer::getTextFont() const { void SymbolLayer::setTextFont(PropertyValue> value) { impl->layout.textFont.set(value); } +PropertyValue SymbolLayer::getDefaultTextSize() { + return { 16 }; +} + PropertyValue SymbolLayer::getTextSize() const { return impl->layout.textSize.get(); } @@ -198,6 +278,10 @@ PropertyValue SymbolLayer::getTextSize() const { void SymbolLayer::setTextSize(PropertyValue value) { impl->layout.textSize.set(value); } +PropertyValue SymbolLayer::getDefaultTextMaxWidth() { + return { 10 }; +} + PropertyValue SymbolLayer::getTextMaxWidth() const { return impl->layout.textMaxWidth.get(); } @@ -205,6 +289,10 @@ PropertyValue SymbolLayer::getTextMaxWidth() const { void SymbolLayer::setTextMaxWidth(PropertyValue value) { impl->layout.textMaxWidth.set(value); } +PropertyValue SymbolLayer::getDefaultTextLineHeight() { + return { 1.2 }; +} + PropertyValue SymbolLayer::getTextLineHeight() const { return impl->layout.textLineHeight.get(); } @@ -212,6 +300,10 @@ PropertyValue SymbolLayer::getTextLineHeight() const { void SymbolLayer::setTextLineHeight(PropertyValue value) { impl->layout.textLineHeight.set(value); } +PropertyValue SymbolLayer::getDefaultTextLetterSpacing() { + return { 0 }; +} + PropertyValue SymbolLayer::getTextLetterSpacing() const { return impl->layout.textLetterSpacing.get(); } @@ -219,6 +311,10 @@ PropertyValue SymbolLayer::getTextLetterSpacing() const { void SymbolLayer::setTextLetterSpacing(PropertyValue value) { impl->layout.textLetterSpacing.set(value); } +PropertyValue SymbolLayer::getDefaultTextJustify() { + return { TextJustifyType::Center }; +} + PropertyValue SymbolLayer::getTextJustify() const { return impl->layout.textJustify.get(); } @@ -226,6 +322,10 @@ PropertyValue SymbolLayer::getTextJustify() const { void SymbolLayer::setTextJustify(PropertyValue value) { impl->layout.textJustify.set(value); } +PropertyValue SymbolLayer::getDefaultTextAnchor() { + return { TextAnchorType::Center }; +} + PropertyValue SymbolLayer::getTextAnchor() const { return impl->layout.textAnchor.get(); } @@ -233,6 +333,10 @@ PropertyValue SymbolLayer::getTextAnchor() const { void SymbolLayer::setTextAnchor(PropertyValue value) { impl->layout.textAnchor.set(value); } +PropertyValue SymbolLayer::getDefaultTextMaxAngle() { + return { 45 }; +} + PropertyValue SymbolLayer::getTextMaxAngle() const { return impl->layout.textMaxAngle.get(); } @@ -240,6 +344,10 @@ PropertyValue SymbolLayer::getTextMaxAngle() const { void SymbolLayer::setTextMaxAngle(PropertyValue value) { impl->layout.textMaxAngle.set(value); } +PropertyValue SymbolLayer::getDefaultTextRotate() { + return { 0 }; +} + PropertyValue SymbolLayer::getTextRotate() const { return impl->layout.textRotate.get(); } @@ -247,6 +355,10 @@ PropertyValue SymbolLayer::getTextRotate() const { void SymbolLayer::setTextRotate(PropertyValue value) { impl->layout.textRotate.set(value); } +PropertyValue SymbolLayer::getDefaultTextPadding() { + return { 2 }; +} + PropertyValue SymbolLayer::getTextPadding() const { return impl->layout.textPadding.get(); } @@ -254,6 +366,10 @@ PropertyValue SymbolLayer::getTextPadding() const { void SymbolLayer::setTextPadding(PropertyValue value) { impl->layout.textPadding.set(value); } +PropertyValue SymbolLayer::getDefaultTextKeepUpright() { + return { true }; +} + PropertyValue SymbolLayer::getTextKeepUpright() const { return impl->layout.textKeepUpright.get(); } @@ -261,6 +377,10 @@ PropertyValue SymbolLayer::getTextKeepUpright() const { void SymbolLayer::setTextKeepUpright(PropertyValue value) { impl->layout.textKeepUpright.set(value); } +PropertyValue SymbolLayer::getDefaultTextTransform() { + return { TextTransformType::None }; +} + PropertyValue SymbolLayer::getTextTransform() const { return impl->layout.textTransform.get(); } @@ -268,6 +388,10 @@ PropertyValue SymbolLayer::getTextTransform() const { void SymbolLayer::setTextTransform(PropertyValue value) { impl->layout.textTransform.set(value); } +PropertyValue> SymbolLayer::getDefaultTextOffset() { + return { {{ 0, 0 }} }; +} + PropertyValue> SymbolLayer::getTextOffset() const { return impl->layout.textOffset.get(); } @@ -275,6 +399,10 @@ PropertyValue> SymbolLayer::getTextOffset() const { void SymbolLayer::setTextOffset(PropertyValue> value) { impl->layout.textOffset.set(value); } +PropertyValue SymbolLayer::getDefaultTextAllowOverlap() { + return { false }; +} + PropertyValue SymbolLayer::getTextAllowOverlap() const { return impl->layout.textAllowOverlap.get(); } @@ -282,6 +410,10 @@ PropertyValue SymbolLayer::getTextAllowOverlap() const { void SymbolLayer::setTextAllowOverlap(PropertyValue value) { impl->layout.textAllowOverlap.set(value); } +PropertyValue SymbolLayer::getDefaultTextIgnorePlacement() { + return { false }; +} + PropertyValue SymbolLayer::getTextIgnorePlacement() const { return impl->layout.textIgnorePlacement.get(); } @@ -289,6 +421,10 @@ PropertyValue SymbolLayer::getTextIgnorePlacement() const { void SymbolLayer::setTextIgnorePlacement(PropertyValue value) { impl->layout.textIgnorePlacement.set(value); } +PropertyValue SymbolLayer::getDefaultTextOptional() { + return { false }; +} + PropertyValue SymbolLayer::getTextOptional() const { return impl->layout.textOptional.get(); } @@ -299,6 +435,10 @@ void SymbolLayer::setTextOptional(PropertyValue value) { // Paint properties +PropertyValue SymbolLayer::getDefaultIconOpacity() { + return { 1 }; +} + PropertyValue SymbolLayer::getIconOpacity() const { return impl->paint.iconOpacity.get(); } @@ -307,6 +447,10 @@ void SymbolLayer::setIconOpacity(PropertyValue value, const optionalpaint.iconOpacity.set(value, klass); } +PropertyValue SymbolLayer::getDefaultIconColor() { + return { Color::black() }; +} + PropertyValue SymbolLayer::getIconColor() const { return impl->paint.iconColor.get(); } @@ -315,6 +459,10 @@ void SymbolLayer::setIconColor(PropertyValue value, const optionalpaint.iconColor.set(value, klass); } +PropertyValue SymbolLayer::getDefaultIconHaloColor() { + return { {} }; +} + PropertyValue SymbolLayer::getIconHaloColor() const { return impl->paint.iconHaloColor.get(); } @@ -323,6 +471,10 @@ void SymbolLayer::setIconHaloColor(PropertyValue value, const optionalpaint.iconHaloColor.set(value, klass); } +PropertyValue SymbolLayer::getDefaultIconHaloWidth() { + return { 0 }; +} + PropertyValue SymbolLayer::getIconHaloWidth() const { return impl->paint.iconHaloWidth.get(); } @@ -331,6 +483,10 @@ void SymbolLayer::setIconHaloWidth(PropertyValue value, const optionalpaint.iconHaloWidth.set(value, klass); } +PropertyValue SymbolLayer::getDefaultIconHaloBlur() { + return { 0 }; +} + PropertyValue SymbolLayer::getIconHaloBlur() const { return impl->paint.iconHaloBlur.get(); } @@ -339,6 +495,10 @@ void SymbolLayer::setIconHaloBlur(PropertyValue value, const optionalpaint.iconHaloBlur.set(value, klass); } +PropertyValue> SymbolLayer::getDefaultIconTranslate() { + return { {{ 0, 0 }} }; +} + PropertyValue> SymbolLayer::getIconTranslate() const { return impl->paint.iconTranslate.get(); } @@ -347,6 +507,10 @@ void SymbolLayer::setIconTranslate(PropertyValue> value, co impl->paint.iconTranslate.set(value, klass); } +PropertyValue SymbolLayer::getDefaultIconTranslateAnchor() { + return { TranslateAnchorType::Map }; +} + PropertyValue SymbolLayer::getIconTranslateAnchor() const { return impl->paint.iconTranslateAnchor.get(); } @@ -355,6 +519,10 @@ void SymbolLayer::setIconTranslateAnchor(PropertyValue valu impl->paint.iconTranslateAnchor.set(value, klass); } +PropertyValue SymbolLayer::getDefaultTextOpacity() { + return { 1 }; +} + PropertyValue SymbolLayer::getTextOpacity() const { return impl->paint.textOpacity.get(); } @@ -363,6 +531,10 @@ void SymbolLayer::setTextOpacity(PropertyValue value, const optionalpaint.textOpacity.set(value, klass); } +PropertyValue SymbolLayer::getDefaultTextColor() { + return { Color::black() }; +} + PropertyValue SymbolLayer::getTextColor() const { return impl->paint.textColor.get(); } @@ -371,6 +543,10 @@ void SymbolLayer::setTextColor(PropertyValue value, const optionalpaint.textColor.set(value, klass); } +PropertyValue SymbolLayer::getDefaultTextHaloColor() { + return { {} }; +} + PropertyValue SymbolLayer::getTextHaloColor() const { return impl->paint.textHaloColor.get(); } @@ -379,6 +555,10 @@ void SymbolLayer::setTextHaloColor(PropertyValue value, const optionalpaint.textHaloColor.set(value, klass); } +PropertyValue SymbolLayer::getDefaultTextHaloWidth() { + return { 0 }; +} + PropertyValue SymbolLayer::getTextHaloWidth() const { return impl->paint.textHaloWidth.get(); } @@ -387,6 +567,10 @@ void SymbolLayer::setTextHaloWidth(PropertyValue value, const optionalpaint.textHaloWidth.set(value, klass); } +PropertyValue SymbolLayer::getDefaultTextHaloBlur() { + return { 0 }; +} + PropertyValue SymbolLayer::getTextHaloBlur() const { return impl->paint.textHaloBlur.get(); } @@ -395,6 +579,10 @@ void SymbolLayer::setTextHaloBlur(PropertyValue value, const optionalpaint.textHaloBlur.set(value, klass); } +PropertyValue> SymbolLayer::getDefaultTextTranslate() { + return { {{ 0, 0 }} }; +} + PropertyValue> SymbolLayer::getTextTranslate() const { return impl->paint.textTranslate.get(); } @@ -403,6 +591,10 @@ void SymbolLayer::setTextTranslate(PropertyValue> value, co impl->paint.textTranslate.set(value, klass); } +PropertyValue SymbolLayer::getDefaultTextTranslateAnchor() { + return { TranslateAnchorType::Map }; +} + PropertyValue SymbolLayer::getTextTranslateAnchor() const { return impl->paint.textTranslateAnchor.get(); }