PeliasGeocoderService

new Ditap.PeliasGeocoderService(url)

Provides geocoding via a Pelias server.
Name Type Description
url Resource | string The endpoint to the Pelias server.
Example:
// Configure a Viewer to use the Pelias server hosted by https://geocode.earth/
const viewer = new Ditap.Viewer('ditapContainer', {
  geocoder: new Ditap.PeliasGeocoderService(new Ditap.Resource({
    url: 'https://api.geocode.earth/v1/',
      queryParameters: {
        api_key: '<Your geocode.earth API key>'
    }
  }))
});

Members

readonly credit : Credit|undefined

Gets the credit to display after a geocode is performed. Typically this is used to credit the geocoder service.

readonly url : Resource

The Resource used to access the Pelias endpoint.

Methods

geocode(query, type)Promise.<Array.<GeocoderService.Result>>

Name Type Default Description
query string The query to be sent to the geocoder service
type GeocodeType GeocodeType.SEARCH optional The type of geocode to perform.
Returns: