Skip to content

MapRendererOptions

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

Options for MapRenderer

PropertyTypeDescriptionDefined in
capabilities?CapabilityPolicyTrust and runtime capabilities for this map. Remarks Gates render-time behavior an author could otherwise abuse — most directly whether an !html popup value renders as markup or as escaped text. Omitted means untrusted: a host embedding a document it did not author gets the safe default without opting into it.packages/core/src/renderer/map-renderer.ts:143
chrome?ChromeMount[]Host-supplied chrome elements (U9 — <ml-map> slot children), mounted into the shared corner system (KTD10) on load, after the built-in legend and params panel so those keep the corner edge. The renderer BORROWS these elements: destroy() removes the corner containers they sit in, so a host that wants them back (re-render, error card) must move them out first — <ml-map> parks them on itself.packages/core/src/renderer/map-renderer.ts:191
controls?objectControls declared in the YAML controls: block — added automatically on map loadpackages/core/src/renderer/map-renderer.ts:131
controls.attribution?boolean | { compact?: boolean; customAttribution?: string | string[]; enabled?: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }-packages/core/src/schemas/map.schema.ts:123
controls.fullscreen?boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }-packages/core/src/schemas/map.schema.ts:122
controls.geolocate?boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }-packages/core/src/schemas/map.schema.ts:120
controls.globe?boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }-packages/core/src/schemas/map.schema.ts:126
controls.navigation?boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }-packages/core/src/schemas/map.schema.ts:117
controls.scale?boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }-packages/core/src/schemas/map.schema.ts:121
controls.terrain?boolean | { enabled: boolean; position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"; }-packages/core/src/schemas/map.schema.ts:129
images?Record<string, string | { pixelRatio?: number; sdf?: boolean; url: string; }>Named images (images:) registered via map.addImage before layers are added, so icon-image/*-pattern references resolve on first render.packages/core/src/renderer/map-renderer.ts:159
legend?objectLegend declared in the YAML legend: block — built automatically on map loadpackages/core/src/renderer/map-renderer.ts:133
legend.collapsedboolean-packages/core/src/schemas/map.schema.ts:173
legend.items?object[]-packages/core/src/schemas/map.schema.ts:174
legend.position"top-left" | "top-right" | "bottom-left" | "bottom-right"-packages/core/src/schemas/map.schema.ts:170
legend.title?string-packages/core/src/schemas/map.schema.ts:172
legendElement?HTMLElementHost-supplied legend element that REPLACES the built-in legend (the legend slot). Mounted at legend.position (default top-left); the auto legend is not built. Borrowed, like chrome.packages/core/src/renderer/map-renderer.ts:197
light?objectThe style-spec light (U10′), applied with map.setLight on load — the live style is built from mapStyle + addLayer, so the document’s light cannot ride in on the style object.packages/core/src/renderer/map-renderer.ts:165
light.anchor?any[] | "map" | "viewport"-packages/core/src/schemas/map.schema.ts:746
light.color?string | any[]-packages/core/src/schemas/map.schema.ts:758
light.intensity?number | any[]-packages/core/src/schemas/map.schema.ts:761
light.position?any[] | [number, number, number]-packages/core/src/schemas/map.schema.ts:752
markers?object[]Standalone markers: — DOM pins added on load, removed on destroy.packages/core/src/renderer/map-renderer.ts:152
onError?(error, fatal?) => voidfatal distinguishes load-aborting failures (source registration, layer add — the document will never reach load) from runtime maplibre error events (a 404’d tile, a missing sprite) that the map survives. Optional second argument, so existing single-arg callbacks are unaffected.packages/core/src/renderer/map-renderer.ts:129
onLoad?() => void-packages/core/src/renderer/map-renderer.ts:122
parameters?Record<string, unknown>parameters: presentation metadata — rendered as the params panel (U8), each control writing its state key via setGlobalStateProperty. Loosely typed to match the schema’s passthrough record; the panel builder reads it as ParameterMeta.packages/core/src/renderer/map-renderer.ts:172
popups?object[]Standalone popups: (U14) — opened at their coordinates on load.packages/core/src/renderer/map-renderer.ts:154
projection?objectProjection (projection:, U15) — map.setProjection, maplibre-gl >= 5.packages/core/src/renderer/map-renderer.ts:182
projection.type"globe" | "mercator"-packages/core/src/schemas/map.schema.ts:722
sky?objectSky / fog / atmosphere (sky:, U15) — map.setSky, maplibre-gl >= 4.5.packages/core/src/renderer/map-renderer.ts:180
sky.atmosphere-blend?number | any[]-packages/core/src/schemas/map.schema.ts:692
sky.fog-color?string | any[]-packages/core/src/schemas/map.schema.ts:680
sky.fog-ground-blend?number | any[]-packages/core/src/schemas/map.schema.ts:689
sky.horizon-color?string | any[]-packages/core/src/schemas/map.schema.ts:677
sky.horizon-fog-blend?number | any[]-packages/core/src/schemas/map.schema.ts:686
sky.sky-color?string | any[]-packages/core/src/schemas/map.schema.ts:674
sky.sky-horizon-blend?number | any[]-packages/core/src/schemas/map.schema.ts:683
state?Record<string, unknown>The document’s state: block ({ key: { default } } per the style spec). Applied on load via setGlobalStateProperty so global-state expressions read the declared defaults — the live style is built from mapStyle + addLayer, so the block cannot ride in on the style object.packages/core/src/renderer/map-renderer.ts:150
terrain?objectMap-level 3D terrain (terrain:, U15). Applied via map.setTerrain once its raster-dem source exists — the live style is built from mapStyle + addLayer, so it cannot ride in on the style object.packages/core/src/renderer/map-renderer.ts:178
terrain.exaggeration?number-packages/core/src/schemas/map.schema.ts:630
terrain.sourcestring-packages/core/src/schemas/map.schema.ts:626