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

Some form of control over z-order of a layer when adding it #167

Closed
JasonSanford opened this issue Jul 3, 2011 · 8 comments
Closed

Some form of control over z-order of a layer when adding it #167

JasonSanford opened this issue Jul 3, 2011 · 8 comments
Assignees
Labels
Milestone

Comments

@JasonSanford
Copy link
Member

Perhaps this is related to issue 73, but I think it would be helpful to have two different types of tiled maps.

I'm using standard base maps from CloudMade, MapQuest, etc and I'm overlaying a custom tiled map of bike trails on top. Switching "base maps" puts my custom overlay map on the bottom and the base map on top, which is far from ideal.

@JasonSanford
Copy link
Member Author

I guess being able to control the z-index of the tiles container would work too.

@mourner
Copy link
Member

mourner commented Jul 3, 2011

How about map.replaceLayer(oldLayer, newLayer) method that removes the old layer and puts a new one on the same level?

@ghost ghost assigned mourner Jul 3, 2011
@JasonSanford
Copy link
Member Author

I think that would be great. This would make it really easy for someone to create their own layer switcher.

@mourner
Copy link
Member

mourner commented Jul 3, 2011

Thanks for the suggestion - that feature is really needed, forgot about it completely!

@mourner
Copy link
Member

mourner commented Jul 20, 2011

Added ability to insert a tile layer at the bottom with addLayer(layer, true). Also implemented Layer Switcher control, take a look. :)

@mourner mourner closed this as completed Jul 20, 2011
@JasonSanford
Copy link
Member Author

Hmmm, I guess this should work with tile layers? I'm having a few issues although I'm not using the new Layer Switcher control. Maybe I'll try that and let you know.

@cdunlap
Copy link

cdunlap commented Nov 26, 2014

There is no longer a second parameter to L.Map.addLayer which inserts a layer the bottom. Perhaps there is some other method to doing so now?

@mourner
Copy link
Member

mourner commented Nov 26, 2014

@cdunlap you can now just pass a zIndex option to TileLayer.

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

No branches or pull requests

3 participants