-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to control the order in which grouped layers appear in the control #54
Comments
The fix for this is awkward. In order to not mess up the order in which the layer groups draw in the picker, we have to ensure that we add the "None" layer immediately before the remaining destinations layers. The group layer control doesn't give us a way to specify a particular order. If we only add based on whether the ctl.destinationsNoneLayer exists or not, we create it too early during the first scope resolution, and the Destinations draw before the Overlays. If we just create based on whether layers are present in the $q.all callback, we may double create the none layer. Opened: ismyrnow/leaflet-groupedlayercontrol#54
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). |
Would the PR #43 fix this issue for you? |
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. ' |
This is great, thanks! |
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.
The text was updated successfully, but these errors were encountered: