Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个以 XML 显示的谷歌地图方向链接:
http://maps.googleapis.com/maps/api/directions/xml?origin=111%20Davisville%20Avenue,Toronto,ON&destination=469%20King%20Street%20West,%20Toronto,%20ON&sensor=false&dirflg=r
尽管它的末尾有方向标志 dirflg=r 以切换到公共交通方向,但它仍然显示行车路线。有什么解决办法吗?
提前致谢。我四处寻找,但找不到任何能准确回答这个问题的东西。
您无法获得直接的网络提要,但您可以获得 json 文件。
在您的网址末尾使用 output=json 属性/值。
例如:https ://maps.google.com/?saddr=546+6th+Avenue,+New+York,+NY+10011+(Sixth+Avenue,+New+York)&daddr=W+103rd+St,+纽约+纽约,+纽约+&dirflg=r&output=json