Choose your path
maplibre-yaml draws a web map from a YAML file: you describe the map, its data and its styling, and a script on the page does the rest. Pick the row that matches what you want to make. Each one says where to start, what to read next, and where to look things up. New to the library? Read What is maplibre-yaml? first.
Try it in the browser first
Section titled “Try it in the browser first”The fastest way to see what a map document does is the playground: edit a map in the browser and watch it change as you type, with nothing to install or save. Mistakes are explained where you make them. When you like the map, download it as a folder that works, or share it as a link.
A map in an HTML page
Section titled “A map in an HTML page”One HTML file and one YAML file, loaded from a CDN. Nothing to install and no build step; any static host, GitHub Pages included, can publish it.
- Start: Quick start: a map in an HTML page
- Then: Your first map, explained · Loading data · Layers & styling · Popups, hover & controls
- Look up: HTML pages: the
<ml-map>element · YAML reference
An Astro site on GitHub Pages
Section titled “An Astro site on GitHub Pages”An Astro site with a map on any page, published by GitHub Actions on every push.
- Start: Quick start: Astro site on GitHub Pages
- Then: Your first map, explained · Astro · Astro content collections
- Look up: Astro components · YAML reference
A React app
Section titled “A React app”A Vite + React app (or Next.js) that installs the element from npm and
renders <ml-map src="/map.yaml"> in a component.
- Start: React quick start
- Then: Respond to a click · Next.js · Your first map, explained
- Look up:
<ml-map>attributes and events · YAML reference
A site or app with a bundler
Section titled “A site or app with a bundler”A Vite project, or a Vue or Svelte app, that installs packages from npm and builds the page.
- Start: Using a bundler (Vite)
- Then: Vue · Svelte · Your first map, explained
- Look up:
<ml-map>attributes and events · JavaScript API
A story map
Section titled “A story map”A map that moves as the reader scrolls through chapters of text and images (often called scrollytelling).
- Start: Story maps in plain HTML, or Story maps in Astro
- Then: Writing a story file (chapters, camera moves and actions)
- Look up: Story map fields
A thematic map
Section titled “A thematic map”A choropleth, graduated circles or a category map: colour or size each feature by one of its values, with a legend made for you.
- Start: Thematic maps & legends
- Then: Thematic maps example · Accessibility & languages (number formats, map titles and descriptions)
- Look up:
classify:in the layer reference
Large data
Section titled “Large data”A dataset too big for one GeoJSON file, imagery or elevation, or a basemap you host yourself: PMTiles, FlatGeobuf, GeoParquet and Cloud Optimized GeoTIFF files, read in parts straight from a static host.
- Start: Large data: PMTiles, FlatGeobuf, GeoParquet & COG
- Then: Hosting: range requests and CORS · Host your own basemap
- Look up: Sources reference · Cloud-native examples
Already know MapLibre?
Section titled “Already know MapLibre?”A map document’s layers are MapLibre style layers: paint:, layout:,
filter: and expressions follow the
style spec unchanged. What
maplibre-yaml adds is data loading, popups, legends, controls and stories,
written in the same file.
- Start: How it works, then the MapLibre examples in YAML: every official MapLibre example, and which ones the format expresses on its own
- Then: Export to style.json:
mlym emitturns a map document into a plainstyle.json, and Export classes lists what each part becomes - Look up: JavaScript API · TypeScript API
Looking something up
Section titled “Looking something up”Every key a map document or story file takes, with its type and default, is
in the YAML reference. The <ml-map> and
<ml-scrollytelling> attributes, events and styling hooks are in
Elements, and the command-line tool’s commands are in
the CLI reference.
Something’s broken
Section titled “Something’s broken”A blank map, an error card, a notice on the map, or a map that works on your computer but not once published.
- Start: Troubleshooting