Google Map Direction API返回零结果Swift [英] Google Map Direction API Return Zero Results Swift
问题描述
我的应用使用Google Maps Direction API在用户任意两个位置(原点-方向位置)之间绘制路线,并将其固定.
My App using Google Maps Direction API to draw route between any two positions (origin - direction positions)user pin it.
我这样使用API:
I used the API like this way:
The problem is sometimes the response return Zero Results, like this :
{
"geocoded_waypoints": [
{},
{}
],
"routes": [],
"status": "ZERO_RESULTS"
}
我搜索了很多,但没有有用的结果.
I searched a lot but no useful results.
有人遇到这个问题吗?
这个问题可能是因为我使用了免费的API吗?
Could this problem be because I used the free API?
感谢您的帮助.
谢谢.
推荐答案
如果没有路径,则返回相同的路径.
If there will be no path then it returns the same.
查看此链接:路径信息
希望这会有所帮助!
更新:
尝试将经纬度隐藏到地址中并将其传递到URL上,它将解决此问题. CLGeocoder
可能会帮助您执行相同的操作.
Try to covert latitude-longitude into address and pass it over the URL and it will solve the issue.
CLGeocoder
might help you to do the same.
这篇关于Google Map Direction API返回零结果Swift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!