This class will help you transform any input into a search bar for geocoding.

const jawgPlaces = new JawgPlaces.Input({
accessToken: 'Access-Token',
input: '#my-input',
})

Hierarchy

  • AbstractPlaces
    • Input

Constructors

Methods

  • Close the result list.

    Returns void

  • Destroy all created DOM elements and listeners. This could be useful when you recreate a JawgPlace instance for the same input.

    Returns void

  • Returns string

    The value of the <input>.

  • Search a random text, lat/lon or GID using Jawg Places.

    All features are points with properties, more details on our documentation.

    See JawgPlacesOptions.reverse for lat/lon search and JawgPlacesOptions.place for GID search.

    Parameters

    • text: string

      The text to search using Jawg Places

    Returns Promise<FeatureCollection>

    A promise with the feature collection received from Jawg Places

  • Parameters

    • value: string

      The new value for the <input>.

    Returns void

  • Open the result list with the error message. This will trigger JawgPlacesOptions.onError.

    Parameters

    • error: any

      The error to show, can be a string or an object.

    Returns void

  • Open the result list with elements from the FeatureCollection. We use the properties.label field of each features. This will trigger JawgPlacesOptions.onFeatures callback. Use it if you want to display specific results or add new elements.

    Parameters

    Returns void

  • Submit the search using the value of the <input>. This will trigger JawgPlacesOptions.onFeatures.

    Returns void