通过 OpenCage 服务器。
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
url |
Resource | string | OpenCage 服务器的端点。 | ||||||
apiKey |
string | OpenCage API 密钥。 | ||||||
params |
object |
optional
具有以下属性的对象(参见 https://opencagedata.com/api#forward-opt):
|
||||||
options.add_request |
number | optional 当设置为 1 时,各种请求参数将添加到响应中,以便于调试。 | ||||||
options.bounds |
string | optional 为地理编码器提供查询所在区域的提示。 | ||||||
options.countrycode |
string | optional 将结果限制为指定的一个或多个国家/地区(如 ISO 3166-1 Alpha 2 标准所定义)。 | ||||||
options.jsonp |
string | optional 用函数名称包装返回的 JSON。 | ||||||
options.language |
string | optional IETF 格式的语言代码。 | ||||||
options.limit |
number | optional 我们应该返回的最大结果数。 | ||||||
options.min_confidence |
number | optional 1-10 之间的整数。只会返回至少具有此置信度的结果。 | ||||||
options.no_annotations |
number | optional 设置为 1 时,结果将不包含注释。 | ||||||
options.no_dedupe |
number | optional 设置为 1 时,不会对结果进行重复数据删除。 | ||||||
options.no_record |
number | optional 设置为 1 时,不记录查询内容。 | ||||||
options.pretty |
number | optional 当设置为 1 时,结果将打印为 'pretty' 以便于阅读。用于调试。 | ||||||
options.proximity |
string | optional 为地理编码器提供提示,使结果偏向于更靠近指定位置的结果(例如:41.40139,2.12870)。 |
Example:
// Configure a Viewer to use the OpenCage Geocoder
const viewer = new Cesium.Viewer('cesiumContainer', {
geocoder: new Cesium.OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '<API key>')
});
Members
readonly credit : Credit|undefined
获取要在执行地理代码后显示的信用项。这通常用于信贷
地理编码器服务。
传递给 OpenCage 的可选参数,用于自定义地理编码
readonly url : Resource
用于访问 OpenCage 终端节点的 Resource。
Methods
geocode(query) → Promise.<Array.<GeocoderService.Result>>
Name | Type | Description |
---|---|---|
query |
string | 要发送到地理编码器服务的查询 |