ControlsManager
Defined in: packages/core/src/renderer/controls-manager.ts:26
Manages MapLibre map controls (navigation, geolocate, scale, etc.)
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ControlsManager(
map,options?):ControlsManager
Defined in: packages/core/src/renderer/controls-manager.ts:40
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
map | maplibregl.Map | - |
options | { beforeAttribution?: () => void; terrain?: { exaggeration?: number; source: string; }; } | - |
options.beforeAttribution? | () => void | called immediately before an attribution control is added; the renderer passes its attribution guard’s scrub, because the control renders source attributions synchronously in onAdd. |
options.terrain? | { exaggeration?: number; source: string; } | the document’s terrain: (what controls.terrain toggles). |
options.terrain.exaggeration? | number | - |
options.terrain.source | string | - |
Returns
Section titled “Returns”ControlsManager
Methods
Section titled “Methods”addControls()
Section titled “addControls()”addControls(
config):void
Defined in: packages/core/src/renderer/controls-manager.ts:53
Add controls to the map based on configuration
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
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"; } |
Returns
Section titled “Returns”void
removeAllControls()
Section titled “removeAllControls()”removeAllControls():
void
Defined in: packages/core/src/renderer/controls-manager.ts:157
Remove all controls from the map
Returns
Section titled “Returns”void