UNPKG

@maptiler/geocoding-control

Version:

The Javascript & TypeScript Map Control component for MapTiler Geocoding service. Easy to be integrated into any JavaScript mapping application.

31 lines (30 loc) 1.72 kB
import { IControl, Map as MLMap, Subscription, default as maplibregl } from 'maplibre-gl'; import { GeocodingControlBase } from './base-control'; import { MaplibreglGeocodingControlEventName, MaplibreglGeocodingControlEventNameMap } from './maplibregl-events'; import { MaplibreglGeocodingControlOptions } from './maplibregl-options'; type EventHandlingMethod<Return> = <Type extends MaplibreglGeocodingControlEventName>(type: Type, listener: (event: MaplibreglGeocodingControlEventNameMap[Type]) => void) => Return; interface EventOnceHandlingMethod<Return> { <Type extends MaplibreglGeocodingControlEventName>(type: Type, listener: (event: MaplibreglGeocodingControlEventNameMap[Type]) => void): Return; <Type extends MaplibreglGeocodingControlEventName>(type: Type, listener?: undefined): Promise<MaplibreglGeocodingControlEventNameMap[Type]>; } export declare class MaplibreglGeocodingControl extends maplibregl.Evented implements IControl, GeocodingControlBase<MaplibreglGeocodingControlOptions> { #private; constructor(options?: MaplibreglGeocodingControlOptions); /** @internal Not to be called directly */ onAdd(map: MLMap): HTMLElement; /** @internal Not to be called directly */ onRemove(): void; getOptions(): MaplibreglGeocodingControlOptions; setOptions(options: MaplibreglGeocodingControlOptions): void; setQuery(value: string): void; submitQuery(value: string): void; clearMap(): void; clearList(): void; setReverseMode(reverseActive: boolean): void; focus(options?: FocusOptions): void; blur(): void; on: EventHandlingMethod<Subscription>; off: EventHandlingMethod<this>; once: EventOnceHandlingMethod<this>; } export {};