Appearance
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
readonlyurl:Resource
The Resource used to access the Pelias endpoint.
credit
readonlycredit: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?
The type of geocode to perform.
返回
Promise<Result[]>
构造函数
构造函数
new PeliasGeocoderService(
url:string|Resource):PeliasGeocoderService
参数
url
string | Resource
返回
PeliasGeocoderService
