diff options
Diffstat (limited to 'src/mbgl/style/layers/custom_layer.cpp')
-rw-r--r-- | src/mbgl/style/layers/custom_layer.cpp | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/src/mbgl/style/layers/custom_layer.cpp b/src/mbgl/style/layers/custom_layer.cpp index d1ac1a705c..a31586f708 100644 --- a/src/mbgl/style/layers/custom_layer.cpp +++ b/src/mbgl/style/layers/custom_layer.cpp @@ -25,31 +25,6 @@ std::unique_ptr<Layer> CustomLayer::cloneRef(const std::string&) const { return nullptr; } -// Visibility - -void CustomLayer::setVisibility(VisibilityType value) { - if (value == getVisibility()) - return; - auto impl_ = mutableImpl(); - impl_->visibility = value; - baseImpl = std::move(impl_); - observer->onLayerChanged(*this); -} - -// Zoom range - -void CustomLayer::setMinZoom(float minZoom) { - auto impl_ = mutableImpl(); - impl_->minZoom = minZoom; - baseImpl = std::move(impl_); -} - -void CustomLayer::setMaxZoom(float maxZoom) { - auto impl_ = mutableImpl(); - impl_->maxZoom = maxZoom; - baseImpl = std::move(impl_); -} - using namespace conversion; optional<Error> CustomLayer::setPaintProperty(const std::string&, const Convertible&) { @@ -60,6 +35,10 @@ optional<Error> CustomLayer::setLayoutProperty(const std::string&, const Convert return Error { "layer doesn't support this property" }; } +Mutable<Layer::Impl> CustomLayer::mutableBaseImpl() const { + return staticMutableCast<Layer::Impl>(mutableImpl()); +} + template <> bool Layer::is<CustomLayer>() const { return getType() == LayerType::Custom; |