Files
MapLibreParticleLab/src/mbgl/style/layer_impl.cpp
John Firebaugh fe2a26225f [core, ios, android, qt] Observe style layer mutations rather than requiring SDKs to use Map::update
This paves the way for updates to filter and layout properties to trigger a source reload, without each SDK having to participate in the implementation.
2016-09-06 14:29:22 -07:00

37 lines
961 B
C++

#include <mbgl/style/layer_impl.hpp>
namespace mbgl {
namespace style {
std::unique_ptr<Layer> Layer::Impl::copy(const std::string& id_,
const std::string& ref_,
const std::string& source_) const {
std::unique_ptr<Layer> result = clone();
result->baseImpl->id = id_;
result->baseImpl->ref = ref_;
result->baseImpl->source = source_;
return result;
}
const std::string& Layer::Impl::bucketName() const {
return ref.empty() ? id : ref;
}
bool Layer::Impl::hasRenderPass(RenderPass pass) const {
return bool(passes & pass);
}
bool Layer::Impl::needsRendering(float zoom) const {
return passes != RenderPass::None
&& visibility != VisibilityType::None
&& minZoom <= zoom
&& maxZoom >= zoom;
}
void Layer::Impl::setObserver(LayerObserver* observer_) {
observer = observer_;
}
} // namespace style
} // namespace mbgl