Skip to content

StyleHalf

Defined in: packages/core/src/model/types.ts:79

The half that compiles to style.json.

PropertyTypeDescriptionDefined in
basemap?unknownThe base style merged in at compile time. mapStyle in v1 surface syntax.packages/core/src/model/types.ts:98
cameraCameraModel-packages/core/src/model/types.ts:99
description?stringWhat the map shows, in words (document-root description:). Remarks Compiles into the emitted style’s root metadata ("maplibre-yaml:description"); live, it is the canvas’s accessible description (aria-describedby).packages/core/src/model/types.ts:96
images?Record<string, string | { pixelRatio?: number; sdf?: boolean; url: string; }>Named images for symbol layers and patterns (U6, R9). Remarks Style half because it fully compiles: live, the renderer addImages each before layers; on export the images are fetched at compile time and merged into the document sprite (class exports).packages/core/src/model/types.ts:129
layersLayerModel[]-packages/core/src/model/types.ts:154
light?objectThe style-spec root light (U10′). Remarks Spec-native, so it compiles straight through to the emitted style.json root (class exports). Live, the renderer applies it with map.setLight — the live style is built from mapStyle + addLayer, so it cannot ride in on the style object.packages/core/src/model/types.ts:152
light.anchor?any[] | "map" | "viewport"-packages/core/src/schemas/map.schema.ts:772
light.color?string | any[]-packages/core/src/schemas/map.schema.ts:784
light.intensity?number | any[]-packages/core/src/schemas/map.schema.ts:787
light.position?any[] | [number, number, number]-packages/core/src/schemas/map.schema.ts:778
metadata?Record<string, unknown>Style-spec root metadata (a v2 style.metadata slot). Remarks The style spec carries a free-form metadata object at its root, so this compiles through to the emitted style.json root rather than being dropped — the never-drop discipline that governs the rest of the style half. It has no v1 surface (v1 config.metadata is a Map option that lands in RuntimeHalf.map), so it is absent from AE2 pairs and never causes a v1/v2 divergence.packages/core/src/model/types.ts:120
projection?objectMap projection (U15) — the style-spec root projection.packages/core/src/model/types.ts:142
projection.type"globe" | "mercator"-packages/core/src/schemas/map.schema.ts:748
sky?objectSky / fog / globe atmosphere (U15) — the style-spec root sky.packages/core/src/model/types.ts:140
sky.atmosphere-blend?number | any[]-packages/core/src/schemas/map.schema.ts:718
sky.fog-color?string | any[]-packages/core/src/schemas/map.schema.ts:706
sky.fog-ground-blend?number | any[]-packages/core/src/schemas/map.schema.ts:715
sky.horizon-color?string | any[]-packages/core/src/schemas/map.schema.ts:703
sky.horizon-fog-blend?number | any[]-packages/core/src/schemas/map.schema.ts:712
sky.sky-color?string | any[]-packages/core/src/schemas/map.schema.ts:700
sky.sky-horizon-blend?number | any[]-packages/core/src/schemas/map.schema.ts:709
sourcesRecord<string, SourceModel>-packages/core/src/model/types.ts:153
state?Record<string, unknown>Spec-native runtime-tunable values (state root property). Remarks Erases, because MapLibre carries it natively. The metadata a control UI needs to render a picker for these — label, type, range — does not, and lives in RuntimeHalf.parameters.packages/core/src/model/types.ts:108
terrain?objectMap-level 3D terrain (U15) — the style-spec root terrain. Remarks Style half: it compiles verbatim (class exports). Live, the renderer applies it with setTerrain because the live style is built from the basemap + addLayer, never from this model’s style object.packages/core/src/model/types.ts:138
terrain.exaggeration?number-packages/core/src/schemas/map.schema.ts:656
terrain.sourcestring-packages/core/src/schemas/map.schema.ts:652
title?stringThe map’s name (document-root title:, v1 and v2 alike). Remarks Style half because it compiles: the emitted style.json carries it as the spec’s root name. Live, it is the map canvas’s accessible name.packages/core/src/model/types.ts:87