@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.
Schema Categories
Section titled “Schema Categories”Base Schemas
Section titled “Base Schemas”Foundational schemas for coordinates, colors, and expressions used throughout the configuration system.
Source Schemas
Section titled “Source Schemas”Schemas for defining data sources (GeoJSON, vector tiles, raster tiles, etc.) that provide data to map layers.
Layer Schemas
Section titled “Layer Schemas”Schemas for all MapLibre layer types (circle, line, fill, symbol, etc.) including paint properties, layout properties, popups, and legends.
Content Schemas
Section titled “Content Schemas”Schemas for rich HTML content blocks that can be used in pages and scrollytelling.
Map Schemas
Section titled “Map Schemas”Schemas for map blocks, including configuration, controls, and legends.
Scrollytelling Schemas
Section titled “Scrollytelling Schemas”Schemas for narrative scrollytelling experiences with chapters and actions.
Page Schemas
Section titled “Page Schemas”Top-level schemas for pages, blocks, and the root configuration structure.
Examples
Section titled “Examples”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>;References
Section titled “References”BackgroundLayerSchema
Section titled “BackgroundLayerSchema”Re-exports BackgroundLayerSchema
BaseLayerPropertiesSchema
Section titled “BaseLayerPropertiesSchema”Re-exports BaseLayerPropertiesSchema
BBoxSchema
Section titled “BBoxSchema”Re-exports BBoxSchema
Re-exports Block
BlockSchema
Section titled “BlockSchema”Re-exports BlockSchema
Chapter
Section titled “Chapter”Re-exports Chapter
ChapterAction
Section titled “ChapterAction”Re-exports ChapterAction
ChapterActionSchema
Section titled “ChapterActionSchema”Re-exports ChapterActionSchema
ChapterLayers
Section titled “ChapterLayers”Re-exports ChapterLayers
ChapterLayersSchema
Section titled “ChapterLayersSchema”Re-exports ChapterLayersSchema
ChapterSchema
Section titled “ChapterSchema”Re-exports ChapterSchema
CircleLayerSchema
Section titled “CircleLayerSchema”Re-exports CircleLayerSchema
ColorOrExpressionSchema
Section titled “ColorOrExpressionSchema”Re-exports ColorOrExpressionSchema
ColorReliefLayerSchema
Section titled “ColorReliefLayerSchema”Re-exports ColorReliefLayerSchema
ColorSchema
Section titled “ColorSchema”Re-exports ColorSchema
ContentBlockSchema
Section titled “ContentBlockSchema”Re-exports ContentBlockSchema
ContentElementSchema
Section titled “ContentElementSchema”Re-exports ContentElementSchema
ContentItemSchema
Section titled “ContentItemSchema”Re-exports ContentItemSchema
ControlPosition
Section titled “ControlPosition”Re-exports ControlPosition
ControlPositionSchema
Section titled “ControlPositionSchema”Re-exports ControlPositionSchema
ControlsConfig
Section titled “ControlsConfig”Re-exports ControlsConfig
ControlsConfigSchema
Section titled “ControlsConfigSchema”Re-exports ControlsConfigSchema
EmitConfigSchema
Section titled “EmitConfigSchema”Re-exports EmitConfigSchema
EmitPayloadItemSchema
Section titled “EmitPayloadItemSchema”Re-exports EmitPayloadItemSchema
ExpressionSchema
Section titled “ExpressionSchema”Re-exports ExpressionSchema
FeatureCollectionSchema
Section titled “FeatureCollectionSchema”Re-exports FeatureCollectionSchema
FeatureSchema
Section titled “FeatureSchema”Re-exports FeatureSchema
FillExtrusionLayerSchema
Section titled “FillExtrusionLayerSchema”Re-exports FillExtrusionLayerSchema
FillLayerSchema
Section titled “FillLayerSchema”Re-exports FillLayerSchema
FitToConfig
Section titled “FitToConfig”Re-exports FitToConfig
FitToSchema
Section titled “FitToSchema”Re-exports FitToSchema
GeoJSONSchema
Section titled “GeoJSONSchema”Re-exports GeoJSONSchema
GeoJSONSourceSchema
Section titled “GeoJSONSourceSchema”Re-exports GeoJSONSourceSchema
GeometrySchema
Section titled “GeometrySchema”Re-exports GeometrySchema
GlobalConfig
Section titled “GlobalConfig”Re-exports GlobalConfig
GlobalConfigSchema
Section titled “GlobalConfigSchema”Re-exports GlobalConfigSchema
HeatmapLayerSchema
Section titled “HeatmapLayerSchema”Re-exports HeatmapLayerSchema
HillshadeLayerSchema
Section titled “HillshadeLayerSchema”Re-exports HillshadeLayerSchema
ImageConfig
Section titled “ImageConfig”Re-exports ImageConfig
ImageConfigSchema
Section titled “ImageConfigSchema”Re-exports ImageConfigSchema
ImagesConfig
Section titled “ImagesConfig”Re-exports ImagesConfig
ImageSourceSchema
Section titled “ImageSourceSchema”Re-exports ImageSourceSchema
ImagesSchema
Section titled “ImagesSchema”Re-exports ImagesSchema
InteractiveConfigSchema
Section titled “InteractiveConfigSchema”Re-exports InteractiveConfigSchema
LatitudeSchema
Section titled “LatitudeSchema”Re-exports LatitudeSchema
LayerOrReferenceSchema
Section titled “LayerOrReferenceSchema”Re-exports LayerOrReferenceSchema
LayerReferenceSchema
Section titled “LayerReferenceSchema”Re-exports LayerReferenceSchema
LayerRuntimeSchema
Section titled “LayerRuntimeSchema”Re-exports LayerRuntimeSchema
LayerSchema
Section titled “LayerSchema”Re-exports LayerSchema
LayerSourceSchema
Section titled “LayerSourceSchema”Re-exports LayerSourceSchema
LayerV2Schema
Section titled “LayerV2Schema”Re-exports LayerV2Schema
LegendConfig
Section titled “LegendConfig”Re-exports LegendConfig
LegendConfigSchema
Section titled “LegendConfigSchema”Re-exports LegendConfigSchema
LegendItemSchema
Section titled “LegendItemSchema”Re-exports LegendItemSchema
LightConfig
Section titled “LightConfig”Re-exports LightConfig
LightSchema
Section titled “LightSchema”Re-exports LightSchema
LineLayerSchema
Section titled “LineLayerSchema”Re-exports LineLayerSchema
LineStringSchema
Section titled “LineStringSchema”Re-exports LineStringSchema
LngLatBoundsSchema
Section titled “LngLatBoundsSchema”Re-exports LngLatBoundsSchema
LngLatSchema
Section titled “LngLatSchema”Re-exports LngLatSchema
LoadingConfigSchema
Section titled “LoadingConfigSchema”Re-exports LoadingConfigSchema
LongitudeSchema
Section titled “LongitudeSchema”Re-exports LongitudeSchema
MapBlock
Section titled “MapBlock”Re-exports MapBlock
MapBlockSchema
Section titled “MapBlockSchema”Re-exports MapBlockSchema
MapBlockV2
Section titled “MapBlockV2”Re-exports MapBlockV2
MapBlockV2Schema
Section titled “MapBlockV2Schema”Re-exports MapBlockV2Schema
MapConfig
Section titled “MapConfig”Re-exports MapConfig
MapConfigSchema
Section titled “MapConfigSchema”Re-exports MapConfigSchema
MapFullPageBlock
Section titled “MapFullPageBlock”Re-exports MapFullPageBlock
MapFullPageBlockSchema
Section titled “MapFullPageBlockSchema”Re-exports MapFullPageBlockSchema
MarkerConfig
Section titled “MarkerConfig”Re-exports MarkerConfig
MarkerSchema
Section titled “MarkerSchema”Re-exports MarkerSchema
MarkersSchema
Section titled “MarkersSchema”Re-exports MarkersSchema
MAX_GEOMETRY_COLLECTION_DEPTH
Section titled “MAX_GEOMETRY_COLLECTION_DEPTH”Re-exports MAX_GEOMETRY_COLLECTION_DEPTH
MixedBlock
Section titled “MixedBlock”Re-exports MixedBlock
MixedBlockSchema
Section titled “MixedBlockSchema”Re-exports MixedBlockSchema
MultiLineStringSchema
Section titled “MultiLineStringSchema”Re-exports MultiLineStringSchema
MultiPointSchema
Section titled “MultiPointSchema”Re-exports MultiPointSchema
MultiPolygonSchema
Section titled “MultiPolygonSchema”Re-exports MultiPolygonSchema
NumberOrExpressionSchema
Section titled “NumberOrExpressionSchema”Re-exports NumberOrExpressionSchema
Re-exports Page
PageSchema
Section titled “PageSchema”Re-exports PageSchema
Parameters
Section titled “Parameters”Re-exports Parameters
ParametersSchema
Section titled “ParametersSchema”Re-exports ParametersSchema
PointSchema
Section titled “PointSchema”Re-exports PointSchema
PolygonSchema
Section titled “PolygonSchema”Re-exports PolygonSchema
PopupContentItemSchema
Section titled “PopupContentItemSchema”Re-exports PopupContentItemSchema
PopupContentSchema
Section titled “PopupContentSchema”Re-exports PopupContentSchema
PopupsSchema
Section titled “PopupsSchema”Re-exports PopupsSchema
PositionSchema
Section titled “PositionSchema”Re-exports PositionSchema
ProjectionConfig
Section titled “ProjectionConfig”Re-exports ProjectionConfig
ProjectionSchema
Section titled “ProjectionSchema”Re-exports ProjectionSchema
RasterDEMSourceSchema
Section titled “RasterDEMSourceSchema”Re-exports RasterDEMSourceSchema
RasterLayerSchema
Section titled “RasterLayerSchema”Re-exports RasterLayerSchema
RasterSourceSchema
Section titled “RasterSourceSchema”Re-exports RasterSourceSchema
RootConfig
Section titled “RootConfig”Re-exports RootConfig
RootSchema
Section titled “RootSchema”Re-exports RootSchema
RuntimeMapSchema
Section titled “RuntimeMapSchema”Re-exports RuntimeMapSchema
RuntimeV2Schema
Section titled “RuntimeV2Schema”Re-exports RuntimeV2Schema
ScrollytellingBlock
Section titled “ScrollytellingBlock”Re-exports ScrollytellingBlock
ScrollytellingBlockSchema
Section titled “ScrollytellingBlockSchema”Re-exports ScrollytellingBlockSchema
SkyConfig
Section titled “SkyConfig”Re-exports SkyConfig
SkySchema
Section titled “SkySchema”Re-exports SkySchema
SourceRuntimeSchema
Section titled “SourceRuntimeSchema”Re-exports SourceRuntimeSchema
SourceV2Schema
Section titled “SourceV2Schema”Re-exports SourceV2Schema
StandalonePopupConfig
Section titled “StandalonePopupConfig”Re-exports StandalonePopupConfig
StandalonePopupSchema
Section titled “StandalonePopupSchema”Re-exports StandalonePopupSchema
Re-exports State
StateSchema
Section titled “StateSchema”Re-exports StateSchema
StreamConfigSchema
Section titled “StreamConfigSchema”Re-exports StreamConfigSchema
StyleV2Schema
Section titled “StyleV2Schema”Re-exports StyleV2Schema
SymbolLayerSchema
Section titled “SymbolLayerSchema”Re-exports SymbolLayerSchema
TerrainConfig
Section titled “TerrainConfig”Re-exports TerrainConfig
TerrainSchema
Section titled “TerrainSchema”Re-exports TerrainSchema
ValidTagNames
Section titled “ValidTagNames”Re-exports ValidTagNames
VectorSourceSchema
Section titled “VectorSourceSchema”Re-exports VectorSourceSchema
VideoSourceSchema
Section titled “VideoSourceSchema”Re-exports VideoSourceSchema
ZoomLevelSchema
Section titled “ZoomLevelSchema”Re-exports ZoomLevelSchema