Google Map Direction API返回零结果Swift [英] Google Map Direction API Return Zero Results Swift

查看:90
本文介绍了Google Map Direction API返回零结果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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆