drawing order of layers in map view needs to be A) independent from order of layers in legend and B) manually controllable

987
4
08-05-2022 08:57 AM
Status: Open
nadja_swiss_parks
Occasional Contributor II

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

4 Comments
JoelBennett

As already pointed out in another thread, the layer order in the Legend is going to match the layer order of the map.  Therefore, if you're going to accomplish what you've described, you're going to have to use more than one Legend control.  In our framework, we create a Legend for each individual layer, and are then free to display those individual Legends in whatever order we see fit.

JoelBennett

My apologies...didn't realize this was in the ideas section.  Hope my reply helps though...

swiss_parks_network_nbernhard

Hi @JoelBennett  

I had hoped that it might be possible now with the layerlist. Unfortunately it is still not possible to order the items in the layerlist independently from the order in the map, which is more than unfortunate for the thematic use of our map. You wrote that for each layer an individual legend could be created and those could be ordered as we please. could you please elaborate on that? I'm not sure if I grasp your idea correctly.

thank you in advance for your reply.

Nicolas_