Layer Types
Layer Types
Section titled “Layer Types”Layers define how your data is visualized on the map. maplibre-yaml supports all MapLibre layer types.
Common Properties
Section titled “Common Properties”All layers share these base properties:
| Property | Type | Default | Description |
|---|---|---|---|
id * | string | — | Unique identifier for the layer |
type * | string | — | Layer type (circle, line, fill, etc.) |
source * | Source | string | — | Data source configuration or reference |
source-layer | string | — | Source layer (for vector tiles) |
minzoom | number | 0 | Minimum zoom level |
maxzoom | number | 24 | Maximum zoom level |
filter | Expression | — | Filter expression |
visible | boolean | true | Initial visibility |
before | string | — | Insert before this layer ID |
interactive | object | — | Click/hover configuration |
legend | object | — | Legend entry configuration |
Circle Layer
Section titled “Circle Layer”Renders points as circles. Great for point data visualization.
Circle Paint Properties
Section titled “Circle Paint Properties”| Property | Type | Default | Description |
|---|---|---|---|
circle-radius | number | Expression | 5 | Circle radius in pixels |
circle-color | color | Expression | "#000000" | Fill color |
circle-opacity | number | Expression | 1 | Fill opacity (0-1) |
circle-stroke-width | number | Expression | 0 | Stroke width in pixels |
circle-stroke-color | color | Expression | "#000000" | Stroke color |
circle-stroke-opacity | number | Expression | 1 | Stroke opacity (0-1) |
circle-blur | number | Expression | 0 | Blur amount |
Example
Section titled “Example”- id: points type: circle source: type: geojson url: "https://example.com/points.geojson" paint: circle-radius: 8 circle-color: "#ff0000"- id: earthquakes type: circle source: type: geojson url: "https://example.com/earthquakes.geojson" paint: circle-radius: - interpolate - ["linear"] - ["get", "magnitude"] - 1 - 4 - 5 - 12 - 8 - 24 circle-color: - interpolate - ["linear"] - ["get", "magnitude"] - 1 - "#ffffcc" - 5 - "#fd8d3c" - 8 - "#bd0026"Line Layer
Section titled “Line Layer”Renders lines and line strings. Perfect for routes, boundaries, and networks.