Skip to content

KBE3D / KBCore / Cesium / PeliasGeocoderService

类: PeliasGeocoderService

Provides geocoding via a Pelias

server.

示例

ts
// Configure a Viewer to use the Pelias server hosted by https://geocode.earth/
const viewer = new Cesium.Viewer('cesiumContainer', {
  geocoder: new Cesium.PeliasGeocoderService(new Cesium.Resource({
    url: 'https://api.geocode.earth/v1/',
      queryParameters: {
        api_key: '<Your geocode.earth API key>'
    }
  }))
});

参数

The endpoint to the Pelias server.

属性

url

readonly url: Resource

The Resource used to access the Pelias endpoint.


credit

readonly credit: Credit | undefined

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

方法

geocode()

geocode(query: string, type?: GeocodeType): Promise<Result[]>

参数

query

string

The query to be sent to the geocoder service

type?

GeocodeType

The type of geocode to perform.

返回

Promise<Result[]>

构造函数

构造函数

new PeliasGeocoderService(url: string | Resource): PeliasGeocoderService

参数

url

string | Resource

返回

PeliasGeocoderService

KBE3D @3.0.0 Copyright © 2024-present KBE3D