leaflet-groupedlayercontrol icon indicating copy to clipboard operation
leaflet-groupedlayercontrol copied to clipboard

Unable to control the order in which grouped layers appear in the control

Open CloudNiner opened this issue 7 years ago • 5 comments

It appears that the layer groups draw in the order in which they are added to the control. There are some situations where this may or may not be feasible, and you may want to manually specify the ordering of the layer groups when the control is initialized.

CloudNiner avatar Aug 02 '17 18:08 CloudNiner

Do you know how the standard leaflet layer control works in this regard? Most of the code for this control comes from that implementation, and we only add the extra group stuff. If the leaflet control works differently, then perhaps our implementation needs to be updated (recopied, basically).

ismyrnow avatar Oct 05 '17 13:10 ismyrnow

Would the PR #43 fix this issue for you?

ismyrnow avatar Oct 05 '17 13:10 ismyrnow

The default sort in my PR is to sort alphabetically. A lazy hack to get some layers to show up at the top is to prefix the name with an html comment, e.g. '<!--sort:4-->'

grischard avatar Nov 28 '17 18:11 grischard

@ismyrnow sorry to bother you, do you think it would be possible to merge my #43 please?

grischard avatar Jan 16 '18 23:01 grischard

This is great, thanks!

SchroeC avatar Jan 25 '19 22:01 SchroeC