Skip to content
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

Enhanced control over layer order #15

Open
cmndrbensisko opened this issue Feb 3, 2015 · 3 comments
Open

Enhanced control over layer order #15

cmndrbensisko opened this issue Feb 3, 2015 · 3 comments

Comments

@cmndrbensisko
Copy link
Owner

Layer order should follow the order specified in the widget, instead of Feature Layers automatically floating to the top of the layer draw order

@rscheitlin
Copy link
Collaborator

Adam,
I think at you already pointed this out, but AGOL operates in a similar fashion, Featurelayers can not be moved below other layer types. I think this has to do with the fact that in the JS API FeatureLayers are grouped together with GraphicLayers in the map. Quote from API doc "layerIds = Array of IDs corresponding to layers in the map, except for GraphicsLayers and FeatureLayers, which are maintained in map.graphicsLayerIds."

@cmndrbensisko
Copy link
Owner Author

Good find on the API doc, Robert. I mostly put this issue up as a note-to-self so that I investigate the issue in detail later, but if it's not something we can do without severely hacking around the API, I agree that it's probably best left by the wayside for now.

@slead
Copy link

slead commented Feb 12, 2015

It may be possible to override the default layer ordering using map.reorderlayer

You could iterate through the JSON list and ensure that the map's layers matched this order.

Edit: after some testing it appears that even when manually reordering the layers, the Layer List widget isn't updating to show the actual position of the layers in the map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants