diff options
Diffstat (limited to 'src/mbgl/annotation/style_sourced_annotation_impl.cpp')
-rw-r--r-- | src/mbgl/annotation/style_sourced_annotation_impl.cpp | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/mbgl/annotation/style_sourced_annotation_impl.cpp b/src/mbgl/annotation/style_sourced_annotation_impl.cpp deleted file mode 100644 index cb664cf15d..0000000000 --- a/src/mbgl/annotation/style_sourced_annotation_impl.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include <mbgl/annotation/style_sourced_annotation_impl.hpp> -#include <mbgl/annotation/annotation_manager.hpp> -#include <mbgl/style/style.hpp> -#include <mbgl/style/layer.hpp> -#include <mbgl/style/layer_impl.hpp> -#include <mbgl/style/layers/line_layer.hpp> -#include <mbgl/style/layers/fill_layer.hpp> - -namespace mbgl { - -using namespace style; - -StyleSourcedAnnotationImpl::StyleSourcedAnnotationImpl(AnnotationID id_, StyleSourcedAnnotation annotation_, uint8_t maxZoom_) - : ShapeAnnotationImpl(id_, maxZoom_), - annotation(std::move(annotation_)) { -} - -void StyleSourcedAnnotationImpl::updateStyle(Style& style) const { - if (style.getLayer(layerID)) - return; - - const Layer* sourceLayer = style.getLayer(annotation.layerID); - if (!sourceLayer) - return; - - if (sourceLayer->is<LineLayer>()) { - std::unique_ptr<Layer> layer = sourceLayer->baseImpl->copy(layerID, AnnotationManager::SourceID); - layer->as<LineLayer>()->setSourceLayer(layerID); - layer->as<LineLayer>()->setVisibility(VisibilityType::Visible); - style.addLayer(std::move(layer), sourceLayer->getID()); - } else if (sourceLayer->is<FillLayer>()) { - std::unique_ptr<Layer> layer = sourceLayer->baseImpl->copy(layerID, AnnotationManager::SourceID); - layer->as<FillLayer>()->setSourceLayer(layerID); - layer->as<FillLayer>()->setVisibility(VisibilityType::Visible); - style.addLayer(std::move(layer), sourceLayer->getID()); - } -} - -const ShapeAnnotationGeometry& StyleSourcedAnnotationImpl::geometry() const { - return annotation.geometry; -} - -} // namespace mbgl |