Skip to content

normalizeMapBlock

normalizeMapBlock(input): MapModel

Defined in: packages/core/src/model/normalize.ts:206

Normalize a v1 map document into the internal model.

ParameterType
inputV1MapInput

MapModel

The config: block is the one that has to be cut rather than moved: it is declared as a single MapLibre MapOptions passthrough, but center, zoom, pitch, bearing, and mapStyle are style-spec root properties while the rest are constructor-only. Any split that keeps config: whole on one side contradicts the spec.

The document root is enumerated, not partitioned, so the never-drop invariant is scoped to the objects above, not the root. A root key outside the recognized set (id, config, layers, sources, controls, legend, className, style, state, parameters, markers, popups, images, terrain, sky, projection) does not reach the model — including type (structural) and x-* extensions, which the extension registry reads from the raw parsed document, not from the model. The emitter strips x-* regardless, so nothing is lost that should survive.

state: and parameters: are accepted at the document root ahead of the rest of v2’s surface syntax, which is where v2 puts them — so an author who adopts them today writes them in their final position and has nothing to migrate. state is a style-spec root property, so accepting it is additive and breaks nothing, and without it no authored document could exercise R13 or AE6 until v0.6.0. These are the only v2 keys v0.5.0 accepts, deliberately.