Skip to content

fill_layer

Stable

Fills polygons from a source.

Generated from the component's definition in the library, so it always matches the version this demo runs.

Attribute Type Default Description
id required string — Unique identifier for the layer
map_id required string — ID of the map to attach to
source_id required string — ID of the data source
source_layer string nil Layer name in the source (for vector tiles)
paint map %{} Paint properties (fill-color, fill-opacity, fill-outline-color, fill-pattern, etc.)
layout map %{} Layout properties (visibility, etc.)
filter any nil Filter expression to show subset of features
min_zoom integer nil Minimum zoom level for layer visibility
max_zoom integer nil Maximum zoom level for layer visibility
before_id string nil ID of layer to insert this layer before
events any [] a list of event names, or :all
cursor string nil a CSS cursor to show over the features, such as "pointer"
hit_width any nil a number of pixels: the layer answers the pointer within that many pixels of what it draws
hover boolean false whether the feature under the pointer has the feature state hover, set in the browser
feature_state map nil a map of feature id => map of state, which paint properties read with feature-state