Adjust a layer's opacity
✓ Published0🌍 Public
Aandyrutkowski
Last edited Mar 8, 2018
Created on Mar 8, 2018
This example uses Mapbox GL JS to display a historical map layer and lets the user adjust its opacity with a range slider. A raster layer sourced from Mapbox tiles is overlaid on a custom style, and moving the slider calls `map.setPaintProperty` with a `raster-opacity` value. A second map instance shows a clickable polygon layer that opens a popup with property details. The code includes two map setups, one centered on Chicago and another on Los Angeles, both using Mapbox styles and tile sources.
AI-generated descriptionBuilt with blockbuilder.org
mit Licensed