Skip to main content
100%

Adjust a layer's opacity

✓ Published0🌍 Public
Aandyrutkowski
Last edited Oct 11, 2018
Created on Oct 11, 2018

This example demonstrates how to interactively adjust the opacity of a raster layer on a Mapbox GL map. It displays a historical map layer (HOLC1939) over a modern base style, with a slider control in a top-left overlay panel. Dragging the slider updates the layer’s transparency in real time using `map.setPaintProperty` with the `raster-opacity` property. The code uses the Mapbox GL JS API (v0.49.0) and loads its tile data from a Mapbox-hosted raster source.

AI-generated description

Built with blockbuilder.org

mit Licensed

Similar vizzes