Mapbox-gl-native: MGLFillStyleLayer are drawn at wrong map-layer

Created on 28 May 2019  路  6Comments  路  Source: mapbox/mapbox-gl-native

Hey i discovered an issue in version 5.0.0 in the mapbox gl native SDK for iOS.

iOS: 12.2
iPhone XR
Xcode: 10.2

In our app we draw several polygons with the following code:

       `let url = URL(string: overlay.geojson_url)

        // Create source and add it to the map style.
        let source = MGLShapeSource(identifier: "\(overlay.id)", url: url!, options: nil)

        let layer = MGLFillStyleLayer(identifier: "\(overlay.id)", source: source)

        layer.fillColor = NSExpression(forConstantValue: UIColor(rgba: overlay.fill_color))
        layer.fillOpacity = NSExpression(forConstantValue: overlay.fill_opacity as NSNumber)

        let sourceAvailable = sources.filter({$0.identifier == overlay.id})

        if sourceAvailable.count == 0 {

            mapView.style!.addSource(source)

        }

        let annotationLayer = mapView.style?.layers.filter({$0.identifier == "com.mapbox.annotations.points"}).first

        mapView.style!.insertLayer(layer, below: annotationLayer!)`

We expected to see the following behaviour like in version 4.6.0:

2019-05-28_09-26-11

Instead the following happened in version 5.0.0:

2019-05-28_09-25-43

The same happens in the Android SDK Version 8.0.0. In addition we discovered that the position indicator in the Android SDK (v.8.0.0) is drawn below buildings in the map.

mapbox location dot

Core bug rendering

Most helpful comment

It looks like fill extrusion layers are being rendered above fill layers. This can be repro'd in iosapp by selecting Add Building Extrusions, then Dynamically Style Polygon.

cc @kkaefer

All 6 comments

It looks like fill extrusion layers are being rendered above fill layers. This can be repro'd in iosapp by selecting Add Building Extrusions, then Dynamically Style Polygon.

cc @kkaefer

Hi @jmkiley @kkaefer The same happens to me in the Android SDK Version 8.0.0. Is there any update on this issue?

Thank you very much in advance!

Yeah, I encountered this as well in the move to 8.0.0. Is this going to be remedied in 8.2.0?

cc @tmpsantos

Wondering if this is somehow related to https://github.com/mapbox/mapbox-gl-native/issues/14844

Fixed in #15065.

Was this page helpful?
0 / 5 - 0 ratings