Skip to content

vector_tile_source

Stable

Adds vector tiles, from a TileJSON URL or a tile template, for layers to draw.

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 source
map_id required string — ID of the map to attach to
url string nil TileJSON URL, or a pmtiles:// URL (see "PMTiles" in the module documentation) (either url or tiles must be provided)
tiles list nil List of tile URL templates (e.g., ["https://a.tile.com/{z}/{x}/{y}.pbf"])
min_zoom integer nil Minimum zoom level (default: 0)
max_zoom integer nil Maximum zoom level (default: 22)
attribution string nil Attribution text
bounds list nil Geographic bounds [west, south, east, north]
scheme string nil Tile scheme: "xyz" (default) or "tms"
promote_id any nil a property name, or a map of source layer => property
volatile boolean false Whether data should be cached (default: false)
events any [] a list of event names, or :all