Closed sakitam-fdd closed 2 months ago
Hello, @sakitam-fdd! Thank you for your feedback!
For v2 of GL JS, you can pass optimizeForTerrain: false
, which could fix the layers ordering issue but at the expense of performance. So, it should be separately tested on your exact scenario.
Regarding 3rd version, it's a known limitation, and you can read about it in Slots and performance-optimized layers reordering section on the migration guide page
Thank you, optimizeForTerrain: false
can work on 2. x. I will look for a solution on renderToTile for 3. x and temporarily close this issue
mapbox-gl-js version: 2.x and 3.x
browser: Chrome 127.0.6533.88
Link to Demonstration
https://codepen.io/sakitam-fdd/pen/NWZjKZa
Expected Behavior
In terrain or globe projection, Custom Layer maintains the same exact hierarchical relationship as Mercator projection.
Actual Behavior
Custom layers override related line layers
Case
The cause of this issue currently is here: https://github.com/mapbox/mapbox-gl-js/blob/main/src/style/style.ts#L3033
For the current implementation, we use proxy tiles for spherical mapping. For performance reasons, we only use one layer and group the layers that need to be rendered to the proxy tiles. Is it possible to use multiple groups when there are related layers interrupted?