#include #include #include #include namespace mbgl { using namespace style; FillAnnotationImpl::FillAnnotationImpl(AnnotationID id_, FillAnnotation annotation_) : ShapeAnnotationImpl(id_), annotation(ShapeAnnotationGeometry::visit(annotation_.geometry, CloseShapeAnnotation{}), annotation_.opacity, annotation_.color, annotation_.outlineColor) { } void FillAnnotationImpl::updateStyle(Style::Impl& style) const { Layer* layer = style.getLayer(layerID); if (!layer) { auto newLayer = std::make_unique(layerID, AnnotationManager::SourceID); newLayer->setSourceLayer(layerID); layer = style.addLayer(std::move(newLayer), AnnotationManager::PointLayerID); } auto* fillLayer = static_cast(layer); fillLayer->setFillOpacity(annotation.opacity); fillLayer->setFillColor(annotation.color); fillLayer->setFillOutlineColor(annotation.outlineColor); } const ShapeAnnotationGeometry& FillAnnotationImpl::geometry() const { return annotation.geometry; } } // namespace mbgl