如何解决此问题。
这是我得到的答案:
{"geocoded_waypoints" : [ {}, {} ],
"routes" : [],
"status" : "ZERO_RESULTS"}
可以帮我理解错误吗?我的请求是否有错误,或者我是否绕过google maps api方向的限制?
答案 0 :(得分:1)
您是否在目的地上翻转纬度和经度? 通过此链接,它可以工作(我将它们翻回):https://maps.googleapis.com/maps/api/directions/json?origin=17.3916642,78.4346606&destination=17.3813395082035,78.4382585808635&%20waypoints=optimize:true|17.3916642,78.4346606|17.3865225743848,78.4374928101897|17.3813395082035,78.4382585808635&sensor=false
修改强>
在航路点前面有一个%20
(urlencoded空间),移除后你得到:
https://maps.googleapis.com/maps/api/directions/json?origin=17.3916642,78.4346606&destination=17.3813395082035,78.4382585808635&waypoints=optimize:true%7C17.3916642,78.4346606%7C17.3865225743848,78.4374928101897%7C17.3813395082035,78.4382585808635&sensor=false