summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-03-21 11:55:02 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-03-21 12:04:20 -0700
commite488ca702e8f822ba6297a2f3c933ee22ca6ce42 (patch)
tree2efe93d84722f37a61b83155510a3da444fc171b /src
parent1f8910de186f35216791a17a683a55f01031ec81 (diff)
parente0fe42d8321d19a4a9cb46edac9fbdb035e70a0c (diff)
downloadqtlocation-mapboxgl-e488ca702e8f822ba6297a2f3c933ee22ca6ce42.tar.gz
Merge branch 'release-ios-v3.5.0-android-v5.0.0'
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/shaders/symbol_sdf.cpp2
-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.hpp5
-rw-r--r--src/mbgl/style/style.cpp4
11 files changed, 243 insertions, 4 deletions
diff --git a/src/mbgl/shaders/symbol_sdf.cpp b/src/mbgl/shaders/symbol_sdf.cpp
index 76399dbb55..e0ee57b6d4 100644
--- a/src/mbgl/shaders/symbol_sdf.cpp
+++ b/src/mbgl/shaders/symbol_sdf.cpp
@@ -142,7 +142,7 @@ void main() {
lowp vec4 color = fill_color;
- lowp float gamma = EDGE_GAMMA / u_gamma_scale;
+ highp float gamma = EDGE_GAMMA / u_gamma_scale;
lowp float buff = (256.0 - 64.0) / 256.0;
if (u_is_halo) {
color = halo_color;
diff --git a/src/mbgl/style/layers/background_layer.cpp b/src/mbgl/style/layers/background_layer.cpp
index 5a903f1b6b..e2a517b9f4 100644
--- a/src/mbgl/style/layers/background_layer.cpp
+++ b/src/mbgl/style/layers/background_layer.cpp
@@ -59,6 +59,10 @@ void BackgroundLayer::setBackgroundColorTransition(const TransitionOptions& valu
impl->paint.setTransition<BackgroundColor>(value, klass);
}
+TransitionOptions BackgroundLayer::getBackgroundColorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<BackgroundColor>(klass);
+}
+
PropertyValue<std::string> BackgroundLayer::getDefaultBackgroundPattern() {
return { "" };
}
@@ -78,6 +82,10 @@ void BackgroundLayer::setBackgroundPatternTransition(const TransitionOptions& va
impl->paint.setTransition<BackgroundPattern>(value, klass);
}
+TransitionOptions BackgroundLayer::getBackgroundPatternTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<BackgroundPattern>(klass);
+}
+
PropertyValue<float> BackgroundLayer::getDefaultBackgroundOpacity() {
return { 1 };
}
@@ -97,5 +105,9 @@ void BackgroundLayer::setBackgroundOpacityTransition(const TransitionOptions& va
impl->paint.setTransition<BackgroundOpacity>(value, klass);
}
+TransitionOptions BackgroundLayer::getBackgroundOpacityTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<BackgroundOpacity>(klass);
+}
+
} // namespace style
} // namespace mbgl
diff --git a/src/mbgl/style/layers/circle_layer.cpp b/src/mbgl/style/layers/circle_layer.cpp
index 53248e9397..a628d7a417 100644
--- a/src/mbgl/style/layers/circle_layer.cpp
+++ b/src/mbgl/style/layers/circle_layer.cpp
@@ -88,6 +88,10 @@ void CircleLayer::setCircleRadiusTransition(const TransitionOptions& value, cons
impl->paint.setTransition<CircleRadius>(value, klass);
}
+TransitionOptions CircleLayer::getCircleRadiusTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<CircleRadius>(klass);
+}
+
DataDrivenPropertyValue<Color> CircleLayer::getDefaultCircleColor() {
return { Color::black() };
}
@@ -111,6 +115,10 @@ void CircleLayer::setCircleColorTransition(const TransitionOptions& value, const
impl->paint.setTransition<CircleColor>(value, klass);
}
+TransitionOptions CircleLayer::getCircleColorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<CircleColor>(klass);
+}
+
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleBlur() {
return { 0 };
}
@@ -134,6 +142,10 @@ void CircleLayer::setCircleBlurTransition(const TransitionOptions& value, const
impl->paint.setTransition<CircleBlur>(value, klass);
}
+TransitionOptions CircleLayer::getCircleBlurTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<CircleBlur>(klass);
+}
+
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleOpacity() {
return { 1 };
}
@@ -157,6 +169,10 @@ void CircleLayer::setCircleOpacityTransition(const TransitionOptions& value, con
impl->paint.setTransition<CircleOpacity>(value, klass);
}
+TransitionOptions CircleLayer::getCircleOpacityTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<CircleOpacity>(klass);
+}
+
PropertyValue<std::array<float, 2>> CircleLayer::getDefaultCircleTranslate() {
return { {{ 0, 0 }} };
}
@@ -176,6 +192,10 @@ void CircleLayer::setCircleTranslateTransition(const TransitionOptions& value, c
impl->paint.setTransition<CircleTranslate>(value, klass);
}
+TransitionOptions CircleLayer::getCircleTranslateTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<CircleTranslate>(klass);
+}
+
PropertyValue<TranslateAnchorType> CircleLayer::getDefaultCircleTranslateAnchor() {
return { TranslateAnchorType::Map };
}
@@ -195,6 +215,10 @@ void CircleLayer::setCircleTranslateAnchorTransition(const TransitionOptions& va
impl->paint.setTransition<CircleTranslateAnchor>(value, klass);
}
+TransitionOptions CircleLayer::getCircleTranslateAnchorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<CircleTranslateAnchor>(klass);
+}
+
PropertyValue<CirclePitchScaleType> CircleLayer::getDefaultCirclePitchScale() {
return { CirclePitchScaleType::Map };
}
@@ -214,6 +238,10 @@ void CircleLayer::setCirclePitchScaleTransition(const TransitionOptions& value,
impl->paint.setTransition<CirclePitchScale>(value, klass);
}
+TransitionOptions CircleLayer::getCirclePitchScaleTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<CirclePitchScale>(klass);
+}
+
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleStrokeWidth() {
return { 0 };
}
@@ -237,6 +265,10 @@ void CircleLayer::setCircleStrokeWidthTransition(const TransitionOptions& value,
impl->paint.setTransition<CircleStrokeWidth>(value, klass);
}
+TransitionOptions CircleLayer::getCircleStrokeWidthTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<CircleStrokeWidth>(klass);
+}
+
DataDrivenPropertyValue<Color> CircleLayer::getDefaultCircleStrokeColor() {
return { Color::black() };
}
@@ -260,6 +292,10 @@ void CircleLayer::setCircleStrokeColorTransition(const TransitionOptions& value,
impl->paint.setTransition<CircleStrokeColor>(value, klass);
}
+TransitionOptions CircleLayer::getCircleStrokeColorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<CircleStrokeColor>(klass);
+}
+
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleStrokeOpacity() {
return { 1 };
}
@@ -283,5 +319,9 @@ void CircleLayer::setCircleStrokeOpacityTransition(const TransitionOptions& valu
impl->paint.setTransition<CircleStrokeOpacity>(value, klass);
}
+TransitionOptions CircleLayer::getCircleStrokeOpacityTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<CircleStrokeOpacity>(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 4672ede9b8..53f7fc0757 100644
--- a/src/mbgl/style/layers/fill_extrusion_layer.cpp
+++ b/src/mbgl/style/layers/fill_extrusion_layer.cpp
@@ -84,6 +84,10 @@ void FillExtrusionLayer::setFillExtrusionOpacityTransition(const TransitionOptio
impl->paint.setTransition<FillExtrusionOpacity>(value, klass);
}
+TransitionOptions FillExtrusionLayer::getFillExtrusionOpacityTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<FillExtrusionOpacity>(klass);
+}
+
DataDrivenPropertyValue<Color> FillExtrusionLayer::getDefaultFillExtrusionColor() {
return { Color::black() };
}
@@ -107,6 +111,10 @@ void FillExtrusionLayer::setFillExtrusionColorTransition(const TransitionOptions
impl->paint.setTransition<FillExtrusionColor>(value, klass);
}
+TransitionOptions FillExtrusionLayer::getFillExtrusionColorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<FillExtrusionColor>(klass);
+}
+
PropertyValue<std::array<float, 2>> FillExtrusionLayer::getDefaultFillExtrusionTranslate() {
return { {{ 0, 0 }} };
}
@@ -126,6 +134,10 @@ void FillExtrusionLayer::setFillExtrusionTranslateTransition(const TransitionOpt
impl->paint.setTransition<FillExtrusionTranslate>(value, klass);
}
+TransitionOptions FillExtrusionLayer::getFillExtrusionTranslateTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<FillExtrusionTranslate>(klass);
+}
+
PropertyValue<TranslateAnchorType> FillExtrusionLayer::getDefaultFillExtrusionTranslateAnchor() {
return { TranslateAnchorType::Map };
}
@@ -145,6 +157,10 @@ void FillExtrusionLayer::setFillExtrusionTranslateAnchorTransition(const Transit
impl->paint.setTransition<FillExtrusionTranslateAnchor>(value, klass);
}
+TransitionOptions FillExtrusionLayer::getFillExtrusionTranslateAnchorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<FillExtrusionTranslateAnchor>(klass);
+}
+
PropertyValue<std::string> FillExtrusionLayer::getDefaultFillExtrusionPattern() {
return { "" };
}
@@ -164,6 +180,10 @@ void FillExtrusionLayer::setFillExtrusionPatternTransition(const TransitionOptio
impl->paint.setTransition<FillExtrusionPattern>(value, klass);
}
+TransitionOptions FillExtrusionLayer::getFillExtrusionPatternTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<FillExtrusionPattern>(klass);
+}
+
DataDrivenPropertyValue<float> FillExtrusionLayer::getDefaultFillExtrusionHeight() {
return { 0 };
}
@@ -187,6 +207,10 @@ void FillExtrusionLayer::setFillExtrusionHeightTransition(const TransitionOption
impl->paint.setTransition<FillExtrusionHeight>(value, klass);
}
+TransitionOptions FillExtrusionLayer::getFillExtrusionHeightTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<FillExtrusionHeight>(klass);
+}
+
DataDrivenPropertyValue<float> FillExtrusionLayer::getDefaultFillExtrusionBase() {
return { 0 };
}
@@ -210,5 +234,9 @@ void FillExtrusionLayer::setFillExtrusionBaseTransition(const TransitionOptions&
impl->paint.setTransition<FillExtrusionBase>(value, klass);
}
+TransitionOptions FillExtrusionLayer::getFillExtrusionBaseTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<FillExtrusionBase>(klass);
+}
+
} // namespace style
} // namespace mbgl
diff --git a/src/mbgl/style/layers/fill_layer.cpp b/src/mbgl/style/layers/fill_layer.cpp
index dfa88b5b0f..34203a10c0 100644
--- a/src/mbgl/style/layers/fill_layer.cpp
+++ b/src/mbgl/style/layers/fill_layer.cpp
@@ -84,6 +84,10 @@ void FillLayer::setFillAntialiasTransition(const TransitionOptions& value, const
impl->paint.setTransition<FillAntialias>(value, klass);
}
+TransitionOptions FillLayer::getFillAntialiasTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<FillAntialias>(klass);
+}
+
DataDrivenPropertyValue<float> FillLayer::getDefaultFillOpacity() {
return { 1 };
}
@@ -107,6 +111,10 @@ void FillLayer::setFillOpacityTransition(const TransitionOptions& value, const o
impl->paint.setTransition<FillOpacity>(value, klass);
}
+TransitionOptions FillLayer::getFillOpacityTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<FillOpacity>(klass);
+}
+
DataDrivenPropertyValue<Color> FillLayer::getDefaultFillColor() {
return { Color::black() };
}
@@ -130,6 +138,10 @@ void FillLayer::setFillColorTransition(const TransitionOptions& value, const opt
impl->paint.setTransition<FillColor>(value, klass);
}
+TransitionOptions FillLayer::getFillColorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<FillColor>(klass);
+}
+
DataDrivenPropertyValue<Color> FillLayer::getDefaultFillOutlineColor() {
return { {} };
}
@@ -153,6 +165,10 @@ void FillLayer::setFillOutlineColorTransition(const TransitionOptions& value, co
impl->paint.setTransition<FillOutlineColor>(value, klass);
}
+TransitionOptions FillLayer::getFillOutlineColorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<FillOutlineColor>(klass);
+}
+
PropertyValue<std::array<float, 2>> FillLayer::getDefaultFillTranslate() {
return { {{ 0, 0 }} };
}
@@ -172,6 +188,10 @@ void FillLayer::setFillTranslateTransition(const TransitionOptions& value, const
impl->paint.setTransition<FillTranslate>(value, klass);
}
+TransitionOptions FillLayer::getFillTranslateTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<FillTranslate>(klass);
+}
+
PropertyValue<TranslateAnchorType> FillLayer::getDefaultFillTranslateAnchor() {
return { TranslateAnchorType::Map };
}
@@ -191,6 +211,10 @@ void FillLayer::setFillTranslateAnchorTransition(const TransitionOptions& value,
impl->paint.setTransition<FillTranslateAnchor>(value, klass);
}
+TransitionOptions FillLayer::getFillTranslateAnchorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<FillTranslateAnchor>(klass);
+}
+
PropertyValue<std::string> FillLayer::getDefaultFillPattern() {
return { "" };
}
@@ -210,5 +234,9 @@ void FillLayer::setFillPatternTransition(const TransitionOptions& value, const o
impl->paint.setTransition<FillPattern>(value, klass);
}
+TransitionOptions FillLayer::getFillPatternTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<FillPattern>(klass);
+}
+
} // namespace style
} // namespace mbgl
diff --git a/src/mbgl/style/layers/layer.cpp.ejs b/src/mbgl/style/layers/layer.cpp.ejs
index 335573abf3..76c83f474a 100644
--- a/src/mbgl/style/layers/layer.cpp.ejs
+++ b/src/mbgl/style/layers/layer.cpp.ejs
@@ -130,6 +130,10 @@ void <%- camelize(type) %>Layer::set<%- camelize(property.name) %>(<%- propertyV
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);
}
+
+TransitionOptions <%- camelize(type) %>Layer::get<%- camelize(property.name) %>Transition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<<%- camelize(property.name) %>>(klass);
+}
<% } -%>
} // namespace style
diff --git a/src/mbgl/style/layers/line_layer.cpp b/src/mbgl/style/layers/line_layer.cpp
index eaaa0fcd45..cfb68f3262 100644
--- a/src/mbgl/style/layers/line_layer.cpp
+++ b/src/mbgl/style/layers/line_layer.cpp
@@ -145,6 +145,10 @@ void LineLayer::setLineOpacityTransition(const TransitionOptions& value, const o
impl->paint.setTransition<LineOpacity>(value, klass);
}
+TransitionOptions LineLayer::getLineOpacityTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<LineOpacity>(klass);
+}
+
DataDrivenPropertyValue<Color> LineLayer::getDefaultLineColor() {
return { Color::black() };
}
@@ -168,6 +172,10 @@ void LineLayer::setLineColorTransition(const TransitionOptions& value, const opt
impl->paint.setTransition<LineColor>(value, klass);
}
+TransitionOptions LineLayer::getLineColorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<LineColor>(klass);
+}
+
PropertyValue<std::array<float, 2>> LineLayer::getDefaultLineTranslate() {
return { {{ 0, 0 }} };
}
@@ -187,6 +195,10 @@ void LineLayer::setLineTranslateTransition(const TransitionOptions& value, const
impl->paint.setTransition<LineTranslate>(value, klass);
}
+TransitionOptions LineLayer::getLineTranslateTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<LineTranslate>(klass);
+}
+
PropertyValue<TranslateAnchorType> LineLayer::getDefaultLineTranslateAnchor() {
return { TranslateAnchorType::Map };
}
@@ -206,6 +218,10 @@ void LineLayer::setLineTranslateAnchorTransition(const TransitionOptions& value,
impl->paint.setTransition<LineTranslateAnchor>(value, klass);
}
+TransitionOptions LineLayer::getLineTranslateAnchorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<LineTranslateAnchor>(klass);
+}
+
PropertyValue<float> LineLayer::getDefaultLineWidth() {
return { 1 };
}
@@ -225,6 +241,10 @@ void LineLayer::setLineWidthTransition(const TransitionOptions& value, const opt
impl->paint.setTransition<LineWidth>(value, klass);
}
+TransitionOptions LineLayer::getLineWidthTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<LineWidth>(klass);
+}
+
DataDrivenPropertyValue<float> LineLayer::getDefaultLineGapWidth() {
return { 0 };
}
@@ -248,6 +268,10 @@ void LineLayer::setLineGapWidthTransition(const TransitionOptions& value, const
impl->paint.setTransition<LineGapWidth>(value, klass);
}
+TransitionOptions LineLayer::getLineGapWidthTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<LineGapWidth>(klass);
+}
+
DataDrivenPropertyValue<float> LineLayer::getDefaultLineOffset() {
return { 0 };
}
@@ -271,6 +295,10 @@ void LineLayer::setLineOffsetTransition(const TransitionOptions& value, const op
impl->paint.setTransition<LineOffset>(value, klass);
}
+TransitionOptions LineLayer::getLineOffsetTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<LineOffset>(klass);
+}
+
DataDrivenPropertyValue<float> LineLayer::getDefaultLineBlur() {
return { 0 };
}
@@ -294,6 +322,10 @@ void LineLayer::setLineBlurTransition(const TransitionOptions& value, const opti
impl->paint.setTransition<LineBlur>(value, klass);
}
+TransitionOptions LineLayer::getLineBlurTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<LineBlur>(klass);
+}
+
PropertyValue<std::vector<float>> LineLayer::getDefaultLineDasharray() {
return { { } };
}
@@ -313,6 +345,10 @@ void LineLayer::setLineDasharrayTransition(const TransitionOptions& value, const
impl->paint.setTransition<LineDasharray>(value, klass);
}
+TransitionOptions LineLayer::getLineDasharrayTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<LineDasharray>(klass);
+}
+
PropertyValue<std::string> LineLayer::getDefaultLinePattern() {
return { "" };
}
@@ -332,5 +368,9 @@ void LineLayer::setLinePatternTransition(const TransitionOptions& value, const o
impl->paint.setTransition<LinePattern>(value, klass);
}
+TransitionOptions LineLayer::getLinePatternTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<LinePattern>(klass);
+}
+
} // namespace style
} // namespace mbgl
diff --git a/src/mbgl/style/layers/raster_layer.cpp b/src/mbgl/style/layers/raster_layer.cpp
index 2108a5c49f..dfdd13e63c 100644
--- a/src/mbgl/style/layers/raster_layer.cpp
+++ b/src/mbgl/style/layers/raster_layer.cpp
@@ -66,6 +66,10 @@ void RasterLayer::setRasterOpacityTransition(const TransitionOptions& value, con
impl->paint.setTransition<RasterOpacity>(value, klass);
}
+TransitionOptions RasterLayer::getRasterOpacityTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<RasterOpacity>(klass);
+}
+
PropertyValue<float> RasterLayer::getDefaultRasterHueRotate() {
return { 0 };
}
@@ -85,6 +89,10 @@ void RasterLayer::setRasterHueRotateTransition(const TransitionOptions& value, c
impl->paint.setTransition<RasterHueRotate>(value, klass);
}
+TransitionOptions RasterLayer::getRasterHueRotateTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<RasterHueRotate>(klass);
+}
+
PropertyValue<float> RasterLayer::getDefaultRasterBrightnessMin() {
return { 0 };
}
@@ -104,6 +112,10 @@ void RasterLayer::setRasterBrightnessMinTransition(const TransitionOptions& valu
impl->paint.setTransition<RasterBrightnessMin>(value, klass);
}
+TransitionOptions RasterLayer::getRasterBrightnessMinTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<RasterBrightnessMin>(klass);
+}
+
PropertyValue<float> RasterLayer::getDefaultRasterBrightnessMax() {
return { 1 };
}
@@ -123,6 +135,10 @@ void RasterLayer::setRasterBrightnessMaxTransition(const TransitionOptions& valu
impl->paint.setTransition<RasterBrightnessMax>(value, klass);
}
+TransitionOptions RasterLayer::getRasterBrightnessMaxTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<RasterBrightnessMax>(klass);
+}
+
PropertyValue<float> RasterLayer::getDefaultRasterSaturation() {
return { 0 };
}
@@ -142,6 +158,10 @@ void RasterLayer::setRasterSaturationTransition(const TransitionOptions& value,
impl->paint.setTransition<RasterSaturation>(value, klass);
}
+TransitionOptions RasterLayer::getRasterSaturationTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<RasterSaturation>(klass);
+}
+
PropertyValue<float> RasterLayer::getDefaultRasterContrast() {
return { 0 };
}
@@ -161,6 +181,10 @@ void RasterLayer::setRasterContrastTransition(const TransitionOptions& value, co
impl->paint.setTransition<RasterContrast>(value, klass);
}
+TransitionOptions RasterLayer::getRasterContrastTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<RasterContrast>(klass);
+}
+
PropertyValue<float> RasterLayer::getDefaultRasterFadeDuration() {
return { 300 };
}
@@ -180,5 +204,9 @@ void RasterLayer::setRasterFadeDurationTransition(const TransitionOptions& value
impl->paint.setTransition<RasterFadeDuration>(value, klass);
}
+TransitionOptions RasterLayer::getRasterFadeDurationTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<RasterFadeDuration>(klass);
+}
+
} // namespace style
} // namespace mbgl
diff --git a/src/mbgl/style/layers/symbol_layer.cpp b/src/mbgl/style/layers/symbol_layer.cpp
index d85b8c00e6..42bcf0e6b0 100644
--- a/src/mbgl/style/layers/symbol_layer.cpp
+++ b/src/mbgl/style/layers/symbol_layer.cpp
@@ -565,6 +565,10 @@ void SymbolLayer::setIconOpacityTransition(const TransitionOptions& value, const
impl->paint.setTransition<IconOpacity>(value, klass);
}
+TransitionOptions SymbolLayer::getIconOpacityTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<IconOpacity>(klass);
+}
+
DataDrivenPropertyValue<Color> SymbolLayer::getDefaultIconColor() {
return { Color::black() };
}
@@ -588,6 +592,10 @@ void SymbolLayer::setIconColorTransition(const TransitionOptions& value, const o
impl->paint.setTransition<IconColor>(value, klass);
}
+TransitionOptions SymbolLayer::getIconColorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<IconColor>(klass);
+}
+
DataDrivenPropertyValue<Color> SymbolLayer::getDefaultIconHaloColor() {
return { {} };
}
@@ -611,6 +619,10 @@ void SymbolLayer::setIconHaloColorTransition(const TransitionOptions& value, con
impl->paint.setTransition<IconHaloColor>(value, klass);
}
+TransitionOptions SymbolLayer::getIconHaloColorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<IconHaloColor>(klass);
+}
+
DataDrivenPropertyValue<float> SymbolLayer::getDefaultIconHaloWidth() {
return { 0 };
}
@@ -634,6 +646,10 @@ void SymbolLayer::setIconHaloWidthTransition(const TransitionOptions& value, con
impl->paint.setTransition<IconHaloWidth>(value, klass);
}
+TransitionOptions SymbolLayer::getIconHaloWidthTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<IconHaloWidth>(klass);
+}
+
DataDrivenPropertyValue<float> SymbolLayer::getDefaultIconHaloBlur() {
return { 0 };
}
@@ -657,6 +673,10 @@ void SymbolLayer::setIconHaloBlurTransition(const TransitionOptions& value, cons
impl->paint.setTransition<IconHaloBlur>(value, klass);
}
+TransitionOptions SymbolLayer::getIconHaloBlurTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<IconHaloBlur>(klass);
+}
+
PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultIconTranslate() {
return { {{ 0, 0 }} };
}
@@ -676,6 +696,10 @@ void SymbolLayer::setIconTranslateTransition(const TransitionOptions& value, con
impl->paint.setTransition<IconTranslate>(value, klass);
}
+TransitionOptions SymbolLayer::getIconTranslateTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<IconTranslate>(klass);
+}
+
PropertyValue<TranslateAnchorType> SymbolLayer::getDefaultIconTranslateAnchor() {
return { TranslateAnchorType::Map };
}
@@ -695,6 +719,10 @@ void SymbolLayer::setIconTranslateAnchorTransition(const TransitionOptions& valu
impl->paint.setTransition<IconTranslateAnchor>(value, klass);
}
+TransitionOptions SymbolLayer::getIconTranslateAnchorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<IconTranslateAnchor>(klass);
+}
+
DataDrivenPropertyValue<float> SymbolLayer::getDefaultTextOpacity() {
return { 1 };
}
@@ -718,6 +746,10 @@ void SymbolLayer::setTextOpacityTransition(const TransitionOptions& value, const
impl->paint.setTransition<TextOpacity>(value, klass);
}
+TransitionOptions SymbolLayer::getTextOpacityTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<TextOpacity>(klass);
+}
+
DataDrivenPropertyValue<Color> SymbolLayer::getDefaultTextColor() {
return { Color::black() };
}
@@ -741,6 +773,10 @@ void SymbolLayer::setTextColorTransition(const TransitionOptions& value, const o
impl->paint.setTransition<TextColor>(value, klass);
}
+TransitionOptions SymbolLayer::getTextColorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<TextColor>(klass);
+}
+
DataDrivenPropertyValue<Color> SymbolLayer::getDefaultTextHaloColor() {
return { {} };
}
@@ -764,6 +800,10 @@ void SymbolLayer::setTextHaloColorTransition(const TransitionOptions& value, con
impl->paint.setTransition<TextHaloColor>(value, klass);
}
+TransitionOptions SymbolLayer::getTextHaloColorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<TextHaloColor>(klass);
+}
+
DataDrivenPropertyValue<float> SymbolLayer::getDefaultTextHaloWidth() {
return { 0 };
}
@@ -787,6 +827,10 @@ void SymbolLayer::setTextHaloWidthTransition(const TransitionOptions& value, con
impl->paint.setTransition<TextHaloWidth>(value, klass);
}
+TransitionOptions SymbolLayer::getTextHaloWidthTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<TextHaloWidth>(klass);
+}
+
DataDrivenPropertyValue<float> SymbolLayer::getDefaultTextHaloBlur() {
return { 0 };
}
@@ -810,6 +854,10 @@ void SymbolLayer::setTextHaloBlurTransition(const TransitionOptions& value, cons
impl->paint.setTransition<TextHaloBlur>(value, klass);
}
+TransitionOptions SymbolLayer::getTextHaloBlurTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<TextHaloBlur>(klass);
+}
+
PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultTextTranslate() {
return { {{ 0, 0 }} };
}
@@ -829,6 +877,10 @@ void SymbolLayer::setTextTranslateTransition(const TransitionOptions& value, con
impl->paint.setTransition<TextTranslate>(value, klass);
}
+TransitionOptions SymbolLayer::getTextTranslateTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<TextTranslate>(klass);
+}
+
PropertyValue<TranslateAnchorType> SymbolLayer::getDefaultTextTranslateAnchor() {
return { TranslateAnchorType::Map };
}
@@ -848,5 +900,9 @@ void SymbolLayer::setTextTranslateAnchorTransition(const TransitionOptions& valu
impl->paint.setTransition<TextTranslateAnchor>(value, klass);
}
+TransitionOptions SymbolLayer::getTextTranslateAnchorTransition(const optional<std::string>& klass) const {
+ return impl->paint.getTransition<TextTranslateAnchor>(klass);
+}
+
} // namespace style
} // namespace mbgl
diff --git a/src/mbgl/style/paint_property.hpp b/src/mbgl/style/paint_property.hpp
index 6035f06583..6fe53de573 100644
--- a/src/mbgl/style/paint_property.hpp
+++ b/src/mbgl/style/paint_property.hpp
@@ -224,6 +224,11 @@ public:
void setTransition(const TransitionOptions& value, const optional<std::string>& klass) {
cascading.template get<P>().setTransition(value, klass);
}
+
+ template <class P>
+ auto getTransition(const optional<std::string>& klass) const {
+ return cascading.template get<P>().getTransition(klass);
+ }
void cascade(const CascadeParameters& parameters) {
unevaluated = Unevaluated {
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp
index 9e212826f9..5f9983ae94 100644
--- a/src/mbgl/style/style.cpp
+++ b/src/mbgl/style/style.cpp
@@ -330,7 +330,7 @@ void Style::recalculate(float z, const TimePoint& timePoint, MapMode mode) {
hasPendingTransitions = false;
for (const auto& layer : layers) {
- const bool hasTransitions = layer->baseImpl->evaluate(parameters);
+ hasPendingTransitions |= layer->baseImpl->evaluate(parameters);
// Disable this layer if it doesn't need to be rendered.
const bool needsRendering = layer->baseImpl->needsRendering(zoomHistory.lastZoom);
@@ -338,8 +338,6 @@ void Style::recalculate(float z, const TimePoint& timePoint, MapMode mode) {
continue;
}
- hasPendingTransitions |= hasTransitions;
-
// If this layer has a source, make sure that it gets loaded.
if (Source* source = getSource(layer->baseImpl->source)) {
source->baseImpl->enabled = true;