summaryrefslogtreecommitdiff
path: root/src/mbgl/annotation/line_annotation_impl.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-04-25 13:15:44 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-02 14:51:39 -0700
commita43940afb2208c61b487bfd8729bbde1bd674794 (patch)
tree53d192ea899be1d88f99aeef3d1b3255f9cb5104 /src/mbgl/annotation/line_annotation_impl.cpp
parent27baa34d44f0006c05ba7c417bf11e184b0bd22b (diff)
downloadqtlocation-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.cpp16
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);
}