Add a vector tile source
Replicates the MapLibre example Add a vector tile source: country outlines drawn from a vector tileset on top of the basemap.
The complete document
Section titled “The complete document”# yaml-language-server: $schema=https://docs.maplibre-yaml.org/schema/latest/map.schema.json# Gallery twin of https://maplibre.org/maplibre-gl-js/docs/examples/add-a-vector-tile-source/# A TileJSON url + source-layer, drawn over the same basemap's raster-free style.type: mapid: add-a-vector-tile-sourceconfig: center: [0, 20] zoom: 1 mapStyle: "https://demotiles.maplibre.org/style.json"layers: - id: country-outlines type: line source: type: vector url: "https://demotiles.maplibre.org/tiles/tiles.json" source-layer: countries paint: line-color: "#ff69b4" line-width: 1What to notice
Section titled “What to notice”- Vector sources take a TileJSON
url:(or atiles:template list); the layer picks its layer inside the tileset withsource-layer:. minzoom/maxzoom,scheme, andpromoteIdare all available on the source when you need them.