English中文

PeliasGeocoderService

new Cesium.PeliasGeocoderService(url)

通过提供地理编码 Provides geocoding via a Pelias server.
名称 Name 类型 Type 说明 Description
url Resource | string Pelias 服务器的端点。 The endpoint to the Pelias server.
示例: 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

获取执行地理编码后要显示的信用。通常,这用于记入地理编码器服务。 Gets the credit to display after a geocode is performed. Typically this is used to credit the geocoder service.
用于访问 Pelias 端点的资源。 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:
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.