Geocoding: {
    isEnabled: (() => boolean);
    search: ((query: string, limit?: number) => Promise<GeocodingResult[]>);
    selectResult: ((result: GeocodingResult) => void);
    destroy: (() => void);
} = ...

Public Geocoding namespace. Available as GeoLeaf.Geocoding after boot.

Type declaration

  • isEnabled: (() => boolean)

    Returns true when geocodingConfig.enabled is set in the active profile.

      • (): boolean
      • Returns boolean

  • search: ((query: string, limit?: number) => Promise<GeocodingResult[]>)

    Programmatically performs an address search. Does not require the UI control to be visible.

      • (query, limit?): Promise<GeocodingResult[]>
      • Parameters

        • query: string

          Address or place name to search (e.g. "Paris", "10 rue de Rivoli").

        • Optionallimit: number

          Maximum number of results to return. Default 5.

        Returns Promise<GeocodingResult[]>

        Promise resolving to an array of GeocodingResult.

  • selectResult: ((result: GeocodingResult) => void)

    Programmatically selects a geocoding result. Flies the map to the result location and dispatches geoleaf:geocoding:result.

      • (result): void
      • Parameters

        • result: GeocodingResult

          A GeocodingResult obtained from .search().

        Returns void

  • destroy: (() => void)

    Unmounts the geocoding control and releases all DOM listeners.

      • (): void
      • Returns void