Show and hide layers
✓ Published0🌍 Public
Aandyrutkowski
Last edited Sep 1, 2018
Created on Aug 31, 2018
This example uses Mapbox GL JS to display a map of Los Angeles with two overlay layers: a Watts curfew map and a 1939 HOLC redlining map. A menu in the top-right corner contains toggle links for each layer. Clicking a link toggles the layer’s visibility via `map.getLayoutProperty` and `map.setLayoutProperty`, updating the active class on the link. Both layers are raster sources loaded from Mapbox tiles, rendered on top of a custom map style.
AI-generated descriptionBuilt with blockbuilder.org
mit Licensed