PeliasGeocoderService

new Cesium.PeliasGeocoderService(url)

通过Pelias服务器提供地理编码。
Name Type Description
url Resource | String Pelias服务器的终结点。
Example:
// Configure a Viewer to use the Pelias server hosted by https://geocode.earth/
var 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

用于访问Pelias终结点的资源。

Methods

geocode(query, type)Promise.<Array.<GeocoderService.Result>>

Name Type Default Description
query String 要发送到geocoder服务的查询
type GeocodeType GeocodeType.SEARCH optional 要执行的地理代码类型。
Returns: