Closed jamesdoyle21 closed 2 years ago
It might actually be easier to add the editing layer(s) to the sorting config.
@ndellicarpini if I have a bunch of map sources that all start with a certain string, can we configure them to always be on top?
The drawing plugin adds like 30 sources to the map, one for each type of geometry it needs x2 for blue and orange
This is actually happening to me after layers are loaded in now. But I'm not positive what the steps are to reproduce
I don't think we can use the layer sorting for the active editing layer because they aren't added to the map like our other layers, they are kind of sneakily added to the map layers. I think you're going to have to move the layers yourself, ignoring any layer sorting.
When the layers get added, find all of those layers with that string and use this: https://docs.mapbox.com/mapbox-gl-js/api/map/#map#movelayer
The easiest way to solve this is probably to only allow the user to start drawing after all layers have loaded in.