简体   繁体   English

如何使用此处的地图API从搜索位置获取多个地址列表(地理编码)

[英]How can I get the multiple address list(Geocoding) from search a location using here maps api

I want to get multiple address when I search a location. 搜索位置时,我想获得多个地址。 It will be like "here maps" app. 就像“这里地图”的应用程序。 I am using the here maps api. 我正在使用here maps api。 I only get one or two location when I use the this api 使用此api时,我只会得到一两个位置

" http://geocoder.cit.api.here.com/6.2/geocode.xml?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&mode=retrieveAddresses&gen=7&searchtext=dhaka " http://geocoder.cit.api.here.com/6.2/geocode.xml?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&mode=retrieveAddresses&gen=7&searchtext=dhaka

But I need more results like 10 or 20 that will be defined by me. 但是我需要更多由我定义的结果,例如10或20。 I try a lot but not get any solution. 我尝试了很多但没有任何解决方案。 like "maxresults=10" parameter. 例如“ maxresults = 10”参数。

NB: I want to use only one api call and must use the here maps api and also for windows phone 8 app. 注意:我只想使用一个api调用,并且必须使用here maps api以及Windows Phone 8应用程序。

Thanks 谢谢

To obtain the location of an address, you need to make a geocoding request: 要获取地址的位置,您需要发出地理编码请求:

http://geocoder.cit.api.here.com/6.2/geocode.xml?app_id= YOUR_APPID &app_code= YOUR_APP_CODE &mode=retrieveAreas&gen=7&searchtext= TEXT &locationattributes=none http://geocoder.cit.api.here.com/6.2/geocode.xml?app_id= YOUR_APPID &app_code = YOUR_APP_CODE &mode = retrieveAreas&gen = 7&searchtext = TEXT &locationattributes = none

The important parameters are as follows: 重要参数如下:

  • mode=retrieveAreas - this will return areas not addresses mode=retrieveAreas这将返回区域而不是地址
  • searchtext=? - this is your text request -这是您的文字要求
  • locationattributes=none - this reduces the size of the response to only return a lat/lng locationattributes=none这会减小响应的大小,只返回lat / lng

Thereafter you need to make a reverse geocoding request to find cities nearby: 之后,您需要进行反向地理编码请求以查找附近的城市:

http://reverse.geocoder.cit.api.here.com/6.2/reversegeocode.xml?level=city&minresults=10&prox=23.713,90.399,1000&mode=retrieveAreas&gen=8&app_id= YOUR_APPID &app_code= YOUR_APP_CODE http://reverse.geocoder.cit.api.here.com/6.2/reversegeocode.xml?level=city&minresults=10&prox=23.713,90.399,1000&mode=retrieveAreas&gen=8&app_id= YOUR_APPID &app_code = YOUR_APP_CODE

The important parameters here are as follows: 这里的重要参数如下:

  • mode=retrieveAreas - this will return areas not addresses mode=retrieveAreas这将返回区域而不是地址
  • level=? - this reduces the responses to a given level - in this case cities - see the API reference for details -这会将响应降低到给定的水平-在这种情况下为城市-有关详细信息,请参阅API参考
  • minresults=? - this ensures that ten city level entities are returned. -这样可以确保返回十个城市级别的实体。

Maybe you are looking for more like suggestions ? 也许您在寻找更喜欢的建议? Places API from HERE might be more helpful in that case, but usually an "at" attribute is required for that 在这种情况下,HERE的Places API可能会更有用,但是通常需要“ at”属性

http://places.demo.api.here.com/places/v1/suggest?at=23.6364%2C91.0803&q=Dhaka&app_id=demo_qCG24t50dHOwrLQ&app_code=NYKC67ShPhQwqaydGIW4yg http://places.demo.api.here.com/places/v1/suggest?at=23.6364%2C91.0803&q=Dhaka&app_id=demo_qCG24t50dHOwrLQ&app_code=NYKC67ShPhQwqaydGIW4yg

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何使用/调用我的搜索框中的地图 API 使用 javascript 代码来显示城市列表 - How can i use/ call maps api in my search box using javascript code to show list of cities 如何从位置(地址)字符串转换为Yahoo Maps API中的YGeoPoint? - How do I convert from a location (address) String to a YGeoPoint in Yahoo Maps API? HERE 地理编码 API - 如何从加拿大位置获取 6 个字符的邮政编码 - HERE Geocoding API - How to get 6 character postal code from Canada locations 地理编码地址输入Google Maps API - Geocoding Address input Google Maps API 如何从Google Maps URL获取位置的地址? - How to get the address of a location from a google maps URL? 如何获取当前位置(经度和纬度)并将其发送到反向地理编码API? - How to get current location (latitude and longitude) and send it to an reverse geocoding API? 如何使用带有Qt的HERE API显示地图? - How to display maps using HERE api with Qt? 如何防止 HERE MAPS / [Here-API] 过期? - How do I keep the HERE MAPS / [Here-API] from expiring? HERE 地理编码 API 和 PowerBI - HERE Geocoding API and PowerBI HERE 地图 API:如何搜索 100 多个地点 - HERE Maps API: How to search for more than 100 places
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM