here-api - HERE Maps matchLevel 参数不起作用
问题描述
我正在尝试仅过滤 HERE Map 的自动完成 API 中的城市。我在他们的文档上读到有matchLevel
参数......
但是,如果我包含它,什么都不会改变。
这是我的电话:
http://autocomplete.geocoder.api.here.com/6.2/suggest.json?app_id=MY_APP_ID&app_code=MY_APP_CODE&matchLevel=city&query=New York
我仍然收到非城市类型的回复。
{
"suggestions": [
{
"label": "United States, New York",
"language": "en",
"countryCode": "USA",
"locationId": "NT_rNsDLtnazM.kjVC-K6YWOA",
"address": {
"country": "United States",
"state": "New York"
},
"matchLevel": "state"
},
{
"label": "United States, New York, New York, New York",
"language": "en",
"countryCode": "USA",
"locationId": "NT_YpQcXqbaOb.I4m5EW8BHEC",
"address": {
"country": "United States",
"state": "New York",
"county": "New York",
"city": "New York",
"postalCode": "10007"
},
"matchLevel": "city"
},
{
"label": "United States, New York, New York",
"language": "en",
"countryCode": "USA",
"locationId": "NT_ABhedB4xGEL83YY5az47iD",
"address": {
"country": "United States",
"state": "New York",
"county": "New York"
},
"matchLevel": "county"
},
...
任何帮助表示赞赏。
解决方案
matchLevel 是响应字段,而不是查询参数。
使用答案的后处理,如 array.filter() 仅保留与“城市”匹配的答案元素
推荐阅读
- node.js - Azure Devops VSTS 使用不同版本的 Node 构建代理
- python - 绘制 pandas 列的直方图
- json - 如果我已经从 API 调用 (flutter/dart) 进行了 Json 反序列化,如何从 Firebase Cloud Firestore 反序列化数组
- maven - Azure 工件提要仅显示 pom 文件,即使 jar 打包
- html - 在导航栏中移动链接位置
- fastlane - Fastlane:如何将lane_context传递到另一个车道
- c - 如何从 libcouchbase 编译示例代码
- python-3.x - 谷歌云功能在流数据到大查询时达到 10MB 速率限制,而不管使用块?
- php - PHP pdo 仅在查询被硬编码时获得结果
- angular - 动画时垫步内容消失 - mat-horizontal-stepper