summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-02-09 12:36:40 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-02-09 15:08:51 -0600
commitb6e5edc26844df6a5f1f6e34881826828d36ce6a (patch)
tree214b77ec99c2302acedb8ee4beb9699e3e2d9d17 /src
parent925d394ab52f3d859c4111d53242b403d4e2e300 (diff)
downloadqtlocation-mapboxgl-b6e5edc26844df6a5f1f6e34881826828d36ce6a.tar.gz
[core] Restore support for *-transition properties
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/style/layers/background_layer.cpp12
-rw-r--r--src/mbgl/style/layers/circle_layer.cpp40
-rw-r--r--src/mbgl/style/layers/fill_extrusion_layer.cpp28
-rw-r--r--src/mbgl/style/layers/fill_layer.cpp28
-rw-r--r--src/mbgl/style/layers/layer.cpp.ejs4
-rw-r--r--src/mbgl/style/layers/line_layer.cpp40
-rw-r--r--src/mbgl/style/layers/raster_layer.cpp28
-rw-r--r--src/mbgl/style/layers/symbol_layer.cpp56
-rw-r--r--src/mbgl/style/paint_property.hpp11
9 files changed, 247 insertions, 0 deletions
diff --git a/src/mbgl/style/layers/background_layer.cpp b/src/mbgl/style/layers/background_layer.cpp
index a75038bfa0..5a903f1b6b 100644
--- a/src/mbgl/style/layers/background_layer.cpp
+++ b/src/mbgl/style/layers/background_layer.cpp
@@ -55,6 +55,10 @@ void BackgroundLayer::setBackgroundColor(PropertyValue<Color> value, const optio
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void BackgroundLayer::setBackgroundColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<BackgroundColor>(value, klass);
+}
+
PropertyValue<std::string> BackgroundLayer::getDefaultBackgroundPattern() {
return { "" };
}
@@ -70,6 +74,10 @@ void BackgroundLayer::setBackgroundPattern(PropertyValue<std::string> value, con
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void BackgroundLayer::setBackgroundPatternTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<BackgroundPattern>(value, klass);
+}
+
PropertyValue<float> BackgroundLayer::getDefaultBackgroundOpacity() {
return { 1 };
}
@@ -85,5 +93,9 @@ void BackgroundLayer::setBackgroundOpacity(PropertyValue<float> value, const opt
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void BackgroundLayer::setBackgroundOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<BackgroundOpacity>(value, klass);
+}
+
} // namespace style
} // namespace mbgl
diff --git a/src/mbgl/style/layers/circle_layer.cpp b/src/mbgl/style/layers/circle_layer.cpp
index f8d06e2644..53248e9397 100644
--- a/src/mbgl/style/layers/circle_layer.cpp
+++ b/src/mbgl/style/layers/circle_layer.cpp
@@ -84,6 +84,10 @@ void CircleLayer::setCircleRadius(DataDrivenPropertyValue<float> value, const op
}
}
+void CircleLayer::setCircleRadiusTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<CircleRadius>(value, klass);
+}
+
DataDrivenPropertyValue<Color> CircleLayer::getDefaultCircleColor() {
return { Color::black() };
}
@@ -103,6 +107,10 @@ void CircleLayer::setCircleColor(DataDrivenPropertyValue<Color> value, const opt
}
}
+void CircleLayer::setCircleColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<CircleColor>(value, klass);
+}
+
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleBlur() {
return { 0 };
}
@@ -122,6 +130,10 @@ void CircleLayer::setCircleBlur(DataDrivenPropertyValue<float> value, const opti
}
}
+void CircleLayer::setCircleBlurTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<CircleBlur>(value, klass);
+}
+
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleOpacity() {
return { 1 };
}
@@ -141,6 +153,10 @@ void CircleLayer::setCircleOpacity(DataDrivenPropertyValue<float> value, const o
}
}
+void CircleLayer::setCircleOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<CircleOpacity>(value, klass);
+}
+
PropertyValue<std::array<float, 2>> CircleLayer::getDefaultCircleTranslate() {
return { {{ 0, 0 }} };
}
@@ -156,6 +172,10 @@ void CircleLayer::setCircleTranslate(PropertyValue<std::array<float, 2>> value,
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void CircleLayer::setCircleTranslateTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<CircleTranslate>(value, klass);
+}
+
PropertyValue<TranslateAnchorType> CircleLayer::getDefaultCircleTranslateAnchor() {
return { TranslateAnchorType::Map };
}
@@ -171,6 +191,10 @@ void CircleLayer::setCircleTranslateAnchor(PropertyValue<TranslateAnchorType> va
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void CircleLayer::setCircleTranslateAnchorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<CircleTranslateAnchor>(value, klass);
+}
+
PropertyValue<CirclePitchScaleType> CircleLayer::getDefaultCirclePitchScale() {
return { CirclePitchScaleType::Map };
}
@@ -186,6 +210,10 @@ void CircleLayer::setCirclePitchScale(PropertyValue<CirclePitchScaleType> value,
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void CircleLayer::setCirclePitchScaleTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<CirclePitchScale>(value, klass);
+}
+
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleStrokeWidth() {
return { 0 };
}
@@ -205,6 +233,10 @@ void CircleLayer::setCircleStrokeWidth(DataDrivenPropertyValue<float> value, con
}
}
+void CircleLayer::setCircleStrokeWidthTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<CircleStrokeWidth>(value, klass);
+}
+
DataDrivenPropertyValue<Color> CircleLayer::getDefaultCircleStrokeColor() {
return { Color::black() };
}
@@ -224,6 +256,10 @@ void CircleLayer::setCircleStrokeColor(DataDrivenPropertyValue<Color> value, con
}
}
+void CircleLayer::setCircleStrokeColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<CircleStrokeColor>(value, klass);
+}
+
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleStrokeOpacity() {
return { 1 };
}
@@ -243,5 +279,9 @@ void CircleLayer::setCircleStrokeOpacity(DataDrivenPropertyValue<float> value, c
}
}
+void CircleLayer::setCircleStrokeOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<CircleStrokeOpacity>(value, klass);
+}
+
} // namespace style
} // namespace mbgl
diff --git a/src/mbgl/style/layers/fill_extrusion_layer.cpp b/src/mbgl/style/layers/fill_extrusion_layer.cpp
index 0ef5c9bcbc..4672ede9b8 100644
--- a/src/mbgl/style/layers/fill_extrusion_layer.cpp
+++ b/src/mbgl/style/layers/fill_extrusion_layer.cpp
@@ -80,6 +80,10 @@ void FillExtrusionLayer::setFillExtrusionOpacity(PropertyValue<float> value, con
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void FillExtrusionLayer::setFillExtrusionOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<FillExtrusionOpacity>(value, klass);
+}
+
DataDrivenPropertyValue<Color> FillExtrusionLayer::getDefaultFillExtrusionColor() {
return { Color::black() };
}
@@ -99,6 +103,10 @@ void FillExtrusionLayer::setFillExtrusionColor(DataDrivenPropertyValue<Color> va
}
}
+void FillExtrusionLayer::setFillExtrusionColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<FillExtrusionColor>(value, klass);
+}
+
PropertyValue<std::array<float, 2>> FillExtrusionLayer::getDefaultFillExtrusionTranslate() {
return { {{ 0, 0 }} };
}
@@ -114,6 +122,10 @@ void FillExtrusionLayer::setFillExtrusionTranslate(PropertyValue<std::array<floa
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void FillExtrusionLayer::setFillExtrusionTranslateTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<FillExtrusionTranslate>(value, klass);
+}
+
PropertyValue<TranslateAnchorType> FillExtrusionLayer::getDefaultFillExtrusionTranslateAnchor() {
return { TranslateAnchorType::Map };
}
@@ -129,6 +141,10 @@ void FillExtrusionLayer::setFillExtrusionTranslateAnchor(PropertyValue<Translate
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void FillExtrusionLayer::setFillExtrusionTranslateAnchorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<FillExtrusionTranslateAnchor>(value, klass);
+}
+
PropertyValue<std::string> FillExtrusionLayer::getDefaultFillExtrusionPattern() {
return { "" };
}
@@ -144,6 +160,10 @@ void FillExtrusionLayer::setFillExtrusionPattern(PropertyValue<std::string> valu
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void FillExtrusionLayer::setFillExtrusionPatternTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<FillExtrusionPattern>(value, klass);
+}
+
DataDrivenPropertyValue<float> FillExtrusionLayer::getDefaultFillExtrusionHeight() {
return { 0 };
}
@@ -163,6 +183,10 @@ void FillExtrusionLayer::setFillExtrusionHeight(DataDrivenPropertyValue<float> v
}
}
+void FillExtrusionLayer::setFillExtrusionHeightTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<FillExtrusionHeight>(value, klass);
+}
+
DataDrivenPropertyValue<float> FillExtrusionLayer::getDefaultFillExtrusionBase() {
return { 0 };
}
@@ -182,5 +206,9 @@ void FillExtrusionLayer::setFillExtrusionBase(DataDrivenPropertyValue<float> val
}
}
+void FillExtrusionLayer::setFillExtrusionBaseTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<FillExtrusionBase>(value, klass);
+}
+
} // namespace style
} // namespace mbgl
diff --git a/src/mbgl/style/layers/fill_layer.cpp b/src/mbgl/style/layers/fill_layer.cpp
index e1c0d4d243..dfa88b5b0f 100644
--- a/src/mbgl/style/layers/fill_layer.cpp
+++ b/src/mbgl/style/layers/fill_layer.cpp
@@ -80,6 +80,10 @@ void FillLayer::setFillAntialias(PropertyValue<bool> value, const optional<std::
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void FillLayer::setFillAntialiasTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<FillAntialias>(value, klass);
+}
+
DataDrivenPropertyValue<float> FillLayer::getDefaultFillOpacity() {
return { 1 };
}
@@ -99,6 +103,10 @@ void FillLayer::setFillOpacity(DataDrivenPropertyValue<float> value, const optio
}
}
+void FillLayer::setFillOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<FillOpacity>(value, klass);
+}
+
DataDrivenPropertyValue<Color> FillLayer::getDefaultFillColor() {
return { Color::black() };
}
@@ -118,6 +126,10 @@ void FillLayer::setFillColor(DataDrivenPropertyValue<Color> value, const optiona
}
}
+void FillLayer::setFillColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<FillColor>(value, klass);
+}
+
DataDrivenPropertyValue<Color> FillLayer::getDefaultFillOutlineColor() {
return { {} };
}
@@ -137,6 +149,10 @@ void FillLayer::setFillOutlineColor(DataDrivenPropertyValue<Color> value, const
}
}
+void FillLayer::setFillOutlineColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<FillOutlineColor>(value, klass);
+}
+
PropertyValue<std::array<float, 2>> FillLayer::getDefaultFillTranslate() {
return { {{ 0, 0 }} };
}
@@ -152,6 +168,10 @@ void FillLayer::setFillTranslate(PropertyValue<std::array<float, 2>> value, cons
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void FillLayer::setFillTranslateTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<FillTranslate>(value, klass);
+}
+
PropertyValue<TranslateAnchorType> FillLayer::getDefaultFillTranslateAnchor() {
return { TranslateAnchorType::Map };
}
@@ -167,6 +187,10 @@ void FillLayer::setFillTranslateAnchor(PropertyValue<TranslateAnchorType> value,
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void FillLayer::setFillTranslateAnchorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<FillTranslateAnchor>(value, klass);
+}
+
PropertyValue<std::string> FillLayer::getDefaultFillPattern() {
return { "" };
}
@@ -182,5 +206,9 @@ void FillLayer::setFillPattern(PropertyValue<std::string> value, const optional<
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void FillLayer::setFillPatternTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<FillPattern>(value, klass);
+}
+
} // namespace style
} // namespace mbgl
diff --git a/src/mbgl/style/layers/layer.cpp.ejs b/src/mbgl/style/layers/layer.cpp.ejs
index 4a91a5c7e3..335573abf3 100644
--- a/src/mbgl/style/layers/layer.cpp.ejs
+++ b/src/mbgl/style/layers/layer.cpp.ejs
@@ -126,6 +126,10 @@ void <%- camelize(type) %>Layer::set<%- camelize(property.name) %>(<%- propertyV
impl->observer->onLayerPaintPropertyChanged(*this);
<% } -%>
}
+
+void <%- camelize(type) %>Layer::set<%- camelize(property.name) %>Transition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<<%- camelize(property.name) %>>(value, klass);
+}
<% } -%>
} // namespace style
diff --git a/src/mbgl/style/layers/line_layer.cpp b/src/mbgl/style/layers/line_layer.cpp
index fcad1eacb6..eaaa0fcd45 100644
--- a/src/mbgl/style/layers/line_layer.cpp
+++ b/src/mbgl/style/layers/line_layer.cpp
@@ -141,6 +141,10 @@ void LineLayer::setLineOpacity(DataDrivenPropertyValue<float> value, const optio
}
}
+void LineLayer::setLineOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<LineOpacity>(value, klass);
+}
+
DataDrivenPropertyValue<Color> LineLayer::getDefaultLineColor() {
return { Color::black() };
}
@@ -160,6 +164,10 @@ void LineLayer::setLineColor(DataDrivenPropertyValue<Color> value, const optiona
}
}
+void LineLayer::setLineColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<LineColor>(value, klass);
+}
+
PropertyValue<std::array<float, 2>> LineLayer::getDefaultLineTranslate() {
return { {{ 0, 0 }} };
}
@@ -175,6 +183,10 @@ void LineLayer::setLineTranslate(PropertyValue<std::array<float, 2>> value, cons
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void LineLayer::setLineTranslateTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<LineTranslate>(value, klass);
+}
+
PropertyValue<TranslateAnchorType> LineLayer::getDefaultLineTranslateAnchor() {
return { TranslateAnchorType::Map };
}
@@ -190,6 +202,10 @@ void LineLayer::setLineTranslateAnchor(PropertyValue<TranslateAnchorType> value,
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void LineLayer::setLineTranslateAnchorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<LineTranslateAnchor>(value, klass);
+}
+
PropertyValue<float> LineLayer::getDefaultLineWidth() {
return { 1 };
}
@@ -205,6 +221,10 @@ void LineLayer::setLineWidth(PropertyValue<float> value, const optional<std::str
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void LineLayer::setLineWidthTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<LineWidth>(value, klass);
+}
+
DataDrivenPropertyValue<float> LineLayer::getDefaultLineGapWidth() {
return { 0 };
}
@@ -224,6 +244,10 @@ void LineLayer::setLineGapWidth(DataDrivenPropertyValue<float> value, const opti
}
}
+void LineLayer::setLineGapWidthTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<LineGapWidth>(value, klass);
+}
+
DataDrivenPropertyValue<float> LineLayer::getDefaultLineOffset() {
return { 0 };
}
@@ -243,6 +267,10 @@ void LineLayer::setLineOffset(DataDrivenPropertyValue<float> value, const option
}
}
+void LineLayer::setLineOffsetTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<LineOffset>(value, klass);
+}
+
DataDrivenPropertyValue<float> LineLayer::getDefaultLineBlur() {
return { 0 };
}
@@ -262,6 +290,10 @@ void LineLayer::setLineBlur(DataDrivenPropertyValue<float> value, const optional
}
}
+void LineLayer::setLineBlurTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<LineBlur>(value, klass);
+}
+
PropertyValue<std::vector<float>> LineLayer::getDefaultLineDasharray() {
return { { } };
}
@@ -277,6 +309,10 @@ void LineLayer::setLineDasharray(PropertyValue<std::vector<float>> value, const
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void LineLayer::setLineDasharrayTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<LineDasharray>(value, klass);
+}
+
PropertyValue<std::string> LineLayer::getDefaultLinePattern() {
return { "" };
}
@@ -292,5 +328,9 @@ void LineLayer::setLinePattern(PropertyValue<std::string> value, const optional<
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void LineLayer::setLinePatternTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<LinePattern>(value, klass);
+}
+
} // namespace style
} // namespace mbgl
diff --git a/src/mbgl/style/layers/raster_layer.cpp b/src/mbgl/style/layers/raster_layer.cpp
index 0fda27f0dc..2108a5c49f 100644
--- a/src/mbgl/style/layers/raster_layer.cpp
+++ b/src/mbgl/style/layers/raster_layer.cpp
@@ -62,6 +62,10 @@ void RasterLayer::setRasterOpacity(PropertyValue<float> value, const optional<st
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void RasterLayer::setRasterOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<RasterOpacity>(value, klass);
+}
+
PropertyValue<float> RasterLayer::getDefaultRasterHueRotate() {
return { 0 };
}
@@ -77,6 +81,10 @@ void RasterLayer::setRasterHueRotate(PropertyValue<float> value, const optional<
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void RasterLayer::setRasterHueRotateTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<RasterHueRotate>(value, klass);
+}
+
PropertyValue<float> RasterLayer::getDefaultRasterBrightnessMin() {
return { 0 };
}
@@ -92,6 +100,10 @@ void RasterLayer::setRasterBrightnessMin(PropertyValue<float> value, const optio
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void RasterLayer::setRasterBrightnessMinTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<RasterBrightnessMin>(value, klass);
+}
+
PropertyValue<float> RasterLayer::getDefaultRasterBrightnessMax() {
return { 1 };
}
@@ -107,6 +119,10 @@ void RasterLayer::setRasterBrightnessMax(PropertyValue<float> value, const optio
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void RasterLayer::setRasterBrightnessMaxTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<RasterBrightnessMax>(value, klass);
+}
+
PropertyValue<float> RasterLayer::getDefaultRasterSaturation() {
return { 0 };
}
@@ -122,6 +138,10 @@ void RasterLayer::setRasterSaturation(PropertyValue<float> value, const optional
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void RasterLayer::setRasterSaturationTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<RasterSaturation>(value, klass);
+}
+
PropertyValue<float> RasterLayer::getDefaultRasterContrast() {
return { 0 };
}
@@ -137,6 +157,10 @@ void RasterLayer::setRasterContrast(PropertyValue<float> value, const optional<s
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void RasterLayer::setRasterContrastTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<RasterContrast>(value, klass);
+}
+
PropertyValue<float> RasterLayer::getDefaultRasterFadeDuration() {
return { 300 };
}
@@ -152,5 +176,9 @@ void RasterLayer::setRasterFadeDuration(PropertyValue<float> value, const option
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void RasterLayer::setRasterFadeDurationTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<RasterFadeDuration>(value, klass);
+}
+
} // namespace style
} // namespace mbgl
diff --git a/src/mbgl/style/layers/symbol_layer.cpp b/src/mbgl/style/layers/symbol_layer.cpp
index 94c47f48b7..94167f5705 100644
--- a/src/mbgl/style/layers/symbol_layer.cpp
+++ b/src/mbgl/style/layers/symbol_layer.cpp
@@ -557,6 +557,10 @@ void SymbolLayer::setIconOpacity(PropertyValue<float> value, const optional<std:
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void SymbolLayer::setIconOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<IconOpacity>(value, klass);
+}
+
PropertyValue<Color> SymbolLayer::getDefaultIconColor() {
return { Color::black() };
}
@@ -572,6 +576,10 @@ void SymbolLayer::setIconColor(PropertyValue<Color> value, const optional<std::s
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void SymbolLayer::setIconColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<IconColor>(value, klass);
+}
+
PropertyValue<Color> SymbolLayer::getDefaultIconHaloColor() {
return { {} };
}
@@ -587,6 +595,10 @@ void SymbolLayer::setIconHaloColor(PropertyValue<Color> value, const optional<st
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void SymbolLayer::setIconHaloColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<IconHaloColor>(value, klass);
+}
+
PropertyValue<float> SymbolLayer::getDefaultIconHaloWidth() {
return { 0 };
}
@@ -602,6 +614,10 @@ void SymbolLayer::setIconHaloWidth(PropertyValue<float> value, const optional<st
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void SymbolLayer::setIconHaloWidthTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<IconHaloWidth>(value, klass);
+}
+
PropertyValue<float> SymbolLayer::getDefaultIconHaloBlur() {
return { 0 };
}
@@ -617,6 +633,10 @@ void SymbolLayer::setIconHaloBlur(PropertyValue<float> value, const optional<std
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void SymbolLayer::setIconHaloBlurTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<IconHaloBlur>(value, klass);
+}
+
PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultIconTranslate() {
return { {{ 0, 0 }} };
}
@@ -632,6 +652,10 @@ void SymbolLayer::setIconTranslate(PropertyValue<std::array<float, 2>> value, co
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void SymbolLayer::setIconTranslateTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<IconTranslate>(value, klass);
+}
+
PropertyValue<TranslateAnchorType> SymbolLayer::getDefaultIconTranslateAnchor() {
return { TranslateAnchorType::Map };
}
@@ -651,6 +675,10 @@ PropertyValue<float> SymbolLayer::getDefaultTextOpacity() {
return { 1 };
}
+void SymbolLayer::setIconTranslateAnchorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<IconTranslateAnchor>(value, klass);
+}
+
PropertyValue<float> SymbolLayer::getTextOpacity(const optional<std::string>& klass) const {
return impl->paint.get<TextOpacity>(klass);
}
@@ -666,6 +694,10 @@ PropertyValue<Color> SymbolLayer::getDefaultTextColor() {
return { Color::black() };
}
+void SymbolLayer::setTextOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<TextOpacity>(value, klass);
+}
+
PropertyValue<Color> SymbolLayer::getTextColor(const optional<std::string>& klass) const {
return impl->paint.get<TextColor>(klass);
}
@@ -677,6 +709,10 @@ void SymbolLayer::setTextColor(PropertyValue<Color> value, const optional<std::s
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void SymbolLayer::setTextColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<TextColor>(value, klass);
+}
+
PropertyValue<Color> SymbolLayer::getDefaultTextHaloColor() {
return { {} };
}
@@ -692,6 +728,10 @@ void SymbolLayer::setTextHaloColor(PropertyValue<Color> value, const optional<st
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void SymbolLayer::setTextHaloColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<TextHaloColor>(value, klass);
+}
+
PropertyValue<float> SymbolLayer::getDefaultTextHaloWidth() {
return { 0 };
}
@@ -707,6 +747,10 @@ void SymbolLayer::setTextHaloWidth(PropertyValue<float> value, const optional<st
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void SymbolLayer::setTextHaloWidthTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<TextHaloWidth>(value, klass);
+}
+
PropertyValue<float> SymbolLayer::getDefaultTextHaloBlur() {
return { 0 };
}
@@ -722,6 +766,10 @@ void SymbolLayer::setTextHaloBlur(PropertyValue<float> value, const optional<std
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void SymbolLayer::setTextHaloBlurTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<TextHaloBlur>(value, klass);
+}
+
PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultTextTranslate() {
return { {{ 0, 0 }} };
}
@@ -737,6 +785,10 @@ void SymbolLayer::setTextTranslate(PropertyValue<std::array<float, 2>> value, co
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void SymbolLayer::setTextTranslateTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<TextTranslate>(value, klass);
+}
+
PropertyValue<TranslateAnchorType> SymbolLayer::getDefaultTextTranslateAnchor() {
return { TranslateAnchorType::Map };
}
@@ -752,5 +804,9 @@ void SymbolLayer::setTextTranslateAnchor(PropertyValue<TranslateAnchorType> valu
impl->observer->onLayerPaintPropertyChanged(*this);
}
+void SymbolLayer::setTextTranslateAnchorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ impl->paint.setTransition<TextTranslateAnchor>(value, klass);
+}
+
} // namespace style
} // namespace mbgl
diff --git a/src/mbgl/style/paint_property.hpp b/src/mbgl/style/paint_property.hpp
index 9031d590fe..1fa2390f33 100644
--- a/src/mbgl/style/paint_property.hpp
+++ b/src/mbgl/style/paint_property.hpp
@@ -97,6 +97,12 @@ public:
values[klass ? ClassDictionary::Get().lookup(*klass) : ClassID::Default] = value_;
}
+ const TransitionOptions& getTransition(const optional<std::string>& klass) const {
+ static const TransitionOptions staticValue{};
+ const auto it = transitions.find(klass ? ClassDictionary::Get().lookup(*klass) : ClassID::Default);
+ return it == transitions.end() ? staticValue : it->second;
+ }
+
void setTransition(const TransitionOptions& transition, const optional<std::string>& klass) {
transitions[klass ? ClassDictionary::Get().lookup(*klass) : ClassID::Default] = transition;
}
@@ -209,6 +215,11 @@ public:
cascading.template get<P>().set(value, klass);
}
+ template <class P>
+ void setTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+ cascading.template get<P>().setTransition(value, klass);
+ }
+
void cascade(const CascadeParameters& parameters) {
unevaluated = Unevaluated {
cascading.template get<Ps>().cascade(parameters,