Skip to content

ControlsManager

Defined in: packages/core/src/renderer/controls-manager.ts:26

Manages MapLibre map controls (navigation, geolocate, scale, etc.)

new ControlsManager(map, options?): ControlsManager

Defined in: packages/core/src/renderer/controls-manager.ts:40

ParameterTypeDescription
mapmaplibregl.Map-
options{ beforeAttribution?: () => void; terrain?: { exaggeration?: number; source: string; }; }-
options.beforeAttribution?() => voidcalled 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.sourcestring-

ControlsManager

addControls(config): void

Defined in: packages/core/src/renderer/controls-manager.ts:53

Add controls to the map based on configuration

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


removeAllControls(): void

Defined in: packages/core/src/renderer/controls-manager.ts:157

Remove all controls from the map

void