diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-25 13:15:44 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-02 14:51:39 -0700 |
commit | a43940afb2208c61b487bfd8729bbde1bd674794 (patch) | |
tree | 53d192ea899be1d88f99aeef3d1b3255f9cb5104 /src/mbgl/annotation/line_annotation_impl.cpp | |
parent | 27baa34d44f0006c05ba7c417bf11e184b0bd22b (diff) | |
download | qtlocation-mapboxgl-a43940afb2208c61b487bfd8729bbde1bd674794.tar.gz |
[core] Runtime style layer API
Diffstat (limited to 'src/mbgl/annotation/line_annotation_impl.cpp')
-rw-r--r-- | src/mbgl/annotation/line_annotation_impl.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/mbgl/annotation/line_annotation_impl.cpp b/src/mbgl/annotation/line_annotation_impl.cpp index 5bcc142a5b..11febc7de7 100644 --- a/src/mbgl/annotation/line_annotation_impl.cpp +++ b/src/mbgl/annotation/line_annotation_impl.cpp @@ -16,16 +16,12 @@ void LineAnnotationImpl::updateStyle(Style& style) const { if (style.getLayer(layerID)) return; - std::unique_ptr<LineLayer> layer = std::make_unique<LineLayer>(); - layer->layout.lineJoin = LineJoinType::Round; - - layer->paint.lineOpacity = annotation.opacity; - layer->paint.lineWidth = annotation.width; - layer->paint.lineColor = annotation.color; - - layer->id = layerID; - layer->source = AnnotationManager::SourceID; - layer->sourceLayer = layer->id; + std::unique_ptr<LineLayer> layer = std::make_unique<LineLayer>(layerID); + layer->setSource(AnnotationManager::SourceID, layerID); + layer->setLineJoin(LineJoinType::Round); + layer->setLineOpacity(annotation.opacity); + layer->setLineWidth(annotation.width); + layer->setLineColor(annotation.color); style.addLayer(std::move(layer), AnnotationManager::PointLayerID); } |