2015-09-09 79 views
-1

我正在嘗試使用靜態谷歌地圖API創建谷歌地圖。我想走路和駕駛靜態地圖。我如何生成步行或駕駛靜態谷歌地圖

婁是我使用的路徑: http://maps.google.com/maps/api/staticmap?maptype=roadmap&zoom=14&size=400x250&markers=color:green|label:A|30.7261629,76.7596221&markers=color:red|label:B|30.7226447,76.7681678&path=color:0xff0000ff|weight:3|30.7261629,76.7596221|30.7226447,76.7681678&sensor=false

+1

你已經嘗試什麼,你可以爲你提供嘗試的代碼? – Falaque

+0

我想通過以下路徑顯示地圖:http://maps.google.com/maps/api/staticmap?maptype=roadmap&zoom=14&size=400x250&markers=color:green|label:A|30.7261629,76.7596221&markers = color:red | label | B | 30.7226447,76.7681678&path = color:0xff0000ff | weight:3 | 30.7261629,76.7596221 | 30.7226447,76.7681678&sensor = false – user2940248

+0

您可以修改此路徑,使其可以生成帶駕駛的地圖從A到B的路線? – user2940248

回答

0

靜態地圖的API支持僅標記不方向。

如果你想使用靜態地圖的方向,你需要使用方向API。

怎麼做:how to create a static api map with directions

基本上就是向上投票的回答是說:

1. Use direction api to get encoded path. 
2. In static map use this encoded path. 
+0

謝謝,現在我能夠生成靜態駕駛地圖網址。 – user2940248

+0

但是,當我在tcpdf中使用這個作爲src的時,它顯示錯誤的路徑。 – user2940248

+0

可能是由於enc:中的字符 – user2940248