diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-23 11:01:56 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-23 13:27:14 -0700 |
commit | 7a03d734fd8a62ebac93c998a6336b619f4cc3e1 (patch) | |
tree | 0be513ad89a4c8bbe2f8e28b034adb08562125e4 /src/mbgl/annotation | |
parent | 930c624364db76e5d5171085da4090092ce81e8e (diff) | |
download | qtlocation-mapboxgl-7a03d734fd8a62ebac93c998a6336b619f4cc3e1.tar.gz |
[core] Respect source layer z-order for style-sourced annotations
Diffstat (limited to 'src/mbgl/annotation')
-rw-r--r-- | src/mbgl/annotation/shape_annotation_impl.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mbgl/annotation/shape_annotation_impl.cpp b/src/mbgl/annotation/shape_annotation_impl.cpp index 4f1863874e..45b25f45e5 100644 --- a/src/mbgl/annotation/shape_annotation_impl.cpp +++ b/src/mbgl/annotation/shape_annotation_impl.cpp @@ -27,6 +27,7 @@ void ShapeAnnotationImpl::updateStyle(Style& style) { return; std::unique_ptr<StyleLayer> layer; + std::string beforeLayerID = AnnotationManager::PointLayerID; if (shape.properties.is<LinePaintProperties>()) { layer = createLineLayer(); @@ -49,7 +50,9 @@ void ShapeAnnotationImpl::updateStyle(Style& style) { layer->styles.emplace(ClassID::Default, std::move(paintProperties)); } else { - const StyleLayer* sourceLayer = style.getLayer(shape.properties.get<std::string>()); + beforeLayerID = shape.properties.get<std::string>(); + + const StyleLayer* sourceLayer = style.getLayer(beforeLayerID); if (!sourceLayer) return; switch (sourceLayer->type) { @@ -73,7 +76,7 @@ void ShapeAnnotationImpl::updateStyle(Style& style) { layer->bucket->source = AnnotationManager::SourceID; layer->bucket->source_layer = layer->id; - style.addLayer(std::move(layer), AnnotationManager::PointLayerID); + style.addLayer(std::move(layer), beforeLayerID); } std::unique_ptr<StyleLayer> ShapeAnnotationImpl::createLineLayer() { |