Class GeocodingControl

Hierarchy

  • MapLibreBasedGeocodingControl
    • GeocodingControl

Implements

  • IControl
Index

Constructors

Methods

  • Returns a true if this instance of Evented or any forwardeed instances of Evented have a listener for the specified type.

    Parameters

    • type:
          | "select"
          | "pick"
          | "response"
          | "featureslisted"
          | "featuresmarked"
          | "optionsvisibilitychange"
          | "querychange"
          | "reversetoggle"

      The event type

    Returns boolean

    true if there is at least one registered listener for specified event type, false otherwise

  • Removes a previously registered event listener.

    Type Parameters

    • T extends
          | "select"
          | "pick"
          | "response"
          | "featureslisted"
          | "featuresmarked"
          | "optionsvisibilitychange"
          | "querychange"
          | "reversetoggle"

    Parameters

    • type: T

      The event type to remove listeners for.

    • listener: (
          ev: {
              featureslisted: FeaturesListedEvent;
              featuresmarked: FeaturesMarkedEvent;
              optionsvisibilitychange: OptionsVisibilityChangeEvent;
              pick: PickEvent;
              querychange: QueryChangeEvent;
              response: ResponseEvent;
              reversetoggle: ReverseToggleEvent;
              select: SelectEvent;
          }[T],
      ) => void

      The listener function to remove.

    Returns this

  • Adds a listener to a specified event type.

    Type Parameters

    • T extends
          | "select"
          | "pick"
          | "response"
          | "featureslisted"
          | "featuresmarked"
          | "optionsvisibilitychange"
          | "querychange"
          | "reversetoggle"

    Parameters

    • type: T

      The event type to add a listen for.

    • listener: (
          ev: {
              featureslisted: FeaturesListedEvent;
              featuresmarked: FeaturesMarkedEvent;
              optionsvisibilitychange: OptionsVisibilityChangeEvent;
              pick: PickEvent;
              querychange: QueryChangeEvent;
              response: ResponseEvent;
              reversetoggle: ReverseToggleEvent;
              select: SelectEvent;
          }[T],
      ) => void

      The function to be called when the event is fired. The listener function is called with the data object passed to fire, extended with target and type properties.

    Returns Subscription

  • Register a control on the map and give it a chance to register event listeners and resources. This method is called by Map#addControl internally.

    Parameters

    • map: Map

      the Map this control will be added to

    Returns HTMLElement

    The control's container element. This should be created by the control and returned by onAdd without being attached to the DOM: the map will insert the control's element into the DOM as necessary.

  • Adds a listener that will be called only once to a specified event type.

    The listener will be called first time the event fires after the listener is registered.

    Type Parameters

    • T extends
          | "select"
          | "pick"
          | "response"
          | "featureslisted"
          | "featuresmarked"
          | "optionsvisibilitychange"
          | "querychange"
          | "reversetoggle"

    Parameters

    • type: T

      The event type to listen for.

    • Optionallistener: (
          ev: {
              featureslisted: FeaturesListedEvent;
              featuresmarked: FeaturesMarkedEvent;
              optionsvisibilitychange: OptionsVisibilityChangeEvent;
              pick: PickEvent;
              querychange: QueryChangeEvent;
              response: ResponseEvent;
              reversetoggle: ReverseToggleEvent;
              select: SelectEvent;
          }[T],
      ) => void

      The function to be called when the event is fired the first time.

    Returns Promise<unknown> | GeocodingControl

    this or a promise if a listener is not provided

  • Update the control options.

    Parameters

    • options: MapLibreBaseControlOptions

      options to update

    Returns void

  • Set the content of search input box.

    Parameters

    • value: string

      text to set

    • submit: boolean = true

      perform the search

    Returns void

  • Set reverse geocoding mode.

    Parameters

    • reverseActive: boolean

      reverse geocoding active

    Returns void

Was this helpful?

SDK JS
Modules
Reference
classes
GeocodingControl