#include #include #include #include namespace mbgl { using namespace style; LineAnnotationImpl::LineAnnotationImpl(AnnotationID id_, LineAnnotation annotation_, uint8_t maxZoom_) : ShapeAnnotationImpl(id_, maxZoom_), annotation({ ShapeAnnotationGeometry::visit(annotation_.geometry, CloseShapeAnnotation{}), annotation_.opacity, annotation_.width, annotation_.color }) { } void LineAnnotationImpl::updateStyle(Style& style) const { if (style.getLayer(layerID)) return; std::unique_ptr layer = std::make_unique(layerID, AnnotationManager::SourceID); layer->setSourceLayer(layerID); layer->setLineJoin(LineJoinType::Round); layer->setLineOpacity(annotation.opacity); layer->setLineWidth(annotation.width); layer->setLineColor(annotation.color); style.addLayer(std::move(layer), AnnotationManager::PointLayerID); } const ShapeAnnotationGeometry& LineAnnotationImpl::geometry() const { return annotation.geometry; } } // namespace mbgl