summaryrefslogtreecommitdiff
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
parent925d394ab52f3d859c4111d53242b403d4e2e300 (diff)
downloadqtlocation-mapboxgl-b6e5edc26844df6a5f1f6e34881826828d36ce6a.tar.gz
[core] Restore support for *-transition properties
-rw-r--r--cmake/core-files.cmake4
-rw-r--r--cmake/test-files.cmake1
-rw-r--r--include/mbgl/style/conversion/make_property_setters.hpp58
-rw-r--r--include/mbgl/style/conversion/make_property_setters.hpp.ejs1
-rw-r--r--include/mbgl/style/conversion/property_setter.hpp19
-rw-r--r--include/mbgl/style/conversion/transition_options.hpp45
-rw-r--r--include/mbgl/style/layers/background_layer.hpp5
-rw-r--r--include/mbgl/style/layers/circle_layer.hpp12
-rw-r--r--include/mbgl/style/layers/fill_extrusion_layer.hpp9
-rw-r--r--include/mbgl/style/layers/fill_layer.hpp9
-rw-r--r--include/mbgl/style/layers/layer.hpp.ejs3
-rw-r--r--include/mbgl/style/layers/line_layer.hpp12
-rw-r--r--include/mbgl/style/layers/raster_layer.hpp9
-rw-r--r--include/mbgl/style/layers/symbol_layer.hpp16
-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
-rw-r--r--test/style/conversion/layer.test.cpp46
24 files changed, 496 insertions, 0 deletions
diff --git a/cmake/core-files.cmake b/cmake/core-files.cmake
index 47e486571f..2696d2bf3e 100644
--- a/cmake/core-files.cmake
+++ b/cmake/core-files.cmake
@@ -296,12 +296,16 @@ set(MBGL_CORE_FILES
include/mbgl/style/conversion/property_value.hpp
include/mbgl/style/conversion/source.hpp
include/mbgl/style/conversion/tileset.hpp
+ include/mbgl/style/conversion/transition_options.hpp
src/mbgl/style/conversion/stringify.hpp
# style/function
include/mbgl/style/function/camera_function.hpp
include/mbgl/style/function/categorical_stops.hpp
+ include/mbgl/style/function/composite_categorical_stops.hpp
+ include/mbgl/style/function/composite_exponential_stops.hpp
include/mbgl/style/function/composite_function.hpp
+ include/mbgl/style/function/composite_interval_stops.hpp
include/mbgl/style/function/exponential_stops.hpp
include/mbgl/style/function/identity_stops.hpp
include/mbgl/style/function/interval_stops.hpp
diff --git a/cmake/test-files.cmake b/cmake/test-files.cmake
index 9ab9918162..b2bff6c72a 100644
--- a/cmake/test-files.cmake
+++ b/cmake/test-files.cmake
@@ -74,6 +74,7 @@ set(MBGL_TEST_FILES
# style/conversion
test/style/conversion/function.test.cpp
test/style/conversion/geojson_options.test.cpp
+ test/style/conversion/layer.test.cpp
test/style/conversion/stringify.test.cpp
# style
diff --git a/include/mbgl/style/conversion/make_property_setters.hpp b/include/mbgl/style/conversion/make_property_setters.hpp
index e30359937e..32fa810f0b 100644
--- a/include/mbgl/style/conversion/make_property_setters.hpp
+++ b/include/mbgl/style/conversion/make_property_setters.hpp
@@ -77,69 +77,127 @@ auto makePaintPropertySetters() {
std::unordered_map<std::string, PaintPropertySetter<V>> result;
result["fill-antialias"] = makePropertySetter<V>(&FillLayer::setFillAntialias);
+ result["fill-antialias-transition"] = makeTransitionSetter<V>(&FillLayer::setFillAntialiasTransition);
result["fill-opacity"] = makePropertySetter<V>(&FillLayer::setFillOpacity);
+ result["fill-opacity-transition"] = makeTransitionSetter<V>(&FillLayer::setFillOpacityTransition);
result["fill-color"] = makePropertySetter<V>(&FillLayer::setFillColor);
+ result["fill-color-transition"] = makeTransitionSetter<V>(&FillLayer::setFillColorTransition);
result["fill-outline-color"] = makePropertySetter<V>(&FillLayer::setFillOutlineColor);
+ result["fill-outline-color-transition"] = makeTransitionSetter<V>(&FillLayer::setFillOutlineColorTransition);
result["fill-translate"] = makePropertySetter<V>(&FillLayer::setFillTranslate);
+ result["fill-translate-transition"] = makeTransitionSetter<V>(&FillLayer::setFillTranslateTransition);
result["fill-translate-anchor"] = makePropertySetter<V>(&FillLayer::setFillTranslateAnchor);
+ result["fill-translate-anchor-transition"] = makeTransitionSetter<V>(&FillLayer::setFillTranslateAnchorTransition);
result["fill-pattern"] = makePropertySetter<V>(&FillLayer::setFillPattern);
+ result["fill-pattern-transition"] = makeTransitionSetter<V>(&FillLayer::setFillPatternTransition);
result["line-opacity"] = makePropertySetter<V>(&LineLayer::setLineOpacity);
+ result["line-opacity-transition"] = makeTransitionSetter<V>(&LineLayer::setLineOpacityTransition);
result["line-color"] = makePropertySetter<V>(&LineLayer::setLineColor);
+ result["line-color-transition"] = makeTransitionSetter<V>(&LineLayer::setLineColorTransition);
result["line-translate"] = makePropertySetter<V>(&LineLayer::setLineTranslate);
+ result["line-translate-transition"] = makeTransitionSetter<V>(&LineLayer::setLineTranslateTransition);
result["line-translate-anchor"] = makePropertySetter<V>(&LineLayer::setLineTranslateAnchor);
+ result["line-translate-anchor-transition"] = makeTransitionSetter<V>(&LineLayer::setLineTranslateAnchorTransition);
result["line-width"] = makePropertySetter<V>(&LineLayer::setLineWidth);
+ result["line-width-transition"] = makeTransitionSetter<V>(&LineLayer::setLineWidthTransition);
result["line-gap-width"] = makePropertySetter<V>(&LineLayer::setLineGapWidth);
+ result["line-gap-width-transition"] = makeTransitionSetter<V>(&LineLayer::setLineGapWidthTransition);
result["line-offset"] = makePropertySetter<V>(&LineLayer::setLineOffset);
+ result["line-offset-transition"] = makeTransitionSetter<V>(&LineLayer::setLineOffsetTransition);
result["line-blur"] = makePropertySetter<V>(&LineLayer::setLineBlur);
+ result["line-blur-transition"] = makeTransitionSetter<V>(&LineLayer::setLineBlurTransition);
result["line-dasharray"] = makePropertySetter<V>(&LineLayer::setLineDasharray);
+ result["line-dasharray-transition"] = makeTransitionSetter<V>(&LineLayer::setLineDasharrayTransition);
result["line-pattern"] = makePropertySetter<V>(&LineLayer::setLinePattern);
+ result["line-pattern-transition"] = makeTransitionSetter<V>(&LineLayer::setLinePatternTransition);
result["icon-opacity"] = makePropertySetter<V>(&SymbolLayer::setIconOpacity);
+ result["icon-opacity-transition"] = makeTransitionSetter<V>(&SymbolLayer::setIconOpacityTransition);
result["icon-color"] = makePropertySetter<V>(&SymbolLayer::setIconColor);
+ result["icon-color-transition"] = makeTransitionSetter<V>(&SymbolLayer::setIconColorTransition);
result["icon-halo-color"] = makePropertySetter<V>(&SymbolLayer::setIconHaloColor);
+ result["icon-halo-color-transition"] = makeTransitionSetter<V>(&SymbolLayer::setIconHaloColorTransition);
result["icon-halo-width"] = makePropertySetter<V>(&SymbolLayer::setIconHaloWidth);
+ result["icon-halo-width-transition"] = makeTransitionSetter<V>(&SymbolLayer::setIconHaloWidthTransition);
result["icon-halo-blur"] = makePropertySetter<V>(&SymbolLayer::setIconHaloBlur);
+ result["icon-halo-blur-transition"] = makeTransitionSetter<V>(&SymbolLayer::setIconHaloBlurTransition);
result["icon-translate"] = makePropertySetter<V>(&SymbolLayer::setIconTranslate);
+ result["icon-translate-transition"] = makeTransitionSetter<V>(&SymbolLayer::setIconTranslateTransition);
result["icon-translate-anchor"] = makePropertySetter<V>(&SymbolLayer::setIconTranslateAnchor);
+ result["icon-translate-anchor-transition"] = makeTransitionSetter<V>(&SymbolLayer::setIconTranslateAnchorTransition);
result["text-opacity"] = makePropertySetter<V>(&SymbolLayer::setTextOpacity);
+ result["text-opacity-transition"] = makeTransitionSetter<V>(&SymbolLayer::setTextOpacityTransition);
result["text-color"] = makePropertySetter<V>(&SymbolLayer::setTextColor);
+ result["text-color-transition"] = makeTransitionSetter<V>(&SymbolLayer::setTextColorTransition);
result["text-halo-color"] = makePropertySetter<V>(&SymbolLayer::setTextHaloColor);
+ result["text-halo-color-transition"] = makeTransitionSetter<V>(&SymbolLayer::setTextHaloColorTransition);
result["text-halo-width"] = makePropertySetter<V>(&SymbolLayer::setTextHaloWidth);
+ result["text-halo-width-transition"] = makeTransitionSetter<V>(&SymbolLayer::setTextHaloWidthTransition);
result["text-halo-blur"] = makePropertySetter<V>(&SymbolLayer::setTextHaloBlur);
+ result["text-halo-blur-transition"] = makeTransitionSetter<V>(&SymbolLayer::setTextHaloBlurTransition);
result["text-translate"] = makePropertySetter<V>(&SymbolLayer::setTextTranslate);
+ result["text-translate-transition"] = makeTransitionSetter<V>(&SymbolLayer::setTextTranslateTransition);
result["text-translate-anchor"] = makePropertySetter<V>(&SymbolLayer::setTextTranslateAnchor);
+ result["text-translate-anchor-transition"] = makeTransitionSetter<V>(&SymbolLayer::setTextTranslateAnchorTransition);
result["circle-radius"] = makePropertySetter<V>(&CircleLayer::setCircleRadius);
+ result["circle-radius-transition"] = makeTransitionSetter<V>(&CircleLayer::setCircleRadiusTransition);
result["circle-color"] = makePropertySetter<V>(&CircleLayer::setCircleColor);
+ result["circle-color-transition"] = makeTransitionSetter<V>(&CircleLayer::setCircleColorTransition);
result["circle-blur"] = makePropertySetter<V>(&CircleLayer::setCircleBlur);
+ result["circle-blur-transition"] = makeTransitionSetter<V>(&CircleLayer::setCircleBlurTransition);
result["circle-opacity"] = makePropertySetter<V>(&CircleLayer::setCircleOpacity);
+ result["circle-opacity-transition"] = makeTransitionSetter<V>(&CircleLayer::setCircleOpacityTransition);
result["circle-translate"] = makePropertySetter<V>(&CircleLayer::setCircleTranslate);
+ result["circle-translate-transition"] = makeTransitionSetter<V>(&CircleLayer::setCircleTranslateTransition);
result["circle-translate-anchor"] = makePropertySetter<V>(&CircleLayer::setCircleTranslateAnchor);
+ result["circle-translate-anchor-transition"] = makeTransitionSetter<V>(&CircleLayer::setCircleTranslateAnchorTransition);
result["circle-pitch-scale"] = makePropertySetter<V>(&CircleLayer::setCirclePitchScale);
+ result["circle-pitch-scale-transition"] = makeTransitionSetter<V>(&CircleLayer::setCirclePitchScaleTransition);
result["circle-stroke-width"] = makePropertySetter<V>(&CircleLayer::setCircleStrokeWidth);
+ result["circle-stroke-width-transition"] = makeTransitionSetter<V>(&CircleLayer::setCircleStrokeWidthTransition);
result["circle-stroke-color"] = makePropertySetter<V>(&CircleLayer::setCircleStrokeColor);
+ result["circle-stroke-color-transition"] = makeTransitionSetter<V>(&CircleLayer::setCircleStrokeColorTransition);
result["circle-stroke-opacity"] = makePropertySetter<V>(&CircleLayer::setCircleStrokeOpacity);
+ result["circle-stroke-opacity-transition"] = makeTransitionSetter<V>(&CircleLayer::setCircleStrokeOpacityTransition);
result["fill-extrusion-opacity"] = makePropertySetter<V>(&FillExtrusionLayer::setFillExtrusionOpacity);
+ result["fill-extrusion-opacity-transition"] = makeTransitionSetter<V>(&FillExtrusionLayer::setFillExtrusionOpacityTransition);
result["fill-extrusion-color"] = makePropertySetter<V>(&FillExtrusionLayer::setFillExtrusionColor);
+ result["fill-extrusion-color-transition"] = makeTransitionSetter<V>(&FillExtrusionLayer::setFillExtrusionColorTransition);
result["fill-extrusion-translate"] = makePropertySetter<V>(&FillExtrusionLayer::setFillExtrusionTranslate);
+ result["fill-extrusion-translate-transition"] = makeTransitionSetter<V>(&FillExtrusionLayer::setFillExtrusionTranslateTransition);
result["fill-extrusion-translate-anchor"] = makePropertySetter<V>(&FillExtrusionLayer::setFillExtrusionTranslateAnchor);
+ result["fill-extrusion-translate-anchor-transition"] = makeTransitionSetter<V>(&FillExtrusionLayer::setFillExtrusionTranslateAnchorTransition);
result["fill-extrusion-pattern"] = makePropertySetter<V>(&FillExtrusionLayer::setFillExtrusionPattern);
+ result["fill-extrusion-pattern-transition"] = makeTransitionSetter<V>(&FillExtrusionLayer::setFillExtrusionPatternTransition);
result["fill-extrusion-height"] = makePropertySetter<V>(&FillExtrusionLayer::setFillExtrusionHeight);
+ result["fill-extrusion-height-transition"] = makeTransitionSetter<V>(&FillExtrusionLayer::setFillExtrusionHeightTransition);
result["fill-extrusion-base"] = makePropertySetter<V>(&FillExtrusionLayer::setFillExtrusionBase);
+ result["fill-extrusion-base-transition"] = makeTransitionSetter<V>(&FillExtrusionLayer::setFillExtrusionBaseTransition);
result["raster-opacity"] = makePropertySetter<V>(&RasterLayer::setRasterOpacity);
+ result["raster-opacity-transition"] = makeTransitionSetter<V>(&RasterLayer::setRasterOpacityTransition);
result["raster-hue-rotate"] = makePropertySetter<V>(&RasterLayer::setRasterHueRotate);
+ result["raster-hue-rotate-transition"] = makeTransitionSetter<V>(&RasterLayer::setRasterHueRotateTransition);
result["raster-brightness-min"] = makePropertySetter<V>(&RasterLayer::setRasterBrightnessMin);
+ result["raster-brightness-min-transition"] = makeTransitionSetter<V>(&RasterLayer::setRasterBrightnessMinTransition);
result["raster-brightness-max"] = makePropertySetter<V>(&RasterLayer::setRasterBrightnessMax);
+ result["raster-brightness-max-transition"] = makeTransitionSetter<V>(&RasterLayer::setRasterBrightnessMaxTransition);
result["raster-saturation"] = makePropertySetter<V>(&RasterLayer::setRasterSaturation);
+ result["raster-saturation-transition"] = makeTransitionSetter<V>(&RasterLayer::setRasterSaturationTransition);
result["raster-contrast"] = makePropertySetter<V>(&RasterLayer::setRasterContrast);
+ result["raster-contrast-transition"] = makeTransitionSetter<V>(&RasterLayer::setRasterContrastTransition);
result["raster-fade-duration"] = makePropertySetter<V>(&RasterLayer::setRasterFadeDuration);
+ result["raster-fade-duration-transition"] = makeTransitionSetter<V>(&RasterLayer::setRasterFadeDurationTransition);
result["background-color"] = makePropertySetter<V>(&BackgroundLayer::setBackgroundColor);
+ result["background-color-transition"] = makeTransitionSetter<V>(&BackgroundLayer::setBackgroundColorTransition);
result["background-pattern"] = makePropertySetter<V>(&BackgroundLayer::setBackgroundPattern);
+ result["background-pattern-transition"] = makeTransitionSetter<V>(&BackgroundLayer::setBackgroundPatternTransition);
result["background-opacity"] = makePropertySetter<V>(&BackgroundLayer::setBackgroundOpacity);
+ result["background-opacity-transition"] = makeTransitionSetter<V>(&BackgroundLayer::setBackgroundOpacityTransition);
return result;
}
diff --git a/include/mbgl/style/conversion/make_property_setters.hpp.ejs b/include/mbgl/style/conversion/make_property_setters.hpp.ejs
index ed8f6e891c..65fbdea63e 100644
--- a/include/mbgl/style/conversion/make_property_setters.hpp.ejs
+++ b/include/mbgl/style/conversion/make_property_setters.hpp.ejs
@@ -36,6 +36,7 @@ auto makePaintPropertySetters() {
<% for (const layer of locals.layers) { -%>
<% for (const property of layer.paintProperties) { -%>
result["<%- property.name %>"] = makePropertySetter<V>(&<%- camelize(layer.type) %>Layer::set<%- camelize(property.name) %>);
+ result["<%- property.name %>-transition"] = makeTransitionSetter<V>(&<%- camelize(layer.type) %>Layer::set<%- camelize(property.name) %>Transition);
<% } -%>
<% } -%>
diff --git a/include/mbgl/style/conversion/property_setter.hpp b/include/mbgl/style/conversion/property_setter.hpp
index 52fb160fde..6a15c64026 100644
--- a/include/mbgl/style/conversion/property_setter.hpp
+++ b/include/mbgl/style/conversion/property_setter.hpp
@@ -5,6 +5,7 @@
#include <mbgl/style/conversion/constant.hpp>
#include <mbgl/style/conversion/property_value.hpp>
#include <mbgl/style/conversion/data_driven_property_value.hpp>
+#include <mbgl/style/conversion/transition_options.hpp>
#include <functional>
#include <string>
@@ -37,6 +38,24 @@ auto makePropertySetter(void (L::*setter)(PropertyValue, const Args&...args)) {
};
}
+template <class V, class L, class...Args>
+auto makeTransitionSetter(void (L::*setter)(const TransitionOptions&, const Args&...args)) {
+ return [setter] (Layer& layer, const V& value, const Args&...args) -> optional<Error> {
+ L* typedLayer = layer.as<L>();
+ if (!typedLayer) {
+ return Error { "layer doesn't support this property" };
+ }
+
+ Result<TransitionOptions> transition = convert<TransitionOptions>(value);
+ if (!transition) {
+ return transition.error();
+ }
+
+ (typedLayer->*setter)(*transition, args...);
+ return {};
+ };
+}
+
template <class V>
optional<Error> setVisibility(Layer& layer, const V& value) {
if (isUndefined(value)) {
diff --git a/include/mbgl/style/conversion/transition_options.hpp b/include/mbgl/style/conversion/transition_options.hpp
new file mode 100644
index 0000000000..cdd65cfe9f
--- /dev/null
+++ b/include/mbgl/style/conversion/transition_options.hpp
@@ -0,0 +1,45 @@
+#pragma once
+
+#include <mbgl/style/transition_options.hpp>
+#include <mbgl/style/conversion.hpp>
+
+namespace mbgl {
+namespace style {
+namespace conversion {
+
+template <>
+struct Converter<TransitionOptions> {
+public:
+ template <class V>
+ Result<TransitionOptions> operator()(const V& value) const {
+ if (!isObject(value)) {
+ return Error { "transition must be an object" };
+ }
+
+ TransitionOptions result;
+
+ auto duration = objectMember(value, "duration");
+ if (duration) {
+ auto number = toNumber(*duration);
+ if (!number) {
+ return Error { "duration must be a number" };
+ }
+ result.duration = { std::chrono::milliseconds(int64_t(*number)) };
+ }
+
+ auto delay = objectMember(value, "delay");
+ if (delay) {
+ auto number = toNumber(*delay);
+ if (!number) {
+ return Error { "delay must be a number" };
+ }
+ result.delay = { std::chrono::milliseconds(int64_t(*number)) };
+ }
+
+ return result;
+ }
+};
+
+} // namespace conversion
+} // namespace style
+} // namespace mbgl
diff --git a/include/mbgl/style/layers/background_layer.hpp b/include/mbgl/style/layers/background_layer.hpp
index 050cb67df6..94076931e7 100644
--- a/include/mbgl/style/layers/background_layer.hpp
+++ b/include/mbgl/style/layers/background_layer.hpp
@@ -12,6 +12,8 @@
namespace mbgl {
namespace style {
+class TransitionOptions;
+
class BackgroundLayer : public Layer {
public:
BackgroundLayer(const std::string& layerID);
@@ -22,14 +24,17 @@ public:
static PropertyValue<Color> getDefaultBackgroundColor();
PropertyValue<Color> getBackgroundColor(const optional<std::string>& klass = {}) const;
void setBackgroundColor(PropertyValue<Color>, const optional<std::string>& klass = {});
+ void setBackgroundColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<std::string> getDefaultBackgroundPattern();
PropertyValue<std::string> getBackgroundPattern(const optional<std::string>& klass = {}) const;
void setBackgroundPattern(PropertyValue<std::string>, const optional<std::string>& klass = {});
+ void setBackgroundPatternTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<float> getDefaultBackgroundOpacity();
PropertyValue<float> getBackgroundOpacity(const optional<std::string>& klass = {}) const;
void setBackgroundOpacity(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setBackgroundOpacityTransition(const TransitionOptions&, const optional<std::string>& klass = {});
// Private implementation
diff --git a/include/mbgl/style/layers/circle_layer.hpp b/include/mbgl/style/layers/circle_layer.hpp
index 8ffea9946f..35db4b3962 100644
--- a/include/mbgl/style/layers/circle_layer.hpp
+++ b/include/mbgl/style/layers/circle_layer.hpp
@@ -12,6 +12,8 @@
namespace mbgl {
namespace style {
+class TransitionOptions;
+
class CircleLayer : public Layer {
public:
CircleLayer(const std::string& layerID, const std::string& sourceID);
@@ -30,42 +32,52 @@ public:
static DataDrivenPropertyValue<float> getDefaultCircleRadius();
DataDrivenPropertyValue<float> getCircleRadius(const optional<std::string>& klass = {}) const;
void setCircleRadius(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
+ void setCircleRadiusTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<Color> getDefaultCircleColor();
DataDrivenPropertyValue<Color> getCircleColor(const optional<std::string>& klass = {}) const;
void setCircleColor(DataDrivenPropertyValue<Color>, const optional<std::string>& klass = {});
+ void setCircleColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<float> getDefaultCircleBlur();
DataDrivenPropertyValue<float> getCircleBlur(const optional<std::string>& klass = {}) const;
void setCircleBlur(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
+ void setCircleBlurTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<float> getDefaultCircleOpacity();
DataDrivenPropertyValue<float> getCircleOpacity(const optional<std::string>& klass = {}) const;
void setCircleOpacity(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
+ void setCircleOpacityTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<std::array<float, 2>> getDefaultCircleTranslate();
PropertyValue<std::array<float, 2>> getCircleTranslate(const optional<std::string>& klass = {}) const;
void setCircleTranslate(PropertyValue<std::array<float, 2>>, const optional<std::string>& klass = {});
+ void setCircleTranslateTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<TranslateAnchorType> getDefaultCircleTranslateAnchor();
PropertyValue<TranslateAnchorType> getCircleTranslateAnchor(const optional<std::string>& klass = {}) const;
void setCircleTranslateAnchor(PropertyValue<TranslateAnchorType>, const optional<std::string>& klass = {});
+ void setCircleTranslateAnchorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<CirclePitchScaleType> getDefaultCirclePitchScale();
PropertyValue<CirclePitchScaleType> getCirclePitchScale(const optional<std::string>& klass = {}) const;
void setCirclePitchScale(PropertyValue<CirclePitchScaleType>, const optional<std::string>& klass = {});
+ void setCirclePitchScaleTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<float> getDefaultCircleStrokeWidth();
DataDrivenPropertyValue<float> getCircleStrokeWidth(const optional<std::string>& klass = {}) const;
void setCircleStrokeWidth(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
+ void setCircleStrokeWidthTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<Color> getDefaultCircleStrokeColor();
DataDrivenPropertyValue<Color> getCircleStrokeColor(const optional<std::string>& klass = {}) const;
void setCircleStrokeColor(DataDrivenPropertyValue<Color>, const optional<std::string>& klass = {});
+ void setCircleStrokeColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<float> getDefaultCircleStrokeOpacity();
DataDrivenPropertyValue<float> getCircleStrokeOpacity(const optional<std::string>& klass = {}) const;
void setCircleStrokeOpacity(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
+ void setCircleStrokeOpacityTransition(const TransitionOptions&, const optional<std::string>& klass = {});
// Private implementation
diff --git a/include/mbgl/style/layers/fill_extrusion_layer.hpp b/include/mbgl/style/layers/fill_extrusion_layer.hpp
index 09a0040ff3..c19a4ee168 100644
--- a/include/mbgl/style/layers/fill_extrusion_layer.hpp
+++ b/include/mbgl/style/layers/fill_extrusion_layer.hpp
@@ -12,6 +12,8 @@
namespace mbgl {
namespace style {
+class TransitionOptions;
+
class FillExtrusionLayer : public Layer {
public:
FillExtrusionLayer(const std::string& layerID, const std::string& sourceID);
@@ -30,30 +32,37 @@ public:
static PropertyValue<float> getDefaultFillExtrusionOpacity();
PropertyValue<float> getFillExtrusionOpacity(const optional<std::string>& klass = {}) const;
void setFillExtrusionOpacity(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setFillExtrusionOpacityTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<Color> getDefaultFillExtrusionColor();
DataDrivenPropertyValue<Color> getFillExtrusionColor(const optional<std::string>& klass = {}) const;
void setFillExtrusionColor(DataDrivenPropertyValue<Color>, const optional<std::string>& klass = {});
+ void setFillExtrusionColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<std::array<float, 2>> getDefaultFillExtrusionTranslate();
PropertyValue<std::array<float, 2>> getFillExtrusionTranslate(const optional<std::string>& klass = {}) const;
void setFillExtrusionTranslate(PropertyValue<std::array<float, 2>>, const optional<std::string>& klass = {});
+ void setFillExtrusionTranslateTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<TranslateAnchorType> getDefaultFillExtrusionTranslateAnchor();
PropertyValue<TranslateAnchorType> getFillExtrusionTranslateAnchor(const optional<std::string>& klass = {}) const;
void setFillExtrusionTranslateAnchor(PropertyValue<TranslateAnchorType>, const optional<std::string>& klass = {});
+ void setFillExtrusionTranslateAnchorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<std::string> getDefaultFillExtrusionPattern();
PropertyValue<std::string> getFillExtrusionPattern(const optional<std::string>& klass = {}) const;
void setFillExtrusionPattern(PropertyValue<std::string>, const optional<std::string>& klass = {});
+ void setFillExtrusionPatternTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<float> getDefaultFillExtrusionHeight();
DataDrivenPropertyValue<float> getFillExtrusionHeight(const optional<std::string>& klass = {}) const;
void setFillExtrusionHeight(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
+ void setFillExtrusionHeightTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<float> getDefaultFillExtrusionBase();
DataDrivenPropertyValue<float> getFillExtrusionBase(const optional<std::string>& klass = {}) const;
void setFillExtrusionBase(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
+ void setFillExtrusionBaseTransition(const TransitionOptions&, const optional<std::string>& klass = {});
// Private implementation
diff --git a/include/mbgl/style/layers/fill_layer.hpp b/include/mbgl/style/layers/fill_layer.hpp
index 079541ec39..c064eab350 100644
--- a/include/mbgl/style/layers/fill_layer.hpp
+++ b/include/mbgl/style/layers/fill_layer.hpp
@@ -12,6 +12,8 @@
namespace mbgl {
namespace style {
+class TransitionOptions;
+
class FillLayer : public Layer {
public:
FillLayer(const std::string& layerID, const std::string& sourceID);
@@ -30,30 +32,37 @@ public:
static PropertyValue<bool> getDefaultFillAntialias();
PropertyValue<bool> getFillAntialias(const optional<std::string>& klass = {}) const;
void setFillAntialias(PropertyValue<bool>, const optional<std::string>& klass = {});
+ void setFillAntialiasTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<float> getDefaultFillOpacity();
DataDrivenPropertyValue<float> getFillOpacity(const optional<std::string>& klass = {}) const;
void setFillOpacity(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
+ void setFillOpacityTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<Color> getDefaultFillColor();
DataDrivenPropertyValue<Color> getFillColor(const optional<std::string>& klass = {}) const;
void setFillColor(DataDrivenPropertyValue<Color>, const optional<std::string>& klass = {});
+ void setFillColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<Color> getDefaultFillOutlineColor();
DataDrivenPropertyValue<Color> getFillOutlineColor(const optional<std::string>& klass = {}) const;
void setFillOutlineColor(DataDrivenPropertyValue<Color>, const optional<std::string>& klass = {});
+ void setFillOutlineColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<std::array<float, 2>> getDefaultFillTranslate();
PropertyValue<std::array<float, 2>> getFillTranslate(const optional<std::string>& klass = {}) const;
void setFillTranslate(PropertyValue<std::array<float, 2>>, const optional<std::string>& klass = {});
+ void setFillTranslateTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<TranslateAnchorType> getDefaultFillTranslateAnchor();
PropertyValue<TranslateAnchorType> getFillTranslateAnchor(const optional<std::string>& klass = {}) const;
void setFillTranslateAnchor(PropertyValue<TranslateAnchorType>, const optional<std::string>& klass = {});
+ void setFillTranslateAnchorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<std::string> getDefaultFillPattern();
PropertyValue<std::string> getFillPattern(const optional<std::string>& klass = {}) const;
void setFillPattern(PropertyValue<std::string>, const optional<std::string>& klass = {});
+ void setFillPatternTransition(const TransitionOptions&, const optional<std::string>& klass = {});
// Private implementation
diff --git a/include/mbgl/style/layers/layer.hpp.ejs b/include/mbgl/style/layers/layer.hpp.ejs
index 0c902de5af..d66eae8198 100644
--- a/include/mbgl/style/layers/layer.hpp.ejs
+++ b/include/mbgl/style/layers/layer.hpp.ejs
@@ -21,6 +21,8 @@
namespace mbgl {
namespace style {
+class TransitionOptions;
+
class <%- camelize(type) %>Layer : public Layer {
public:
<% if (type === 'background') { -%>
@@ -58,6 +60,7 @@ public:
static <%- propertyValueType(property) %> getDefault<%- camelize(property.name) %>();
<%- propertyValueType(property) %> get<%- camelize(property.name) %>(const optional<std::string>& klass = {}) const;
void set<%- camelize(property.name) %>(<%- propertyValueType(property) %>, const optional<std::string>& klass = {});
+ void set<%- camelize(property.name) %>Transition(const TransitionOptions&, const optional<std::string>& klass = {});
<% } -%>
// Private implementation
diff --git a/include/mbgl/style/layers/line_layer.hpp b/include/mbgl/style/layers/line_layer.hpp
index c9413f1096..2ed269ae74 100644
--- a/include/mbgl/style/layers/line_layer.hpp
+++ b/include/mbgl/style/layers/line_layer.hpp
@@ -14,6 +14,8 @@
namespace mbgl {
namespace style {
+class TransitionOptions;
+
class LineLayer : public Layer {
public:
LineLayer(const std::string& layerID, const std::string& sourceID);
@@ -50,42 +52,52 @@ public:
static DataDrivenPropertyValue<float> getDefaultLineOpacity();
DataDrivenPropertyValue<float> getLineOpacity(const optional<std::string>& klass = {}) const;
void setLineOpacity(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
+ void setLineOpacityTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<Color> getDefaultLineColor();
DataDrivenPropertyValue<Color> getLineColor(const optional<std::string>& klass = {}) const;
void setLineColor(DataDrivenPropertyValue<Color>, const optional<std::string>& klass = {});
+ void setLineColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<std::array<float, 2>> getDefaultLineTranslate();
PropertyValue<std::array<float, 2>> getLineTranslate(const optional<std::string>& klass = {}) const;
void setLineTranslate(PropertyValue<std::array<float, 2>>, const optional<std::string>& klass = {});
+ void setLineTranslateTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<TranslateAnchorType> getDefaultLineTranslateAnchor();
PropertyValue<TranslateAnchorType> getLineTranslateAnchor(const optional<std::string>& klass = {}) const;
void setLineTranslateAnchor(PropertyValue<TranslateAnchorType>, const optional<std::string>& klass = {});
+ void setLineTranslateAnchorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<float> getDefaultLineWidth();
PropertyValue<float> getLineWidth(const optional<std::string>& klass = {}) const;
void setLineWidth(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setLineWidthTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<float> getDefaultLineGapWidth();
DataDrivenPropertyValue<float> getLineGapWidth(const optional<std::string>& klass = {}) const;
void setLineGapWidth(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
+ void setLineGapWidthTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<float> getDefaultLineOffset();
DataDrivenPropertyValue<float> getLineOffset(const optional<std::string>& klass = {}) const;
void setLineOffset(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
+ void setLineOffsetTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static DataDrivenPropertyValue<float> getDefaultLineBlur();
DataDrivenPropertyValue<float> getLineBlur(const optional<std::string>& klass = {}) const;
void setLineBlur(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
+ void setLineBlurTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<std::vector<float>> getDefaultLineDasharray();
PropertyValue<std::vector<float>> getLineDasharray(const optional<std::string>& klass = {}) const;
void setLineDasharray(PropertyValue<std::vector<float>>, const optional<std::string>& klass = {});
+ void setLineDasharrayTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<std::string> getDefaultLinePattern();
PropertyValue<std::string> getLinePattern(const optional<std::string>& klass = {}) const;
void setLinePattern(PropertyValue<std::string>, const optional<std::string>& klass = {});
+ void setLinePatternTransition(const TransitionOptions&, const optional<std::string>& klass = {});
// Private implementation
diff --git a/include/mbgl/style/layers/raster_layer.hpp b/include/mbgl/style/layers/raster_layer.hpp
index e998abf12a..72665baa72 100644
--- a/include/mbgl/style/layers/raster_layer.hpp
+++ b/include/mbgl/style/layers/raster_layer.hpp
@@ -12,6 +12,8 @@
namespace mbgl {
namespace style {
+class TransitionOptions;
+
class RasterLayer : public Layer {
public:
RasterLayer(const std::string& layerID, const std::string& sourceID);
@@ -25,30 +27,37 @@ public:
static PropertyValue<float> getDefaultRasterOpacity();
PropertyValue<float> getRasterOpacity(const optional<std::string>& klass = {}) const;
void setRasterOpacity(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setRasterOpacityTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<float> getDefaultRasterHueRotate();
PropertyValue<float> getRasterHueRotate(const optional<std::string>& klass = {}) const;
void setRasterHueRotate(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setRasterHueRotateTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<float> getDefaultRasterBrightnessMin();
PropertyValue<float> getRasterBrightnessMin(const optional<std::string>& klass = {}) const;
void setRasterBrightnessMin(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setRasterBrightnessMinTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<float> getDefaultRasterBrightnessMax();
PropertyValue<float> getRasterBrightnessMax(const optional<std::string>& klass = {}) const;
void setRasterBrightnessMax(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setRasterBrightnessMaxTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<float> getDefaultRasterSaturation();
PropertyValue<float> getRasterSaturation(const optional<std::string>& klass = {}) const;
void setRasterSaturation(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setRasterSaturationTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<float> getDefaultRasterContrast();
PropertyValue<float> getRasterContrast(const optional<std::string>& klass = {}) const;
void setRasterContrast(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setRasterContrastTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<float> getDefaultRasterFadeDuration();
PropertyValue<float> getRasterFadeDuration(const optional<std::string>& klass = {}) const;
void setRasterFadeDuration(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setRasterFadeDurationTransition(const TransitionOptions&, const optional<std::string>& klass = {});
// Private implementation
diff --git a/include/mbgl/style/layers/symbol_layer.hpp b/include/mbgl/style/layers/symbol_layer.hpp
index 8826408e81..ad21a70698 100644
--- a/include/mbgl/style/layers/symbol_layer.hpp
+++ b/include/mbgl/style/layers/symbol_layer.hpp
@@ -14,6 +14,8 @@
namespace mbgl {
namespace style {
+class TransitionOptions;
+
class SymbolLayer : public Layer {
public:
SymbolLayer(const std::string& layerID, const std::string& sourceID);
@@ -170,58 +172,72 @@ public:
static PropertyValue<float> getDefaultIconOpacity();
PropertyValue<float> getIconOpacity(const optional<std::string>& klass = {}) const;
void setIconOpacity(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setIconOpacityTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<Color> getDefaultIconColor();
PropertyValue<Color> getIconColor(const optional<std::string>& klass = {}) const;
void setIconColor(PropertyValue<Color>, const optional<std::string>& klass = {});
+ void setIconColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<Color> getDefaultIconHaloColor();
PropertyValue<Color> getIconHaloColor(const optional<std::string>& klass = {}) const;
void setIconHaloColor(PropertyValue<Color>, const optional<std::string>& klass = {});
+ void setIconHaloColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<float> getDefaultIconHaloWidth();
PropertyValue<float> getIconHaloWidth(const optional<std::string>& klass = {}) const;
void setIconHaloWidth(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setIconHaloWidthTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<float> getDefaultIconHaloBlur();
PropertyValue<float> getIconHaloBlur(const optional<std::string>& klass = {}) const;
void setIconHaloBlur(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setIconHaloBlurTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<std::array<float, 2>> getDefaultIconTranslate();
PropertyValue<std::array<float, 2>> getIconTranslate(const optional<std::string>& klass = {}) const;
void setIconTranslate(PropertyValue<std::array<float, 2>>, const optional<std::string>& klass = {});
+ void setIconTranslateTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<TranslateAnchorType> getDefaultIconTranslateAnchor();
PropertyValue<TranslateAnchorType> getIconTranslateAnchor(const optional<std::string>& klass = {}) const;
void setIconTranslateAnchor(PropertyValue<TranslateAnchorType>, const optional<std::string>& klass = {});
+ void setIconTranslateAnchorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<float> getDefaultTextOpacity();
PropertyValue<float> getTextOpacity(const optional<std::string>& klass = {}) const;
void setTextOpacity(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setTextOpacityTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<Color> getDefaultTextColor();
PropertyValue<Color> getTextColor(const optional<std::string>& klass = {}) const;
void setTextColor(PropertyValue<Color>, const optional<std::string>& klass = {});
+ void setTextColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<Color> getDefaultTextHaloColor();
PropertyValue<Color> getTextHaloColor(const optional<std::string>& klass = {}) const;
void setTextHaloColor(PropertyValue<Color>, const optional<std::string>& klass = {});
+ void setTextHaloColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<float> getDefaultTextHaloWidth();
PropertyValue<float> getTextHaloWidth(const optional<std::string>& klass = {}) const;
void setTextHaloWidth(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setTextHaloWidthTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<float> getDefaultTextHaloBlur();
PropertyValue<float> getTextHaloBlur(const optional<std::string>& klass = {}) const;
void setTextHaloBlur(PropertyValue<float>, const optional<std::string>& klass = {});
+ void setTextHaloBlurTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<std::array<float, 2>> getDefaultTextTranslate();
PropertyValue<std::array<float, 2>> getTextTranslate(const optional<std::string>& klass = {}) const;
void setTextTranslate(PropertyValue<std::array<float, 2>>, const optional<std::string>& klass = {});
+ void setTextTranslateTransition(const TransitionOptions&, const optional<std::string>& klass = {});
static PropertyValue<TranslateAnchorType> getDefaultTextTranslateAnchor();
PropertyValue<TranslateAnchorType> getTextTranslateAnchor(const optional<std::string>& klass = {}) const;
void setTextTranslateAnchor(PropertyValue<TranslateAnchorType>, const optional<std::string>& klass = {});
+ void setTextTranslateAnchorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
// Private implementation
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,
diff --git a/test/style/conversion/layer.test.cpp b/test/style/conversion/layer.test.cpp
new file mode 100644
index 0000000000..b27c1841ee
--- /dev/null
+++ b/test/style/conversion/layer.test.cpp
@@ -0,0 +1,46 @@
+#include <mbgl/test/util.hpp>
+
+#include <mbgl/style/conversion.hpp>
+#include <mbgl/style/rapidjson_conversion.hpp>
+#include <mbgl/style/conversion/layer.hpp>
+#include <mbgl/style/layers/background_layer_impl.hpp>
+#include <mbgl/util/rapidjson.hpp>
+
+using namespace mbgl;
+using namespace mbgl::style;
+using namespace mbgl::style::conversion;
+using namespace std::literals::chrono_literals;
+
+auto parseLayer(const std::string& src) {
+ JSDocument doc;
+ doc.Parse<0>(src);
+ return convert<std::unique_ptr<Layer>, JSValue>(doc);
+}
+
+TEST(StyleConversion, LayerTransition) {
+ auto layer = parseLayer(R"JSON({
+ "type": "background",
+ "id": "background",
+ "paint": {
+ "background-color-transition": {
+ "duration": 400,
+ "delay": 500
+ }
+ },
+ "paint.class": {
+ "background-color-transition": {
+ "duration": 100
+ }
+ }
+ })JSON");
+
+ ASSERT_EQ(400ms, *(*layer)->as<BackgroundLayer>()->impl->paint.cascading
+ .get<BackgroundColor>().getTransition({}).duration);
+ ASSERT_EQ(500ms, *(*layer)->as<BackgroundLayer>()->impl->paint.cascading
+ .get<BackgroundColor>().getTransition({}).delay);
+
+ ASSERT_EQ(100ms, *(*layer)->as<BackgroundLayer>()->impl->paint.cascading
+ .get<BackgroundColor>().getTransition({"class"}).duration);
+ ASSERT_FALSE(bool((*layer)->as<BackgroundLayer>()->impl->paint.cascading
+ .get<BackgroundColor>().getTransition({"class"}).delay));
+}