resolveMapBlock
resolveMapBlock(
mapBlock,globalConfig?):object
Defined in: packages/core/src/utils/config-resolver.ts:163
Resolves a complete MapBlock by applying global defaults to its config.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
mapBlock | {[key: string]: any; } | The map block with potentially incomplete config |
globalConfig? | { dataFetching?: { defaultStrategy: "runtime" | "build" | "hybrid"; retryAttempts: number; timeout: number; }; defaultCenter?: [number, number]; defaultMapStyle?: string; defaultZoom?: number; description?: string; theme: "light" | "dark"; title?: string; } | Global configuration with defaults |
globalConfig.dataFetching? | { defaultStrategy: "runtime" | "build" | "hybrid"; retryAttempts: number; timeout: number; } | - |
globalConfig.dataFetching.defaultStrategy? | "runtime" | "build" | "hybrid" | - |
globalConfig.dataFetching.retryAttempts? | number | - |
globalConfig.dataFetching.timeout? | number | - |
globalConfig.defaultCenter? | [number, number] | - |
globalConfig.defaultMapStyle? | string | - |
globalConfig.defaultZoom? | number | - |
globalConfig.description? | string | - |
globalConfig.theme? | "light" | "dark" | - |
globalConfig.title? | string | - |
Returns
Section titled “Returns”object
Resolved map block with complete configuration
Throws
Section titled “Throws”If required fields are missing after resolution
Remarks
Section titled “Remarks”This function resolves the config property of a MapBlock while preserving
all other block properties (layers, controls, legend, etc.).
Example
Section titled “Example”const mapBlock = { type: 'map', id: 'my-map', config: { center: [0, 0], zoom: 5 }, layers: [...]};
const resolved = resolveMapBlock(mapBlock, { defaultMapStyle: 'https://example.com/style.json'});// resolved.config.mapStyle === 'https://example.com/style.json'