Skip to content

@maplibre-yaml/core/schemas

Central export file for all MapLibre YAML schemas

This module provides a centralized export point for all Zod schemas used in the MapLibre YAML configuration system. These schemas validate and type-check YAML configurations for creating interactive map applications.

Foundational schemas for coordinates, colors, and expressions used throughout the configuration system.

Schemas for defining data sources (GeoJSON, vector tiles, raster tiles, etc.) that provide data to map layers.

Schemas for all MapLibre layer types (circle, line, fill, symbol, etc.) including paint properties, layout properties, popups, and legends.

Schemas for rich HTML content blocks that can be used in pages and scrollytelling.

Schemas for map blocks, including configuration, controls, and legends.

Schemas for narrative scrollytelling experiences with chapters and actions.

Top-level schemas for pages, blocks, and the root configuration structure.

Basic schema usage

import { RootSchema } from '@maplibre-yaml/core/schemas';
const config = {
pages: [
{
path: '/',
title: 'Home',
blocks: [
{
type: 'map',
id: 'main-map',
config: {
center: [0, 0],
zoom: 2,
mapStyle: 'https://example.com/style.json'
}
}
]
}
]
};
const validated = RootSchema.parse(config);

Type inference from schemas

import { z } from 'zod';
import { LayerSchema, PageSchema } from '@maplibre-yaml/core/schemas';
type Layer = z.infer<typeof LayerSchema>;
type Page = z.infer<typeof PageSchema>;

Re-exports BackgroundLayerSchema


Re-exports BaseLayerPropertiesSchema


Re-exports BBoxSchema


Re-exports Block


Re-exports BlockSchema


Re-exports Chapter


Re-exports ChapterAction


Re-exports ChapterActionSchema


Re-exports ChapterLayers


Re-exports ChapterLayersSchema


Re-exports ChapterSchema


Re-exports CircleLayerSchema


Re-exports ColorOrExpressionSchema


Re-exports ColorReliefLayerSchema


Re-exports ColorSchema


Re-exports ContentBlockSchema


Re-exports ContentElementSchema


Re-exports ContentItemSchema


Re-exports ControlPosition


Re-exports ControlPositionSchema


Re-exports ControlsConfig


Re-exports ControlsConfigSchema


Re-exports EmitConfigSchema


Re-exports EmitPayloadItemSchema


Re-exports ExpressionSchema


Re-exports FeatureCollectionSchema


Re-exports FeatureSchema


Re-exports FillExtrusionLayerSchema


Re-exports FillLayerSchema


Re-exports FitToConfig


Re-exports FitToSchema


Re-exports GeoJSONSchema


Re-exports GeoJSONSourceSchema


Re-exports GeometrySchema


Re-exports GlobalConfig


Re-exports GlobalConfigSchema


Re-exports HeatmapLayerSchema


Re-exports HillshadeLayerSchema


Re-exports ImageConfig


Re-exports ImageConfigSchema


Re-exports ImagesConfig


Re-exports ImageSourceSchema


Re-exports ImagesSchema


Re-exports InteractiveConfigSchema


Re-exports LatitudeSchema


Re-exports LayerOrReferenceSchema


Re-exports LayerReferenceSchema


Re-exports LayerRuntimeSchema


Re-exports LayerSchema


Re-exports LayerSourceSchema


Re-exports LayerV2Schema


Re-exports LegendConfig


Re-exports LegendConfigSchema


Re-exports LegendItemSchema


Re-exports LightConfig


Re-exports LightSchema


Re-exports LineLayerSchema


Re-exports LineStringSchema


Re-exports LngLatBoundsSchema


Re-exports LngLatSchema


Re-exports LoadingConfigSchema


Re-exports LongitudeSchema


Re-exports MapBlock


Re-exports MapBlockSchema


Re-exports MapBlockV2


Re-exports MapBlockV2Schema


Re-exports MapConfig


Re-exports MapConfigSchema


Re-exports MapFullPageBlock


Re-exports MapFullPageBlockSchema


Re-exports MarkerConfig


Re-exports MarkerSchema


Re-exports MarkersSchema


Re-exports MAX_GEOMETRY_COLLECTION_DEPTH


Re-exports MixedBlock


Re-exports MixedBlockSchema


Re-exports MultiLineStringSchema


Re-exports MultiPointSchema


Re-exports MultiPolygonSchema


Re-exports NumberOrExpressionSchema


Re-exports Page


Re-exports PageSchema


Re-exports Parameters


Re-exports ParametersSchema


Re-exports PointSchema


Re-exports PolygonSchema


Re-exports PopupContentItemSchema


Re-exports PopupContentSchema


Re-exports PopupsSchema


Re-exports PositionSchema


Re-exports ProjectionConfig


Re-exports ProjectionSchema


Re-exports RasterDEMSourceSchema


Re-exports RasterLayerSchema


Re-exports RasterSourceSchema


Re-exports RootConfig


Re-exports RootSchema


Re-exports RuntimeMapSchema


Re-exports RuntimeV2Schema


Re-exports ScrollytellingBlock


Re-exports ScrollytellingBlockSchema


Re-exports SkyConfig


Re-exports SkySchema


Re-exports SourceRuntimeSchema


Re-exports SourceV2Schema


Re-exports StandalonePopupConfig


Re-exports StandalonePopupSchema


Re-exports State


Re-exports StateSchema


Re-exports StreamConfigSchema


Re-exports StyleV2Schema


Re-exports SymbolLayerSchema


Re-exports TerrainConfig


Re-exports TerrainSchema


Re-exports ValidTagNames


Re-exports VectorSourceSchema


Re-exports VideoSourceSchema


Re-exports ZoomLevelSchema