-
Notifications
You must be signed in to change notification settings - Fork 43
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
Ability to show and hide layers in a map easily #282
Comments
This may be something that would require some re-jiggering of Tangram.js. What do you think @bcamper? |
@nvkelso and @sensescape have been refactoring the house styles so there are easy BTW there is some layer toggling in Tizen, but only for specific things like transit overlay (so some of these changes were made to support that project). You can see that in the Bubble Wrap demo by selecting transit layer "show" in the menu: http://tangrams.github.io/bubble-wrap/#15/37.7928/-122.3937 |
Does that mean that it’s currently possible-though-inconvenient, or would we need to wait for a new revision of the styles to be able to take advantage of this? |
I believe it's only possible in Bubble Wrap right now, because the other house styles still use the older YAML anchor/reference syntax, and those values can't be changed at run-time (they are just strings embedded in the YAML and get interpreted once at parse-time). @nvkelso can provide guidance on when all styles should be switched to the new |
👍 |
Just to be clear, it was not specifically about toggling layers inside of vector tiles / or changing Tangram style. This person was using some raster tiles including satellite image, and (can't remember what it was but one kind of) selecting-layer-plugin was being used to switch I will look into how people are switching tilelayer, and see current structure works with other existing controls. (loosely related issue: https://github.com/mapzen/mapzen.js/issues/284) |
@hanbyul-here - it looks like this works with Leaflet's built-in Layers control. See example: https://bl.ocks.org/rfriberg/169ad43af27511c5bf4ef4f32a77d406 Also, see larger discussion I'm (slowly) pushing in #318 |
@rfriberg oh yeah. I was worried that TangramLayer is trying to draw over 2d or something, but I was wrong! |
During office hours in October, we had a user who was just starting to work with mapzen.js. He has a map that used Stamen raster tiles, along with a series of layers, like a basemap, roads, terrain, special points of interest, and so on. He had already built some JS for his previous web map to turn layers on and off with a checkbox. While we were watching, he switched to mapzen.js and our vector tiles.
Adding this here to make sure our tools can support and we have documented this kind of fundamental "map sandwich" workflow. This is basically like the hamburger menu on GMaps, where you can turn the satellite, traffic, and transit layers on and off with a switcher.
The text was updated successfully, but these errors were encountered: