2012-01-09 15 views
2

的地址URL:如何在源地圖和目的地緯度點之間傳遞路標,並且在Google地圖中路徑的長度以kml爲長度?

http://maps.googleapis.com/maps/api/directions/json?origin=Chicago,IL&destination=Los+Angeles,CA&waypoints=Joplin,MO|Oklahoma+City,OK&sensor=false 
在這個網址betwn源和目標

我們可以通過航點 但如何我可以通過航點爲KML網址

http://maps.google.com/maps?f=d&hl=en&saddr=9.036597,77.536&daddr=8.919942,77.669208&ie=UTF8&0&om=0&output=kml 

我已經試過這樣

http://maps.google.com/maps?f=d&hl=en&saddr=9.157283,77.544239&daddr=9.035239,77.784564&waypoints=9.036597,77.536|8.919942,77.669208&sensor=false&ie=UTF8&0&om=0&output=kml 

但它沒有工作,所以我怎麼能通過航點多個經緯度之間源和目的地?

+0

這篇文章可以幫助你解決你的問題。 [http://stackoverflow.com/questions/11745314/why-retrieving-google-directions-for-android-using-kml-data-is-not-working-anymo/11745316#11745316][1] [1]:http://stackoverflow.com/questions/11745314/why-retrieving-google-directions-for-android-using-kml-data-is-not-working-anymo/11745316# 11745316 – 2012-10-12 14:10:16

+0

@ girishce26你解決了這個問題嗎? – Noundla 2013-07-12 08:31:34

回答

0

沒有記錄的方式來做到這一點。 maps.google.com上的KML接口並不是真正的「API」,如具有正式文檔和規範的Directions API ......它只是針對簡單請求的常用服務。

最好的辦法是使用指導服務中的JSON/XML並將其轉換爲KML(如果您無法直接使用它)。

相關問題