Skip to content

Introduction

maplibre-yaml is a library that lets you create interactive web maps using YAML configuration instead of JavaScript code.

Learning web mapping but don’t want to write JavaScript? maplibre-yaml lets you focus on cartography and data visualization without the programming overhead.

Need to prototype maps quickly? Define layers, styling, and interactivity in YAML and iterate faster than ever.

Building story maps or data journalism pieces? Use scrollytelling features without touching code.

Instead of this JavaScript:

const map = new maplibregl.Map({
container: "map",
style: "https://demotiles.maplibre.org/style.json",
center: [-74.006, 40.7128],
zoom: 12,
});
map.on("load", () => {
map.addSource("bikes", {
type: "geojson",
data: "https://example.com/bikes.geojson",
});
map.addLayer({
id: "bike-lanes",
type: "line",
source: "bikes",
paint: {
"line-color": "#00ff00",
"line-width": 2,
},
});
});

You write this YAML:

type: map
id: my-map
config:
center: [-74.006, 40.7128]
zoom: 12
mapStyle: "https://demotiles.maplibre.org/style.json"
layers:
- id: bike-lanes
type: line
source:
type: geojson
url: "https://example.com/bikes.geojson"
paint:
line-color: "#00ff00"
line-width: 2
FeatureDescription
Declarative ConfigDefine maps in YAML or JSON
Runtime DataFetch GeoJSON when map loads
Live UpdatesWebSocket, SSE, and polling support
ScrollytellingNarrative story maps
Web Components<ml-map> works anywhere
Type SafetyFull TypeScript support

Ready to get started?

  1. Install maplibre-yaml
  2. Create your first map
  3. Explore the guides