Google 地理编码 API 未返回正确的纬度、经度地址作为谷歌地图中的返回值
我面临着谷歌地理编码 API 的一个奇怪的问题。 我的要求是,每当用户输入任何地址时,所有相应的位置都应该显示在我的地图视图中(我正在使用 MKMap 视图),就像在谷歌地图中发生的那样。 所以我所做的是使用谷歌地理编码 API,它返回相应位置的纬度和经度列表。
但对于某些位置,例如:- 驯鹿咖啡,教堂希尔(当我在谷歌地图中搜索此位置时,我得到了许多显示该地址的注释,但当我在地理编码中输入此地址时,我什么也没得到。
请求网址:-http://maps.googleapis.com/maps/api/geocode/xml?address=caribou%20coffee,%20chapel%20hil%20&sensor=false
回复:-
-<GeocodeResponse>
<status>ZERO_RESULTS</status>
</GeocodeResponse>
任何人都可以告诉我为什么我没有得到与该地址对应的任何纬度和经度,就像谷歌地图中显示的那样,或者有其他方法可以整合我的应用程序中的谷歌地图(mk 地图视图)。
因为我被困在这里。
帮助我,
请
I am facing a strange problem of google geocoding API.
My requirement is whenever a user types any address all the corresponding locations should show in my map View(I am using MKMap View) like it happens in google maps.
So what I do is I use google geocoding API that returns me a list of latitudes and longitudes for that corresponding location.
But for some location eg:- caribou coffee, chapel hil (When I search for this location in google maps,I get a number of annotations showing that address but when I type this address in geocoding I didnt get nothing.
request url:-http://maps.googleapis.com/maps/api/geocode/xml?address=caribou%20coffee,%20chapel%20hil%20&sensor=false
response:-
-<GeocodeResponse>
<status>ZERO_RESULTS</status>
</GeocodeResponse>
Can any body tell me why I am not getting any latitude and longitude that correspnds to this address like it shown in google maps or there is some other way so that I can integrate the behaviour of google maps in my applications(mk map view).
Please help me as I am stuck here.
Any suggestions will be highly appreciated.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请注意,地址不完整 - 例如,搜索 caribou Coffee, Chapel Hill, NC 确实会产生结果。
我认为地理编码 API 无法对此类地址执行任何操作,并且您可能需要使用一些额外的 API - 例如 Places API (https://code.google.com/apis/maps/documentation/places/ ),其中可以返回诸如“coffee”之类的查询的一些结果。但是,您需要提供用户的位置作为基础。
Note that the address is incomplete - e.g. searching for caribou coffee, chapel hill, nc does produce a result.
I would think that Geocoding API can't do anything with such addresses, and you may need to use some extra API - e.g. Places API (https://code.google.com/apis/maps/documentation/places/ ), which can return some results for queries like "coffee". You'd need to supply the user's location to use as a base, however.