OpenCageGeocoderService

external class OpenCageGeocoderService(val url: Resource, apiKey: String, params: ERROR CLASS: Symbol not found for JsAny?? = definedExternally)(source)

Provides geocoding via a OpenCage server.

// Configure a Viewer to use the OpenCage Geocoder
const viewer = new Viewer('cesiumContainer', {
geocoder: new OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '<API key>')
});

Parameters

apiKey

The OpenCage API Key.

params

An object with the following properties (See https://opencagedata.com/api#forward-opt):

params.abbrv

When set to 1 we attempt to abbreviate and shorten the formatted string we return.

See also

Constructors

Link copied to clipboard
constructor(url: Resource, apiKey: String, params: ERROR CLASS: Symbol not found for JsAny?? = definedExternally)
constructor(url: String, apiKey: String, params: ERROR CLASS: Symbol not found for JsAny?? = definedExternally)

Properties

Link copied to clipboard

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

Link copied to clipboard
val params: ERROR CLASS: Symbol not found for JsAny

Optional params passed to OpenCage in order to customize geocoding

Link copied to clipboard

The endpoint to the OpenCage server.

Functions

Link copied to clipboard
suspend fun geocode(query: String): ERROR CLASS: Symbol not found for ReadonlyArray<cesium/engine/GeocoderService.Result>
Link copied to clipboard
fun geocodeAsync(query: String): ERROR CLASS: Symbol not found for Promise<ERROR CLASS: Symbol not found for ReadonlyArray<cesium/engine/GeocoderService.Result>>