summaryrefslogtreecommitdiff
path: root/src/mbgl/annotation/shape_annotation_impl.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-10-23 11:01:56 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-10-23 13:27:14 -0700
commit7a03d734fd8a62ebac93c998a6336b619f4cc3e1 (patch)
tree0be513ad89a4c8bbe2f8e28b034adb08562125e4 /src/mbgl/annotation/shape_annotation_impl.cpp
parent930c624364db76e5d5171085da4090092ce81e8e (diff)
downloadqtlocation-mapboxgl-7a03d734fd8a62ebac93c998a6336b619f4cc3e1.tar.gz
[core] Respect source layer z-order for style-sourced annotations
Diffstat (limited to 'src/mbgl/annotation/shape_annotation_impl.cpp')
-rw-r--r--src/mbgl/annotation/shape_annotation_impl.cpp7
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() {