Skip to content

MapRenderer

Defined in: packages/core/src/renderer/map-renderer.ts:602

new MapRenderer(container, config, layers?, options?, sources?): MapRenderer

Defined in: packages/core/src/renderer/map-renderer.ts:715

ParameterTypeDefault value
containerstring | HTMLElementundefined
configobjectOutputTypeundefined
layers(objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<{ id: ZodString; layout: ZodOptional<ZodObject<{ }, "passthrough", ZodTypeAny, objectOutputType<{ }, ZodTypeAny, "passthrough">, objectInputType<{ }, ZodTypeAny, "passthrough">>>; metadata: ZodOptional<ZodRecord<ZodString, ZodAny>>; paint: ZodOptional<ZodObject<{ background-color: ZodOptional<ZodUnion<[ZodEffects<…, …, …>, ZodType<…, …, …>]>>; background-opacity: ZodOptional<ZodUnion<[ZodNumber, ZodType<…, …, …>]>>; background-pattern: ZodOptional<ZodUnion<[ZodString, ZodType<…, …, …>]>>; }, "passthrough", ZodTypeAny, objectOutputType<{ background-color: ZodOptional<ZodUnion<[…, …]>>; background-opacity: ZodOptional<ZodUnion<[…, …]>>; background-pattern: ZodOptional<ZodUnion<[…, …]>>; }, ZodTypeAny, "passthrough">, objectInputType<{ background-color: ZodOptional<ZodUnion<[…, …]>>; background-opacity: ZodOptional<ZodUnion<[…, …]>>; background-pattern: ZodOptional<ZodUnion<[…, …]>>; }, ZodTypeAny, "passthrough">>>; type: ZodLiteral<"background">; }, ZodTypeAny, "passthrough">)[][]
optionsMapRendererOptions{}
sources?Record<string, objectOutputType<{ attribution: ZodOptional<ZodString>; buffer: ZodOptional<ZodNumber>; cache: ZodOptional<ZodObject<{ enabled: ZodDefault<ZodBoolean>; ttl: ZodOptional<ZodNumber>; }, "strip", ZodTypeAny, { enabled: boolean; ttl?: number; }, { enabled?: boolean; ttl?: number; }>>; cluster: ZodOptional<ZodBoolean>; clusterMaxZoom: ZodOptional<ZodNumber>; clusterMinPoints: ZodOptional<ZodNumber>; clusterProperties: ZodOptional<ZodRecord<ZodString, ZodAny>>; clusterRadius: ZodOptional<ZodNumber>; columns: ZodOptional<ZodUnion<[ZodLiteral<"all">, ZodArray<ZodString, "many">]>>; data: ZodOptional<ZodAny>; fetchStrategy: ZodDefault<ZodEnum<["runtime", "build", "hybrid"]>>; format: ZodOptional<ZodEnum<["pmtiles", "flatgeobuf", "geoparquet", "cog"]>>; generateId: ZodOptional<ZodBoolean>; lineMetrics: ZodOptional<ZodBoolean>; load: ZodOptional<ZodUnion<[ZodEnum<["all", "viewport"]>, ZodObject<{ maxFeatures: ZodOptional<…>; minzoom: ZodOptional<…>; mode: ZodOptional<…>; overviews: ZodOptional<…>; }, "strip", ZodTypeAny, { maxFeatures?: … | …; minzoom?: … | …; mode?: … | … | …; overviews?: … | … | …; }, { maxFeatures?: … | …; minzoom?: … | …; mode?: … | … | …; overviews?: … | … | …; }>]>>; loading: ZodOptional<ZodObject<{ enabled: ZodDefault<ZodBoolean>; message: ZodOptional<ZodString>; showErrorOverlay: ZodDefault<ZodBoolean>; }, "strip", ZodTypeAny, { enabled: boolean; message?: string; showErrorOverlay: boolean; }, { enabled?: boolean; message?: string; showErrorOverlay?: boolean; }>>; prefetchedData: ZodOptional<ZodAny>; promoteId: ZodOptional<ZodUnion<[ZodString, ZodRecord<ZodString, ZodString>]>>; refresh: ZodOptional<ZodEffects<ZodObject<{ refreshInterval: ZodOptional<ZodNumber>; timestampField: ZodOptional<ZodString>; updateKey: ZodOptional<ZodString>; updateStrategy: ZodDefault<ZodEnum<…>>; windowDuration: ZodOptional<ZodNumber>; windowSize: ZodOptional<ZodNumber>; }, "strip", ZodTypeAny, { refreshInterval?: number; timestampField?: string; updateKey?: string; updateStrategy: "replace" | "merge" | "append-window"; windowDuration?: number; windowSize?: number; }, { refreshInterval?: number; timestampField?: string; updateKey?: string; updateStrategy?: "replace" | "merge" | "append-window"; windowDuration?: number; windowSize?: number; }>, { refreshInterval?: number; timestampField?: string; updateKey?: string; updateStrategy: "replace" | "merge" | "append-window"; windowDuration?: number; windowSize?: number; }, { refreshInterval?: number; timestampField?: string; updateKey?: string; updateStrategy?: "replace" | "merge" | "append-window"; windowDuration?: number; windowSize?: number; }>>; refreshInterval: ZodOptional<ZodNumber>; stream: ZodOptional<ZodObject<{ eventTypes: ZodOptional<ZodArray<ZodString, "many">>; protocols: ZodOptional<ZodUnion<[…, …]>>; reconnect: ZodDefault<ZodBoolean>; reconnectDelay: ZodDefault<ZodNumber>; reconnectMaxAttempts: ZodDefault<ZodNumber>; reconnectMaxDelay: ZodDefault<ZodNumber>; type: ZodEnum<["websocket", "sse"]>; url: ZodOptional<ZodString>; }, "strip", ZodTypeAny, { eventTypes?: string[]; protocols?: string | string[]; reconnect: boolean; reconnectDelay: number; reconnectMaxAttempts: number; reconnectMaxDelay: number; type: "websocket" | "sse"; url?: string; }, { eventTypes?: string[]; protocols?: string | string[]; reconnect?: boolean; reconnectDelay?: number; reconnectMaxAttempts?: number; reconnectMaxDelay?: number; type: "websocket" | "sse"; url?: string; }>>; tolerance: ZodOptional<ZodNumber>; type: ZodLiteral<"geojson">; updateKey: ZodOptional<ZodString>; updateStrategy: ZodOptional<ZodEnum<["replace", "merge", "append-window"]>>; url: ZodOptional<ZodString>; }, ZodTypeAny, "passthrough"> | objectOutputType<{ attribution: ZodOptional<ZodString>; bounds: ZodOptional<ZodTuple<[ZodNumber, ZodNumber, ZodNumber, ZodNumber], null>>; encoding: ZodOptional<ZodEnum<["mvt", "mlt"]>>; format: ZodOptional<ZodEnum<["pmtiles", "flatgeobuf", "geoparquet", "cog"]>>; maxzoom: ZodOptional<ZodNumber>; minzoom: ZodOptional<ZodNumber>; promoteId: ZodOptional<ZodUnion<[ZodString, ZodRecord<ZodString, ZodString>]>>; scheme: ZodOptional<ZodEnum<["xyz", "tms"]>>; tiles: ZodOptional<ZodArray<ZodEffects<ZodString, string, string>, "many">>; type: ZodLiteral<"vector">; url: ZodOptional<ZodString>; volatile: ZodOptional<ZodBoolean>; }, ZodTypeAny, "passthrough"> | objectOutputType<{ attribution: ZodOptional<ZodString>; bounds: ZodOptional<ZodTuple<[ZodNumber, ZodNumber, ZodNumber, ZodNumber], null>>; colorRamp: ZodOptional<ZodObject<{ classes: ZodOptional<ZodNumber>; colors: ZodOptional<ZodArray<ZodString, "many">>; max: ZodNumber; min: ZodNumber; palette: ZodOptional<ZodString>; reverse: ZodOptional<ZodBoolean>; }, "strip", ZodTypeAny, { classes?: number; colors?: string[]; max: number; min: number; palette?: string; reverse?: boolean; }, { classes?: number; colors?: string[]; max: number; min: number; palette?: string; reverse?: boolean; }>>; format: ZodOptional<ZodEnum<["pmtiles", "flatgeobuf", "geoparquet", "cog"]>>; maxzoom: ZodOptional<ZodNumber>; minzoom: ZodOptional<ZodNumber>; scheme: ZodOptional<ZodEnum<["xyz", "tms"]>>; tiles: ZodOptional<ZodArray<ZodEffects<ZodString, string, string>, "many">>; tileSize: ZodDefault<ZodNumber>; type: ZodLiteral<"raster">; url: ZodOptional<ZodString>; volatile: ZodOptional<ZodBoolean>; }, ZodTypeAny, "passthrough"> | objectOutputType<{ attribution: ZodOptional<ZodString>; bounds: ZodOptional<ZodTuple<[ZodNumber, ZodNumber, ZodNumber, ZodNumber], null>>; encoding: ZodDefault<ZodEnum<["terrarium", "mapbox", "custom"]>>; format: ZodOptional<ZodEnum<["pmtiles", "flatgeobuf", "geoparquet", "cog"]>>; maxzoom: ZodOptional<ZodNumber>; minzoom: ZodOptional<ZodNumber>; tiles: ZodOptional<ZodArray<ZodEffects<ZodString, string, string>, "many">>; tileSize: ZodDefault<ZodNumber>; type: ZodLiteral<"raster-dem">; url: ZodOptional<ZodString>; volatile: ZodOptional<ZodBoolean>; }, ZodTypeAny, "passthrough"> | objectOutputType<{ coordinates: ZodTuple<[ZodTuple<[ZodNumber, ZodNumber], null>, ZodTuple<[ZodNumber, ZodNumber], null>, ZodTuple<[ZodNumber, ZodNumber], null>, ZodTuple<[ZodNumber, ZodNumber], null>], null>; type: ZodLiteral<"image">; url: ZodString; }, ZodTypeAny, "passthrough"> | objectOutputType<{ coordinates: ZodTuple<[ZodTuple<[ZodNumber, ZodNumber], null>, ZodTuple<[ZodNumber, ZodNumber], null>, ZodTuple<[ZodNumber, ZodNumber], null>, ZodTuple<[ZodNumber, ZodNumber], null>], null>; type: ZodLiteral<"video">; urls: ZodArray<ZodString, "many">; }, ZodTypeAny, "passthrough"> | { attribution?: string; bands?: number[]; bounds?: [number, number, number, number]; cache?: { enabled: boolean; ttl?: number; }; encoding: "geotiff" | "rg-uv" | "scalar-r" | "nullschool-json"; grid?: { dx: number; dy: number; la1: number; lo1: number; nx: number; ny: number; }; loading?: { enabled: boolean; message?: string; showErrorOverlay: boolean; }; nodata?: number | { above?: number; below?: number; channel: "a" | "b" | "r" | "g"; equals?: number; }; range?: [number, number]; type: "grid"; units?: string; url: string; }>undefined

MapRenderer

addControls(config): void

Defined in: packages/core/src/renderer/map-renderer.ts:1860

Add controls to the map

ParameterType
config{ attribution?: boolean | { compact?: boolean; customAttribution?: string | string[]; enabled?: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }; fullscreen?: boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }; geolocate?: boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }; globe?: boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }; navigation?: boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }; scale?: boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }; terrain?: boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }; }
config.attribution?boolean | { compact?: boolean; customAttribution?: string | string[]; enabled?: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }
config.fullscreen?boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }
config.geolocate?boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }
config.globe?boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }
config.navigation?boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }
config.scale?boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }
config.terrain?boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }

void

Called automatically on map load when a controls: config was passed via MapRendererOptions. Calling it manually marks controls as added so the automatic invocation is skipped (no double-add).


addLayer(layer): Promise<void>

Defined in: packages/core/src/renderer/map-renderer.ts:1709

Add a layer to the map

ParameterType
layerobjectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<{ id: ZodString; layout: ZodOptional<ZodObject<{ }, "passthrough", ZodTypeAny, objectOutputType<{ }, ZodTypeAny, "passthrough">, objectInputType<{ }, ZodTypeAny, "passthrough">>>; metadata: ZodOptional<ZodRecord<ZodString, ZodAny>>; paint: ZodOptional<ZodObject<{ background-color: ZodOptional<ZodUnion<[ZodEffects<ZodString, string, string>, ZodType<…[], ZodTypeDef, …[]>]>>; background-opacity: ZodOptional<ZodUnion<[ZodNumber, ZodType<…[], ZodTypeDef, …[]>]>>; background-pattern: ZodOptional<ZodUnion<[ZodString, ZodType<…[], ZodTypeDef, …[]>]>>; }, "passthrough", ZodTypeAny, objectOutputType<{ background-color: ZodOptional<ZodUnion<[ZodEffects<…, …, …>, ZodType<…, …, …>]>>; background-opacity: ZodOptional<ZodUnion<[ZodNumber, ZodType<…, …, …>]>>; background-pattern: ZodOptional<ZodUnion<[ZodString, ZodType<…, …, …>]>>; }, ZodTypeAny, "passthrough">, objectInputType<{ background-color: ZodOptional<ZodUnion<[ZodEffects<…, …, …>, ZodType<…, …, …>]>>; background-opacity: ZodOptional<ZodUnion<[ZodNumber, ZodType<…, …, …>]>>; background-pattern: ZodOptional<ZodUnion<[ZodString, ZodType<…, …, …>]>>; }, ZodTypeAny, "passthrough">>>; type: ZodLiteral<"background">; }, ZodTypeAny, "passthrough">

Promise<void>


buildLegend(container, layers, config?): void

Defined in: packages/core/src/renderer/map-renderer.ts:1873

Build legend in container

ParameterType
containerstring | HTMLElement
layers(objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<object & object, ZodTypeAny, "passthrough"> | objectOutputType<{ id: ZodString; layout: ZodOptional<ZodObject<{ }, "passthrough", ZodTypeAny, objectOutputType<{ }, ZodTypeAny, "passthrough">, objectInputType<{ }, ZodTypeAny, "passthrough">>>; metadata: ZodOptional<ZodRecord<ZodString, ZodAny>>; paint: ZodOptional<ZodObject<{ background-color: ZodOptional<ZodUnion<[ZodEffects<…, …, …>, ZodType<…, …, …>]>>; background-opacity: ZodOptional<ZodUnion<[ZodNumber, ZodType<…, …, …>]>>; background-pattern: ZodOptional<ZodUnion<[ZodString, ZodType<…, …, …>]>>; }, "passthrough", ZodTypeAny, objectOutputType<{ background-color: ZodOptional<ZodUnion<[…, …]>>; background-opacity: ZodOptional<ZodUnion<[…, …]>>; background-pattern: ZodOptional<ZodUnion<[…, …]>>; }, ZodTypeAny, "passthrough">, objectInputType<{ background-color: ZodOptional<ZodUnion<[…, …]>>; background-opacity: ZodOptional<ZodUnion<[…, …]>>; background-pattern: ZodOptional<ZodUnion<[…, …]>>; }, ZodTypeAny, "passthrough">>>; type: ZodLiteral<"background">; }, ZodTypeAny, "passthrough">)[]
config?{ collapsed: boolean; items?: object[]; position: "top-left" | "top-right" | "bottom-left" | "bottom-right"; title?: string; }
config.collapsed?boolean
config.items?object[]
config.position?"top-left" | "top-right" | "bottom-left" | "bottom-right"
config.title?string

void

Called automatically on map load when a legend: config was passed via MapRendererOptions. Calling it manually marks the legend as built so the automatic invocation is skipped (no double-build).


destroy(): void

Defined in: packages/core/src/renderer/map-renderer.ts:2693

Destroy the map and clean up resources

void


failedSources(): ReadonlySet<string>

Defined in: packages/core/src/renderer/map-renderer.ts:2381

The sources whose last load failed, for hints.failedSources (KTD11): reload() retries them.

ReadonlySet<string>


getDocument(): AppliedDocument

Defined in: packages/core/src/renderer/map-renderer.ts:2352

The normalized document this map shows (KTD15): the shape the constructor receives and update() takes, never the parsed MapBlock (<ml-map>.getDocument() returns that). After update:applied it is the next document, failures included: the document is the source of truth (KTD7).

AppliedDocument


getGrid(sourceId): GridField | undefined

Defined in: packages/core/src/renderer/map-renderer.ts:2391

A grid source’s field (grid source, R14): the decoded, sampleable field once it is in, undefined before that and for any other id. Never mutated: a live update that changes the source hands out a new one (source:loaded says when).

ParameterType
sourceIdstring

GridField | undefined


getLegendBuilder(): LegendBuilder

Defined in: packages/core/src/renderer/map-renderer.ts:2624

Get the legend builder instance

LegendBuilder


getMap(): maplibregl.Map

Defined in: packages/core/src/renderer/map-renderer.ts:1682

Get the underlying MapLibre map instance

maplibregl.Map


getState(): Record<string, unknown>

Defined in: packages/core/src/renderer/map-renderer.ts:2061

The document’s current state: values (live documents, KTD6): its defaults, the panel’s seeds and every write since, by key.

Record<string, unknown>


gridReady(sourceId): Promise<GridField>

Defined in: packages/core/src/renderer/map-renderer.ts:2413

A grid source’s field once it is in (R14). Rejects with an Error naming the id when the applied document has no grid source of that id; with the source’s FormatError when its load fails (a later reload() gives new callers a fresh promise); and when the source is removed or the renderer destroyed while the load is in flight. Does not wait for mapReady()’s layers — only for the style load that registers sources.

ParameterType
sourceIdstring

Promise<GridField>


hasGrid(sourceId): boolean

Defined in: packages/core/src/renderer/map-renderer.ts:2401

Whether the applied document has a type: grid source of this id, decoded or not: tells “not decoded yet” from “no such source” without awaiting gridReady. False before the style load registers the document’s sources, after the source is removed, and once destroyed.

ParameterType
sourceIdstring

boolean


isMapLoaded(): boolean

Defined in: packages/core/src/renderer/map-renderer.ts:1702

Check if map is loaded

boolean


mountHostChrome(): void

Defined in: packages/core/src/renderer/map-renderer.ts:2582

Put the host’s chrome into the corner system (KTD10): the legend slot at its corner’s edge, in the built-in legend’s place, then the chrome elements after the built-in pieces. Once: at style load, or, for a map built off the page (deferChrome), when the host commits the swap (KTD8) — right before it is shown, so the elements leave the old map only then and never for a map that fails to load.

void


noteImageReference(property, value): void

Defined in: packages/core/src/renderer/map-renderer.ts:1695

Record an image property value the document sets at runtime (a story’s setLayoutProperty action, for example), so a missing image it names is reported as the document’s, not dismissed as a basemap sprite gap. Values of non-image properties are ignored.

ParameterTypeDescription
propertystringThe layout/paint property (icon-image, fill-pattern, …).
valueunknownIts value: a name, a {token} string, or an expression.

void


off<K>(event, callback): void

Defined in: packages/core/src/renderer/map-renderer.ts:2641

Unregister an event listener

Type Parameter
K extends keyof MapRendererEvents
ParameterType
eventK
callback(data) => void

void


on<K>(event, callback): void

Defined in: packages/core/src/renderer/map-renderer.ts:2631

Register an event listener

Type Parameter
K extends keyof MapRendererEvents
ParameterType
eventK
callback(data) => void

void


pause(): void

Defined in: packages/core/src/renderer/map-renderer.ts:2425

Stop this map’s pipelines (polling, by-view loaders): a fallback rebuild is replacing it (KTD8).

void


rebuildSeed(): object

Defined in: packages/core/src/renderer/map-renderer.ts:2441

What a fallback rebuild seeds the next map with (KTD8): the state: values a reader wrote (setState, the panel; not the document’s defaults or the panel’s seeds, which the next document provides again) and the panel’s visibility overrides, as the next renderer’s initialState and initialVisibility.

object

NameTypeDefined in
initialStateRecord<string, unknown>packages/core/src/renderer/map-renderer.ts:2441
initialVisibilityRecord<string, boolean>packages/core/src/renderer/map-renderer.ts:2441

removeLayer(layerId): void

Defined in: packages/core/src/renderer/map-renderer.ts:1829

Remove a layer from the map

ParameterType
layerIdstring

void


resume(): void

Defined in: packages/core/src/renderer/map-renderer.ts:2430

The counterpart of pause: the rebuild failed and this map stays.

void


setCameraOwner(owner): void

Defined in: packages/core/src/renderer/map-renderer.ts:2376

Who owns the camera from the next update on (KTD13): <ml-map camera> changed on a running map.

ParameterType
owner"document" | "host"

void


setLayerVisibility(layerId, visible): void

Defined in: packages/core/src/renderer/map-renderer.ts:1838

Set layer visibility

ParameterType
layerIdstring
visibleboolean

void


setState(values): void

Defined in: packages/core/src/renderer/map-renderer.ts:2077

Write state: values (live documents, R12): each goes through setGlobalStateProperty, the params panel follows, and one state:change fires. A key the document’s state: block does not declare refuses the whole call — nothing is written — and a write made before the map loads is applied once it does, after the defaults.

ParameterType
valuesRecord<string, unknown>

void

When a key is undeclared, or the running maplibre-gl has no setGlobalStateProperty (below 5.6).


update(next, hints?): Promise<UpdateResult>

Defined in: packages/core/src/renderer/map-renderer.ts:2470

Apply a changed document to the running map in place (live documents, 0.10): layers, sources, runtime features and the camera follow the difference between the applied document and next; nothing else is touched, and a host’s own layers are never moved or removed (R10).

ParameterTypeDefault valueDescription
nextAppliedDocumentundefinedThe normalized document, as the constructor takes it.
hintsDiffHintsNO_HINTSWhat the documents don’t say (KTD11): sources whose last load failed and whether base re-resolved URLs. Default: none, so an unchanged document is a no-op.

Promise<UpdateResult>

Resolves when the outcome is final (KTD5): applied after the last operation and re-sync (with update:applied fired), fallback when next needs a rebuild (mapStyle, a constructor-only option) — decided before anything is awaited, and nothing is mutated: the host rebuilds —, rejected with kind: 'chunk' when the engine’s file couldn’t be downloaded (update:rejected fired, map and document unchanged), or superseded when a later update() replaced this one in the queue. One update applies at a time; an update arriving mid-apply waits, and only the last waiting one runs, against the document applied by then. An update made before the map’s own load waits for it.


updateLayerData(layerId, data): void

Defined in: packages/core/src/renderer/map-renderer.ts:1845

Update layer data

ParameterType
layerIdstring
dataGeoJSON

void


static fromModel(container, model, options?): MapRenderer

Defined in: packages/core/src/renderer/map-renderer.ts:701

Construct a renderer from the v2 internal model.

ParameterType
containerstring | HTMLElement
modelMapModel
optionsMapRendererOptions

MapRenderer

The model is the shape the emitter is written against (R30), and this is how the renderer consumes the same one. v0.5.0 keeps the v1 constructor as the compatibility surface — it is public API with external callers, and breaking it inside a minor is not on the table — so this factory reassembles the v1 arguments rather than the managers being rewritten onto new shapes.

<ml-map> does not call this — it derives the same arguments inline, so the component test double (which mocks MapRenderer as a bare function with no statics) keeps working. This factory is for callers that already hold a model. It differs from the inline path in one respect worth knowing: caller options win over the model’s controls/legend, so passing { controls: undefined } erases them.