diff --git a/include/mbgl/style/layer.hpp b/include/mbgl/style/layer.hpp index f368e2110d4..219d3b150e0 100644 --- a/include/mbgl/style/layer.hpp +++ b/include/mbgl/style/layer.hpp @@ -148,6 +148,8 @@ class Layer { private: optional setVisibility(const conversion::Convertible& value); + optional setMinZoom(const conversion::Convertible& value); + optional setMaxZoom(const conversion::Convertible& value); }; } // namespace style diff --git a/src/mbgl/style/layer.cpp b/src/mbgl/style/layer.cpp index efbc91434f0..bc1d188f3cc 100644 --- a/src/mbgl/style/layer.cpp +++ b/src/mbgl/style/layer.cpp @@ -144,9 +144,17 @@ void Layer::setObserver(LayerObserver* observer_) { } optional Layer::setProperty(const std::string& name, const conversion::Convertible& value) { - optional error = setPropertyInternal(name, value); + using namespace conversion; + optional error = setPropertyInternal(name, value); if (!error) return error; // Successfully set by the derived class implementation. if (name == "visibility") return setVisibility(value); + if (name == "min-zoom") { + if (auto zoom = convert(value, *error)) setMinZoom(*zoom); + } else if (name == "max-zoom") { + if (auto zoom = convert(value, *error)) setMaxZoom(*zoom); + } else if (name == "filter") { + if (auto filter = convert(value, *error)) setFilter(*filter); + } return error; // Must be Error{"layer doesn't support this property"}. }