We're migrating our webmap from 3.x to 4.x.
On the current webmap, there are several layers which need to be thematically ordered in the legend/layerlist. (We don't need to order sublayers nor features.) Furthermore, there are some layers with higher importance than others, which need to be placed above (or below) other layers.
However, the drawing order of these layers on the map needs to fit cartographic and other needs. One of the cartographic principles is "polygon under lines under points". Furthermore, there are user-interactions with these layers. Layers which were last active need to be places above other layers (within the same geometry-type, e.g. offer A (a line, clicked on) needs to be above offer B (another line, not clicked on)).
Summarised, we need ot be able to manually and individually control the order of the layers in the map independently from the order of the layers in the legend. The 3.x version used an index - that would be fine by us.
codepen visualising some of the layers without any interaction: https://codepen.io/nwp_nadja_bernhard/pen/OJvOQdp?editors=0011