summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/render.cpp5
-rw-r--r--cmake/core-files.cmake2
-rw-r--r--include/mbgl/map/map.hpp7
-rw-r--r--include/mbgl/style/conversion/layer.hpp23
-rw-r--r--include/mbgl/style/conversion/make_property_setters.hpp198
-rw-r--r--include/mbgl/style/conversion/make_property_setters.hpp.ejs8
-rw-r--r--include/mbgl/style/conversion/property_setter.hpp30
-rw-r--r--include/mbgl/style/layers/background_layer.hpp24
-rw-r--r--include/mbgl/style/layers/circle_layer.hpp80
-rw-r--r--include/mbgl/style/layers/fill_extrusion_layer.hpp56
-rw-r--r--include/mbgl/style/layers/fill_layer.hpp56
-rw-r--r--include/mbgl/style/layers/layer.hpp.ejs8
-rw-r--r--include/mbgl/style/layers/line_layer.hpp80
-rw-r--r--include/mbgl/style/layers/raster_layer.hpp56
-rw-r--r--include/mbgl/style/layers/symbol_layer.hpp112
m---------mapbox-gl-js0
-rw-r--r--platform/android/src/style/layers/layer.cpp2
-rw-r--r--platform/darwin/docs/guides/For Style Authors.md.ejs1
-rw-r--r--platform/darwin/src/MGLStyle.h32
-rw-r--r--platform/darwin/src/MGLStyle.mm34
-rw-r--r--platform/glfw/glfw_view.cpp11
-rw-r--r--platform/ios/CHANGELOG.md4
-rw-r--r--platform/ios/docs/guides/For Style Authors.md1
-rw-r--r--platform/ios/src/MGLMapView.h20
-rw-r--r--platform/macos/CHANGELOG.md4
-rw-r--r--platform/macos/docs/guides/For Style Authors.md1
-rw-r--r--platform/node/src/node_map.cpp29
-rw-r--r--platform/node/src/node_map.hpp1
-rw-r--r--platform/node/test/js/map.test.js1
-rw-r--r--platform/qt/app/mapwindow.cpp10
-rw-r--r--platform/qt/include/qmapboxgl.hpp8
-rw-r--r--platform/qt/src/qmapboxgl.cpp85
-rw-r--r--src/mbgl/map/map.cpp30
-rw-r--r--src/mbgl/map/update.hpp1
-rw-r--r--src/mbgl/renderer/transition_parameters.hpp2
-rw-r--r--src/mbgl/style/class_dictionary.cpp51
-rw-r--r--src/mbgl/style/class_dictionary.hpp52
-rw-r--r--src/mbgl/style/layers/background_layer.cpp54
-rw-r--r--src/mbgl/style/layers/circle_layer.cpp180
-rw-r--r--src/mbgl/style/layers/fill_extrusion_layer.cpp126
-rw-r--r--src/mbgl/style/layers/fill_layer.cpp126
-rw-r--r--src/mbgl/style/layers/layer.cpp.ejs18
-rw-r--r--src/mbgl/style/layers/line_layer.cpp180
-rw-r--r--src/mbgl/style/layers/raster_layer.cpp126
-rw-r--r--src/mbgl/style/layers/symbol_layer.cpp252
-rw-r--r--src/mbgl/style/paint_property.hpp6
-rw-r--r--src/mbgl/style/properties.hpp57
-rw-r--r--src/mbgl/style/style.cpp41
-rw-r--r--src/mbgl/style/style.hpp8
-rw-r--r--src/mbgl/tile/geometry_tile_worker.cpp1
-rw-r--r--test/map/map.test.cpp34
-rw-r--r--test/style/conversion/layer.test.cpp14
52 files changed, 930 insertions, 1418 deletions
diff --git a/bin/render.cpp b/bin/render.cpp
index 0af933475a..43b3c57a8d 100644
--- a/bin/render.cpp
+++ b/bin/render.cpp
@@ -34,7 +34,6 @@ int main(int argc, char *argv[]) {
static std::string output = "out.png";
std::string cache_file = "cache.sqlite";
std::string asset_root = ".";
- std::vector<std::string> classes;
std::string token;
bool debug = false;
@@ -49,7 +48,6 @@ int main(int argc, char *argv[]) {
("width,w", po::value(&width)->value_name("pixels")->default_value(width), "Image width")
("height,h", po::value(&height)->value_name("pixels")->default_value(height), "Image height")
("ratio,r", po::value(&pixelRatio)->value_name("number")->default_value(pixelRatio), "Image scale factor")
- ("class,c", po::value(&classes)->value_name("name"), "Class name")
("token,t", po::value(&token)->value_name("key")->default_value(token), "Mapbox access token")
("debug", po::bool_switch(&debug)->default_value(debug), "Debug mode")
("output,o", po::value(&output)->value_name("file")->default_value(output), "Output file name")
@@ -95,9 +93,6 @@ int main(int argc, char *argv[]) {
}
map.setStyleURL(style_path);
-
- map.setClasses(classes);
-
map.setLatLngZoom({ lat, lon }, zoom);
map.setBearing(bearing);
map.setPitch(pitch);
diff --git a/cmake/core-files.cmake b/cmake/core-files.cmake
index d9a475785c..47b34fcbc0 100644
--- a/cmake/core-files.cmake
+++ b/cmake/core-files.cmake
@@ -328,8 +328,6 @@ set(MBGL_CORE_FILES
include/mbgl/style/transition_options.hpp
include/mbgl/style/types.hpp
include/mbgl/style/undefined.hpp
- src/mbgl/style/class_dictionary.cpp
- src/mbgl/style/class_dictionary.hpp
src/mbgl/style/image.cpp
src/mbgl/style/image_impl.cpp
src/mbgl/style/image_impl.hpp
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index 1c0c2c544b..6b86684faa 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -59,16 +59,9 @@ public:
void render(View&);
// Styling
- void addClass(const std::string&);
- void removeClass(const std::string&);
- void setClasses(const std::vector<std::string>&);
-
style::TransitionOptions getTransitionOptions() const;
void setTransitionOptions(const style::TransitionOptions&);
- bool hasClass(const std::string&) const;
- std::vector<std::string> getClasses() const;
-
void setStyleURL(const std::string&);
void setStyleJSON(const std::string&);
std::string getStyleURL() const;
diff --git a/include/mbgl/style/conversion/layer.hpp b/include/mbgl/style/conversion/layer.hpp
index 3a64c36bf5..1fe467165d 100644
--- a/include/mbgl/style/conversion/layer.hpp
+++ b/include/mbgl/style/conversion/layer.hpp
@@ -28,30 +28,23 @@ optional<Error> setLayoutProperty(Layer& layer, const std::string& name, const V
}
template <class V>
-optional<Error> setPaintProperty(Layer& layer, const std::string& name, const V& value, const optional<std::string>& klass) {
+optional<Error> setPaintProperty(Layer& layer, const std::string& name, const V& value) {
static const auto setters = makePaintPropertySetters<V>();
auto it = setters.find(name);
if (it == setters.end()) {
return Error { "property not found" };
}
- return it->second(layer, value, klass);
+ return it->second(layer, value);
}
template <class V>
optional<Error> setPaintProperties(Layer& layer, const V& value) {
- return eachMember(value, [&] (const std::string& paintName, const V& paintValue) -> optional<Error> {
- if (paintName.compare(0, 5, "paint") != 0) {
- return {};
- }
-
- optional<std::string> klass;
- if (paintName.compare(0, 6, "paint.") == 0) {
- klass = paintName.substr(6);
- }
-
- return eachMember(paintValue, [&] (const std::string& k, const V& v) {
- return setPaintProperty(layer, k, v, klass);
- });
+ auto paintValue = objectMember(value, "paint");
+ if (!paintValue) {
+ return {};
+ }
+ return eachMember(*paintValue, [&] (const std::string& k, const V& v) {
+ return setPaintProperty(layer, k, v);
});
}
diff --git a/include/mbgl/style/conversion/make_property_setters.hpp b/include/mbgl/style/conversion/make_property_setters.hpp
index 105cca99d6..582ac7079f 100644
--- a/include/mbgl/style/conversion/make_property_setters.hpp
+++ b/include/mbgl/style/conversion/make_property_setters.hpp
@@ -20,50 +20,50 @@ namespace conversion {
template <class V>
auto makeLayoutPropertySetters() {
- std::unordered_map<std::string, LayoutPropertySetter<V>> result;
+ std::unordered_map<std::string, PropertySetter<V>> result;
result["visibility"] = &setVisibility<V>;
- result["line-cap"] = &setLayoutProperty<V, LineLayer, PropertyValue<LineCapType>, &LineLayer::setLineCap>;
- result["line-join"] = &setLayoutProperty<V, LineLayer, PropertyValue<LineJoinType>, &LineLayer::setLineJoin>;
- result["line-miter-limit"] = &setLayoutProperty<V, LineLayer, PropertyValue<float>, &LineLayer::setLineMiterLimit>;
- result["line-round-limit"] = &setLayoutProperty<V, LineLayer, PropertyValue<float>, &LineLayer::setLineRoundLimit>;
-
- result["symbol-placement"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<SymbolPlacementType>, &SymbolLayer::setSymbolPlacement>;
- result["symbol-spacing"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setSymbolSpacing>;
- result["symbol-avoid-edges"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setSymbolAvoidEdges>;
- result["icon-allow-overlap"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setIconAllowOverlap>;
- result["icon-ignore-placement"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setIconIgnorePlacement>;
- result["icon-optional"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setIconOptional>;
- result["icon-rotation-alignment"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<AlignmentType>, &SymbolLayer::setIconRotationAlignment>;
- result["icon-size"] = &setLayoutProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setIconSize>;
- result["icon-text-fit"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<IconTextFitType>, &SymbolLayer::setIconTextFit>;
- result["icon-text-fit-padding"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<std::array<float, 4>>, &SymbolLayer::setIconTextFitPadding>;
- result["icon-image"] = &setLayoutProperty<V, SymbolLayer, DataDrivenPropertyValue<std::string>, &SymbolLayer::setIconImage>;
- result["icon-rotate"] = &setLayoutProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setIconRotate>;
- result["icon-padding"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setIconPadding>;
- result["icon-keep-upright"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setIconKeepUpright>;
- result["icon-offset"] = &setLayoutProperty<V, SymbolLayer, DataDrivenPropertyValue<std::array<float, 2>>, &SymbolLayer::setIconOffset>;
- result["text-pitch-alignment"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<AlignmentType>, &SymbolLayer::setTextPitchAlignment>;
- result["text-rotation-alignment"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<AlignmentType>, &SymbolLayer::setTextRotationAlignment>;
- result["text-field"] = &setLayoutProperty<V, SymbolLayer, DataDrivenPropertyValue<std::string>, &SymbolLayer::setTextField>;
- result["text-font"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<std::vector<std::string>>, &SymbolLayer::setTextFont>;
- result["text-size"] = &setLayoutProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setTextSize>;
- result["text-max-width"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setTextMaxWidth>;
- result["text-line-height"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setTextLineHeight>;
- result["text-letter-spacing"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setTextLetterSpacing>;
- result["text-justify"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<TextJustifyType>, &SymbolLayer::setTextJustify>;
- result["text-anchor"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<TextAnchorType>, &SymbolLayer::setTextAnchor>;
- result["text-max-angle"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setTextMaxAngle>;
- result["text-rotate"] = &setLayoutProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setTextRotate>;
- result["text-padding"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setTextPadding>;
- result["text-keep-upright"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setTextKeepUpright>;
- result["text-transform"] = &setLayoutProperty<V, SymbolLayer, DataDrivenPropertyValue<TextTransformType>, &SymbolLayer::setTextTransform>;
- result["text-offset"] = &setLayoutProperty<V, SymbolLayer, DataDrivenPropertyValue<std::array<float, 2>>, &SymbolLayer::setTextOffset>;
- result["text-allow-overlap"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setTextAllowOverlap>;
- result["text-ignore-placement"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setTextIgnorePlacement>;
- result["text-optional"] = &setLayoutProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setTextOptional>;
+ result["line-cap"] = &setProperty<V, LineLayer, PropertyValue<LineCapType>, &LineLayer::setLineCap>;
+ result["line-join"] = &setProperty<V, LineLayer, PropertyValue<LineJoinType>, &LineLayer::setLineJoin>;
+ result["line-miter-limit"] = &setProperty<V, LineLayer, PropertyValue<float>, &LineLayer::setLineMiterLimit>;
+ result["line-round-limit"] = &setProperty<V, LineLayer, PropertyValue<float>, &LineLayer::setLineRoundLimit>;
+
+ result["symbol-placement"] = &setProperty<V, SymbolLayer, PropertyValue<SymbolPlacementType>, &SymbolLayer::setSymbolPlacement>;
+ result["symbol-spacing"] = &setProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setSymbolSpacing>;
+ result["symbol-avoid-edges"] = &setProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setSymbolAvoidEdges>;
+ result["icon-allow-overlap"] = &setProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setIconAllowOverlap>;
+ result["icon-ignore-placement"] = &setProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setIconIgnorePlacement>;
+ result["icon-optional"] = &setProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setIconOptional>;
+ result["icon-rotation-alignment"] = &setProperty<V, SymbolLayer, PropertyValue<AlignmentType>, &SymbolLayer::setIconRotationAlignment>;
+ result["icon-size"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setIconSize>;
+ result["icon-text-fit"] = &setProperty<V, SymbolLayer, PropertyValue<IconTextFitType>, &SymbolLayer::setIconTextFit>;
+ result["icon-text-fit-padding"] = &setProperty<V, SymbolLayer, PropertyValue<std::array<float, 4>>, &SymbolLayer::setIconTextFitPadding>;
+ result["icon-image"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<std::string>, &SymbolLayer::setIconImage>;
+ result["icon-rotate"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setIconRotate>;
+ result["icon-padding"] = &setProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setIconPadding>;
+ result["icon-keep-upright"] = &setProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setIconKeepUpright>;
+ result["icon-offset"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<std::array<float, 2>>, &SymbolLayer::setIconOffset>;
+ result["text-pitch-alignment"] = &setProperty<V, SymbolLayer, PropertyValue<AlignmentType>, &SymbolLayer::setTextPitchAlignment>;
+ result["text-rotation-alignment"] = &setProperty<V, SymbolLayer, PropertyValue<AlignmentType>, &SymbolLayer::setTextRotationAlignment>;
+ result["text-field"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<std::string>, &SymbolLayer::setTextField>;
+ result["text-font"] = &setProperty<V, SymbolLayer, PropertyValue<std::vector<std::string>>, &SymbolLayer::setTextFont>;
+ result["text-size"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setTextSize>;
+ result["text-max-width"] = &setProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setTextMaxWidth>;
+ result["text-line-height"] = &setProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setTextLineHeight>;
+ result["text-letter-spacing"] = &setProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setTextLetterSpacing>;
+ result["text-justify"] = &setProperty<V, SymbolLayer, PropertyValue<TextJustifyType>, &SymbolLayer::setTextJustify>;
+ result["text-anchor"] = &setProperty<V, SymbolLayer, PropertyValue<TextAnchorType>, &SymbolLayer::setTextAnchor>;
+ result["text-max-angle"] = &setProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setTextMaxAngle>;
+ result["text-rotate"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setTextRotate>;
+ result["text-padding"] = &setProperty<V, SymbolLayer, PropertyValue<float>, &SymbolLayer::setTextPadding>;
+ result["text-keep-upright"] = &setProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setTextKeepUpright>;
+ result["text-transform"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<TextTransformType>, &SymbolLayer::setTextTransform>;
+ result["text-offset"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<std::array<float, 2>>, &SymbolLayer::setTextOffset>;
+ result["text-allow-overlap"] = &setProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setTextAllowOverlap>;
+ result["text-ignore-placement"] = &setProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setTextIgnorePlacement>;
+ result["text-optional"] = &setProperty<V, SymbolLayer, PropertyValue<bool>, &SymbolLayer::setTextOptional>;
@@ -74,129 +74,129 @@ auto makeLayoutPropertySetters() {
template <class V>
auto makePaintPropertySetters() {
- std::unordered_map<std::string, PaintPropertySetter<V>> result;
+ std::unordered_map<std::string, PropertySetter<V>> result;
- result["fill-antialias"] = &setPaintProperty<V, FillLayer, PropertyValue<bool>, &FillLayer::setFillAntialias>;
+ result["fill-antialias"] = &setProperty<V, FillLayer, PropertyValue<bool>, &FillLayer::setFillAntialias>;
result["fill-antialias-transition"] = &setTransition<V, FillLayer, &FillLayer::setFillAntialiasTransition>;
- result["fill-opacity"] = &setPaintProperty<V, FillLayer, DataDrivenPropertyValue<float>, &FillLayer::setFillOpacity>;
+ result["fill-opacity"] = &setProperty<V, FillLayer, DataDrivenPropertyValue<float>, &FillLayer::setFillOpacity>;
result["fill-opacity-transition"] = &setTransition<V, FillLayer, &FillLayer::setFillOpacityTransition>;
- result["fill-color"] = &setPaintProperty<V, FillLayer, DataDrivenPropertyValue<Color>, &FillLayer::setFillColor>;
+ result["fill-color"] = &setProperty<V, FillLayer, DataDrivenPropertyValue<Color>, &FillLayer::setFillColor>;
result["fill-color-transition"] = &setTransition<V, FillLayer, &FillLayer::setFillColorTransition>;
- result["fill-outline-color"] = &setPaintProperty<V, FillLayer, DataDrivenPropertyValue<Color>, &FillLayer::setFillOutlineColor>;
+ result["fill-outline-color"] = &setProperty<V, FillLayer, DataDrivenPropertyValue<Color>, &FillLayer::setFillOutlineColor>;
result["fill-outline-color-transition"] = &setTransition<V, FillLayer, &FillLayer::setFillOutlineColorTransition>;
- result["fill-translate"] = &setPaintProperty<V, FillLayer, PropertyValue<std::array<float, 2>>, &FillLayer::setFillTranslate>;
+ result["fill-translate"] = &setProperty<V, FillLayer, PropertyValue<std::array<float, 2>>, &FillLayer::setFillTranslate>;
result["fill-translate-transition"] = &setTransition<V, FillLayer, &FillLayer::setFillTranslateTransition>;
- result["fill-translate-anchor"] = &setPaintProperty<V, FillLayer, PropertyValue<TranslateAnchorType>, &FillLayer::setFillTranslateAnchor>;
+ result["fill-translate-anchor"] = &setProperty<V, FillLayer, PropertyValue<TranslateAnchorType>, &FillLayer::setFillTranslateAnchor>;
result["fill-translate-anchor-transition"] = &setTransition<V, FillLayer, &FillLayer::setFillTranslateAnchorTransition>;
- result["fill-pattern"] = &setPaintProperty<V, FillLayer, PropertyValue<std::string>, &FillLayer::setFillPattern>;
+ result["fill-pattern"] = &setProperty<V, FillLayer, PropertyValue<std::string>, &FillLayer::setFillPattern>;
result["fill-pattern-transition"] = &setTransition<V, FillLayer, &FillLayer::setFillPatternTransition>;
- result["line-opacity"] = &setPaintProperty<V, LineLayer, DataDrivenPropertyValue<float>, &LineLayer::setLineOpacity>;
+ result["line-opacity"] = &setProperty<V, LineLayer, DataDrivenPropertyValue<float>, &LineLayer::setLineOpacity>;
result["line-opacity-transition"] = &setTransition<V, LineLayer, &LineLayer::setLineOpacityTransition>;
- result["line-color"] = &setPaintProperty<V, LineLayer, DataDrivenPropertyValue<Color>, &LineLayer::setLineColor>;
+ result["line-color"] = &setProperty<V, LineLayer, DataDrivenPropertyValue<Color>, &LineLayer::setLineColor>;
result["line-color-transition"] = &setTransition<V, LineLayer, &LineLayer::setLineColorTransition>;
- result["line-translate"] = &setPaintProperty<V, LineLayer, PropertyValue<std::array<float, 2>>, &LineLayer::setLineTranslate>;
+ result["line-translate"] = &setProperty<V, LineLayer, PropertyValue<std::array<float, 2>>, &LineLayer::setLineTranslate>;
result["line-translate-transition"] = &setTransition<V, LineLayer, &LineLayer::setLineTranslateTransition>;
- result["line-translate-anchor"] = &setPaintProperty<V, LineLayer, PropertyValue<TranslateAnchorType>, &LineLayer::setLineTranslateAnchor>;
+ result["line-translate-anchor"] = &setProperty<V, LineLayer, PropertyValue<TranslateAnchorType>, &LineLayer::setLineTranslateAnchor>;
result["line-translate-anchor-transition"] = &setTransition<V, LineLayer, &LineLayer::setLineTranslateAnchorTransition>;
- result["line-width"] = &setPaintProperty<V, LineLayer, PropertyValue<float>, &LineLayer::setLineWidth>;
+ result["line-width"] = &setProperty<V, LineLayer, PropertyValue<float>, &LineLayer::setLineWidth>;
result["line-width-transition"] = &setTransition<V, LineLayer, &LineLayer::setLineWidthTransition>;
- result["line-gap-width"] = &setPaintProperty<V, LineLayer, DataDrivenPropertyValue<float>, &LineLayer::setLineGapWidth>;
+ result["line-gap-width"] = &setProperty<V, LineLayer, DataDrivenPropertyValue<float>, &LineLayer::setLineGapWidth>;
result["line-gap-width-transition"] = &setTransition<V, LineLayer, &LineLayer::setLineGapWidthTransition>;
- result["line-offset"] = &setPaintProperty<V, LineLayer, DataDrivenPropertyValue<float>, &LineLayer::setLineOffset>;
+ result["line-offset"] = &setProperty<V, LineLayer, DataDrivenPropertyValue<float>, &LineLayer::setLineOffset>;
result["line-offset-transition"] = &setTransition<V, LineLayer, &LineLayer::setLineOffsetTransition>;
- result["line-blur"] = &setPaintProperty<V, LineLayer, DataDrivenPropertyValue<float>, &LineLayer::setLineBlur>;
+ result["line-blur"] = &setProperty<V, LineLayer, DataDrivenPropertyValue<float>, &LineLayer::setLineBlur>;
result["line-blur-transition"] = &setTransition<V, LineLayer, &LineLayer::setLineBlurTransition>;
- result["line-dasharray"] = &setPaintProperty<V, LineLayer, PropertyValue<std::vector<float>>, &LineLayer::setLineDasharray>;
+ result["line-dasharray"] = &setProperty<V, LineLayer, PropertyValue<std::vector<float>>, &LineLayer::setLineDasharray>;
result["line-dasharray-transition"] = &setTransition<V, LineLayer, &LineLayer::setLineDasharrayTransition>;
- result["line-pattern"] = &setPaintProperty<V, LineLayer, PropertyValue<std::string>, &LineLayer::setLinePattern>;
+ result["line-pattern"] = &setProperty<V, LineLayer, PropertyValue<std::string>, &LineLayer::setLinePattern>;
result["line-pattern-transition"] = &setTransition<V, LineLayer, &LineLayer::setLinePatternTransition>;
- result["icon-opacity"] = &setPaintProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setIconOpacity>;
+ result["icon-opacity"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setIconOpacity>;
result["icon-opacity-transition"] = &setTransition<V, SymbolLayer, &SymbolLayer::setIconOpacityTransition>;
- result["icon-color"] = &setPaintProperty<V, SymbolLayer, DataDrivenPropertyValue<Color>, &SymbolLayer::setIconColor>;
+ result["icon-color"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<Color>, &SymbolLayer::setIconColor>;
result["icon-color-transition"] = &setTransition<V, SymbolLayer, &SymbolLayer::setIconColorTransition>;
- result["icon-halo-color"] = &setPaintProperty<V, SymbolLayer, DataDrivenPropertyValue<Color>, &SymbolLayer::setIconHaloColor>;
+ result["icon-halo-color"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<Color>, &SymbolLayer::setIconHaloColor>;
result["icon-halo-color-transition"] = &setTransition<V, SymbolLayer, &SymbolLayer::setIconHaloColorTransition>;
- result["icon-halo-width"] = &setPaintProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setIconHaloWidth>;
+ result["icon-halo-width"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setIconHaloWidth>;
result["icon-halo-width-transition"] = &setTransition<V, SymbolLayer, &SymbolLayer::setIconHaloWidthTransition>;
- result["icon-halo-blur"] = &setPaintProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setIconHaloBlur>;
+ result["icon-halo-blur"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setIconHaloBlur>;
result["icon-halo-blur-transition"] = &setTransition<V, SymbolLayer, &SymbolLayer::setIconHaloBlurTransition>;
- result["icon-translate"] = &setPaintProperty<V, SymbolLayer, PropertyValue<std::array<float, 2>>, &SymbolLayer::setIconTranslate>;
+ result["icon-translate"] = &setProperty<V, SymbolLayer, PropertyValue<std::array<float, 2>>, &SymbolLayer::setIconTranslate>;
result["icon-translate-transition"] = &setTransition<V, SymbolLayer, &SymbolLayer::setIconTranslateTransition>;
- result["icon-translate-anchor"] = &setPaintProperty<V, SymbolLayer, PropertyValue<TranslateAnchorType>, &SymbolLayer::setIconTranslateAnchor>;
+ result["icon-translate-anchor"] = &setProperty<V, SymbolLayer, PropertyValue<TranslateAnchorType>, &SymbolLayer::setIconTranslateAnchor>;
result["icon-translate-anchor-transition"] = &setTransition<V, SymbolLayer, &SymbolLayer::setIconTranslateAnchorTransition>;
- result["text-opacity"] = &setPaintProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setTextOpacity>;
+ result["text-opacity"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setTextOpacity>;
result["text-opacity-transition"] = &setTransition<V, SymbolLayer, &SymbolLayer::setTextOpacityTransition>;
- result["text-color"] = &setPaintProperty<V, SymbolLayer, DataDrivenPropertyValue<Color>, &SymbolLayer::setTextColor>;
+ result["text-color"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<Color>, &SymbolLayer::setTextColor>;
result["text-color-transition"] = &setTransition<V, SymbolLayer, &SymbolLayer::setTextColorTransition>;
- result["text-halo-color"] = &setPaintProperty<V, SymbolLayer, DataDrivenPropertyValue<Color>, &SymbolLayer::setTextHaloColor>;
+ result["text-halo-color"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<Color>, &SymbolLayer::setTextHaloColor>;
result["text-halo-color-transition"] = &setTransition<V, SymbolLayer, &SymbolLayer::setTextHaloColorTransition>;
- result["text-halo-width"] = &setPaintProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setTextHaloWidth>;
+ result["text-halo-width"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setTextHaloWidth>;
result["text-halo-width-transition"] = &setTransition<V, SymbolLayer, &SymbolLayer::setTextHaloWidthTransition>;
- result["text-halo-blur"] = &setPaintProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setTextHaloBlur>;
+ result["text-halo-blur"] = &setProperty<V, SymbolLayer, DataDrivenPropertyValue<float>, &SymbolLayer::setTextHaloBlur>;
result["text-halo-blur-transition"] = &setTransition<V, SymbolLayer, &SymbolLayer::setTextHaloBlurTransition>;
- result["text-translate"] = &setPaintProperty<V, SymbolLayer, PropertyValue<std::array<float, 2>>, &SymbolLayer::setTextTranslate>;
+ result["text-translate"] = &setProperty<V, SymbolLayer, PropertyValue<std::array<float, 2>>, &SymbolLayer::setTextTranslate>;
result["text-translate-transition"] = &setTransition<V, SymbolLayer, &SymbolLayer::setTextTranslateTransition>;
- result["text-translate-anchor"] = &setPaintProperty<V, SymbolLayer, PropertyValue<TranslateAnchorType>, &SymbolLayer::setTextTranslateAnchor>;
+ result["text-translate-anchor"] = &setProperty<V, SymbolLayer, PropertyValue<TranslateAnchorType>, &SymbolLayer::setTextTranslateAnchor>;
result["text-translate-anchor-transition"] = &setTransition<V, SymbolLayer, &SymbolLayer::setTextTranslateAnchorTransition>;
- result["circle-radius"] = &setPaintProperty<V, CircleLayer, DataDrivenPropertyValue<float>, &CircleLayer::setCircleRadius>;
+ result["circle-radius"] = &setProperty<V, CircleLayer, DataDrivenPropertyValue<float>, &CircleLayer::setCircleRadius>;
result["circle-radius-transition"] = &setTransition<V, CircleLayer, &CircleLayer::setCircleRadiusTransition>;
- result["circle-color"] = &setPaintProperty<V, CircleLayer, DataDrivenPropertyValue<Color>, &CircleLayer::setCircleColor>;
+ result["circle-color"] = &setProperty<V, CircleLayer, DataDrivenPropertyValue<Color>, &CircleLayer::setCircleColor>;
result["circle-color-transition"] = &setTransition<V, CircleLayer, &CircleLayer::setCircleColorTransition>;
- result["circle-blur"] = &setPaintProperty<V, CircleLayer, DataDrivenPropertyValue<float>, &CircleLayer::setCircleBlur>;
+ result["circle-blur"] = &setProperty<V, CircleLayer, DataDrivenPropertyValue<float>, &CircleLayer::setCircleBlur>;
result["circle-blur-transition"] = &setTransition<V, CircleLayer, &CircleLayer::setCircleBlurTransition>;
- result["circle-opacity"] = &setPaintProperty<V, CircleLayer, DataDrivenPropertyValue<float>, &CircleLayer::setCircleOpacity>;
+ result["circle-opacity"] = &setProperty<V, CircleLayer, DataDrivenPropertyValue<float>, &CircleLayer::setCircleOpacity>;
result["circle-opacity-transition"] = &setTransition<V, CircleLayer, &CircleLayer::setCircleOpacityTransition>;
- result["circle-translate"] = &setPaintProperty<V, CircleLayer, PropertyValue<std::array<float, 2>>, &CircleLayer::setCircleTranslate>;
+ result["circle-translate"] = &setProperty<V, CircleLayer, PropertyValue<std::array<float, 2>>, &CircleLayer::setCircleTranslate>;
result["circle-translate-transition"] = &setTransition<V, CircleLayer, &CircleLayer::setCircleTranslateTransition>;
- result["circle-translate-anchor"] = &setPaintProperty<V, CircleLayer, PropertyValue<TranslateAnchorType>, &CircleLayer::setCircleTranslateAnchor>;
+ result["circle-translate-anchor"] = &setProperty<V, CircleLayer, PropertyValue<TranslateAnchorType>, &CircleLayer::setCircleTranslateAnchor>;
result["circle-translate-anchor-transition"] = &setTransition<V, CircleLayer, &CircleLayer::setCircleTranslateAnchorTransition>;
- result["circle-pitch-scale"] = &setPaintProperty<V, CircleLayer, PropertyValue<CirclePitchScaleType>, &CircleLayer::setCirclePitchScale>;
+ result["circle-pitch-scale"] = &setProperty<V, CircleLayer, PropertyValue<CirclePitchScaleType>, &CircleLayer::setCirclePitchScale>;
result["circle-pitch-scale-transition"] = &setTransition<V, CircleLayer, &CircleLayer::setCirclePitchScaleTransition>;
- result["circle-stroke-width"] = &setPaintProperty<V, CircleLayer, DataDrivenPropertyValue<float>, &CircleLayer::setCircleStrokeWidth>;
+ result["circle-stroke-width"] = &setProperty<V, CircleLayer, DataDrivenPropertyValue<float>, &CircleLayer::setCircleStrokeWidth>;
result["circle-stroke-width-transition"] = &setTransition<V, CircleLayer, &CircleLayer::setCircleStrokeWidthTransition>;
- result["circle-stroke-color"] = &setPaintProperty<V, CircleLayer, DataDrivenPropertyValue<Color>, &CircleLayer::setCircleStrokeColor>;
+ result["circle-stroke-color"] = &setProperty<V, CircleLayer, DataDrivenPropertyValue<Color>, &CircleLayer::setCircleStrokeColor>;
result["circle-stroke-color-transition"] = &setTransition<V, CircleLayer, &CircleLayer::setCircleStrokeColorTransition>;
- result["circle-stroke-opacity"] = &setPaintProperty<V, CircleLayer, DataDrivenPropertyValue<float>, &CircleLayer::setCircleStrokeOpacity>;
+ result["circle-stroke-opacity"] = &setProperty<V, CircleLayer, DataDrivenPropertyValue<float>, &CircleLayer::setCircleStrokeOpacity>;
result["circle-stroke-opacity-transition"] = &setTransition<V, CircleLayer, &CircleLayer::setCircleStrokeOpacityTransition>;
- result["fill-extrusion-opacity"] = &setPaintProperty<V, FillExtrusionLayer, PropertyValue<float>, &FillExtrusionLayer::setFillExtrusionOpacity>;
+ result["fill-extrusion-opacity"] = &setProperty<V, FillExtrusionLayer, PropertyValue<float>, &FillExtrusionLayer::setFillExtrusionOpacity>;
result["fill-extrusion-opacity-transition"] = &setTransition<V, FillExtrusionLayer, &FillExtrusionLayer::setFillExtrusionOpacityTransition>;
- result["fill-extrusion-color"] = &setPaintProperty<V, FillExtrusionLayer, DataDrivenPropertyValue<Color>, &FillExtrusionLayer::setFillExtrusionColor>;
+ result["fill-extrusion-color"] = &setProperty<V, FillExtrusionLayer, DataDrivenPropertyValue<Color>, &FillExtrusionLayer::setFillExtrusionColor>;
result["fill-extrusion-color-transition"] = &setTransition<V, FillExtrusionLayer, &FillExtrusionLayer::setFillExtrusionColorTransition>;
- result["fill-extrusion-translate"] = &setPaintProperty<V, FillExtrusionLayer, PropertyValue<std::array<float, 2>>, &FillExtrusionLayer::setFillExtrusionTranslate>;
+ result["fill-extrusion-translate"] = &setProperty<V, FillExtrusionLayer, PropertyValue<std::array<float, 2>>, &FillExtrusionLayer::setFillExtrusionTranslate>;
result["fill-extrusion-translate-transition"] = &setTransition<V, FillExtrusionLayer, &FillExtrusionLayer::setFillExtrusionTranslateTransition>;
- result["fill-extrusion-translate-anchor"] = &setPaintProperty<V, FillExtrusionLayer, PropertyValue<TranslateAnchorType>, &FillExtrusionLayer::setFillExtrusionTranslateAnchor>;
+ result["fill-extrusion-translate-anchor"] = &setProperty<V, FillExtrusionLayer, PropertyValue<TranslateAnchorType>, &FillExtrusionLayer::setFillExtrusionTranslateAnchor>;
result["fill-extrusion-translate-anchor-transition"] = &setTransition<V, FillExtrusionLayer, &FillExtrusionLayer::setFillExtrusionTranslateAnchorTransition>;
- result["fill-extrusion-pattern"] = &setPaintProperty<V, FillExtrusionLayer, PropertyValue<std::string>, &FillExtrusionLayer::setFillExtrusionPattern>;
+ result["fill-extrusion-pattern"] = &setProperty<V, FillExtrusionLayer, PropertyValue<std::string>, &FillExtrusionLayer::setFillExtrusionPattern>;
result["fill-extrusion-pattern-transition"] = &setTransition<V, FillExtrusionLayer, &FillExtrusionLayer::setFillExtrusionPatternTransition>;
- result["fill-extrusion-height"] = &setPaintProperty<V, FillExtrusionLayer, DataDrivenPropertyValue<float>, &FillExtrusionLayer::setFillExtrusionHeight>;
+ result["fill-extrusion-height"] = &setProperty<V, FillExtrusionLayer, DataDrivenPropertyValue<float>, &FillExtrusionLayer::setFillExtrusionHeight>;
result["fill-extrusion-height-transition"] = &setTransition<V, FillExtrusionLayer, &FillExtrusionLayer::setFillExtrusionHeightTransition>;
- result["fill-extrusion-base"] = &setPaintProperty<V, FillExtrusionLayer, DataDrivenPropertyValue<float>, &FillExtrusionLayer::setFillExtrusionBase>;
+ result["fill-extrusion-base"] = &setProperty<V, FillExtrusionLayer, DataDrivenPropertyValue<float>, &FillExtrusionLayer::setFillExtrusionBase>;
result["fill-extrusion-base-transition"] = &setTransition<V, FillExtrusionLayer, &FillExtrusionLayer::setFillExtrusionBaseTransition>;
- result["raster-opacity"] = &setPaintProperty<V, RasterLayer, PropertyValue<float>, &RasterLayer::setRasterOpacity>;
+ result["raster-opacity"] = &setProperty<V, RasterLayer, PropertyValue<float>, &RasterLayer::setRasterOpacity>;
result["raster-opacity-transition"] = &setTransition<V, RasterLayer, &RasterLayer::setRasterOpacityTransition>;
- result["raster-hue-rotate"] = &setPaintProperty<V, RasterLayer, PropertyValue<float>, &RasterLayer::setRasterHueRotate>;
+ result["raster-hue-rotate"] = &setProperty<V, RasterLayer, PropertyValue<float>, &RasterLayer::setRasterHueRotate>;
result["raster-hue-rotate-transition"] = &setTransition<V, RasterLayer, &RasterLayer::setRasterHueRotateTransition>;
- result["raster-brightness-min"] = &setPaintProperty<V, RasterLayer, PropertyValue<float>, &RasterLayer::setRasterBrightnessMin>;
+ result["raster-brightness-min"] = &setProperty<V, RasterLayer, PropertyValue<float>, &RasterLayer::setRasterBrightnessMin>;
result["raster-brightness-min-transition"] = &setTransition<V, RasterLayer, &RasterLayer::setRasterBrightnessMinTransition>;
- result["raster-brightness-max"] = &setPaintProperty<V, RasterLayer, PropertyValue<float>, &RasterLayer::setRasterBrightnessMax>;
+ result["raster-brightness-max"] = &setProperty<V, RasterLayer, PropertyValue<float>, &RasterLayer::setRasterBrightnessMax>;
result["raster-brightness-max-transition"] = &setTransition<V, RasterLayer, &RasterLayer::setRasterBrightnessMaxTransition>;
- result["raster-saturation"] = &setPaintProperty<V, RasterLayer, PropertyValue<float>, &RasterLayer::setRasterSaturation>;
+ result["raster-saturation"] = &setProperty<V, RasterLayer, PropertyValue<float>, &RasterLayer::setRasterSaturation>;
result["raster-saturation-transition"] = &setTransition<V, RasterLayer, &RasterLayer::setRasterSaturationTransition>;
- result["raster-contrast"] = &setPaintProperty<V, RasterLayer, PropertyValue<float>, &RasterLayer::setRasterContrast>;
+ result["raster-contrast"] = &setProperty<V, RasterLayer, PropertyValue<float>, &RasterLayer::setRasterContrast>;
result["raster-contrast-transition"] = &setTransition<V, RasterLayer, &RasterLayer::setRasterContrastTransition>;
- result["raster-fade-duration"] = &setPaintProperty<V, RasterLayer, PropertyValue<float>, &RasterLayer::setRasterFadeDuration>;
+ result["raster-fade-duration"] = &setProperty<V, RasterLayer, PropertyValue<float>, &RasterLayer::setRasterFadeDuration>;
result["raster-fade-duration-transition"] = &setTransition<V, RasterLayer, &RasterLayer::setRasterFadeDurationTransition>;
- result["background-color"] = &setPaintProperty<V, BackgroundLayer, PropertyValue<Color>, &BackgroundLayer::setBackgroundColor>;
+ result["background-color"] = &setProperty<V, BackgroundLayer, PropertyValue<Color>, &BackgroundLayer::setBackgroundColor>;
result["background-color-transition"] = &setTransition<V, BackgroundLayer, &BackgroundLayer::setBackgroundColorTransition>;
- result["background-pattern"] = &setPaintProperty<V, BackgroundLayer, PropertyValue<std::string>, &BackgroundLayer::setBackgroundPattern>;
+ result["background-pattern"] = &setProperty<V, BackgroundLayer, PropertyValue<std::string>, &BackgroundLayer::setBackgroundPattern>;
result["background-pattern-transition"] = &setTransition<V, BackgroundLayer, &BackgroundLayer::setBackgroundPatternTransition>;
- result["background-opacity"] = &setPaintProperty<V, BackgroundLayer, PropertyValue<float>, &BackgroundLayer::setBackgroundOpacity>;
+ result["background-opacity"] = &setProperty<V, BackgroundLayer, PropertyValue<float>, &BackgroundLayer::setBackgroundOpacity>;
result["background-opacity-transition"] = &setTransition<V, BackgroundLayer, &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 a99e75aec7..19c9f70538 100644
--- a/include/mbgl/style/conversion/make_property_setters.hpp.ejs
+++ b/include/mbgl/style/conversion/make_property_setters.hpp.ejs
@@ -16,13 +16,13 @@ namespace conversion {
template <class V>
auto makeLayoutPropertySetters() {
- std::unordered_map<std::string, LayoutPropertySetter<V>> result;
+ std::unordered_map<std::string, PropertySetter<V>> result;
result["visibility"] = &setVisibility<V>;
<% for (const layer of locals.layers) { -%>
<% for (const property of layer.layoutProperties) { -%>
- result["<%- property.name %>"] = &setLayoutProperty<V, <%- camelize(layer.type) %>Layer, <%- propertyValueType(property) %>, &<%- camelize(layer.type) %>Layer::set<%- camelize(property.name) %>>;
+ result["<%- property.name %>"] = &setProperty<V, <%- camelize(layer.type) %>Layer, <%- propertyValueType(property) %>, &<%- camelize(layer.type) %>Layer::set<%- camelize(property.name) %>>;
<% } -%>
<% } -%>
@@ -31,11 +31,11 @@ auto makeLayoutPropertySetters() {
template <class V>
auto makePaintPropertySetters() {
- std::unordered_map<std::string, PaintPropertySetter<V>> result;
+ std::unordered_map<std::string, PropertySetter<V>> result;
<% for (const layer of locals.layers) { -%>
<% for (const property of layer.paintProperties) { -%>
- result["<%- property.name %>"] = &setPaintProperty<V, <%- camelize(layer.type) %>Layer, <%- propertyValueType(property) %>, &<%- camelize(layer.type) %>Layer::set<%- camelize(property.name) %>>;
+ result["<%- property.name %>"] = &setProperty<V, <%- camelize(layer.type) %>Layer, <%- propertyValueType(property) %>, &<%- camelize(layer.type) %>Layer::set<%- camelize(property.name) %>>;
result["<%- property.name %>-transition"] = &setTransition<V, <%- camelize(layer.type) %>Layer, &<%- 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 8658fd60b0..759c4512cc 100644
--- a/include/mbgl/style/conversion/property_setter.hpp
+++ b/include/mbgl/style/conversion/property_setter.hpp
@@ -14,13 +14,10 @@ namespace style {
namespace conversion {
template <class V>
-using LayoutPropertySetter = optional<Error> (*) (Layer&, const V&);
-
-template <class V>
-using PaintPropertySetter = optional<Error> (*) (Layer&, const V&, const optional<std::string>&);
+using PropertySetter = optional<Error> (*) (Layer&, const V&);
template <class V, class L, class PropertyValue, void (L::*setter)(PropertyValue)>
-optional<Error> setLayoutProperty(Layer& layer, const V& value) {
+optional<Error> setProperty(Layer& layer, const V& value) {
auto* typedLayer = layer.as<L>();
if (!typedLayer) {
return Error { "layer doesn't support this property" };
@@ -36,25 +33,8 @@ optional<Error> setLayoutProperty(Layer& layer, const V& value) {
return {};
}
-template <class V, class L, class PropertyValue, void (L::*setter)(PropertyValue, const optional<std::string>&)>
-optional<Error> setPaintProperty(Layer& layer, const V& value, const optional<std::string>& klass) {
- auto* typedLayer = layer.as<L>();
- if (!typedLayer) {
- return Error { "layer doesn't support this property" };
- }
-
- Error error;
- optional<PropertyValue> typedValue = convert<PropertyValue>(value, error);
- if (!typedValue) {
- return error;
- }
-
- (typedLayer->*setter)(*typedValue, klass);
- return {};
-}
-
-template <class V, class L, void (L::*setter)(const TransitionOptions&, const optional<std::string>&)>
-optional<Error> setTransition(Layer& layer, const V& value, const optional<std::string>& klass) {
+template <class V, class L, void (L::*setter)(const TransitionOptions&)>
+optional<Error> setTransition(Layer& layer, const V& value) {
auto* typedLayer = layer.as<L>();
if (!typedLayer) {
return Error { "layer doesn't support this property" };
@@ -66,7 +46,7 @@ optional<Error> setTransition(Layer& layer, const V& value, const optional<std::
return error;
}
- (typedLayer->*setter)(*transition, klass);
+ (typedLayer->*setter)(*transition);
return {};
}
diff --git a/include/mbgl/style/layers/background_layer.hpp b/include/mbgl/style/layers/background_layer.hpp
index 63708a449f..903983844f 100644
--- a/include/mbgl/style/layers/background_layer.hpp
+++ b/include/mbgl/style/layers/background_layer.hpp
@@ -29,22 +29,22 @@ public:
// Paint properties
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 = {});
- TransitionOptions getBackgroundColorTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<Color> getBackgroundColor() const;
+ void setBackgroundColor(PropertyValue<Color>);
+ void setBackgroundColorTransition(const TransitionOptions&);
+ TransitionOptions getBackgroundColorTransition() const;
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 = {});
- TransitionOptions getBackgroundPatternTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<std::string> getBackgroundPattern() const;
+ void setBackgroundPattern(PropertyValue<std::string>);
+ void setBackgroundPatternTransition(const TransitionOptions&);
+ TransitionOptions getBackgroundPatternTransition() const;
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 = {});
- TransitionOptions getBackgroundOpacityTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<float> getBackgroundOpacity() const;
+ void setBackgroundOpacity(PropertyValue<float>);
+ void setBackgroundOpacityTransition(const TransitionOptions&);
+ TransitionOptions getBackgroundOpacityTransition() const;
// Private implementation
diff --git a/include/mbgl/style/layers/circle_layer.hpp b/include/mbgl/style/layers/circle_layer.hpp
index f40c507e28..275a2e67a5 100644
--- a/include/mbgl/style/layers/circle_layer.hpp
+++ b/include/mbgl/style/layers/circle_layer.hpp
@@ -37,64 +37,64 @@ public:
// Paint properties
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 = {});
- TransitionOptions getCircleRadiusTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getCircleRadius() const;
+ void setCircleRadius(DataDrivenPropertyValue<float>);
+ void setCircleRadiusTransition(const TransitionOptions&);
+ TransitionOptions getCircleRadiusTransition() const;
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 = {});
- TransitionOptions getCircleColorTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<Color> getCircleColor() const;
+ void setCircleColor(DataDrivenPropertyValue<Color>);
+ void setCircleColorTransition(const TransitionOptions&);
+ TransitionOptions getCircleColorTransition() const;
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 = {});
- TransitionOptions getCircleBlurTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getCircleBlur() const;
+ void setCircleBlur(DataDrivenPropertyValue<float>);
+ void setCircleBlurTransition(const TransitionOptions&);
+ TransitionOptions getCircleBlurTransition() const;
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 = {});
- TransitionOptions getCircleOpacityTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getCircleOpacity() const;
+ void setCircleOpacity(DataDrivenPropertyValue<float>);
+ void setCircleOpacityTransition(const TransitionOptions&);
+ TransitionOptions getCircleOpacityTransition() const;
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 = {});
- TransitionOptions getCircleTranslateTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<std::array<float, 2>> getCircleTranslate() const;
+ void setCircleTranslate(PropertyValue<std::array<float, 2>>);
+ void setCircleTranslateTransition(const TransitionOptions&);
+ TransitionOptions getCircleTranslateTransition() const;
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 = {});
- TransitionOptions getCircleTranslateAnchorTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<TranslateAnchorType> getCircleTranslateAnchor() const;
+ void setCircleTranslateAnchor(PropertyValue<TranslateAnchorType>);
+ void setCircleTranslateAnchorTransition(const TransitionOptions&);
+ TransitionOptions getCircleTranslateAnchorTransition() const;
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 = {});
- TransitionOptions getCirclePitchScaleTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<CirclePitchScaleType> getCirclePitchScale() const;
+ void setCirclePitchScale(PropertyValue<CirclePitchScaleType>);
+ void setCirclePitchScaleTransition(const TransitionOptions&);
+ TransitionOptions getCirclePitchScaleTransition() const;
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 = {});
- TransitionOptions getCircleStrokeWidthTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getCircleStrokeWidth() const;
+ void setCircleStrokeWidth(DataDrivenPropertyValue<float>);
+ void setCircleStrokeWidthTransition(const TransitionOptions&);
+ TransitionOptions getCircleStrokeWidthTransition() const;
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 = {});
- TransitionOptions getCircleStrokeColorTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<Color> getCircleStrokeColor() const;
+ void setCircleStrokeColor(DataDrivenPropertyValue<Color>);
+ void setCircleStrokeColorTransition(const TransitionOptions&);
+ TransitionOptions getCircleStrokeColorTransition() const;
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 = {});
- TransitionOptions getCircleStrokeOpacityTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getCircleStrokeOpacity() const;
+ void setCircleStrokeOpacity(DataDrivenPropertyValue<float>);
+ void setCircleStrokeOpacityTransition(const TransitionOptions&);
+ TransitionOptions getCircleStrokeOpacityTransition() const;
// Private implementation
diff --git a/include/mbgl/style/layers/fill_extrusion_layer.hpp b/include/mbgl/style/layers/fill_extrusion_layer.hpp
index bc6890e82f..e1c54f54ee 100644
--- a/include/mbgl/style/layers/fill_extrusion_layer.hpp
+++ b/include/mbgl/style/layers/fill_extrusion_layer.hpp
@@ -37,46 +37,46 @@ public:
// Paint properties
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 = {});
- TransitionOptions getFillExtrusionOpacityTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<float> getFillExtrusionOpacity() const;
+ void setFillExtrusionOpacity(PropertyValue<float>);
+ void setFillExtrusionOpacityTransition(const TransitionOptions&);
+ TransitionOptions getFillExtrusionOpacityTransition() const;
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 = {});
- TransitionOptions getFillExtrusionColorTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<Color> getFillExtrusionColor() const;
+ void setFillExtrusionColor(DataDrivenPropertyValue<Color>);
+ void setFillExtrusionColorTransition(const TransitionOptions&);
+ TransitionOptions getFillExtrusionColorTransition() const;
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 = {});
- TransitionOptions getFillExtrusionTranslateTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<std::array<float, 2>> getFillExtrusionTranslate() const;
+ void setFillExtrusionTranslate(PropertyValue<std::array<float, 2>>);
+ void setFillExtrusionTranslateTransition(const TransitionOptions&);
+ TransitionOptions getFillExtrusionTranslateTransition() const;
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 = {});
- TransitionOptions getFillExtrusionTranslateAnchorTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<TranslateAnchorType> getFillExtrusionTranslateAnchor() const;
+ void setFillExtrusionTranslateAnchor(PropertyValue<TranslateAnchorType>);
+ void setFillExtrusionTranslateAnchorTransition(const TransitionOptions&);
+ TransitionOptions getFillExtrusionTranslateAnchorTransition() const;
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 = {});
- TransitionOptions getFillExtrusionPatternTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<std::string> getFillExtrusionPattern() const;
+ void setFillExtrusionPattern(PropertyValue<std::string>);
+ void setFillExtrusionPatternTransition(const TransitionOptions&);
+ TransitionOptions getFillExtrusionPatternTransition() const;
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 = {});
- TransitionOptions getFillExtrusionHeightTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getFillExtrusionHeight() const;
+ void setFillExtrusionHeight(DataDrivenPropertyValue<float>);
+ void setFillExtrusionHeightTransition(const TransitionOptions&);
+ TransitionOptions getFillExtrusionHeightTransition() const;
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 = {});
- TransitionOptions getFillExtrusionBaseTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getFillExtrusionBase() const;
+ void setFillExtrusionBase(DataDrivenPropertyValue<float>);
+ void setFillExtrusionBaseTransition(const TransitionOptions&);
+ TransitionOptions getFillExtrusionBaseTransition() const;
// Private implementation
diff --git a/include/mbgl/style/layers/fill_layer.hpp b/include/mbgl/style/layers/fill_layer.hpp
index 3d08e75a1c..dfbe69d7fe 100644
--- a/include/mbgl/style/layers/fill_layer.hpp
+++ b/include/mbgl/style/layers/fill_layer.hpp
@@ -37,46 +37,46 @@ public:
// Paint properties
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 = {});
- TransitionOptions getFillAntialiasTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<bool> getFillAntialias() const;
+ void setFillAntialias(PropertyValue<bool>);
+ void setFillAntialiasTransition(const TransitionOptions&);
+ TransitionOptions getFillAntialiasTransition() const;
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 = {});
- TransitionOptions getFillOpacityTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getFillOpacity() const;
+ void setFillOpacity(DataDrivenPropertyValue<float>);
+ void setFillOpacityTransition(const TransitionOptions&);
+ TransitionOptions getFillOpacityTransition() const;
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 = {});
- TransitionOptions getFillColorTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<Color> getFillColor() const;
+ void setFillColor(DataDrivenPropertyValue<Color>);
+ void setFillColorTransition(const TransitionOptions&);
+ TransitionOptions getFillColorTransition() const;
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 = {});
- TransitionOptions getFillOutlineColorTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<Color> getFillOutlineColor() const;
+ void setFillOutlineColor(DataDrivenPropertyValue<Color>);
+ void setFillOutlineColorTransition(const TransitionOptions&);
+ TransitionOptions getFillOutlineColorTransition() const;
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 = {});
- TransitionOptions getFillTranslateTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<std::array<float, 2>> getFillTranslate() const;
+ void setFillTranslate(PropertyValue<std::array<float, 2>>);
+ void setFillTranslateTransition(const TransitionOptions&);
+ TransitionOptions getFillTranslateTransition() const;
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 = {});
- TransitionOptions getFillTranslateAnchorTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<TranslateAnchorType> getFillTranslateAnchor() const;
+ void setFillTranslateAnchor(PropertyValue<TranslateAnchorType>);
+ void setFillTranslateAnchorTransition(const TransitionOptions&);
+ TransitionOptions getFillTranslateAnchorTransition() const;
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 = {});
- TransitionOptions getFillPatternTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<std::string> getFillPattern() const;
+ void setFillPattern(PropertyValue<std::string>);
+ void setFillPatternTransition(const TransitionOptions&);
+ TransitionOptions getFillPatternTransition() const;
// Private implementation
diff --git a/include/mbgl/style/layers/layer.hpp.ejs b/include/mbgl/style/layers/layer.hpp.ejs
index 033ae88956..4ee5545247 100644
--- a/include/mbgl/style/layers/layer.hpp.ejs
+++ b/include/mbgl/style/layers/layer.hpp.ejs
@@ -65,10 +65,10 @@ public:
<% for (const property of paintProperties) { -%>
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 = {});
- TransitionOptions get<%- camelize(property.name) %>Transition(const optional<std::string>& klass = {}) const;
+ <%- propertyValueType(property) %> get<%- camelize(property.name) %>() const;
+ void set<%- camelize(property.name) %>(<%- propertyValueType(property) %>);
+ void set<%- camelize(property.name) %>Transition(const TransitionOptions&);
+ TransitionOptions get<%- camelize(property.name) %>Transition() const;
<% } -%>
// Private implementation
diff --git a/include/mbgl/style/layers/line_layer.hpp b/include/mbgl/style/layers/line_layer.hpp
index 6000839d1c..c643ad110d 100644
--- a/include/mbgl/style/layers/line_layer.hpp
+++ b/include/mbgl/style/layers/line_layer.hpp
@@ -57,64 +57,64 @@ public:
// Paint properties
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 = {});
- TransitionOptions getLineOpacityTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getLineOpacity() const;
+ void setLineOpacity(DataDrivenPropertyValue<float>);
+ void setLineOpacityTransition(const TransitionOptions&);
+ TransitionOptions getLineOpacityTransition() const;
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 = {});
- TransitionOptions getLineColorTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<Color> getLineColor() const;
+ void setLineColor(DataDrivenPropertyValue<Color>);
+ void setLineColorTransition(const TransitionOptions&);
+ TransitionOptions getLineColorTransition() const;
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 = {});
- TransitionOptions getLineTranslateTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<std::array<float, 2>> getLineTranslate() const;
+ void setLineTranslate(PropertyValue<std::array<float, 2>>);
+ void setLineTranslateTransition(const TransitionOptions&);
+ TransitionOptions getLineTranslateTransition() const;
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 = {});
- TransitionOptions getLineTranslateAnchorTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<TranslateAnchorType> getLineTranslateAnchor() const;
+ void setLineTranslateAnchor(PropertyValue<TranslateAnchorType>);
+ void setLineTranslateAnchorTransition(const TransitionOptions&);
+ TransitionOptions getLineTranslateAnchorTransition() const;
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 = {});
- TransitionOptions getLineWidthTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<float> getLineWidth() const;
+ void setLineWidth(PropertyValue<float>);
+ void setLineWidthTransition(const TransitionOptions&);
+ TransitionOptions getLineWidthTransition() const;
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 = {});
- TransitionOptions getLineGapWidthTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getLineGapWidth() const;
+ void setLineGapWidth(DataDrivenPropertyValue<float>);
+ void setLineGapWidthTransition(const TransitionOptions&);
+ TransitionOptions getLineGapWidthTransition() const;
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 = {});
- TransitionOptions getLineOffsetTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getLineOffset() const;
+ void setLineOffset(DataDrivenPropertyValue<float>);
+ void setLineOffsetTransition(const TransitionOptions&);
+ TransitionOptions getLineOffsetTransition() const;
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 = {});
- TransitionOptions getLineBlurTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getLineBlur() const;
+ void setLineBlur(DataDrivenPropertyValue<float>);
+ void setLineBlurTransition(const TransitionOptions&);
+ TransitionOptions getLineBlurTransition() const;
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 = {});
- TransitionOptions getLineDasharrayTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<std::vector<float>> getLineDasharray() const;
+ void setLineDasharray(PropertyValue<std::vector<float>>);
+ void setLineDasharrayTransition(const TransitionOptions&);
+ TransitionOptions getLineDasharrayTransition() const;
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 = {});
- TransitionOptions getLinePatternTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<std::string> getLinePattern() const;
+ void setLinePattern(PropertyValue<std::string>);
+ void setLinePatternTransition(const TransitionOptions&);
+ TransitionOptions getLinePatternTransition() const;
// Private implementation
diff --git a/include/mbgl/style/layers/raster_layer.hpp b/include/mbgl/style/layers/raster_layer.hpp
index ad9a68f1b0..8111364709 100644
--- a/include/mbgl/style/layers/raster_layer.hpp
+++ b/include/mbgl/style/layers/raster_layer.hpp
@@ -32,46 +32,46 @@ public:
// Paint properties
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 = {});
- TransitionOptions getRasterOpacityTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<float> getRasterOpacity() const;
+ void setRasterOpacity(PropertyValue<float>);
+ void setRasterOpacityTransition(const TransitionOptions&);
+ TransitionOptions getRasterOpacityTransition() const;
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 = {});
- TransitionOptions getRasterHueRotateTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<float> getRasterHueRotate() const;
+ void setRasterHueRotate(PropertyValue<float>);
+ void setRasterHueRotateTransition(const TransitionOptions&);
+ TransitionOptions getRasterHueRotateTransition() const;
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 = {});
- TransitionOptions getRasterBrightnessMinTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<float> getRasterBrightnessMin() const;
+ void setRasterBrightnessMin(PropertyValue<float>);
+ void setRasterBrightnessMinTransition(const TransitionOptions&);
+ TransitionOptions getRasterBrightnessMinTransition() const;
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 = {});
- TransitionOptions getRasterBrightnessMaxTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<float> getRasterBrightnessMax() const;
+ void setRasterBrightnessMax(PropertyValue<float>);
+ void setRasterBrightnessMaxTransition(const TransitionOptions&);
+ TransitionOptions getRasterBrightnessMaxTransition() const;
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 = {});
- TransitionOptions getRasterSaturationTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<float> getRasterSaturation() const;
+ void setRasterSaturation(PropertyValue<float>);
+ void setRasterSaturationTransition(const TransitionOptions&);
+ TransitionOptions getRasterSaturationTransition() const;
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 = {});
- TransitionOptions getRasterContrastTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<float> getRasterContrast() const;
+ void setRasterContrast(PropertyValue<float>);
+ void setRasterContrastTransition(const TransitionOptions&);
+ TransitionOptions getRasterContrastTransition() const;
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 = {});
- TransitionOptions getRasterFadeDurationTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<float> getRasterFadeDuration() const;
+ void setRasterFadeDuration(PropertyValue<float>);
+ void setRasterFadeDurationTransition(const TransitionOptions&);
+ TransitionOptions getRasterFadeDurationTransition() const;
// Private implementation
diff --git a/include/mbgl/style/layers/symbol_layer.hpp b/include/mbgl/style/layers/symbol_layer.hpp
index e7df5a92ae..8158f267c9 100644
--- a/include/mbgl/style/layers/symbol_layer.hpp
+++ b/include/mbgl/style/layers/symbol_layer.hpp
@@ -177,88 +177,88 @@ public:
// Paint properties
static DataDrivenPropertyValue<float> getDefaultIconOpacity();
- DataDrivenPropertyValue<float> getIconOpacity(const optional<std::string>& klass = {}) const;
- void setIconOpacity(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
- void setIconOpacityTransition(const TransitionOptions&, const optional<std::string>& klass = {});
- TransitionOptions getIconOpacityTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getIconOpacity() const;
+ void setIconOpacity(DataDrivenPropertyValue<float>);
+ void setIconOpacityTransition(const TransitionOptions&);
+ TransitionOptions getIconOpacityTransition() const;
static DataDrivenPropertyValue<Color> getDefaultIconColor();
- DataDrivenPropertyValue<Color> getIconColor(const optional<std::string>& klass = {}) const;
- void setIconColor(DataDrivenPropertyValue<Color>, const optional<std::string>& klass = {});
- void setIconColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
- TransitionOptions getIconColorTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<Color> getIconColor() const;
+ void setIconColor(DataDrivenPropertyValue<Color>);
+ void setIconColorTransition(const TransitionOptions&);
+ TransitionOptions getIconColorTransition() const;
static DataDrivenPropertyValue<Color> getDefaultIconHaloColor();
- DataDrivenPropertyValue<Color> getIconHaloColor(const optional<std::string>& klass = {}) const;
- void setIconHaloColor(DataDrivenPropertyValue<Color>, const optional<std::string>& klass = {});
- void setIconHaloColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
- TransitionOptions getIconHaloColorTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<Color> getIconHaloColor() const;
+ void setIconHaloColor(DataDrivenPropertyValue<Color>);
+ void setIconHaloColorTransition(const TransitionOptions&);
+ TransitionOptions getIconHaloColorTransition() const;
static DataDrivenPropertyValue<float> getDefaultIconHaloWidth();
- DataDrivenPropertyValue<float> getIconHaloWidth(const optional<std::string>& klass = {}) const;
- void setIconHaloWidth(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
- void setIconHaloWidthTransition(const TransitionOptions&, const optional<std::string>& klass = {});
- TransitionOptions getIconHaloWidthTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getIconHaloWidth() const;
+ void setIconHaloWidth(DataDrivenPropertyValue<float>);
+ void setIconHaloWidthTransition(const TransitionOptions&);
+ TransitionOptions getIconHaloWidthTransition() const;
static DataDrivenPropertyValue<float> getDefaultIconHaloBlur();
- DataDrivenPropertyValue<float> getIconHaloBlur(const optional<std::string>& klass = {}) const;
- void setIconHaloBlur(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
- void setIconHaloBlurTransition(const TransitionOptions&, const optional<std::string>& klass = {});
- TransitionOptions getIconHaloBlurTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getIconHaloBlur() const;
+ void setIconHaloBlur(DataDrivenPropertyValue<float>);
+ void setIconHaloBlurTransition(const TransitionOptions&);
+ TransitionOptions getIconHaloBlurTransition() const;
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 = {});
- TransitionOptions getIconTranslateTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<std::array<float, 2>> getIconTranslate() const;
+ void setIconTranslate(PropertyValue<std::array<float, 2>>);
+ void setIconTranslateTransition(const TransitionOptions&);
+ TransitionOptions getIconTranslateTransition() const;
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 = {});
- TransitionOptions getIconTranslateAnchorTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<TranslateAnchorType> getIconTranslateAnchor() const;
+ void setIconTranslateAnchor(PropertyValue<TranslateAnchorType>);
+ void setIconTranslateAnchorTransition(const TransitionOptions&);
+ TransitionOptions getIconTranslateAnchorTransition() const;
static DataDrivenPropertyValue<float> getDefaultTextOpacity();
- DataDrivenPropertyValue<float> getTextOpacity(const optional<std::string>& klass = {}) const;
- void setTextOpacity(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
- void setTextOpacityTransition(const TransitionOptions&, const optional<std::string>& klass = {});
- TransitionOptions getTextOpacityTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getTextOpacity() const;
+ void setTextOpacity(DataDrivenPropertyValue<float>);
+ void setTextOpacityTransition(const TransitionOptions&);
+ TransitionOptions getTextOpacityTransition() const;
static DataDrivenPropertyValue<Color> getDefaultTextColor();
- DataDrivenPropertyValue<Color> getTextColor(const optional<std::string>& klass = {}) const;
- void setTextColor(DataDrivenPropertyValue<Color>, const optional<std::string>& klass = {});
- void setTextColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
- TransitionOptions getTextColorTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<Color> getTextColor() const;
+ void setTextColor(DataDrivenPropertyValue<Color>);
+ void setTextColorTransition(const TransitionOptions&);
+ TransitionOptions getTextColorTransition() const;
static DataDrivenPropertyValue<Color> getDefaultTextHaloColor();
- DataDrivenPropertyValue<Color> getTextHaloColor(const optional<std::string>& klass = {}) const;
- void setTextHaloColor(DataDrivenPropertyValue<Color>, const optional<std::string>& klass = {});
- void setTextHaloColorTransition(const TransitionOptions&, const optional<std::string>& klass = {});
- TransitionOptions getTextHaloColorTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<Color> getTextHaloColor() const;
+ void setTextHaloColor(DataDrivenPropertyValue<Color>);
+ void setTextHaloColorTransition(const TransitionOptions&);
+ TransitionOptions getTextHaloColorTransition() const;
static DataDrivenPropertyValue<float> getDefaultTextHaloWidth();
- DataDrivenPropertyValue<float> getTextHaloWidth(const optional<std::string>& klass = {}) const;
- void setTextHaloWidth(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
- void setTextHaloWidthTransition(const TransitionOptions&, const optional<std::string>& klass = {});
- TransitionOptions getTextHaloWidthTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getTextHaloWidth() const;
+ void setTextHaloWidth(DataDrivenPropertyValue<float>);
+ void setTextHaloWidthTransition(const TransitionOptions&);
+ TransitionOptions getTextHaloWidthTransition() const;
static DataDrivenPropertyValue<float> getDefaultTextHaloBlur();
- DataDrivenPropertyValue<float> getTextHaloBlur(const optional<std::string>& klass = {}) const;
- void setTextHaloBlur(DataDrivenPropertyValue<float>, const optional<std::string>& klass = {});
- void setTextHaloBlurTransition(const TransitionOptions&, const optional<std::string>& klass = {});
- TransitionOptions getTextHaloBlurTransition(const optional<std::string>& klass = {}) const;
+ DataDrivenPropertyValue<float> getTextHaloBlur() const;
+ void setTextHaloBlur(DataDrivenPropertyValue<float>);
+ void setTextHaloBlurTransition(const TransitionOptions&);
+ TransitionOptions getTextHaloBlurTransition() const;
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 = {});
- TransitionOptions getTextTranslateTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<std::array<float, 2>> getTextTranslate() const;
+ void setTextTranslate(PropertyValue<std::array<float, 2>>);
+ void setTextTranslateTransition(const TransitionOptions&);
+ TransitionOptions getTextTranslateTransition() const;
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 = {});
- TransitionOptions getTextTranslateAnchorTransition(const optional<std::string>& klass = {}) const;
+ PropertyValue<TranslateAnchorType> getTextTranslateAnchor() const;
+ void setTextTranslateAnchor(PropertyValue<TranslateAnchorType>);
+ void setTextTranslateAnchorTransition(const TransitionOptions&);
+ TransitionOptions getTextTranslateAnchorTransition() const;
// Private implementation
diff --git a/mapbox-gl-js b/mapbox-gl-js
-Subproject 94619177e52614564496c9e5bdd7751fc8ee426
+Subproject a99706af3681a96562c39e30b0cd2e8124caa61
diff --git a/platform/android/src/style/layers/layer.cpp b/platform/android/src/style/layers/layer.cpp
index d571c3fd2e..5352f9e548 100644
--- a/platform/android/src/style/layers/layer.cpp
+++ b/platform/android/src/style/layers/layer.cpp
@@ -91,7 +91,7 @@ namespace android {
Value value(env, jvalue);
// Convert and set property
- optional<mbgl::style::conversion::Error> error = mbgl::style::conversion::setPaintProperty(layer, jni::Make<std::string>(env, jname), value, mbgl::optional<std::string>());
+ optional<mbgl::style::conversion::Error> error = mbgl::style::conversion::setPaintProperty(layer, jni::Make<std::string>(env, jname), value);
if (error) {
mbgl::Log::Error(mbgl::Event::JNI, "Error setting property: " + jni::Make<std::string>(env, jname) + " " + error->message);
return;
diff --git a/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/darwin/docs/guides/For Style Authors.md.ejs
index 2d9ce635b8..34c1b5dddc 100644
--- a/platform/darwin/docs/guides/For Style Authors.md.ejs
+++ b/platform/darwin/docs/guides/For Style Authors.md.ejs
@@ -158,7 +158,6 @@ the following terms for concepts defined in the style specification:
In the style specification | In the SDK
---------------------------|---------
-class | style class
filter | predicate
function type | interpolation mode
id | identifier
diff --git a/platform/darwin/src/MGLStyle.h b/platform/darwin/src/MGLStyle.h
index 26434eb492..ccec863236 100644
--- a/platform/darwin/src/MGLStyle.h
+++ b/platform/darwin/src/MGLStyle.h
@@ -483,40 +483,24 @@ MGL_EXPORT
#pragma mark Managing Style Classes
/**
- Currently active style classes, represented as an array of string identifiers.
+ Support for style classes has been removed. This property always returns an empty array.
*/
-@property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses __attribute__((deprecated("This property will be removed in a future release.")));
+@property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses __attribute__((deprecated("This property is non-functional.")));
/**
- Returns a Boolean value indicating whether the style class with the given
- identifier is currently active.
-
- @param styleClass The style class to query for.
- @return Whether the style class is currently active.
+ Support for style classes has been removed. This method always returns NO.
*/
-- (BOOL)hasStyleClass:(NSString *)styleClass __attribute__((deprecated("This method will be removed in a future release.")));
+- (BOOL)hasStyleClass:(NSString *)styleClass __attribute__((deprecated("This method is non-functional.")));
/**
- Activates the style class with the given identifier.
-
- @param styleClass The style class to activate.
+ Support for style classes has been removed. This method is a no-op.
*/
-- (void)addStyleClass:(NSString *)styleClass __attribute__((deprecated("This method will be removed in a future release.")));
+- (void)addStyleClass:(NSString *)styleClass __attribute__((deprecated("This method is non-functional.")));
/**
- Deactivates the style class with the given identifier.
-
- @note Style class names are not guaranteed to exist across styles or different
- versions of the same style. Applications that use this API must first set the
- style URL to an explicitly versioned style using a convenience method like
- `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL”
- inspectable in Interface Builder, or a manually constructed `NSURL`. This
- approach also avoids style class name changes that will occur in the default
- style over time.
-
- @param styleClass The style class to deactivate.
+ Support for style classes has been removed. This method is a no-op.
*/
-- (void)removeStyleClass:(NSString *)styleClass __attribute__((deprecated("This method will be removed in a future release.")));
+- (void)removeStyleClass:(NSString *)styleClass __attribute__((deprecated("This method is non-functional.")));
#pragma mark Managing a Style’s Images
diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm
index af02c31b6d..2c54b11634 100644
--- a/platform/darwin/src/MGLStyle.mm
+++ b/platform/darwin/src/MGLStyle.mm
@@ -469,60 +469,32 @@ static NSURL *MGLStyleURL_emerald;
- (NS_ARRAY_OF(NSString *) *)styleClasses
{
- const std::vector<std::string> &appliedClasses = self.mapView.mbglMap->getClasses();
-
- NSMutableArray *returnArray = [NSMutableArray arrayWithCapacity:appliedClasses.size()];
-
- for (auto appliedClass : appliedClasses) {
- [returnArray addObject:@(appliedClass.c_str())];
- }
-
- return returnArray;
+ return @[];
}
- (void)setStyleClasses:(NS_ARRAY_OF(NSString *) *)appliedClasses
{
- [self setStyleClasses:appliedClasses transitionDuration:0];
}
- (void)setStyleClasses:(NS_ARRAY_OF(NSString *) *)appliedClasses transitionDuration:(NSTimeInterval)transitionDuration
{
- std::vector<std::string> newAppliedClasses;
-
- for (NSString *appliedClass in appliedClasses)
- {
- newAppliedClasses.push_back([appliedClass UTF8String]);
- }
-
- mbgl::style::TransitionOptions transition { { MGLDurationFromTimeInterval(transitionDuration) } };
- self.mapView.mbglMap->setTransitionOptions(transition);
- self.mapView.mbglMap->setClasses(newAppliedClasses);
}
- (NSUInteger)countOfStyleClasses {
- const auto &classes = self.mapView.mbglMap->getClasses();
- return classes.size();
+ return 0;
}
- (BOOL)hasStyleClass:(NSString *)styleClass
{
- return styleClass && self.mapView.mbglMap->hasClass([styleClass UTF8String]);
+ return NO;
}
- (void)addStyleClass:(NSString *)styleClass
{
- if (styleClass)
- {
- self.mapView.mbglMap->addClass([styleClass UTF8String]);
- }
}
- (void)removeStyleClass:(NSString *)styleClass
{
- if (styleClass)
- {
- self.mapView.mbglMap->removeClass([styleClass UTF8String]);
- }
}
#pragma mark Style images
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index 1be38e5e4a..d3a6347110 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -163,17 +163,6 @@ void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action,
if (view->changeStyleCallback)
view->changeStyleCallback();
break;
- case GLFW_KEY_R:
- if (!mods) {
- static const mbgl::style::TransitionOptions transition { { mbgl::Milliseconds(300) } };
- view->map->setTransitionOptions(transition);
- if (view->map->hasClass("night")) {
- view->map->removeClass("night");
- } else {
- view->map->addClass("night");
- }
- }
- break;
#if not MBGL_USE_GLES2
case GLFW_KEY_B: {
auto debug = view->map->getDebug();
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md
index 922b7b6486..ed28b65ae5 100644
--- a/platform/ios/CHANGELOG.md
+++ b/platform/ios/CHANGELOG.md
@@ -4,6 +4,10 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
## master
+* The previously-deprecated support for style classes has been removed. For interface compatibility, the API methods remain, but they are now non-functional.
+
+## 3.6.0
+
### Styles
* Added support for 3D extrusion of buildings and other polygonal features via the `MGLFillExtrusionStyleLayer` class and the `fill-extrusion` layer type in style JSON. ([#8431](https://github.com/mapbox/mapbox-gl-native/pull/8431))
diff --git a/platform/ios/docs/guides/For Style Authors.md b/platform/ios/docs/guides/For Style Authors.md
index fee4d70b34..734e0dc9ee 100644
--- a/platform/ios/docs/guides/For Style Authors.md
+++ b/platform/ios/docs/guides/For Style Authors.md
@@ -107,7 +107,6 @@ the following terms for concepts defined in the style specification:
In the style specification | In the SDK
---------------------------|---------
-class | style class
filter | predicate
function type | interpolation mode
id | identifier
diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h
index 31320ac977..8d26b1c90e 100644
--- a/platform/ios/src/MGLMapView.h
+++ b/platform/ios/src/MGLMapView.h
@@ -270,13 +270,25 @@ IB_DESIGNABLE
*/
@property (nonatomic, readonly) UIButton *attributionButton;
-@property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses __attribute__((deprecated("Use style.styleClasses.")));
+/**
+ Support for style classes has been removed. This property always returns an empty array.
+ */
+@property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses __attribute__((deprecated("This property is non-functional.")));
-- (BOOL)hasStyleClass:(NSString *)styleClass __attribute__((deprecated("Use style.hasStyleClass:.")));
+/**
+ Support for style classes has been removed. This property always returns NO.
+ */
+- (BOOL)hasStyleClass:(NSString *)styleClass __attribute__((deprecated("This method is non-functional.")));
-- (void)addStyleClass:(NSString *)styleClass __attribute__((deprecated("Use style.addStyleClass:.")));
+/**
+ Support for style classes has been removed. This property is a no-op.
+ */
+- (void)addStyleClass:(NSString *)styleClass __attribute__((deprecated("This method is non-functional.")));
-- (void)removeStyleClass:(NSString *)styleClass __attribute__((deprecated("Use style.removeStyleClass:.")));
+/**
+ Support for style classes has been removed. This property is a no-op.
+ */
+- (void)removeStyleClass:(NSString *)styleClass __attribute__((deprecated("This method is non-functional.")));
#pragma mark Displaying the User’s Location
diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md
index 632bcfa44b..377c321452 100644
--- a/platform/macos/CHANGELOG.md
+++ b/platform/macos/CHANGELOG.md
@@ -2,6 +2,10 @@
## master
+* The previously-deprecated support for style classes has been removed. For interface compatibility, the API methods remain, but they are now non-functional.
+
+## 0.5.0
+
### Styles
* Added support for 3D extrusion of buildings and other polygonal features via the `MGLFillExtrusionStyleLayer` class and the `fill-extrusion` layer type in style JSON. ([#8431](https://github.com/mapbox/mapbox-gl-native/pull/8431))
diff --git a/platform/macos/docs/guides/For Style Authors.md b/platform/macos/docs/guides/For Style Authors.md
index b9163582b4..164b1b58bf 100644
--- a/platform/macos/docs/guides/For Style Authors.md
+++ b/platform/macos/docs/guides/For Style Authors.md
@@ -96,7 +96,6 @@ the following terms for concepts defined in the style specification:
In the style specification | In the SDK
---------------------------|---------
-class | style class
filter | predicate
function type | interpolation mode
id | identifier
diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp
index 680de6f90c..b174893e78 100644
--- a/platform/node/src/node_map.cpp
+++ b/platform/node/src/node_map.cpp
@@ -60,7 +60,6 @@ void NodeMap::Init(v8::Local<v8::Object> target) {
Nan::SetPrototypeMethod(tpl, "release", Release);
Nan::SetPrototypeMethod(tpl, "cancel", Cancel);
- Nan::SetPrototypeMethod(tpl, "addClass", AddClass);
Nan::SetPrototypeMethod(tpl, "addSource", AddSource);
Nan::SetPrototypeMethod(tpl, "addLayer", AddLayer);
Nan::SetPrototypeMethod(tpl, "removeLayer", RemoveLayer);
@@ -376,10 +375,6 @@ void NodeMap::startRender(NodeMap::RenderOptions options) {
view = std::make_unique<mbgl::OffscreenView>(backend.getContext(), fbSize);
}
- if (map->getClasses() != options.classes) {
- map->setClasses(options.classes);
- }
-
if (map->getZoom() != options.zoom) {
map->setZoom(options.zoom);
}
@@ -546,23 +541,6 @@ void NodeMap::cancel() {
renderFinished();
}
-void NodeMap::AddClass(const Nan::FunctionCallbackInfo<v8::Value>& info) {
- auto nodeMap = Nan::ObjectWrap::Unwrap<NodeMap>(info.Holder());
- if (!nodeMap->map) return Nan::ThrowError(releasedMessage());
-
- if (info.Length() <= 0 || !info[0]->IsString()) {
- return Nan::ThrowTypeError("First argument must be a string");
- }
-
- try {
- nodeMap->map->addClass(*Nan::Utf8String(info[0]));
- } catch (const std::exception &ex) {
- return Nan::ThrowError(ex.what());
- }
-
- info.GetReturnValue().SetUndefined();
-}
-
void NodeMap::AddSource(const Nan::FunctionCallbackInfo<v8::Value>& info) {
using namespace mbgl::style;
using namespace mbgl::style::conversion;
@@ -763,12 +741,7 @@ void NodeMap::SetPaintProperty(const Nan::FunctionCallbackInfo<v8::Value>& info)
return Nan::ThrowTypeError("Second argument must be a string");
}
- mbgl::optional<std::string> klass;
- if (info.Length() == 4 && info[3]->IsString()) {
- klass = std::string(*Nan::Utf8String(info[3]));
- }
-
- mbgl::optional<Error> error = setPaintProperty(*layer, *Nan::Utf8String(info[1]), info[2], klass);
+ mbgl::optional<Error> error = setPaintProperty(*layer, *Nan::Utf8String(info[1]), info[2]);
if (error) {
return Nan::ThrowTypeError(error->message.c_str());
}
diff --git a/platform/node/src/node_map.hpp b/platform/node/src/node_map.hpp
index cdc8f1e51f..7b81ecd894 100644
--- a/platform/node/src/node_map.hpp
+++ b/platform/node/src/node_map.hpp
@@ -42,7 +42,6 @@ public:
static void Render(const Nan::FunctionCallbackInfo<v8::Value>&);
static void Release(const Nan::FunctionCallbackInfo<v8::Value>&);
static void Cancel(const Nan::FunctionCallbackInfo<v8::Value>&);
- static void AddClass(const Nan::FunctionCallbackInfo<v8::Value>&);
static void AddSource(const Nan::FunctionCallbackInfo<v8::Value>&);
static void AddLayer(const Nan::FunctionCallbackInfo<v8::Value>&);
static void RemoveLayer(const Nan::FunctionCallbackInfo<v8::Value>&);
diff --git a/platform/node/test/js/map.test.js b/platform/node/test/js/map.test.js
index 4ab76b937a..04d02d0558 100644
--- a/platform/node/test/js/map.test.js
+++ b/platform/node/test/js/map.test.js
@@ -108,7 +108,6 @@ test('Map', function(t) {
'render',
'release',
'cancel',
- 'addClass',
'addSource',
'addLayer',
'removeLayer',
diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp
index aa5561731c..03ca052ec4 100644
--- a/platform/qt/app/mapwindow.cpp
+++ b/platform/qt/app/mapwindow.cpp
@@ -79,8 +79,6 @@ void MapWindow::changeStyle()
void MapWindow::keyPressEvent(QKeyEvent *ev)
{
- static const qint64 transitionDuration = 300;
-
switch (ev->key()) {
case Qt::Key_S:
changeStyle();
@@ -307,14 +305,6 @@ void MapWindow::keyPressEvent(QKeyEvent *ev)
case Qt::Key_Tab:
m_map->cycleDebugOptions();
break;
- case Qt::Key_R: {
- m_map->setTransitionOptions(transitionDuration);
- if (m_map->hasClass("night")) {
- m_map->removeClass("night");
- } else {
- m_map->addClass("night");
- }
- } break;
default:
break;
}
diff --git a/platform/qt/include/qmapboxgl.hpp b/platform/qt/include/qmapboxgl.hpp
index 478c15a51e..e2fb283989 100644
--- a/platform/qt/include/qmapboxgl.hpp
+++ b/platform/qt/include/qmapboxgl.hpp
@@ -168,12 +168,6 @@ public:
void setGestureInProgress(bool inProgress);
- void addClass(const QString &);
- void removeClass(const QString &);
- bool hasClass(const QString &) const;
- void setClasses(const QStringList &);
- QStringList getClasses() const;
-
void setTransitionOptions(qint64 duration, qint64 delay = 0);
void addAnnotationIcon(const QString &name, const QImage &sprite);
@@ -183,7 +177,7 @@ public:
void removeAnnotation(QMapbox::AnnotationID);
void setLayoutProperty(const QString &layer, const QString &property, const QVariant &value);
- void setPaintProperty(const QString &layer, const QString &property, const QVariant &value, const QString &klass = QString());
+ void setPaintProperty(const QString &layer, const QString &property, const QVariant &value);
bool isFullyLoaded() const;
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index 80b64f05df..c37b2563b5 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -71,16 +71,6 @@ QThreadStorage<std::shared_ptr<mbgl::util::RunLoop>> loop;
// Conversion helper functions.
-auto fromQStringList(const QStringList &list)
-{
- std::vector<std::string> strings;
- strings.reserve(list.size());
- for (const QString &string : list) {
- strings.push_back(string.toStdString());
- }
- return strings;
-}
-
mbgl::Size sanitizedSize(const QSize& size) {
return mbgl::Size {
mbgl::util::max(0u, static_cast<uint32_t>(size.width())),
@@ -752,69 +742,6 @@ void QMapboxGL::setGestureInProgress(bool progress)
}
/*!
- Adds an \a className to the list of active classes. Layers tagged with a certain class
- will only be active when the class is added.
-
- This was removed from the \l {https://www.mapbox.com/mapbox-gl-style-spec/#layer-paint.*}
- {Mapbox style specification} and should no longer be used.
-
- \deprecated
- \sa removeClass()
-*/
-void QMapboxGL::addClass(const QString &className)
-{
- d_ptr->mapObj->addClass(className.toStdString());
-}
-
-/*!
- Removes a \a className.
-
- \deprecated
- \sa addClass()
-*/
-void QMapboxGL::removeClass(const QString &className)
-{
- d_ptr->mapObj->removeClass(className.toStdString());
-}
-
-/*!
- Returns true when \a className is active, false otherwise.
-
- \deprecated
- \sa addClass()
-*/
-bool QMapboxGL::hasClass(const QString &className) const
-{
- return d_ptr->mapObj->hasClass(className.toStdString());
-}
-
-/*!
- Bulk adds a list of \a classNames.
-
- \deprecated
- \sa addClass()
-*/
-void QMapboxGL::setClasses(const QStringList &classNames)
-{
- d_ptr->mapObj->setClasses(fromQStringList(classNames));
-}
-
-/*!
- Returns a list of active classes.
-
- \deprecated
- \sa setClasses()
-*/
-QStringList QMapboxGL::getClasses() const
-{
- QStringList classNames;
- for (const std::string &mbglClass : d_ptr->mapObj->getClasses()) {
- classNames << QString::fromStdString(mbglClass);
- }
- return classNames;
-}
-
-/*!
Sets the \a duration and \a delay of style class transitions. Style property
values transition to new values with animation when a new class is set.
@@ -958,9 +885,6 @@ void QMapboxGL::setLayoutProperty(const QString& layer, const QString& property,
as defined by the \l {https://www.mapbox.com/mapbox-gl-style-spec/} {Mapbox style specification}
for paint properties.
- The argument \a styleClass is deprecated and is used for defining the style class for the paint
- property.
-
For paint properties that take a color as \a value, such as \c fill-color, a string such as
\c blue can be passed or a QColor.
@@ -1006,7 +930,7 @@ void QMapboxGL::setLayoutProperty(const QString& layer, const QString& property,
map->setPaintProperty("route","line-dasharray", lineDashArray);
\endcode
*/
-void QMapboxGL::setPaintProperty(const QString& layer, const QString& property, const QVariant& value, const QString& styleClass)
+void QMapboxGL::setPaintProperty(const QString& layer, const QString& property, const QVariant& value)
{
using namespace mbgl::style;
@@ -1016,12 +940,7 @@ void QMapboxGL::setPaintProperty(const QString& layer, const QString& property,
return;
}
- mbgl::optional<std::string> klass;
- if (!styleClass.isEmpty()) {
- klass = styleClass.toStdString();
- }
-
- if (conversion::setPaintProperty(*layer_, property.toStdString(), value, klass)) {
+ if (conversion::setPaintProperty(*layer_, property.toStdString(), value)) {
qWarning() << "Error setting paint property:" << layer << "-" << property;
return;
}
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 16254f6e9b..c6d3ed9915 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -1053,25 +1053,6 @@ bool Map::isFullyLoaded() const {
return impl->style ? impl->style->isLoaded() : false;
}
-void Map::addClass(const std::string& className) {
- if (impl->style && impl->style->addClass(className)) {
- impl->onUpdate(Update::Classes);
- }
-}
-
-void Map::removeClass(const std::string& className) {
- if (impl->style && impl->style->removeClass(className)) {
- impl->onUpdate(Update::Classes);
- }
-}
-
-void Map::setClasses(const std::vector<std::string>& classNames) {
- if (impl->style) {
- impl->style->setClasses(classNames);
- impl->onUpdate(Update::Classes);
- }
-}
-
style::TransitionOptions Map::getTransitionOptions() const {
if (impl->style) {
return impl->style->getTransitionOptions();
@@ -1085,17 +1066,6 @@ void Map::setTransitionOptions(const style::TransitionOptions& options) {
}
}
-bool Map::hasClass(const std::string& className) const {
- return impl->style ? impl->style->hasClass(className) : false;
-}
-
-std::vector<std::string> Map::getClasses() const {
- if (impl->style) {
- return impl->style->getClasses();
- }
- return {};
-}
-
void Map::setSourceTileCacheSize(size_t size) {
if (size != impl->sourceCacheSize) {
impl->sourceCacheSize = size;
diff --git a/src/mbgl/map/update.hpp b/src/mbgl/map/update.hpp
index 29f2583f7c..82d98284f5 100644
--- a/src/mbgl/map/update.hpp
+++ b/src/mbgl/map/update.hpp
@@ -7,7 +7,6 @@ namespace mbgl {
enum class Update {
Nothing = 0,
Repaint = 1 << 0,
- Classes = 1 << 2,
AnnotationStyle = 1 << 6,
AnnotationData = 1 << 7
};
diff --git a/src/mbgl/renderer/transition_parameters.hpp b/src/mbgl/renderer/transition_parameters.hpp
index 573845fa24..c47aa2e35f 100644
--- a/src/mbgl/renderer/transition_parameters.hpp
+++ b/src/mbgl/renderer/transition_parameters.hpp
@@ -1,7 +1,6 @@
#pragma once
#include <mbgl/util/chrono.hpp>
-#include <mbgl/style/class_dictionary.hpp>
#include <mbgl/style/transition_options.hpp>
#include <vector>
@@ -10,7 +9,6 @@ namespace mbgl {
class TransitionParameters {
public:
- std::vector<style::ClassID> classes;
TimePoint now;
style::TransitionOptions transition;
};
diff --git a/src/mbgl/style/class_dictionary.cpp b/src/mbgl/style/class_dictionary.cpp
deleted file mode 100644
index 4474b28520..0000000000
--- a/src/mbgl/style/class_dictionary.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-#include <mbgl/style/class_dictionary.hpp>
-
-#include <pthread.h>
-
-namespace mbgl {
-namespace style {
-
-ClassDictionary::ClassDictionary() = default;
-
-ClassDictionary &ClassDictionary::Get() {
- static pthread_once_t store_once = PTHREAD_ONCE_INIT;
- static pthread_key_t store_key;
-
- // Create the key.
- pthread_once(&store_once, []() {
- pthread_key_create(&store_key, [](void *ptr) {
- delete reinterpret_cast<ClassDictionary *>(ptr);
- });
- });
-
- auto *ptr = reinterpret_cast<ClassDictionary *>(pthread_getspecific(store_key));
- if (ptr == nullptr) {
- ptr = new ClassDictionary();
- pthread_setspecific(store_key, ptr);
- }
-
- return *ptr;
-}
-
-ClassID ClassDictionary::lookup(const std::string &class_name) {
- auto it = store.find(class_name);
- if (it == store.end()) {
- // Insert the class name into the store.
- auto id = ClassID(uint32_t(ClassID::Named) + offset++);
- store.emplace(class_name, id);
- return id;
- } else {
- return it->second;
- }
-}
-
-ClassID ClassDictionary::normalize(ClassID id) {
- if (id >= ClassID::Named) {
- return ClassID::Named;
- } else {
- return id;
- }
-}
-
-} // namespace style
-} // namespace mbgl
diff --git a/src/mbgl/style/class_dictionary.hpp b/src/mbgl/style/class_dictionary.hpp
deleted file mode 100644
index 37eb488240..0000000000
--- a/src/mbgl/style/class_dictionary.hpp
+++ /dev/null
@@ -1,52 +0,0 @@
-#pragma once
-
-#include <cstdint>
-#include <string>
-#include <unordered_map>
-#include <functional>
-
-namespace mbgl {
-namespace style {
-
-enum class ClassID : uint32_t {
- Default = 1, // These values are from the default style for a layer
- Named = 2 // These values (and all subsequent IDs) are from a named style from the layer
-};
-
-class ClassDictionary {
-private:
- ClassDictionary();
-
-public:
- static ClassDictionary &Get();
-
- // Returns an ID for a class name. If the class name does not yet have an ID, one is
- // auto-generated and stored for future reference.
- ClassID lookup(const std::string &class_name);
-
- // Returns either Fallback, Default or Named, depending on the type of the class id.
- ClassID normalize(ClassID id);
-
-private:
- std::unordered_map<std::string, ClassID> store = { { "", ClassID::Default } };
- uint32_t offset = 0;
-};
-
-} // namespace style
-} // namespace mbgl
-
-namespace std {
-
-// Explicitly define std::hash<style::ClassID> because GCC doesn't automatically use std::hash<> of
-// the underlying enum type.
-
-template <>
-struct hash<mbgl::style::ClassID> {
-public:
- size_t operator()(const mbgl::style::ClassID id) const {
- using T = std::underlying_type_t<mbgl::style::ClassID>;
- return std::hash<T>()(static_cast<T>(id));
- }
-};
-
-} // namespace std
diff --git a/src/mbgl/style/layers/background_layer.cpp b/src/mbgl/style/layers/background_layer.cpp
index 6c9be96528..c4b22aa0e3 100644
--- a/src/mbgl/style/layers/background_layer.cpp
+++ b/src/mbgl/style/layers/background_layer.cpp
@@ -70,81 +70,81 @@ PropertyValue<Color> BackgroundLayer::getDefaultBackgroundColor() {
return { Color::black() };
}
-PropertyValue<Color> BackgroundLayer::getBackgroundColor(const optional<std::string>& klass) const {
- return impl().paint.template get<BackgroundColor>().get(klass);
+PropertyValue<Color> BackgroundLayer::getBackgroundColor() const {
+ return impl().paint.template get<BackgroundColor>().value;
}
-void BackgroundLayer::setBackgroundColor(PropertyValue<Color> value, const optional<std::string>& klass) {
- if (value == getBackgroundColor(klass))
+void BackgroundLayer::setBackgroundColor(PropertyValue<Color> value) {
+ if (value == getBackgroundColor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<BackgroundColor>().set(value, klass);
+ impl_->paint.template get<BackgroundColor>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void BackgroundLayer::setBackgroundColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void BackgroundLayer::setBackgroundColorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<BackgroundColor>().setTransition(value, klass);
+ impl_->paint.template get<BackgroundColor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions BackgroundLayer::getBackgroundColorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<BackgroundColor>().getTransition(klass);
+TransitionOptions BackgroundLayer::getBackgroundColorTransition() const {
+ return impl().paint.template get<BackgroundColor>().options;
}
PropertyValue<std::string> BackgroundLayer::getDefaultBackgroundPattern() {
return { "" };
}
-PropertyValue<std::string> BackgroundLayer::getBackgroundPattern(const optional<std::string>& klass) const {
- return impl().paint.template get<BackgroundPattern>().get(klass);
+PropertyValue<std::string> BackgroundLayer::getBackgroundPattern() const {
+ return impl().paint.template get<BackgroundPattern>().value;
}
-void BackgroundLayer::setBackgroundPattern(PropertyValue<std::string> value, const optional<std::string>& klass) {
- if (value == getBackgroundPattern(klass))
+void BackgroundLayer::setBackgroundPattern(PropertyValue<std::string> value) {
+ if (value == getBackgroundPattern())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<BackgroundPattern>().set(value, klass);
+ impl_->paint.template get<BackgroundPattern>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void BackgroundLayer::setBackgroundPatternTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void BackgroundLayer::setBackgroundPatternTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<BackgroundPattern>().setTransition(value, klass);
+ impl_->paint.template get<BackgroundPattern>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions BackgroundLayer::getBackgroundPatternTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<BackgroundPattern>().getTransition(klass);
+TransitionOptions BackgroundLayer::getBackgroundPatternTransition() const {
+ return impl().paint.template get<BackgroundPattern>().options;
}
PropertyValue<float> BackgroundLayer::getDefaultBackgroundOpacity() {
return { 1 };
}
-PropertyValue<float> BackgroundLayer::getBackgroundOpacity(const optional<std::string>& klass) const {
- return impl().paint.template get<BackgroundOpacity>().get(klass);
+PropertyValue<float> BackgroundLayer::getBackgroundOpacity() const {
+ return impl().paint.template get<BackgroundOpacity>().value;
}
-void BackgroundLayer::setBackgroundOpacity(PropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getBackgroundOpacity(klass))
+void BackgroundLayer::setBackgroundOpacity(PropertyValue<float> value) {
+ if (value == getBackgroundOpacity())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<BackgroundOpacity>().set(value, klass);
+ impl_->paint.template get<BackgroundOpacity>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void BackgroundLayer::setBackgroundOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void BackgroundLayer::setBackgroundOpacityTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<BackgroundOpacity>().setTransition(value, klass);
+ impl_->paint.template get<BackgroundOpacity>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions BackgroundLayer::getBackgroundOpacityTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<BackgroundOpacity>().getTransition(klass);
+TransitionOptions BackgroundLayer::getBackgroundOpacityTransition() const {
+ return impl().paint.template get<BackgroundOpacity>().options;
}
} // namespace style
diff --git a/src/mbgl/style/layers/circle_layer.cpp b/src/mbgl/style/layers/circle_layer.cpp
index 1f64aa7ca6..e5c4c33497 100644
--- a/src/mbgl/style/layers/circle_layer.cpp
+++ b/src/mbgl/style/layers/circle_layer.cpp
@@ -98,15 +98,15 @@ DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleRadius() {
return { 5 };
}
-DataDrivenPropertyValue<float> CircleLayer::getCircleRadius(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleRadius>().get(klass);
+DataDrivenPropertyValue<float> CircleLayer::getCircleRadius() const {
+ return impl().paint.template get<CircleRadius>().value;
}
-void CircleLayer::setCircleRadius(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getCircleRadius(klass))
+void CircleLayer::setCircleRadius(DataDrivenPropertyValue<float> value) {
+ if (value == getCircleRadius())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleRadius>().set(value, klass);
+ impl_->paint.template get<CircleRadius>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -115,29 +115,29 @@ void CircleLayer::setCircleRadius(DataDrivenPropertyValue<float> value, const op
}
}
-void CircleLayer::setCircleRadiusTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void CircleLayer::setCircleRadiusTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleRadius>().setTransition(value, klass);
+ impl_->paint.template get<CircleRadius>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions CircleLayer::getCircleRadiusTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleRadius>().getTransition(klass);
+TransitionOptions CircleLayer::getCircleRadiusTransition() const {
+ return impl().paint.template get<CircleRadius>().options;
}
DataDrivenPropertyValue<Color> CircleLayer::getDefaultCircleColor() {
return { Color::black() };
}
-DataDrivenPropertyValue<Color> CircleLayer::getCircleColor(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleColor>().get(klass);
+DataDrivenPropertyValue<Color> CircleLayer::getCircleColor() const {
+ return impl().paint.template get<CircleColor>().value;
}
-void CircleLayer::setCircleColor(DataDrivenPropertyValue<Color> value, const optional<std::string>& klass) {
- if (value == getCircleColor(klass))
+void CircleLayer::setCircleColor(DataDrivenPropertyValue<Color> value) {
+ if (value == getCircleColor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleColor>().set(value, klass);
+ impl_->paint.template get<CircleColor>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -146,29 +146,29 @@ void CircleLayer::setCircleColor(DataDrivenPropertyValue<Color> value, const opt
}
}
-void CircleLayer::setCircleColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void CircleLayer::setCircleColorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleColor>().setTransition(value, klass);
+ impl_->paint.template get<CircleColor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions CircleLayer::getCircleColorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleColor>().getTransition(klass);
+TransitionOptions CircleLayer::getCircleColorTransition() const {
+ return impl().paint.template get<CircleColor>().options;
}
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleBlur() {
return { 0 };
}
-DataDrivenPropertyValue<float> CircleLayer::getCircleBlur(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleBlur>().get(klass);
+DataDrivenPropertyValue<float> CircleLayer::getCircleBlur() const {
+ return impl().paint.template get<CircleBlur>().value;
}
-void CircleLayer::setCircleBlur(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getCircleBlur(klass))
+void CircleLayer::setCircleBlur(DataDrivenPropertyValue<float> value) {
+ if (value == getCircleBlur())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleBlur>().set(value, klass);
+ impl_->paint.template get<CircleBlur>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -177,29 +177,29 @@ void CircleLayer::setCircleBlur(DataDrivenPropertyValue<float> value, const opti
}
}
-void CircleLayer::setCircleBlurTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void CircleLayer::setCircleBlurTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleBlur>().setTransition(value, klass);
+ impl_->paint.template get<CircleBlur>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions CircleLayer::getCircleBlurTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleBlur>().getTransition(klass);
+TransitionOptions CircleLayer::getCircleBlurTransition() const {
+ return impl().paint.template get<CircleBlur>().options;
}
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleOpacity() {
return { 1 };
}
-DataDrivenPropertyValue<float> CircleLayer::getCircleOpacity(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleOpacity>().get(klass);
+DataDrivenPropertyValue<float> CircleLayer::getCircleOpacity() const {
+ return impl().paint.template get<CircleOpacity>().value;
}
-void CircleLayer::setCircleOpacity(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getCircleOpacity(klass))
+void CircleLayer::setCircleOpacity(DataDrivenPropertyValue<float> value) {
+ if (value == getCircleOpacity())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleOpacity>().set(value, klass);
+ impl_->paint.template get<CircleOpacity>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -208,110 +208,110 @@ void CircleLayer::setCircleOpacity(DataDrivenPropertyValue<float> value, const o
}
}
-void CircleLayer::setCircleOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void CircleLayer::setCircleOpacityTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleOpacity>().setTransition(value, klass);
+ impl_->paint.template get<CircleOpacity>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions CircleLayer::getCircleOpacityTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleOpacity>().getTransition(klass);
+TransitionOptions CircleLayer::getCircleOpacityTransition() const {
+ return impl().paint.template get<CircleOpacity>().options;
}
PropertyValue<std::array<float, 2>> CircleLayer::getDefaultCircleTranslate() {
return { {{ 0, 0 }} };
}
-PropertyValue<std::array<float, 2>> CircleLayer::getCircleTranslate(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleTranslate>().get(klass);
+PropertyValue<std::array<float, 2>> CircleLayer::getCircleTranslate() const {
+ return impl().paint.template get<CircleTranslate>().value;
}
-void CircleLayer::setCircleTranslate(PropertyValue<std::array<float, 2>> value, const optional<std::string>& klass) {
- if (value == getCircleTranslate(klass))
+void CircleLayer::setCircleTranslate(PropertyValue<std::array<float, 2>> value) {
+ if (value == getCircleTranslate())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleTranslate>().set(value, klass);
+ impl_->paint.template get<CircleTranslate>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void CircleLayer::setCircleTranslateTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void CircleLayer::setCircleTranslateTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleTranslate>().setTransition(value, klass);
+ impl_->paint.template get<CircleTranslate>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions CircleLayer::getCircleTranslateTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleTranslate>().getTransition(klass);
+TransitionOptions CircleLayer::getCircleTranslateTransition() const {
+ return impl().paint.template get<CircleTranslate>().options;
}
PropertyValue<TranslateAnchorType> CircleLayer::getDefaultCircleTranslateAnchor() {
return { TranslateAnchorType::Map };
}
-PropertyValue<TranslateAnchorType> CircleLayer::getCircleTranslateAnchor(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleTranslateAnchor>().get(klass);
+PropertyValue<TranslateAnchorType> CircleLayer::getCircleTranslateAnchor() const {
+ return impl().paint.template get<CircleTranslateAnchor>().value;
}
-void CircleLayer::setCircleTranslateAnchor(PropertyValue<TranslateAnchorType> value, const optional<std::string>& klass) {
- if (value == getCircleTranslateAnchor(klass))
+void CircleLayer::setCircleTranslateAnchor(PropertyValue<TranslateAnchorType> value) {
+ if (value == getCircleTranslateAnchor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleTranslateAnchor>().set(value, klass);
+ impl_->paint.template get<CircleTranslateAnchor>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void CircleLayer::setCircleTranslateAnchorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void CircleLayer::setCircleTranslateAnchorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleTranslateAnchor>().setTransition(value, klass);
+ impl_->paint.template get<CircleTranslateAnchor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions CircleLayer::getCircleTranslateAnchorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleTranslateAnchor>().getTransition(klass);
+TransitionOptions CircleLayer::getCircleTranslateAnchorTransition() const {
+ return impl().paint.template get<CircleTranslateAnchor>().options;
}
PropertyValue<CirclePitchScaleType> CircleLayer::getDefaultCirclePitchScale() {
return { CirclePitchScaleType::Map };
}
-PropertyValue<CirclePitchScaleType> CircleLayer::getCirclePitchScale(const optional<std::string>& klass) const {
- return impl().paint.template get<CirclePitchScale>().get(klass);
+PropertyValue<CirclePitchScaleType> CircleLayer::getCirclePitchScale() const {
+ return impl().paint.template get<CirclePitchScale>().value;
}
-void CircleLayer::setCirclePitchScale(PropertyValue<CirclePitchScaleType> value, const optional<std::string>& klass) {
- if (value == getCirclePitchScale(klass))
+void CircleLayer::setCirclePitchScale(PropertyValue<CirclePitchScaleType> value) {
+ if (value == getCirclePitchScale())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<CirclePitchScale>().set(value, klass);
+ impl_->paint.template get<CirclePitchScale>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void CircleLayer::setCirclePitchScaleTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void CircleLayer::setCirclePitchScaleTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<CirclePitchScale>().setTransition(value, klass);
+ impl_->paint.template get<CirclePitchScale>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions CircleLayer::getCirclePitchScaleTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<CirclePitchScale>().getTransition(klass);
+TransitionOptions CircleLayer::getCirclePitchScaleTransition() const {
+ return impl().paint.template get<CirclePitchScale>().options;
}
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleStrokeWidth() {
return { 0 };
}
-DataDrivenPropertyValue<float> CircleLayer::getCircleStrokeWidth(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleStrokeWidth>().get(klass);
+DataDrivenPropertyValue<float> CircleLayer::getCircleStrokeWidth() const {
+ return impl().paint.template get<CircleStrokeWidth>().value;
}
-void CircleLayer::setCircleStrokeWidth(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getCircleStrokeWidth(klass))
+void CircleLayer::setCircleStrokeWidth(DataDrivenPropertyValue<float> value) {
+ if (value == getCircleStrokeWidth())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleStrokeWidth>().set(value, klass);
+ impl_->paint.template get<CircleStrokeWidth>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -320,29 +320,29 @@ void CircleLayer::setCircleStrokeWidth(DataDrivenPropertyValue<float> value, con
}
}
-void CircleLayer::setCircleStrokeWidthTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void CircleLayer::setCircleStrokeWidthTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleStrokeWidth>().setTransition(value, klass);
+ impl_->paint.template get<CircleStrokeWidth>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions CircleLayer::getCircleStrokeWidthTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleStrokeWidth>().getTransition(klass);
+TransitionOptions CircleLayer::getCircleStrokeWidthTransition() const {
+ return impl().paint.template get<CircleStrokeWidth>().options;
}
DataDrivenPropertyValue<Color> CircleLayer::getDefaultCircleStrokeColor() {
return { Color::black() };
}
-DataDrivenPropertyValue<Color> CircleLayer::getCircleStrokeColor(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleStrokeColor>().get(klass);
+DataDrivenPropertyValue<Color> CircleLayer::getCircleStrokeColor() const {
+ return impl().paint.template get<CircleStrokeColor>().value;
}
-void CircleLayer::setCircleStrokeColor(DataDrivenPropertyValue<Color> value, const optional<std::string>& klass) {
- if (value == getCircleStrokeColor(klass))
+void CircleLayer::setCircleStrokeColor(DataDrivenPropertyValue<Color> value) {
+ if (value == getCircleStrokeColor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleStrokeColor>().set(value, klass);
+ impl_->paint.template get<CircleStrokeColor>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -351,29 +351,29 @@ void CircleLayer::setCircleStrokeColor(DataDrivenPropertyValue<Color> value, con
}
}
-void CircleLayer::setCircleStrokeColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void CircleLayer::setCircleStrokeColorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleStrokeColor>().setTransition(value, klass);
+ impl_->paint.template get<CircleStrokeColor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions CircleLayer::getCircleStrokeColorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleStrokeColor>().getTransition(klass);
+TransitionOptions CircleLayer::getCircleStrokeColorTransition() const {
+ return impl().paint.template get<CircleStrokeColor>().options;
}
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleStrokeOpacity() {
return { 1 };
}
-DataDrivenPropertyValue<float> CircleLayer::getCircleStrokeOpacity(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleStrokeOpacity>().get(klass);
+DataDrivenPropertyValue<float> CircleLayer::getCircleStrokeOpacity() const {
+ return impl().paint.template get<CircleStrokeOpacity>().value;
}
-void CircleLayer::setCircleStrokeOpacity(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getCircleStrokeOpacity(klass))
+void CircleLayer::setCircleStrokeOpacity(DataDrivenPropertyValue<float> value) {
+ if (value == getCircleStrokeOpacity())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleStrokeOpacity>().set(value, klass);
+ impl_->paint.template get<CircleStrokeOpacity>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -382,14 +382,14 @@ void CircleLayer::setCircleStrokeOpacity(DataDrivenPropertyValue<float> value, c
}
}
-void CircleLayer::setCircleStrokeOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void CircleLayer::setCircleStrokeOpacityTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<CircleStrokeOpacity>().setTransition(value, klass);
+ impl_->paint.template get<CircleStrokeOpacity>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions CircleLayer::getCircleStrokeOpacityTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<CircleStrokeOpacity>().getTransition(klass);
+TransitionOptions CircleLayer::getCircleStrokeOpacityTransition() const {
+ return impl().paint.template get<CircleStrokeOpacity>().options;
}
} // namespace style
diff --git a/src/mbgl/style/layers/fill_extrusion_layer.cpp b/src/mbgl/style/layers/fill_extrusion_layer.cpp
index 37ae79850b..4a5dc592e6 100644
--- a/src/mbgl/style/layers/fill_extrusion_layer.cpp
+++ b/src/mbgl/style/layers/fill_extrusion_layer.cpp
@@ -98,42 +98,42 @@ PropertyValue<float> FillExtrusionLayer::getDefaultFillExtrusionOpacity() {
return { 1 };
}
-PropertyValue<float> FillExtrusionLayer::getFillExtrusionOpacity(const optional<std::string>& klass) const {
- return impl().paint.template get<FillExtrusionOpacity>().get(klass);
+PropertyValue<float> FillExtrusionLayer::getFillExtrusionOpacity() const {
+ return impl().paint.template get<FillExtrusionOpacity>().value;
}
-void FillExtrusionLayer::setFillExtrusionOpacity(PropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getFillExtrusionOpacity(klass))
+void FillExtrusionLayer::setFillExtrusionOpacity(PropertyValue<float> value) {
+ if (value == getFillExtrusionOpacity())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<FillExtrusionOpacity>().set(value, klass);
+ impl_->paint.template get<FillExtrusionOpacity>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void FillExtrusionLayer::setFillExtrusionOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void FillExtrusionLayer::setFillExtrusionOpacityTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<FillExtrusionOpacity>().setTransition(value, klass);
+ impl_->paint.template get<FillExtrusionOpacity>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions FillExtrusionLayer::getFillExtrusionOpacityTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<FillExtrusionOpacity>().getTransition(klass);
+TransitionOptions FillExtrusionLayer::getFillExtrusionOpacityTransition() const {
+ return impl().paint.template get<FillExtrusionOpacity>().options;
}
DataDrivenPropertyValue<Color> FillExtrusionLayer::getDefaultFillExtrusionColor() {
return { Color::black() };
}
-DataDrivenPropertyValue<Color> FillExtrusionLayer::getFillExtrusionColor(const optional<std::string>& klass) const {
- return impl().paint.template get<FillExtrusionColor>().get(klass);
+DataDrivenPropertyValue<Color> FillExtrusionLayer::getFillExtrusionColor() const {
+ return impl().paint.template get<FillExtrusionColor>().value;
}
-void FillExtrusionLayer::setFillExtrusionColor(DataDrivenPropertyValue<Color> value, const optional<std::string>& klass) {
- if (value == getFillExtrusionColor(klass))
+void FillExtrusionLayer::setFillExtrusionColor(DataDrivenPropertyValue<Color> value) {
+ if (value == getFillExtrusionColor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<FillExtrusionColor>().set(value, klass);
+ impl_->paint.template get<FillExtrusionColor>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -142,110 +142,110 @@ void FillExtrusionLayer::setFillExtrusionColor(DataDrivenPropertyValue<Color> va
}
}
-void FillExtrusionLayer::setFillExtrusionColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void FillExtrusionLayer::setFillExtrusionColorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<FillExtrusionColor>().setTransition(value, klass);
+ impl_->paint.template get<FillExtrusionColor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions FillExtrusionLayer::getFillExtrusionColorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<FillExtrusionColor>().getTransition(klass);
+TransitionOptions FillExtrusionLayer::getFillExtrusionColorTransition() const {
+ return impl().paint.template get<FillExtrusionColor>().options;
}
PropertyValue<std::array<float, 2>> FillExtrusionLayer::getDefaultFillExtrusionTranslate() {
return { {{ 0, 0 }} };
}
-PropertyValue<std::array<float, 2>> FillExtrusionLayer::getFillExtrusionTranslate(const optional<std::string>& klass) const {
- return impl().paint.template get<FillExtrusionTranslate>().get(klass);
+PropertyValue<std::array<float, 2>> FillExtrusionLayer::getFillExtrusionTranslate() const {
+ return impl().paint.template get<FillExtrusionTranslate>().value;
}
-void FillExtrusionLayer::setFillExtrusionTranslate(PropertyValue<std::array<float, 2>> value, const optional<std::string>& klass) {
- if (value == getFillExtrusionTranslate(klass))
+void FillExtrusionLayer::setFillExtrusionTranslate(PropertyValue<std::array<float, 2>> value) {
+ if (value == getFillExtrusionTranslate())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<FillExtrusionTranslate>().set(value, klass);
+ impl_->paint.template get<FillExtrusionTranslate>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void FillExtrusionLayer::setFillExtrusionTranslateTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void FillExtrusionLayer::setFillExtrusionTranslateTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<FillExtrusionTranslate>().setTransition(value, klass);
+ impl_->paint.template get<FillExtrusionTranslate>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions FillExtrusionLayer::getFillExtrusionTranslateTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<FillExtrusionTranslate>().getTransition(klass);
+TransitionOptions FillExtrusionLayer::getFillExtrusionTranslateTransition() const {
+ return impl().paint.template get<FillExtrusionTranslate>().options;
}
PropertyValue<TranslateAnchorType> FillExtrusionLayer::getDefaultFillExtrusionTranslateAnchor() {
return { TranslateAnchorType::Map };
}
-PropertyValue<TranslateAnchorType> FillExtrusionLayer::getFillExtrusionTranslateAnchor(const optional<std::string>& klass) const {
- return impl().paint.template get<FillExtrusionTranslateAnchor>().get(klass);
+PropertyValue<TranslateAnchorType> FillExtrusionLayer::getFillExtrusionTranslateAnchor() const {
+ return impl().paint.template get<FillExtrusionTranslateAnchor>().value;
}
-void FillExtrusionLayer::setFillExtrusionTranslateAnchor(PropertyValue<TranslateAnchorType> value, const optional<std::string>& klass) {
- if (value == getFillExtrusionTranslateAnchor(klass))
+void FillExtrusionLayer::setFillExtrusionTranslateAnchor(PropertyValue<TranslateAnchorType> value) {
+ if (value == getFillExtrusionTranslateAnchor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<FillExtrusionTranslateAnchor>().set(value, klass);
+ impl_->paint.template get<FillExtrusionTranslateAnchor>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void FillExtrusionLayer::setFillExtrusionTranslateAnchorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void FillExtrusionLayer::setFillExtrusionTranslateAnchorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<FillExtrusionTranslateAnchor>().setTransition(value, klass);
+ impl_->paint.template get<FillExtrusionTranslateAnchor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions FillExtrusionLayer::getFillExtrusionTranslateAnchorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<FillExtrusionTranslateAnchor>().getTransition(klass);
+TransitionOptions FillExtrusionLayer::getFillExtrusionTranslateAnchorTransition() const {
+ return impl().paint.template get<FillExtrusionTranslateAnchor>().options;
}
PropertyValue<std::string> FillExtrusionLayer::getDefaultFillExtrusionPattern() {
return { "" };
}
-PropertyValue<std::string> FillExtrusionLayer::getFillExtrusionPattern(const optional<std::string>& klass) const {
- return impl().paint.template get<FillExtrusionPattern>().get(klass);
+PropertyValue<std::string> FillExtrusionLayer::getFillExtrusionPattern() const {
+ return impl().paint.template get<FillExtrusionPattern>().value;
}
-void FillExtrusionLayer::setFillExtrusionPattern(PropertyValue<std::string> value, const optional<std::string>& klass) {
- if (value == getFillExtrusionPattern(klass))
+void FillExtrusionLayer::setFillExtrusionPattern(PropertyValue<std::string> value) {
+ if (value == getFillExtrusionPattern())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<FillExtrusionPattern>().set(value, klass);
+ impl_->paint.template get<FillExtrusionPattern>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void FillExtrusionLayer::setFillExtrusionPatternTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void FillExtrusionLayer::setFillExtrusionPatternTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<FillExtrusionPattern>().setTransition(value, klass);
+ impl_->paint.template get<FillExtrusionPattern>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions FillExtrusionLayer::getFillExtrusionPatternTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<FillExtrusionPattern>().getTransition(klass);
+TransitionOptions FillExtrusionLayer::getFillExtrusionPatternTransition() const {
+ return impl().paint.template get<FillExtrusionPattern>().options;
}
DataDrivenPropertyValue<float> FillExtrusionLayer::getDefaultFillExtrusionHeight() {
return { 0 };
}
-DataDrivenPropertyValue<float> FillExtrusionLayer::getFillExtrusionHeight(const optional<std::string>& klass) const {
- return impl().paint.template get<FillExtrusionHeight>().get(klass);
+DataDrivenPropertyValue<float> FillExtrusionLayer::getFillExtrusionHeight() const {
+ return impl().paint.template get<FillExtrusionHeight>().value;
}
-void FillExtrusionLayer::setFillExtrusionHeight(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getFillExtrusionHeight(klass))
+void FillExtrusionLayer::setFillExtrusionHeight(DataDrivenPropertyValue<float> value) {
+ if (value == getFillExtrusionHeight())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<FillExtrusionHeight>().set(value, klass);
+ impl_->paint.template get<FillExtrusionHeight>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -254,29 +254,29 @@ void FillExtrusionLayer::setFillExtrusionHeight(DataDrivenPropertyValue<float> v
}
}
-void FillExtrusionLayer::setFillExtrusionHeightTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void FillExtrusionLayer::setFillExtrusionHeightTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<FillExtrusionHeight>().setTransition(value, klass);
+ impl_->paint.template get<FillExtrusionHeight>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions FillExtrusionLayer::getFillExtrusionHeightTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<FillExtrusionHeight>().getTransition(klass);
+TransitionOptions FillExtrusionLayer::getFillExtrusionHeightTransition() const {
+ return impl().paint.template get<FillExtrusionHeight>().options;
}
DataDrivenPropertyValue<float> FillExtrusionLayer::getDefaultFillExtrusionBase() {
return { 0 };
}
-DataDrivenPropertyValue<float> FillExtrusionLayer::getFillExtrusionBase(const optional<std::string>& klass) const {
- return impl().paint.template get<FillExtrusionBase>().get(klass);
+DataDrivenPropertyValue<float> FillExtrusionLayer::getFillExtrusionBase() const {
+ return impl().paint.template get<FillExtrusionBase>().value;
}
-void FillExtrusionLayer::setFillExtrusionBase(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getFillExtrusionBase(klass))
+void FillExtrusionLayer::setFillExtrusionBase(DataDrivenPropertyValue<float> value) {
+ if (value == getFillExtrusionBase())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<FillExtrusionBase>().set(value, klass);
+ impl_->paint.template get<FillExtrusionBase>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -285,14 +285,14 @@ void FillExtrusionLayer::setFillExtrusionBase(DataDrivenPropertyValue<float> val
}
}
-void FillExtrusionLayer::setFillExtrusionBaseTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void FillExtrusionLayer::setFillExtrusionBaseTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<FillExtrusionBase>().setTransition(value, klass);
+ impl_->paint.template get<FillExtrusionBase>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions FillExtrusionLayer::getFillExtrusionBaseTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<FillExtrusionBase>().getTransition(klass);
+TransitionOptions FillExtrusionLayer::getFillExtrusionBaseTransition() const {
+ return impl().paint.template get<FillExtrusionBase>().options;
}
} // namespace style
diff --git a/src/mbgl/style/layers/fill_layer.cpp b/src/mbgl/style/layers/fill_layer.cpp
index 5e3df1d54d..b98c325451 100644
--- a/src/mbgl/style/layers/fill_layer.cpp
+++ b/src/mbgl/style/layers/fill_layer.cpp
@@ -98,42 +98,42 @@ PropertyValue<bool> FillLayer::getDefaultFillAntialias() {
return { true };
}
-PropertyValue<bool> FillLayer::getFillAntialias(const optional<std::string>& klass) const {
- return impl().paint.template get<FillAntialias>().get(klass);
+PropertyValue<bool> FillLayer::getFillAntialias() const {
+ return impl().paint.template get<FillAntialias>().value;
}
-void FillLayer::setFillAntialias(PropertyValue<bool> value, const optional<std::string>& klass) {
- if (value == getFillAntialias(klass))
+void FillLayer::setFillAntialias(PropertyValue<bool> value) {
+ if (value == getFillAntialias())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<FillAntialias>().set(value, klass);
+ impl_->paint.template get<FillAntialias>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void FillLayer::setFillAntialiasTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void FillLayer::setFillAntialiasTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<FillAntialias>().setTransition(value, klass);
+ impl_->paint.template get<FillAntialias>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions FillLayer::getFillAntialiasTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<FillAntialias>().getTransition(klass);
+TransitionOptions FillLayer::getFillAntialiasTransition() const {
+ return impl().paint.template get<FillAntialias>().options;
}
DataDrivenPropertyValue<float> FillLayer::getDefaultFillOpacity() {
return { 1 };
}
-DataDrivenPropertyValue<float> FillLayer::getFillOpacity(const optional<std::string>& klass) const {
- return impl().paint.template get<FillOpacity>().get(klass);
+DataDrivenPropertyValue<float> FillLayer::getFillOpacity() const {
+ return impl().paint.template get<FillOpacity>().value;
}
-void FillLayer::setFillOpacity(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getFillOpacity(klass))
+void FillLayer::setFillOpacity(DataDrivenPropertyValue<float> value) {
+ if (value == getFillOpacity())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<FillOpacity>().set(value, klass);
+ impl_->paint.template get<FillOpacity>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -142,29 +142,29 @@ void FillLayer::setFillOpacity(DataDrivenPropertyValue<float> value, const optio
}
}
-void FillLayer::setFillOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void FillLayer::setFillOpacityTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<FillOpacity>().setTransition(value, klass);
+ impl_->paint.template get<FillOpacity>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions FillLayer::getFillOpacityTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<FillOpacity>().getTransition(klass);
+TransitionOptions FillLayer::getFillOpacityTransition() const {
+ return impl().paint.template get<FillOpacity>().options;
}
DataDrivenPropertyValue<Color> FillLayer::getDefaultFillColor() {
return { Color::black() };
}
-DataDrivenPropertyValue<Color> FillLayer::getFillColor(const optional<std::string>& klass) const {
- return impl().paint.template get<FillColor>().get(klass);
+DataDrivenPropertyValue<Color> FillLayer::getFillColor() const {
+ return impl().paint.template get<FillColor>().value;
}
-void FillLayer::setFillColor(DataDrivenPropertyValue<Color> value, const optional<std::string>& klass) {
- if (value == getFillColor(klass))
+void FillLayer::setFillColor(DataDrivenPropertyValue<Color> value) {
+ if (value == getFillColor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<FillColor>().set(value, klass);
+ impl_->paint.template get<FillColor>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -173,29 +173,29 @@ void FillLayer::setFillColor(DataDrivenPropertyValue<Color> value, const optiona
}
}
-void FillLayer::setFillColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void FillLayer::setFillColorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<FillColor>().setTransition(value, klass);
+ impl_->paint.template get<FillColor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions FillLayer::getFillColorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<FillColor>().getTransition(klass);
+TransitionOptions FillLayer::getFillColorTransition() const {
+ return impl().paint.template get<FillColor>().options;
}
DataDrivenPropertyValue<Color> FillLayer::getDefaultFillOutlineColor() {
return { {} };
}
-DataDrivenPropertyValue<Color> FillLayer::getFillOutlineColor(const optional<std::string>& klass) const {
- return impl().paint.template get<FillOutlineColor>().get(klass);
+DataDrivenPropertyValue<Color> FillLayer::getFillOutlineColor() const {
+ return impl().paint.template get<FillOutlineColor>().value;
}
-void FillLayer::setFillOutlineColor(DataDrivenPropertyValue<Color> value, const optional<std::string>& klass) {
- if (value == getFillOutlineColor(klass))
+void FillLayer::setFillOutlineColor(DataDrivenPropertyValue<Color> value) {
+ if (value == getFillOutlineColor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<FillOutlineColor>().set(value, klass);
+ impl_->paint.template get<FillOutlineColor>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -204,95 +204,95 @@ void FillLayer::setFillOutlineColor(DataDrivenPropertyValue<Color> value, const
}
}
-void FillLayer::setFillOutlineColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void FillLayer::setFillOutlineColorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<FillOutlineColor>().setTransition(value, klass);
+ impl_->paint.template get<FillOutlineColor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions FillLayer::getFillOutlineColorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<FillOutlineColor>().getTransition(klass);
+TransitionOptions FillLayer::getFillOutlineColorTransition() const {
+ return impl().paint.template get<FillOutlineColor>().options;
}
PropertyValue<std::array<float, 2>> FillLayer::getDefaultFillTranslate() {
return { {{ 0, 0 }} };
}
-PropertyValue<std::array<float, 2>> FillLayer::getFillTranslate(const optional<std::string>& klass) const {
- return impl().paint.template get<FillTranslate>().get(klass);
+PropertyValue<std::array<float, 2>> FillLayer::getFillTranslate() const {
+ return impl().paint.template get<FillTranslate>().value;
}
-void FillLayer::setFillTranslate(PropertyValue<std::array<float, 2>> value, const optional<std::string>& klass) {
- if (value == getFillTranslate(klass))
+void FillLayer::setFillTranslate(PropertyValue<std::array<float, 2>> value) {
+ if (value == getFillTranslate())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<FillTranslate>().set(value, klass);
+ impl_->paint.template get<FillTranslate>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void FillLayer::setFillTranslateTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void FillLayer::setFillTranslateTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<FillTranslate>().setTransition(value, klass);
+ impl_->paint.template get<FillTranslate>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions FillLayer::getFillTranslateTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<FillTranslate>().getTransition(klass);
+TransitionOptions FillLayer::getFillTranslateTransition() const {
+ return impl().paint.template get<FillTranslate>().options;
}
PropertyValue<TranslateAnchorType> FillLayer::getDefaultFillTranslateAnchor() {
return { TranslateAnchorType::Map };
}
-PropertyValue<TranslateAnchorType> FillLayer::getFillTranslateAnchor(const optional<std::string>& klass) const {
- return impl().paint.template get<FillTranslateAnchor>().get(klass);
+PropertyValue<TranslateAnchorType> FillLayer::getFillTranslateAnchor() const {
+ return impl().paint.template get<FillTranslateAnchor>().value;
}
-void FillLayer::setFillTranslateAnchor(PropertyValue<TranslateAnchorType> value, const optional<std::string>& klass) {
- if (value == getFillTranslateAnchor(klass))
+void FillLayer::setFillTranslateAnchor(PropertyValue<TranslateAnchorType> value) {
+ if (value == getFillTranslateAnchor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<FillTranslateAnchor>().set(value, klass);
+ impl_->paint.template get<FillTranslateAnchor>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void FillLayer::setFillTranslateAnchorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void FillLayer::setFillTranslateAnchorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<FillTranslateAnchor>().setTransition(value, klass);
+ impl_->paint.template get<FillTranslateAnchor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions FillLayer::getFillTranslateAnchorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<FillTranslateAnchor>().getTransition(klass);
+TransitionOptions FillLayer::getFillTranslateAnchorTransition() const {
+ return impl().paint.template get<FillTranslateAnchor>().options;
}
PropertyValue<std::string> FillLayer::getDefaultFillPattern() {
return { "" };
}
-PropertyValue<std::string> FillLayer::getFillPattern(const optional<std::string>& klass) const {
- return impl().paint.template get<FillPattern>().get(klass);
+PropertyValue<std::string> FillLayer::getFillPattern() const {
+ return impl().paint.template get<FillPattern>().value;
}
-void FillLayer::setFillPattern(PropertyValue<std::string> value, const optional<std::string>& klass) {
- if (value == getFillPattern(klass))
+void FillLayer::setFillPattern(PropertyValue<std::string> value) {
+ if (value == getFillPattern())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<FillPattern>().set(value, klass);
+ impl_->paint.template get<FillPattern>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void FillLayer::setFillPatternTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void FillLayer::setFillPatternTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<FillPattern>().setTransition(value, klass);
+ impl_->paint.template get<FillPattern>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions FillLayer::getFillPatternTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<FillPattern>().getTransition(klass);
+TransitionOptions FillLayer::getFillPatternTransition() const {
+ return impl().paint.template get<FillPattern>().options;
}
} // namespace style
diff --git a/src/mbgl/style/layers/layer.cpp.ejs b/src/mbgl/style/layers/layer.cpp.ejs
index 4f747792cf..b9c3e64cb4 100644
--- a/src/mbgl/style/layers/layer.cpp.ejs
+++ b/src/mbgl/style/layers/layer.cpp.ejs
@@ -137,15 +137,15 @@ void <%- camelize(type) %>Layer::set<%- camelize(property.name) %>(<%- propertyV
return { <%- defaultValue(property) %> };
}
-<%- propertyValueType(property) %> <%- camelize(type) %>Layer::get<%- camelize(property.name) %>(const optional<std::string>& klass) const {
- return impl().paint.template get<<%- camelize(property.name) %>>().get(klass);
+<%- propertyValueType(property) %> <%- camelize(type) %>Layer::get<%- camelize(property.name) %>() const {
+ return impl().paint.template get<<%- camelize(property.name) %>>().value;
}
-void <%- camelize(type) %>Layer::set<%- camelize(property.name) %>(<%- propertyValueType(property) %> value, const optional<std::string>& klass) {
- if (value == get<%- camelize(property.name) %>(klass))
+void <%- camelize(type) %>Layer::set<%- camelize(property.name) %>(<%- propertyValueType(property) %> value) {
+ if (value == get<%- camelize(property.name) %>())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<<%- camelize(property.name) %>>().set(value, klass);
+ impl_->paint.template get<<%- camelize(property.name) %>>().value = value;
baseImpl = std::move(impl_);
<% if (isDataDriven(property)) { -%>
if (value.isDataDriven()) {
@@ -158,14 +158,14 @@ 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) {
+void <%- camelize(type) %>Layer::set<%- camelize(property.name) %>Transition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<<%- camelize(property.name) %>>().setTransition(value, klass);
+ impl_->paint.template get<<%- camelize(property.name) %>>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions <%- camelize(type) %>Layer::get<%- camelize(property.name) %>Transition(const optional<std::string>& klass) const {
- return impl().paint.template get<<%- camelize(property.name) %>>().getTransition(klass);
+TransitionOptions <%- camelize(type) %>Layer::get<%- camelize(property.name) %>Transition() const {
+ return impl().paint.template get<<%- camelize(property.name) %>>().options;
}
<% } -%>
diff --git a/src/mbgl/style/layers/line_layer.cpp b/src/mbgl/style/layers/line_layer.cpp
index 286289b28e..96f1fa4d11 100644
--- a/src/mbgl/style/layers/line_layer.cpp
+++ b/src/mbgl/style/layers/line_layer.cpp
@@ -163,15 +163,15 @@ DataDrivenPropertyValue<float> LineLayer::getDefaultLineOpacity() {
return { 1 };
}
-DataDrivenPropertyValue<float> LineLayer::getLineOpacity(const optional<std::string>& klass) const {
- return impl().paint.template get<LineOpacity>().get(klass);
+DataDrivenPropertyValue<float> LineLayer::getLineOpacity() const {
+ return impl().paint.template get<LineOpacity>().value;
}
-void LineLayer::setLineOpacity(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getLineOpacity(klass))
+void LineLayer::setLineOpacity(DataDrivenPropertyValue<float> value) {
+ if (value == getLineOpacity())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<LineOpacity>().set(value, klass);
+ impl_->paint.template get<LineOpacity>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -180,29 +180,29 @@ void LineLayer::setLineOpacity(DataDrivenPropertyValue<float> value, const optio
}
}
-void LineLayer::setLineOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void LineLayer::setLineOpacityTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<LineOpacity>().setTransition(value, klass);
+ impl_->paint.template get<LineOpacity>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions LineLayer::getLineOpacityTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<LineOpacity>().getTransition(klass);
+TransitionOptions LineLayer::getLineOpacityTransition() const {
+ return impl().paint.template get<LineOpacity>().options;
}
DataDrivenPropertyValue<Color> LineLayer::getDefaultLineColor() {
return { Color::black() };
}
-DataDrivenPropertyValue<Color> LineLayer::getLineColor(const optional<std::string>& klass) const {
- return impl().paint.template get<LineColor>().get(klass);
+DataDrivenPropertyValue<Color> LineLayer::getLineColor() const {
+ return impl().paint.template get<LineColor>().value;
}
-void LineLayer::setLineColor(DataDrivenPropertyValue<Color> value, const optional<std::string>& klass) {
- if (value == getLineColor(klass))
+void LineLayer::setLineColor(DataDrivenPropertyValue<Color> value) {
+ if (value == getLineColor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<LineColor>().set(value, klass);
+ impl_->paint.template get<LineColor>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -211,110 +211,110 @@ void LineLayer::setLineColor(DataDrivenPropertyValue<Color> value, const optiona
}
}
-void LineLayer::setLineColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void LineLayer::setLineColorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<LineColor>().setTransition(value, klass);
+ impl_->paint.template get<LineColor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions LineLayer::getLineColorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<LineColor>().getTransition(klass);
+TransitionOptions LineLayer::getLineColorTransition() const {
+ return impl().paint.template get<LineColor>().options;
}
PropertyValue<std::array<float, 2>> LineLayer::getDefaultLineTranslate() {
return { {{ 0, 0 }} };
}
-PropertyValue<std::array<float, 2>> LineLayer::getLineTranslate(const optional<std::string>& klass) const {
- return impl().paint.template get<LineTranslate>().get(klass);
+PropertyValue<std::array<float, 2>> LineLayer::getLineTranslate() const {
+ return impl().paint.template get<LineTranslate>().value;
}
-void LineLayer::setLineTranslate(PropertyValue<std::array<float, 2>> value, const optional<std::string>& klass) {
- if (value == getLineTranslate(klass))
+void LineLayer::setLineTranslate(PropertyValue<std::array<float, 2>> value) {
+ if (value == getLineTranslate())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<LineTranslate>().set(value, klass);
+ impl_->paint.template get<LineTranslate>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void LineLayer::setLineTranslateTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void LineLayer::setLineTranslateTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<LineTranslate>().setTransition(value, klass);
+ impl_->paint.template get<LineTranslate>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions LineLayer::getLineTranslateTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<LineTranslate>().getTransition(klass);
+TransitionOptions LineLayer::getLineTranslateTransition() const {
+ return impl().paint.template get<LineTranslate>().options;
}
PropertyValue<TranslateAnchorType> LineLayer::getDefaultLineTranslateAnchor() {
return { TranslateAnchorType::Map };
}
-PropertyValue<TranslateAnchorType> LineLayer::getLineTranslateAnchor(const optional<std::string>& klass) const {
- return impl().paint.template get<LineTranslateAnchor>().get(klass);
+PropertyValue<TranslateAnchorType> LineLayer::getLineTranslateAnchor() const {
+ return impl().paint.template get<LineTranslateAnchor>().value;
}
-void LineLayer::setLineTranslateAnchor(PropertyValue<TranslateAnchorType> value, const optional<std::string>& klass) {
- if (value == getLineTranslateAnchor(klass))
+void LineLayer::setLineTranslateAnchor(PropertyValue<TranslateAnchorType> value) {
+ if (value == getLineTranslateAnchor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<LineTranslateAnchor>().set(value, klass);
+ impl_->paint.template get<LineTranslateAnchor>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void LineLayer::setLineTranslateAnchorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void LineLayer::setLineTranslateAnchorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<LineTranslateAnchor>().setTransition(value, klass);
+ impl_->paint.template get<LineTranslateAnchor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions LineLayer::getLineTranslateAnchorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<LineTranslateAnchor>().getTransition(klass);
+TransitionOptions LineLayer::getLineTranslateAnchorTransition() const {
+ return impl().paint.template get<LineTranslateAnchor>().options;
}
PropertyValue<float> LineLayer::getDefaultLineWidth() {
return { 1 };
}
-PropertyValue<float> LineLayer::getLineWidth(const optional<std::string>& klass) const {
- return impl().paint.template get<LineWidth>().get(klass);
+PropertyValue<float> LineLayer::getLineWidth() const {
+ return impl().paint.template get<LineWidth>().value;
}
-void LineLayer::setLineWidth(PropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getLineWidth(klass))
+void LineLayer::setLineWidth(PropertyValue<float> value) {
+ if (value == getLineWidth())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<LineWidth>().set(value, klass);
+ impl_->paint.template get<LineWidth>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void LineLayer::setLineWidthTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void LineLayer::setLineWidthTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<LineWidth>().setTransition(value, klass);
+ impl_->paint.template get<LineWidth>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions LineLayer::getLineWidthTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<LineWidth>().getTransition(klass);
+TransitionOptions LineLayer::getLineWidthTransition() const {
+ return impl().paint.template get<LineWidth>().options;
}
DataDrivenPropertyValue<float> LineLayer::getDefaultLineGapWidth() {
return { 0 };
}
-DataDrivenPropertyValue<float> LineLayer::getLineGapWidth(const optional<std::string>& klass) const {
- return impl().paint.template get<LineGapWidth>().get(klass);
+DataDrivenPropertyValue<float> LineLayer::getLineGapWidth() const {
+ return impl().paint.template get<LineGapWidth>().value;
}
-void LineLayer::setLineGapWidth(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getLineGapWidth(klass))
+void LineLayer::setLineGapWidth(DataDrivenPropertyValue<float> value) {
+ if (value == getLineGapWidth())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<LineGapWidth>().set(value, klass);
+ impl_->paint.template get<LineGapWidth>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -323,29 +323,29 @@ void LineLayer::setLineGapWidth(DataDrivenPropertyValue<float> value, const opti
}
}
-void LineLayer::setLineGapWidthTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void LineLayer::setLineGapWidthTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<LineGapWidth>().setTransition(value, klass);
+ impl_->paint.template get<LineGapWidth>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions LineLayer::getLineGapWidthTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<LineGapWidth>().getTransition(klass);
+TransitionOptions LineLayer::getLineGapWidthTransition() const {
+ return impl().paint.template get<LineGapWidth>().options;
}
DataDrivenPropertyValue<float> LineLayer::getDefaultLineOffset() {
return { 0 };
}
-DataDrivenPropertyValue<float> LineLayer::getLineOffset(const optional<std::string>& klass) const {
- return impl().paint.template get<LineOffset>().get(klass);
+DataDrivenPropertyValue<float> LineLayer::getLineOffset() const {
+ return impl().paint.template get<LineOffset>().value;
}
-void LineLayer::setLineOffset(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getLineOffset(klass))
+void LineLayer::setLineOffset(DataDrivenPropertyValue<float> value) {
+ if (value == getLineOffset())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<LineOffset>().set(value, klass);
+ impl_->paint.template get<LineOffset>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -354,29 +354,29 @@ void LineLayer::setLineOffset(DataDrivenPropertyValue<float> value, const option
}
}
-void LineLayer::setLineOffsetTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void LineLayer::setLineOffsetTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<LineOffset>().setTransition(value, klass);
+ impl_->paint.template get<LineOffset>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions LineLayer::getLineOffsetTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<LineOffset>().getTransition(klass);
+TransitionOptions LineLayer::getLineOffsetTransition() const {
+ return impl().paint.template get<LineOffset>().options;
}
DataDrivenPropertyValue<float> LineLayer::getDefaultLineBlur() {
return { 0 };
}
-DataDrivenPropertyValue<float> LineLayer::getLineBlur(const optional<std::string>& klass) const {
- return impl().paint.template get<LineBlur>().get(klass);
+DataDrivenPropertyValue<float> LineLayer::getLineBlur() const {
+ return impl().paint.template get<LineBlur>().value;
}
-void LineLayer::setLineBlur(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getLineBlur(klass))
+void LineLayer::setLineBlur(DataDrivenPropertyValue<float> value) {
+ if (value == getLineBlur())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<LineBlur>().set(value, klass);
+ impl_->paint.template get<LineBlur>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -385,68 +385,68 @@ void LineLayer::setLineBlur(DataDrivenPropertyValue<float> value, const optional
}
}
-void LineLayer::setLineBlurTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void LineLayer::setLineBlurTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<LineBlur>().setTransition(value, klass);
+ impl_->paint.template get<LineBlur>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions LineLayer::getLineBlurTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<LineBlur>().getTransition(klass);
+TransitionOptions LineLayer::getLineBlurTransition() const {
+ return impl().paint.template get<LineBlur>().options;
}
PropertyValue<std::vector<float>> LineLayer::getDefaultLineDasharray() {
return { { } };
}
-PropertyValue<std::vector<float>> LineLayer::getLineDasharray(const optional<std::string>& klass) const {
- return impl().paint.template get<LineDasharray>().get(klass);
+PropertyValue<std::vector<float>> LineLayer::getLineDasharray() const {
+ return impl().paint.template get<LineDasharray>().value;
}
-void LineLayer::setLineDasharray(PropertyValue<std::vector<float>> value, const optional<std::string>& klass) {
- if (value == getLineDasharray(klass))
+void LineLayer::setLineDasharray(PropertyValue<std::vector<float>> value) {
+ if (value == getLineDasharray())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<LineDasharray>().set(value, klass);
+ impl_->paint.template get<LineDasharray>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void LineLayer::setLineDasharrayTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void LineLayer::setLineDasharrayTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<LineDasharray>().setTransition(value, klass);
+ impl_->paint.template get<LineDasharray>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions LineLayer::getLineDasharrayTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<LineDasharray>().getTransition(klass);
+TransitionOptions LineLayer::getLineDasharrayTransition() const {
+ return impl().paint.template get<LineDasharray>().options;
}
PropertyValue<std::string> LineLayer::getDefaultLinePattern() {
return { "" };
}
-PropertyValue<std::string> LineLayer::getLinePattern(const optional<std::string>& klass) const {
- return impl().paint.template get<LinePattern>().get(klass);
+PropertyValue<std::string> LineLayer::getLinePattern() const {
+ return impl().paint.template get<LinePattern>().value;
}
-void LineLayer::setLinePattern(PropertyValue<std::string> value, const optional<std::string>& klass) {
- if (value == getLinePattern(klass))
+void LineLayer::setLinePattern(PropertyValue<std::string> value) {
+ if (value == getLinePattern())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<LinePattern>().set(value, klass);
+ impl_->paint.template get<LinePattern>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void LineLayer::setLinePatternTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void LineLayer::setLinePatternTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<LinePattern>().setTransition(value, klass);
+ impl_->paint.template get<LinePattern>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions LineLayer::getLinePatternTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<LinePattern>().getTransition(klass);
+TransitionOptions LineLayer::getLinePatternTransition() const {
+ return impl().paint.template get<LinePattern>().options;
}
} // namespace style
diff --git a/src/mbgl/style/layers/raster_layer.cpp b/src/mbgl/style/layers/raster_layer.cpp
index fc28672abd..a7a32768b6 100644
--- a/src/mbgl/style/layers/raster_layer.cpp
+++ b/src/mbgl/style/layers/raster_layer.cpp
@@ -76,189 +76,189 @@ PropertyValue<float> RasterLayer::getDefaultRasterOpacity() {
return { 1 };
}
-PropertyValue<float> RasterLayer::getRasterOpacity(const optional<std::string>& klass) const {
- return impl().paint.template get<RasterOpacity>().get(klass);
+PropertyValue<float> RasterLayer::getRasterOpacity() const {
+ return impl().paint.template get<RasterOpacity>().value;
}
-void RasterLayer::setRasterOpacity(PropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getRasterOpacity(klass))
+void RasterLayer::setRasterOpacity(PropertyValue<float> value) {
+ if (value == getRasterOpacity())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<RasterOpacity>().set(value, klass);
+ impl_->paint.template get<RasterOpacity>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void RasterLayer::setRasterOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void RasterLayer::setRasterOpacityTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<RasterOpacity>().setTransition(value, klass);
+ impl_->paint.template get<RasterOpacity>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions RasterLayer::getRasterOpacityTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<RasterOpacity>().getTransition(klass);
+TransitionOptions RasterLayer::getRasterOpacityTransition() const {
+ return impl().paint.template get<RasterOpacity>().options;
}
PropertyValue<float> RasterLayer::getDefaultRasterHueRotate() {
return { 0 };
}
-PropertyValue<float> RasterLayer::getRasterHueRotate(const optional<std::string>& klass) const {
- return impl().paint.template get<RasterHueRotate>().get(klass);
+PropertyValue<float> RasterLayer::getRasterHueRotate() const {
+ return impl().paint.template get<RasterHueRotate>().value;
}
-void RasterLayer::setRasterHueRotate(PropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getRasterHueRotate(klass))
+void RasterLayer::setRasterHueRotate(PropertyValue<float> value) {
+ if (value == getRasterHueRotate())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<RasterHueRotate>().set(value, klass);
+ impl_->paint.template get<RasterHueRotate>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void RasterLayer::setRasterHueRotateTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void RasterLayer::setRasterHueRotateTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<RasterHueRotate>().setTransition(value, klass);
+ impl_->paint.template get<RasterHueRotate>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions RasterLayer::getRasterHueRotateTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<RasterHueRotate>().getTransition(klass);
+TransitionOptions RasterLayer::getRasterHueRotateTransition() const {
+ return impl().paint.template get<RasterHueRotate>().options;
}
PropertyValue<float> RasterLayer::getDefaultRasterBrightnessMin() {
return { 0 };
}
-PropertyValue<float> RasterLayer::getRasterBrightnessMin(const optional<std::string>& klass) const {
- return impl().paint.template get<RasterBrightnessMin>().get(klass);
+PropertyValue<float> RasterLayer::getRasterBrightnessMin() const {
+ return impl().paint.template get<RasterBrightnessMin>().value;
}
-void RasterLayer::setRasterBrightnessMin(PropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getRasterBrightnessMin(klass))
+void RasterLayer::setRasterBrightnessMin(PropertyValue<float> value) {
+ if (value == getRasterBrightnessMin())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<RasterBrightnessMin>().set(value, klass);
+ impl_->paint.template get<RasterBrightnessMin>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void RasterLayer::setRasterBrightnessMinTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void RasterLayer::setRasterBrightnessMinTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<RasterBrightnessMin>().setTransition(value, klass);
+ impl_->paint.template get<RasterBrightnessMin>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions RasterLayer::getRasterBrightnessMinTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<RasterBrightnessMin>().getTransition(klass);
+TransitionOptions RasterLayer::getRasterBrightnessMinTransition() const {
+ return impl().paint.template get<RasterBrightnessMin>().options;
}
PropertyValue<float> RasterLayer::getDefaultRasterBrightnessMax() {
return { 1 };
}
-PropertyValue<float> RasterLayer::getRasterBrightnessMax(const optional<std::string>& klass) const {
- return impl().paint.template get<RasterBrightnessMax>().get(klass);
+PropertyValue<float> RasterLayer::getRasterBrightnessMax() const {
+ return impl().paint.template get<RasterBrightnessMax>().value;
}
-void RasterLayer::setRasterBrightnessMax(PropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getRasterBrightnessMax(klass))
+void RasterLayer::setRasterBrightnessMax(PropertyValue<float> value) {
+ if (value == getRasterBrightnessMax())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<RasterBrightnessMax>().set(value, klass);
+ impl_->paint.template get<RasterBrightnessMax>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void RasterLayer::setRasterBrightnessMaxTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void RasterLayer::setRasterBrightnessMaxTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<RasterBrightnessMax>().setTransition(value, klass);
+ impl_->paint.template get<RasterBrightnessMax>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions RasterLayer::getRasterBrightnessMaxTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<RasterBrightnessMax>().getTransition(klass);
+TransitionOptions RasterLayer::getRasterBrightnessMaxTransition() const {
+ return impl().paint.template get<RasterBrightnessMax>().options;
}
PropertyValue<float> RasterLayer::getDefaultRasterSaturation() {
return { 0 };
}
-PropertyValue<float> RasterLayer::getRasterSaturation(const optional<std::string>& klass) const {
- return impl().paint.template get<RasterSaturation>().get(klass);
+PropertyValue<float> RasterLayer::getRasterSaturation() const {
+ return impl().paint.template get<RasterSaturation>().value;
}
-void RasterLayer::setRasterSaturation(PropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getRasterSaturation(klass))
+void RasterLayer::setRasterSaturation(PropertyValue<float> value) {
+ if (value == getRasterSaturation())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<RasterSaturation>().set(value, klass);
+ impl_->paint.template get<RasterSaturation>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void RasterLayer::setRasterSaturationTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void RasterLayer::setRasterSaturationTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<RasterSaturation>().setTransition(value, klass);
+ impl_->paint.template get<RasterSaturation>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions RasterLayer::getRasterSaturationTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<RasterSaturation>().getTransition(klass);
+TransitionOptions RasterLayer::getRasterSaturationTransition() const {
+ return impl().paint.template get<RasterSaturation>().options;
}
PropertyValue<float> RasterLayer::getDefaultRasterContrast() {
return { 0 };
}
-PropertyValue<float> RasterLayer::getRasterContrast(const optional<std::string>& klass) const {
- return impl().paint.template get<RasterContrast>().get(klass);
+PropertyValue<float> RasterLayer::getRasterContrast() const {
+ return impl().paint.template get<RasterContrast>().value;
}
-void RasterLayer::setRasterContrast(PropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getRasterContrast(klass))
+void RasterLayer::setRasterContrast(PropertyValue<float> value) {
+ if (value == getRasterContrast())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<RasterContrast>().set(value, klass);
+ impl_->paint.template get<RasterContrast>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void RasterLayer::setRasterContrastTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void RasterLayer::setRasterContrastTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<RasterContrast>().setTransition(value, klass);
+ impl_->paint.template get<RasterContrast>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions RasterLayer::getRasterContrastTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<RasterContrast>().getTransition(klass);
+TransitionOptions RasterLayer::getRasterContrastTransition() const {
+ return impl().paint.template get<RasterContrast>().options;
}
PropertyValue<float> RasterLayer::getDefaultRasterFadeDuration() {
return { 300 };
}
-PropertyValue<float> RasterLayer::getRasterFadeDuration(const optional<std::string>& klass) const {
- return impl().paint.template get<RasterFadeDuration>().get(klass);
+PropertyValue<float> RasterLayer::getRasterFadeDuration() const {
+ return impl().paint.template get<RasterFadeDuration>().value;
}
-void RasterLayer::setRasterFadeDuration(PropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getRasterFadeDuration(klass))
+void RasterLayer::setRasterFadeDuration(PropertyValue<float> value) {
+ if (value == getRasterFadeDuration())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<RasterFadeDuration>().set(value, klass);
+ impl_->paint.template get<RasterFadeDuration>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void RasterLayer::setRasterFadeDurationTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void RasterLayer::setRasterFadeDurationTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<RasterFadeDuration>().setTransition(value, klass);
+ impl_->paint.template get<RasterFadeDuration>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions RasterLayer::getRasterFadeDurationTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<RasterFadeDuration>().getTransition(klass);
+TransitionOptions RasterLayer::getRasterFadeDurationTransition() const {
+ return impl().paint.template get<RasterFadeDuration>().options;
}
} // namespace style
diff --git a/src/mbgl/style/layers/symbol_layer.cpp b/src/mbgl/style/layers/symbol_layer.cpp
index d21014dda0..b2f9ca754f 100644
--- a/src/mbgl/style/layers/symbol_layer.cpp
+++ b/src/mbgl/style/layers/symbol_layer.cpp
@@ -643,15 +643,15 @@ DataDrivenPropertyValue<float> SymbolLayer::getDefaultIconOpacity() {
return { 1 };
}
-DataDrivenPropertyValue<float> SymbolLayer::getIconOpacity(const optional<std::string>& klass) const {
- return impl().paint.template get<IconOpacity>().get(klass);
+DataDrivenPropertyValue<float> SymbolLayer::getIconOpacity() const {
+ return impl().paint.template get<IconOpacity>().value;
}
-void SymbolLayer::setIconOpacity(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getIconOpacity(klass))
+void SymbolLayer::setIconOpacity(DataDrivenPropertyValue<float> value) {
+ if (value == getIconOpacity())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<IconOpacity>().set(value, klass);
+ impl_->paint.template get<IconOpacity>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -660,29 +660,29 @@ void SymbolLayer::setIconOpacity(DataDrivenPropertyValue<float> value, const opt
}
}
-void SymbolLayer::setIconOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void SymbolLayer::setIconOpacityTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<IconOpacity>().setTransition(value, klass);
+ impl_->paint.template get<IconOpacity>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions SymbolLayer::getIconOpacityTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<IconOpacity>().getTransition(klass);
+TransitionOptions SymbolLayer::getIconOpacityTransition() const {
+ return impl().paint.template get<IconOpacity>().options;
}
DataDrivenPropertyValue<Color> SymbolLayer::getDefaultIconColor() {
return { Color::black() };
}
-DataDrivenPropertyValue<Color> SymbolLayer::getIconColor(const optional<std::string>& klass) const {
- return impl().paint.template get<IconColor>().get(klass);
+DataDrivenPropertyValue<Color> SymbolLayer::getIconColor() const {
+ return impl().paint.template get<IconColor>().value;
}
-void SymbolLayer::setIconColor(DataDrivenPropertyValue<Color> value, const optional<std::string>& klass) {
- if (value == getIconColor(klass))
+void SymbolLayer::setIconColor(DataDrivenPropertyValue<Color> value) {
+ if (value == getIconColor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<IconColor>().set(value, klass);
+ impl_->paint.template get<IconColor>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -691,29 +691,29 @@ void SymbolLayer::setIconColor(DataDrivenPropertyValue<Color> value, const optio
}
}
-void SymbolLayer::setIconColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void SymbolLayer::setIconColorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<IconColor>().setTransition(value, klass);
+ impl_->paint.template get<IconColor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions SymbolLayer::getIconColorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<IconColor>().getTransition(klass);
+TransitionOptions SymbolLayer::getIconColorTransition() const {
+ return impl().paint.template get<IconColor>().options;
}
DataDrivenPropertyValue<Color> SymbolLayer::getDefaultIconHaloColor() {
return { {} };
}
-DataDrivenPropertyValue<Color> SymbolLayer::getIconHaloColor(const optional<std::string>& klass) const {
- return impl().paint.template get<IconHaloColor>().get(klass);
+DataDrivenPropertyValue<Color> SymbolLayer::getIconHaloColor() const {
+ return impl().paint.template get<IconHaloColor>().value;
}
-void SymbolLayer::setIconHaloColor(DataDrivenPropertyValue<Color> value, const optional<std::string>& klass) {
- if (value == getIconHaloColor(klass))
+void SymbolLayer::setIconHaloColor(DataDrivenPropertyValue<Color> value) {
+ if (value == getIconHaloColor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<IconHaloColor>().set(value, klass);
+ impl_->paint.template get<IconHaloColor>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -722,29 +722,29 @@ void SymbolLayer::setIconHaloColor(DataDrivenPropertyValue<Color> value, const o
}
}
-void SymbolLayer::setIconHaloColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void SymbolLayer::setIconHaloColorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<IconHaloColor>().setTransition(value, klass);
+ impl_->paint.template get<IconHaloColor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions SymbolLayer::getIconHaloColorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<IconHaloColor>().getTransition(klass);
+TransitionOptions SymbolLayer::getIconHaloColorTransition() const {
+ return impl().paint.template get<IconHaloColor>().options;
}
DataDrivenPropertyValue<float> SymbolLayer::getDefaultIconHaloWidth() {
return { 0 };
}
-DataDrivenPropertyValue<float> SymbolLayer::getIconHaloWidth(const optional<std::string>& klass) const {
- return impl().paint.template get<IconHaloWidth>().get(klass);
+DataDrivenPropertyValue<float> SymbolLayer::getIconHaloWidth() const {
+ return impl().paint.template get<IconHaloWidth>().value;
}
-void SymbolLayer::setIconHaloWidth(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getIconHaloWidth(klass))
+void SymbolLayer::setIconHaloWidth(DataDrivenPropertyValue<float> value) {
+ if (value == getIconHaloWidth())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<IconHaloWidth>().set(value, klass);
+ impl_->paint.template get<IconHaloWidth>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -753,29 +753,29 @@ void SymbolLayer::setIconHaloWidth(DataDrivenPropertyValue<float> value, const o
}
}
-void SymbolLayer::setIconHaloWidthTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void SymbolLayer::setIconHaloWidthTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<IconHaloWidth>().setTransition(value, klass);
+ impl_->paint.template get<IconHaloWidth>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions SymbolLayer::getIconHaloWidthTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<IconHaloWidth>().getTransition(klass);
+TransitionOptions SymbolLayer::getIconHaloWidthTransition() const {
+ return impl().paint.template get<IconHaloWidth>().options;
}
DataDrivenPropertyValue<float> SymbolLayer::getDefaultIconHaloBlur() {
return { 0 };
}
-DataDrivenPropertyValue<float> SymbolLayer::getIconHaloBlur(const optional<std::string>& klass) const {
- return impl().paint.template get<IconHaloBlur>().get(klass);
+DataDrivenPropertyValue<float> SymbolLayer::getIconHaloBlur() const {
+ return impl().paint.template get<IconHaloBlur>().value;
}
-void SymbolLayer::setIconHaloBlur(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getIconHaloBlur(klass))
+void SymbolLayer::setIconHaloBlur(DataDrivenPropertyValue<float> value) {
+ if (value == getIconHaloBlur())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<IconHaloBlur>().set(value, klass);
+ impl_->paint.template get<IconHaloBlur>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -784,83 +784,83 @@ void SymbolLayer::setIconHaloBlur(DataDrivenPropertyValue<float> value, const op
}
}
-void SymbolLayer::setIconHaloBlurTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void SymbolLayer::setIconHaloBlurTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<IconHaloBlur>().setTransition(value, klass);
+ impl_->paint.template get<IconHaloBlur>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions SymbolLayer::getIconHaloBlurTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<IconHaloBlur>().getTransition(klass);
+TransitionOptions SymbolLayer::getIconHaloBlurTransition() const {
+ return impl().paint.template get<IconHaloBlur>().options;
}
PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultIconTranslate() {
return { {{ 0, 0 }} };
}
-PropertyValue<std::array<float, 2>> SymbolLayer::getIconTranslate(const optional<std::string>& klass) const {
- return impl().paint.template get<IconTranslate>().get(klass);
+PropertyValue<std::array<float, 2>> SymbolLayer::getIconTranslate() const {
+ return impl().paint.template get<IconTranslate>().value;
}
-void SymbolLayer::setIconTranslate(PropertyValue<std::array<float, 2>> value, const optional<std::string>& klass) {
- if (value == getIconTranslate(klass))
+void SymbolLayer::setIconTranslate(PropertyValue<std::array<float, 2>> value) {
+ if (value == getIconTranslate())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<IconTranslate>().set(value, klass);
+ impl_->paint.template get<IconTranslate>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void SymbolLayer::setIconTranslateTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void SymbolLayer::setIconTranslateTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<IconTranslate>().setTransition(value, klass);
+ impl_->paint.template get<IconTranslate>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions SymbolLayer::getIconTranslateTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<IconTranslate>().getTransition(klass);
+TransitionOptions SymbolLayer::getIconTranslateTransition() const {
+ return impl().paint.template get<IconTranslate>().options;
}
PropertyValue<TranslateAnchorType> SymbolLayer::getDefaultIconTranslateAnchor() {
return { TranslateAnchorType::Map };
}
-PropertyValue<TranslateAnchorType> SymbolLayer::getIconTranslateAnchor(const optional<std::string>& klass) const {
- return impl().paint.template get<IconTranslateAnchor>().get(klass);
+PropertyValue<TranslateAnchorType> SymbolLayer::getIconTranslateAnchor() const {
+ return impl().paint.template get<IconTranslateAnchor>().value;
}
-void SymbolLayer::setIconTranslateAnchor(PropertyValue<TranslateAnchorType> value, const optional<std::string>& klass) {
- if (value == getIconTranslateAnchor(klass))
+void SymbolLayer::setIconTranslateAnchor(PropertyValue<TranslateAnchorType> value) {
+ if (value == getIconTranslateAnchor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<IconTranslateAnchor>().set(value, klass);
+ impl_->paint.template get<IconTranslateAnchor>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void SymbolLayer::setIconTranslateAnchorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void SymbolLayer::setIconTranslateAnchorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<IconTranslateAnchor>().setTransition(value, klass);
+ impl_->paint.template get<IconTranslateAnchor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions SymbolLayer::getIconTranslateAnchorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<IconTranslateAnchor>().getTransition(klass);
+TransitionOptions SymbolLayer::getIconTranslateAnchorTransition() const {
+ return impl().paint.template get<IconTranslateAnchor>().options;
}
DataDrivenPropertyValue<float> SymbolLayer::getDefaultTextOpacity() {
return { 1 };
}
-DataDrivenPropertyValue<float> SymbolLayer::getTextOpacity(const optional<std::string>& klass) const {
- return impl().paint.template get<TextOpacity>().get(klass);
+DataDrivenPropertyValue<float> SymbolLayer::getTextOpacity() const {
+ return impl().paint.template get<TextOpacity>().value;
}
-void SymbolLayer::setTextOpacity(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getTextOpacity(klass))
+void SymbolLayer::setTextOpacity(DataDrivenPropertyValue<float> value) {
+ if (value == getTextOpacity())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<TextOpacity>().set(value, klass);
+ impl_->paint.template get<TextOpacity>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -869,29 +869,29 @@ void SymbolLayer::setTextOpacity(DataDrivenPropertyValue<float> value, const opt
}
}
-void SymbolLayer::setTextOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void SymbolLayer::setTextOpacityTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<TextOpacity>().setTransition(value, klass);
+ impl_->paint.template get<TextOpacity>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions SymbolLayer::getTextOpacityTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<TextOpacity>().getTransition(klass);
+TransitionOptions SymbolLayer::getTextOpacityTransition() const {
+ return impl().paint.template get<TextOpacity>().options;
}
DataDrivenPropertyValue<Color> SymbolLayer::getDefaultTextColor() {
return { Color::black() };
}
-DataDrivenPropertyValue<Color> SymbolLayer::getTextColor(const optional<std::string>& klass) const {
- return impl().paint.template get<TextColor>().get(klass);
+DataDrivenPropertyValue<Color> SymbolLayer::getTextColor() const {
+ return impl().paint.template get<TextColor>().value;
}
-void SymbolLayer::setTextColor(DataDrivenPropertyValue<Color> value, const optional<std::string>& klass) {
- if (value == getTextColor(klass))
+void SymbolLayer::setTextColor(DataDrivenPropertyValue<Color> value) {
+ if (value == getTextColor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<TextColor>().set(value, klass);
+ impl_->paint.template get<TextColor>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -900,29 +900,29 @@ void SymbolLayer::setTextColor(DataDrivenPropertyValue<Color> value, const optio
}
}
-void SymbolLayer::setTextColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void SymbolLayer::setTextColorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<TextColor>().setTransition(value, klass);
+ impl_->paint.template get<TextColor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions SymbolLayer::getTextColorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<TextColor>().getTransition(klass);
+TransitionOptions SymbolLayer::getTextColorTransition() const {
+ return impl().paint.template get<TextColor>().options;
}
DataDrivenPropertyValue<Color> SymbolLayer::getDefaultTextHaloColor() {
return { {} };
}
-DataDrivenPropertyValue<Color> SymbolLayer::getTextHaloColor(const optional<std::string>& klass) const {
- return impl().paint.template get<TextHaloColor>().get(klass);
+DataDrivenPropertyValue<Color> SymbolLayer::getTextHaloColor() const {
+ return impl().paint.template get<TextHaloColor>().value;
}
-void SymbolLayer::setTextHaloColor(DataDrivenPropertyValue<Color> value, const optional<std::string>& klass) {
- if (value == getTextHaloColor(klass))
+void SymbolLayer::setTextHaloColor(DataDrivenPropertyValue<Color> value) {
+ if (value == getTextHaloColor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<TextHaloColor>().set(value, klass);
+ impl_->paint.template get<TextHaloColor>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -931,29 +931,29 @@ void SymbolLayer::setTextHaloColor(DataDrivenPropertyValue<Color> value, const o
}
}
-void SymbolLayer::setTextHaloColorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void SymbolLayer::setTextHaloColorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<TextHaloColor>().setTransition(value, klass);
+ impl_->paint.template get<TextHaloColor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions SymbolLayer::getTextHaloColorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<TextHaloColor>().getTransition(klass);
+TransitionOptions SymbolLayer::getTextHaloColorTransition() const {
+ return impl().paint.template get<TextHaloColor>().options;
}
DataDrivenPropertyValue<float> SymbolLayer::getDefaultTextHaloWidth() {
return { 0 };
}
-DataDrivenPropertyValue<float> SymbolLayer::getTextHaloWidth(const optional<std::string>& klass) const {
- return impl().paint.template get<TextHaloWidth>().get(klass);
+DataDrivenPropertyValue<float> SymbolLayer::getTextHaloWidth() const {
+ return impl().paint.template get<TextHaloWidth>().value;
}
-void SymbolLayer::setTextHaloWidth(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getTextHaloWidth(klass))
+void SymbolLayer::setTextHaloWidth(DataDrivenPropertyValue<float> value) {
+ if (value == getTextHaloWidth())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<TextHaloWidth>().set(value, klass);
+ impl_->paint.template get<TextHaloWidth>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -962,29 +962,29 @@ void SymbolLayer::setTextHaloWidth(DataDrivenPropertyValue<float> value, const o
}
}
-void SymbolLayer::setTextHaloWidthTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void SymbolLayer::setTextHaloWidthTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<TextHaloWidth>().setTransition(value, klass);
+ impl_->paint.template get<TextHaloWidth>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions SymbolLayer::getTextHaloWidthTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<TextHaloWidth>().getTransition(klass);
+TransitionOptions SymbolLayer::getTextHaloWidthTransition() const {
+ return impl().paint.template get<TextHaloWidth>().options;
}
DataDrivenPropertyValue<float> SymbolLayer::getDefaultTextHaloBlur() {
return { 0 };
}
-DataDrivenPropertyValue<float> SymbolLayer::getTextHaloBlur(const optional<std::string>& klass) const {
- return impl().paint.template get<TextHaloBlur>().get(klass);
+DataDrivenPropertyValue<float> SymbolLayer::getTextHaloBlur() const {
+ return impl().paint.template get<TextHaloBlur>().value;
}
-void SymbolLayer::setTextHaloBlur(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) {
- if (value == getTextHaloBlur(klass))
+void SymbolLayer::setTextHaloBlur(DataDrivenPropertyValue<float> value) {
+ if (value == getTextHaloBlur())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<TextHaloBlur>().set(value, klass);
+ impl_->paint.template get<TextHaloBlur>().value = value;
baseImpl = std::move(impl_);
if (value.isDataDriven()) {
observer->onLayerDataDrivenPaintPropertyChanged(*this);
@@ -993,68 +993,68 @@ void SymbolLayer::setTextHaloBlur(DataDrivenPropertyValue<float> value, const op
}
}
-void SymbolLayer::setTextHaloBlurTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void SymbolLayer::setTextHaloBlurTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<TextHaloBlur>().setTransition(value, klass);
+ impl_->paint.template get<TextHaloBlur>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions SymbolLayer::getTextHaloBlurTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<TextHaloBlur>().getTransition(klass);
+TransitionOptions SymbolLayer::getTextHaloBlurTransition() const {
+ return impl().paint.template get<TextHaloBlur>().options;
}
PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultTextTranslate() {
return { {{ 0, 0 }} };
}
-PropertyValue<std::array<float, 2>> SymbolLayer::getTextTranslate(const optional<std::string>& klass) const {
- return impl().paint.template get<TextTranslate>().get(klass);
+PropertyValue<std::array<float, 2>> SymbolLayer::getTextTranslate() const {
+ return impl().paint.template get<TextTranslate>().value;
}
-void SymbolLayer::setTextTranslate(PropertyValue<std::array<float, 2>> value, const optional<std::string>& klass) {
- if (value == getTextTranslate(klass))
+void SymbolLayer::setTextTranslate(PropertyValue<std::array<float, 2>> value) {
+ if (value == getTextTranslate())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<TextTranslate>().set(value, klass);
+ impl_->paint.template get<TextTranslate>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void SymbolLayer::setTextTranslateTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void SymbolLayer::setTextTranslateTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<TextTranslate>().setTransition(value, klass);
+ impl_->paint.template get<TextTranslate>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions SymbolLayer::getTextTranslateTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<TextTranslate>().getTransition(klass);
+TransitionOptions SymbolLayer::getTextTranslateTransition() const {
+ return impl().paint.template get<TextTranslate>().options;
}
PropertyValue<TranslateAnchorType> SymbolLayer::getDefaultTextTranslateAnchor() {
return { TranslateAnchorType::Map };
}
-PropertyValue<TranslateAnchorType> SymbolLayer::getTextTranslateAnchor(const optional<std::string>& klass) const {
- return impl().paint.template get<TextTranslateAnchor>().get(klass);
+PropertyValue<TranslateAnchorType> SymbolLayer::getTextTranslateAnchor() const {
+ return impl().paint.template get<TextTranslateAnchor>().value;
}
-void SymbolLayer::setTextTranslateAnchor(PropertyValue<TranslateAnchorType> value, const optional<std::string>& klass) {
- if (value == getTextTranslateAnchor(klass))
+void SymbolLayer::setTextTranslateAnchor(PropertyValue<TranslateAnchorType> value) {
+ if (value == getTextTranslateAnchor())
return;
auto impl_ = mutableImpl();
- impl_->paint.template get<TextTranslateAnchor>().set(value, klass);
+ impl_->paint.template get<TextTranslateAnchor>().value = value;
baseImpl = std::move(impl_);
observer->onLayerPaintPropertyChanged(*this);
}
-void SymbolLayer::setTextTranslateAnchorTransition(const TransitionOptions& value, const optional<std::string>& klass) {
+void SymbolLayer::setTextTranslateAnchorTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
- impl_->paint.template get<TextTranslateAnchor>().setTransition(value, klass);
+ impl_->paint.template get<TextTranslateAnchor>().options = options;
baseImpl = std::move(impl_);
}
-TransitionOptions SymbolLayer::getTextTranslateAnchorTransition(const optional<std::string>& klass) const {
- return impl().paint.template get<TextTranslateAnchor>().getTransition(klass);
+TransitionOptions SymbolLayer::getTextTranslateAnchorTransition() const {
+ return impl().paint.template get<TextTranslateAnchor>().options;
}
} // namespace style
diff --git a/src/mbgl/style/paint_property.hpp b/src/mbgl/style/paint_property.hpp
index 80d54abceb..cb86fd1a30 100644
--- a/src/mbgl/style/paint_property.hpp
+++ b/src/mbgl/style/paint_property.hpp
@@ -15,7 +15,7 @@ namespace style {
template <class T>
class PaintProperty {
public:
- using TransitionableType = Cascading<PropertyValue<T>>;
+ using TransitionableType = Transitionable<PropertyValue<T>>;
using UnevaluatedType = Transitioning<PropertyValue<T>>;
using EvaluatorType = PropertyEvaluator<T>;
using PossiblyEvaluatedType = T;
@@ -26,7 +26,7 @@ public:
template <class T, class A>
class DataDrivenPaintProperty {
public:
- using TransitionableType = Cascading<DataDrivenPropertyValue<T>>;
+ using TransitionableType = Transitionable<DataDrivenPropertyValue<T>>;
using UnevaluatedType = Transitioning<DataDrivenPropertyValue<T>>;
using EvaluatorType = DataDrivenPropertyEvaluator<T>;
using PossiblyEvaluatedType = PossiblyEvaluatedPropertyValue<T>;
@@ -39,7 +39,7 @@ public:
template <class T>
class CrossFadedPaintProperty {
public:
- using TransitionableType = Cascading<PropertyValue<T>>;
+ using TransitionableType = Transitionable<PropertyValue<T>>;
using UnevaluatedType = Transitioning<PropertyValue<T>>;
using EvaluatorType = CrossFadedPropertyEvaluator<T>;
using PossiblyEvaluatedType = Faded<T>;
diff --git a/src/mbgl/style/properties.hpp b/src/mbgl/style/properties.hpp
index cd69ffb9be..678d38563a 100644
--- a/src/mbgl/style/properties.hpp
+++ b/src/mbgl/style/properties.hpp
@@ -92,63 +92,6 @@ public:
}
};
-template <class Value>
-class Cascading {
-public:
- bool isUndefined() const {
- return values.find(ClassID::Default) == values.end();
- }
-
- const Value& get(const optional<std::string>& klass) const {
- static const Value staticValue{};
- const auto it = values.find(klass ? ClassDictionary::Get().lookup(*klass) : ClassID::Default);
- return it == values.end() ? staticValue : it->second;
- }
-
- void set(const Value& value_, const optional<std::string>& klass) {
- 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;
- }
-
- Transitioning<Value> transition(const TransitionParameters& params, Transitioning<Value> prior) const {
- TransitionOptions transition;
- Value value;
-
- for (const auto classID : params.classes) {
- if (values.find(classID) != values.end()) {
- value = values.at(classID);
- break;
- }
- }
-
- for (const auto classID : params.classes) {
- if (transitions.find(classID) != transitions.end()) {
- transition = transitions.at(classID).reverseMerge(transition);
- break;
- }
- }
-
- return Transitioning<Value>(std::move(value),
- std::move(prior),
- transition.reverseMerge(params.transition),
- params.now);
- }
-
-private:
- std::map<ClassID, Value> values;
- std::map<ClassID, TransitionOptions> transitions;
-};
-
-
template <class P>
struct IsDataDriven : std::integral_constant<bool, P::IsDataDriven> {};
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp
index 962ba0f39b..f601c4126c 100644
--- a/src/mbgl/style/style.cpp
+++ b/src/mbgl/style/style.cpp
@@ -15,7 +15,6 @@
#include <mbgl/style/layer_impl.hpp>
#include <mbgl/style/parser.hpp>
#include <mbgl/style/transition_options.hpp>
-#include <mbgl/style/class_dictionary.hpp>
#include <mbgl/sprite/sprite_atlas.hpp>
#include <mbgl/sprite/sprite_image_collection.hpp>
#include <mbgl/sprite/sprite_loader.hpp>
@@ -93,33 +92,6 @@ Style::~Style() {
}
}
-bool Style::addClass(const std::string& className) {
- if (hasClass(className)) return false;
- classes.push_back(className);
- return true;
-}
-
-bool Style::hasClass(const std::string& className) const {
- return std::find(classes.begin(), classes.end(), className) != classes.end();
-}
-
-bool Style::removeClass(const std::string& className) {
- const auto it = std::find(classes.begin(), classes.end(), className);
- if (it != classes.end()) {
- classes.erase(it);
- return true;
- }
- return false;
-}
-
-void Style::setClasses(const std::vector<std::string>& classNames) {
- classes = classNames;
-}
-
-std::vector<std::string> Style::getClasses() const {
- return classes;
-}
-
void Style::setTransitionOptions(const TransitionOptions& options) {
transitionOptions = options;
}
@@ -132,7 +104,6 @@ void Style::setJSON(const std::string& json) {
sources.clear();
renderSources.clear();
layers.clear();
- classes.clear();
transitionOptions = {};
updateBatch = {};
@@ -333,16 +304,8 @@ double Style::getDefaultPitch() const {
void Style::update(const UpdateParameters& parameters) {
const bool zoomChanged = zoomHistory.update(parameters.transformState.getZoom(), parameters.timePoint);
- const bool classesChanged = parameters.updateFlags & Update::Classes;
-
- std::vector<ClassID> classIDs;
- for (const auto& className : classes) {
- classIDs.push_back(ClassDictionary::Get().lookup(className));
- }
- classIDs.push_back(ClassID::Default);
const TransitionParameters transitionParameters {
- classIDs,
parameters.timePoint,
parameters.mode == MapMode::Continuous ? transitionOptions : TransitionOptions()
};
@@ -432,11 +395,11 @@ void Style::update(const UpdateParameters& parameters) {
const bool layerAdded = layerDiff.added.count(entry.first);
const bool layerChanged = layerDiff.changed.count(entry.first);
- if (classesChanged || layerAdded || layerChanged) {
+ if (layerAdded || layerChanged) {
layer.transition(transitionParameters);
}
- if (classesChanged || layerAdded || layerChanged || zoomChanged || layer.hasTransition()) {
+ if (layerAdded || layerChanged || zoomChanged || layer.hasTransition()) {
layer.evaluate(evaluationParameters);
}
}
diff --git a/src/mbgl/style/style.hpp b/src/mbgl/style/style.hpp
index fb724e2b46..b4ff4f9ac4 100644
--- a/src/mbgl/style/style.hpp
+++ b/src/mbgl/style/style.hpp
@@ -93,16 +93,9 @@ public:
double getDefaultBearing() const;
double getDefaultPitch() const;
- bool addClass(const std::string&);
- bool removeClass(const std::string&);
- void setClasses(const std::vector<std::string>&);
-
TransitionOptions getTransitionOptions() const;
void setTransitionOptions(const TransitionOptions&);
- bool hasClass(const std::string&) const;
- std::vector<std::string> getClasses() const;
-
void setLight(std::unique_ptr<Light>);
Light* getLight() const;
const RenderLight& getRenderLight() const;
@@ -134,7 +127,6 @@ public:
private:
std::vector<std::unique_ptr<Source>> sources;
std::vector<std::unique_ptr<Layer>> layers;
- std::vector<std::string> classes;
TransitionOptions transitionOptions;
std::unique_ptr<Light> light;
diff --git a/src/mbgl/tile/geometry_tile_worker.cpp b/src/mbgl/tile/geometry_tile_worker.cpp
index 1dfc739adf..1d683b3a11 100644
--- a/src/mbgl/tile/geometry_tile_worker.cpp
+++ b/src/mbgl/tile/geometry_tile_worker.cpp
@@ -249,7 +249,6 @@ static std::vector<std::unique_ptr<RenderLayer>> toRenderLayers(const std::vecto
renderLayers.push_back(RenderLayer::create(layer));
renderLayers.back()->transition(TransitionParameters {
- { ClassID::Default },
Clock::time_point::max(),
TransitionOptions()
});
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp
index 6809fefb65..2b7c3c2e3d 100644
--- a/test/map/map.test.cpp
+++ b/test/map/map.test.cpp
@@ -439,40 +439,6 @@ TEST(Map, DisabledSources) {
test::checkImage("test/fixtures/map/disabled_layers/second", test::render(map, test.view));
}
-TEST(Map, Classes) {
- MapTest test;
-
- Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still);
- map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
-
- EXPECT_FALSE(map.getTransitionOptions().duration);
-
- auto duration = mbgl::Duration(mbgl::Milliseconds(300));
- map.setTransitionOptions({ duration });
- EXPECT_EQ(map.getTransitionOptions().duration, duration);
-
- map.addClass("test");
- EXPECT_TRUE(map.hasClass("test"));
-
- map.removeClass("test");
- EXPECT_TRUE(map.getClasses().empty());
-
- std::vector<std::string> classes = { "foo", "bar" };
- map.setClasses(classes);
- EXPECT_FALSE(map.hasClass("test"));
- EXPECT_TRUE(map.hasClass("foo"));
- EXPECT_TRUE(map.hasClass("bar"));
-
- // Does nothing - same style JSON.
- map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
- EXPECT_TRUE(map.hasClass("foo"));
- EXPECT_EQ(map.getTransitionOptions().duration, duration);
-
- map.setStyleJSON(util::read_file("test/fixtures/api/water.json"));
- EXPECT_TRUE(map.getClasses().empty());
- EXPECT_FALSE(map.getTransitionOptions().duration);
-}
-
TEST(Map, AddImage) {
MapTest test;
diff --git a/test/style/conversion/layer.test.cpp b/test/style/conversion/layer.test.cpp
index 22be61e809..d51d7d33e2 100644
--- a/test/style/conversion/layer.test.cpp
+++ b/test/style/conversion/layer.test.cpp
@@ -27,21 +27,11 @@ TEST(StyleConversion, LayerTransition) {
"duration": 400,
"delay": 500
}
- },
- "paint.class": {
- "background-color-transition": {
- "duration": 100
- }
}
})JSON");
ASSERT_EQ(400ms, *layer->as<BackgroundLayer>()->impl().paint
- .get<BackgroundColor>().getTransition({}).duration);
+ .get<BackgroundColor>().options.duration);
ASSERT_EQ(500ms, *layer->as<BackgroundLayer>()->impl().paint
- .get<BackgroundColor>().getTransition({}).delay);
-
- ASSERT_EQ(100ms, *layer->as<BackgroundLayer>()->impl().paint
- .get<BackgroundColor>().getTransition({"class"}).duration);
- ASSERT_FALSE(bool(layer->as<BackgroundLayer>()->impl().paint
- .get<BackgroundColor>().getTransition({"class"}).delay));
+ .get<BackgroundColor>().options.delay);
}