Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Symbol layers with viewport alignment render above fill layers regardless of layer order #8699

Closed
jmkiley opened this issue Apr 10, 2017 · 2 comments
Labels
archived Archived because of inactivity bug Core The cross-platform C++ core, aka mbgl

Comments

@jmkiley
Copy link
Contributor

jmkiley commented Apr 10, 2017

Platform: Core (tested with iOS)
Mapbox SDK version: iOS SDK v3.5.2

Steps to trigger behavior

  1. Create a map view.
  2. Add a fill layer above the country-label-lg symbol layer.
MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"states" source:source];
    fillLayer.sourceLayerIdentifier = @"stateData_2-dx853g";
    fillLayer.fillColor = [MGLStyleValue valueWithRawValue:[UIColor redColor]];
    MGLSymbolStyleLayer *symbolLayer2 = [style layerWithIdentifier:@"country-label-lg"];
    fillLayer.fillOpacity = [MGLStyleValue valueWithRawValue:@1];
    [style insertLayer:fillLayer aboveLayer:symbolLayer2];

Expected behavior

The fill layer should be rendered above the symbol layer.

Actual behavior

Fill layer is inserted below the labels.

Current workaround is to set the fillLayer property to 0.99.

@lbud tracked the issue to being due to textPitchAlignment being viewport or auto, because it then does not use depth testing.

Related GL-JS ticket:
mapbox/mapbox-gl-js#2074

@Etienne-io
Copy link

#8824
I am not really sure that the issue is the same that this one but I don't really know how all of this work in Core GL.
So, I prefere summarize to be sure that we are not missing something.

Here we are working with fill layer:

  • With opacity 1, layer is shown on the wrong place (below symbol instead of above symbol)
  • With opacity <1, the behaviour is ok

In #8824 we are working with Polygon Annotation:

  • With opacity 1, polygon is shown below symbol which sounds like the expected behaviour.
  • With opacity <1, the polygon is shown above symbol.

@stale
Copy link

stale bot commented Nov 27, 2018

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Nov 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived because of inactivity bug Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

2 participants