UNPKG

@ecogis/maps-style-switcher

Version:

Ecogis Style Switcher

36 lines (35 loc) 1.1 kB
import { IControl, Map as MapboxMap } from "mapbox-gl"; export type EcoGisStyleDefinition = { title: string; uri: string; icon?: string; useIconOnly?: boolean; }; export type EcoGisStyleSwitcherOptions = { defaultStyle?: string; eventListeners?: EcoGisStyleSwitcherEvents; }; type EcoGisStyleSwitcherEvents = { onOpen?: (event: MouseEvent) => boolean; onSelect?: (event: MouseEvent) => boolean; onChange?: (event: MouseEvent, style: string) => boolean; }; export declare class EcoGisStyleSwitcherControl implements IControl { private static readonly DEFAULT_STYLE; private static readonly DEFAULT_STYLES; private controlContainer; private events?; private map?; private mapStyleContainer; private styleButton; private styles; private defaultStyle; constructor(styles?: EcoGisStyleDefinition[], options?: EcoGisStyleSwitcherOptions | string); getDefaultPosition(): string; onAdd(map: MapboxMap): HTMLElement; onRemove(): void; private closeModal; private openModal; private onDocumentClick; } export {};