createSimpleMapConfig
createSimpleMapConfig(
options,globalConfig?):objectOutputType
Defined in: packages/core/src/utils/config-resolver.ts:233
Creates a map configuration with sensible defaults for simple use cases.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { bearing?: number; center: [number, number]; interactive?: boolean; mapStyle?: string; pitch?: number; zoom?: number; } | Minimal configuration options |
options.bearing? | number | - |
options.center? | [number, number] | - |
options.interactive? | boolean | - |
options.mapStyle? | string | - |
options.pitch? | number | - |
options.zoom? | number | - |
globalConfig? | { dataFetching?: { defaultStrategy: "runtime" | "build" | "hybrid"; retryAttempts: number; timeout: number; }; defaultCenter?: [number, number]; defaultMapStyle?: string; defaultZoom?: number; description?: string; theme: "light" | "dark"; title?: string; } | Optional global configuration for 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”objectOutputType
Complete map configuration
Remarks
Section titled “Remarks”This is a convenience function for creating simple map configurations without needing to specify every field. Useful for collection items and content-focused applications.
Default Values:
zoom: 12pitch: 0bearing: 0interactive: true
Examples
Section titled “Examples”Simple Location Map
const config = createSimpleMapConfig({ center: [-74.006, 40.7128], mapStyle: 'https://example.com/style.json'});With Global Style
const config = createSimpleMapConfig( { center: [-74.006, 40.7128] }, { defaultMapStyle: 'https://example.com/style.json' });