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

Create a global zindex object for layer management #30

Open
rguico opened this issue Mar 22, 2015 · 1 comment
Open

Create a global zindex object for layer management #30

rguico opened this issue Mar 22, 2015 · 1 comment

Comments

@rguico
Copy link
Contributor

rguico commented Mar 22, 2015

We need to manage which layers are on top of other ones better, instead of defaulting to "whichever one we checked last".

The best way to do this is probably a global variable, something like the following...

var ZINDEX = Object.freeze({
    'densityBase': 1,
    'densityHighlighted': 2,
    'bikeLanes': 3
});

// set the layer zIndex
layer.setZIndex(ZINDEX.densityBase);
@stevevance
Copy link
Collaborator

There's a Leaflet method to do this, I think. autoZIndex

I believe that when it's set to true, which is the default, then the layers maintain their zIndex.

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

No branches or pull requests

2 participants