通过 Pelias 服务器提供地理编码(geocoding)功能。
| Name | Type | Description |
|---|---|---|
url |
Resource | string | 指向 Pelias 服务器的端点(endpoint)。 |
Example:
// 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>'
}
}))
});
Members
readonly credit : Credit|undefined
获取在执行地理编码后要显示的版权信息(credit)。通常这用于标注地理编码服务。
readonly url : Resource
用于访问 Pelias 端点的 Resource。
Methods
geocode(query, type) → Promise.<Array.<GeocoderService.Result>>
| Name | Type | Default | Description |
|---|---|---|---|
query |
string | 要发送给地理编码服务的查询。 | |
type |
GeocodeType |
GeocodeType.SEARCH
|
optional 要执行的地理编码类型。 |
