1

可能重复:
谷歌地图输出=公里损坏?

我想通过使用坐标系来使用路线系统:

https://maps.google.com/maps?saddr=39.951217,32.835406&daddr=39.908288,32.776308&sll=39.951217,32.835406&dirflg=w&hl=en&ie=UTF8&z=14&output=kml

但谷歌已在 7 月 27 日进行了更新,我想我必须使用这种格式:

http://maps.googleapis.com/maps/api/directions/json?origin=Boston,MA&destination=Concord,MA&waypoints=Charlestown,MA|列克星敦,MA&sensor=false

有没有办法使用旧系统,因为我不认为通过给出地址我会得到精确的结果?

4

1 回答 1

1

这种通过解析 KML 文件从 Google 中提取 Google 路线的方式自 2012 年 7 月 27 日起不再可用(因为 Google 改变了检索 Google 路线的结构,现在您只能通过 JSON 或 XML 来获取),是时候将您的代码迁移到 JSON 而不是 KML。

请注意,起点和终点参数可以是纬度和经度,而无需使用航路点。

在我自己的问题中查看答案。

于 2012-08-07T13:07:25.680 回答