From 63cce78cf1597ba5879227f2298bda52e91e4e04 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 23 Aug 2016 12:49:47 -0700 Subject: [core] Add static getters for property default values (#6124) --- src/mbgl/style/layers/line_layer.cpp | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'src/mbgl/style/layers/line_layer.cpp') 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 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(); } -- cgit v1.2.1