@maptiler/geocoding-control
Version:
The Javascript & TypeScript Map Control component for MapTiler Geocoding service. Easy to be integrated into any JavaScript mapping application.
117 lines (116 loc) • 4.5 kB
TypeScript
import { LitElement } from 'lit';
import { BBox, EnableReverse, Feature, ProximityRule, ShowPlaceType, TypeRule, Worldview } from '../types';
import { MaptilerGeocoderEventName, MaptilerGeocoderEventNameMap } from './geocoder-events';
import { MaptilerGeocoderOptions } from './geocoder-options';
export declare class MaptilerGeocoderElement extends LitElement implements MaptilerGeocoderOptions {
#private;
/** @internal */
static styles: import('lit').CSSResult;
adjustUrl?: (url: URL) => void;
apiKey?: string;
apiUrl?: string;
bbox?: BBox;
clearButtonTitle?: string;
clearListOnPick: boolean;
clearOnBlur: boolean;
collapsed: boolean;
country?: string | string[];
debounceSearch?: number;
enableReverse?: EnableReverse;
errorMessage?: string;
excludeTypes: boolean;
exhaustiveReverseGeocoding: boolean;
fetchFullGeometryOnPick: boolean;
fetchParameters?: RequestInit;
filter?: (feature: Feature) => boolean;
fuzzyMatch?: boolean | undefined;
iconsBaseUrl?: string;
keepListOpen: boolean;
language?: string | string[] | null;
limit?: number;
minLength?: number;
noResultsMessage?: string;
openListOnTop: boolean;
placeholder?: string;
proximity?: ProximityRule[] | null;
reverseActive: boolean;
reverseButtonTitle?: string;
reverseGeocodingExcludeTypes?: boolean | undefined;
reverseGeocodingLimit?: number;
reverseGeocodingTypes?: TypeRule[];
selectFirst?: boolean | undefined;
showPlaceType?: ShowPlaceType;
showResultsWhileTyping?: boolean | undefined;
types?: TypeRule[];
worldview?: Worldview;
/** Reference to the input element the user can type a query into */
private input;
/** Value to search via geocoding */
private searchValue;
/** Features found via geocoding */
private listFeatures?;
/** Index of item currently selected from the list of found features */
private selectedItemIndex;
/** Feature that has been picked by the user */
private picked?;
/** Cached found features to be used to restore the features when loading more data for picked feature */
private cachedFeatures;
/** Effectively a cache key for cached features */
private lastSearchUrl;
/** Last error that happened in geocoding, to be shown to user */
private error;
/** AbortController instance used to potentially cancel the current geocoding request*/
private abortController?;
/** Focus state of input element */
private focused;
/** Visibility state of feature list */
private isFeatureListVisible;
/** Feature list is currently interacted with using pointer device so it should not be closed even though input lost focus */
private isFeatureListInteractedWith;
protected firstUpdated(): void;
/**
* Set the options of this instance.
*
* @param options options to set
*/
setOptions(options: Partial<MaptilerGeocoderOptions>): void;
/**
* Set the content of search input box.
*
* @param value text to set
*/
setQuery(value: string): void;
/**
* Set the content of search input box and immediately submit it.
*
* @param value text to set and submit
*/
submitQuery(value: string): void;
/**
* Clear search result list.
*/
clearList(): void;
/**
* Focus the search input box.
*
* @param options [FocusOptions](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
*/
focus(options?: FocusOptions): void;
/**
* Blur the search input box.
*/
blur(): void;
addEventListener<E extends MaptilerGeocoderEventName>(type: E, listener: (this: HTMLElement, e: MaptilerGeocoderEventNameMap[E]) => unknown, options?: boolean | AddEventListenerOptions): void;
removeEventListener<E extends MaptilerGeocoderEventName>(type: E, listener: (this: HTMLElement, e: MaptilerGeocoderEventNameMap[E]) => unknown, options?: boolean | EventListenerOptions): void;
/** @internal */
handleMapChange(centerAndZoom: [zoom: number, lon: number, lat: number] | undefined): void;
/** @internal */
handleMapClick(coordinates: [lng: number, lat: number]): void;
willUpdate(changedProperties: Map<string, unknown>): void;
render(): import('lit-html').TemplateResult<1>;
}
declare global {
interface HTMLElementTagNameMap {
"maptiler-geocoder": MaptilerGeocoderElement;
}
}