Add Google Maps driving directions to your website添加Google Maps上的行車路線到您的網站
Posted on April 29, 2008 at 5:23 am張貼於2008年4月29日在上午05時23分
I love using Google Maps “Get Directions” feature any time I need to figure how to get from point A to B. It’s one of the best ways to get driving directions in the USA for sure.我愛使用Google Maps “指示”功能,任何時候我需要的數字,如何從A點B.它奇摩的最佳途徑之一,以獲取駕車路線,在美國是肯定的。
So what if you have a wedding website or a MySpace page and you’re throwing a big party, wouldn’t it be nice if your guests could go to your site, type in the address they will be coming from and automatically get directions to the event location!?那麼,如果您有一個婚禮類網站,或MySpace網頁,而您投擲一個大黨,不會是很好,如果您的客人可以到您的網站中,輸入地址,他們將來自和自動獲得指示活動地點! ? Not sure what I mean?不知道我的意思嗎? Type your address in the box below and you’ll get directions from your address to my house:輸入您的地址在下面的框中您將得到指示,從您的地址到我家:
Cool huh?酷吧? You can easily create this little form on any website, blog, or anywhere you can put in some HTML code!您可以輕鬆地創造了這張小小的表格,對任何網站,博客或任何你可以把在某些HTML代碼! This is also great for small business web sites as you can throw it up on your contact page and people can get directions quickly, rather than having to copy your address, open a new window, and then type in their starting address.這亦是偉大的為小型企業的網站,您可以把它在您的聯繫方式網頁和人民可以得到迅速的方向,而不是複製到您的地址,打開一個新窗口,然後輸入自己的起始地址。
So how do we go about creating this modified get directions box?因此,我們如何去創造這一修改得到的指示框嗎? Well first, we’ll need to get the correct syntax for the URL that Google uses for directions.以及首先,我們將需要獲得正確的語法為網址, Google用為方向。 Luckily, we can figure that out by getting directions between two places and then clicking on the Send link at the top right.幸運的是,我們可以數字指出,由獲得方向之間的兩地,然後點擊發送鏈接在右上角。
Here’s what you end up getting:以下是您最終獲得:
Notice the link in the email message!通知的電子郵件中的鏈接的訊息! That’s what we need!這正是我們最需要的! Here’s what the entire link looks like right now:這裡的什麼整個連結看起來像現在的權利:
http://maps.google.com/maps?f=d&hl=en&geocode=&saddr= 6348+Pratt+Dr,+New+Orleans,+LA+70122+(Pratt+Home)&daddr=4601+lennox+blvd,+new+orleans,+la&sll=37.0625,-95.677068&sspn=33.214763,82.265625&ie=UTF8&z=12 http://maps.google.com/maps?f=d&hl=en&geocode=&saddr = 6348 + +普拉特博士, +新+新奧爾良, +香格里拉70122 + (普拉特+首頁) & daddr = 4601 +藍妮克絲+大道, +新+新奧爾良, +香格里拉& sll = 37.0625 , -95.677068 & sspn = 33.214763,82.265625 &即= utf8進行& z = 12
Eeeks! eeeks ! That’s pretty long!這是相當長的! There are a lot of fields in the URL, such as SADDR (starting address), DADDR (destination address), hl (language), and some more stuff related to the latitude and longitude.有很多領域,在網址,如saddr (起始地址) , daddr (目的地地址) , hl (語文) ,和一些相關的更多的東西向的經度和緯度。
However, you don’t really need all of these fields in order for Google to give you driving directions!不過,你不真的需要所有這些領域,為了讓Google給你的行車路線! All you need is this:你所需做的一切是這樣的:
http://maps.google.com/maps?saddr=start&daddr=end http://maps.google.com/maps?saddr=start&daddr=end
Go ahead and give it a shot.繼續並給它一個鏡頭。 Put in an address in quotes for the starting and ending address and paste the URL into your browser!提出在一個地址在尋獲起始和結束地址和URL粘貼到您的瀏覽器! I replaced start with my home city New Orleans and end with Houston, TX, so this is what my Google Maps directions URL looks like: i取代,開始與我的家鄉城市新奧爾良和年底與休斯敦,得克薩斯州,所以這是我的Google地圖的指示網址看起來就像這樣:
Pretty nifty eh!相當漂亮的高血壓! Isn’t it fun to mess around with these types of things!是不是很有趣的爛攤子左右,與這些類型的東西! Ok, so now that we have a URL that we can pass into Google Maps, we need to create a simple form with two fields, one for the starting address and one for the destination address.確定,所以現在我們有一個網址,我們可以通過進入Google Maps上,我們需要創建一個簡單的表格,連同兩個領域,一為起始地址和一個目的地地址。
If you want people to just type in their address and get directions to your place, then we’ll want the second field to be hidden and already set to the destination address.如果您想要的人只需鍵入在其施政報告並獲得指示,以您的位置,那麼我們將要第二個欄位,以隱藏的和已定,到目的地地址。
<form action=”http://maps.google.com/maps” method=”get” target=”_blank”> <form action="http://maps.google.com/maps" method="get" target="_blank">請
Enter your starting address: 輸入您的起始地址:
<input type=”text” name=”saddr” /> <input type="text" name="saddr" />
<input type=”hidden” name=”daddr” value=”6348 Pratt Dr, New Orleans, LA” /> <input type="hidden" name="daddr" value="6348普拉特dr,新orleans, la" />
<input type=”submit” value=”get directions” /> <input type="submit" value="get directions" />
</form> < /表格>
Check out the code above.檢查上面的代碼。 The first line starts out form and says that when the submit button is clicked, the data should be sent to maps.google.com/maps.第一線出發的形式和說,當提交按鈕按下,數據應發送到maps.google.com /圖。 The target=blank means that we want the result to open in a new window. 目標=空白 ,就是我們想要的結果,以在新窗口中打開。 Then we have a text box for the starting address, which is blank.然後我們有一個文本框為起始地址,這是空白。
The second text box is hidden and the value is the destination address that we desire.第二個文本框是隱藏的和值是目的地地址,我們的願望。 Finally, there is a submit button with the title “Get Directions”.最後,有一個提交按鈕與標題“指示” 。 Now when someone types in their address, they’ll get this:現在,當有人在他們的類型地址,他們將獲得:
You can customize the directions and map even more by following the same procedure as I went through above.您可以自訂的方向和地圖更是按照同樣的程序,正如我經歷了以上。 For example, let’s say you don’t want the default view to be maps, but instead want it to be Satellite and show Traffic .舉例來說,假設您不想默認視圖要地圖,而是希望它是衛星和顯示交通 。 Type in your directions and then press the Satellite and Traffic buttons on the Google map.輸入您的指示,然後按下衛星和交通的按鈕上的Google地圖。 Next, click on Send and you’ll see the modified URL:接下來,按一下就發送,您會看到修改網址:
Notice the layer=t and t=h fields in the URL.公告層=噸和t = h領域的網址。 layer=t is for the traffic layer and t=h means satellite in some strange fashion!層=噸,是為交通層和t = h指衛星在一些奇怪的時裝! Just tack those on to your final URL and you’ve now got a highly customized Google Maps Get Directions form on your site!剛才那些釘到您最後的網址和你現在這種做法已經得到高度定制的Google Maps得到指示的形式對您的網站! Source:資料來源: AskDaveTaylor askdavetaylor
Have any issues with this, post a comment and I’ll try to help!有任何問題,這一點,張貼評論,我將盡力幫助! Enjoy!享受!
If you enjoyed this post, make sure you 如果您喜歡這個職位,請務必 subscribe to my RSS feed 訂閱我的RSS饋送 ! !
» Filed Under »提交下 Google Software/Tips Google軟件/秘訣
Related Posts相關文章
- Create free website contact form without sharing your email address創建免費網站的聯繫表單沒有分享您的電子郵件地址
- Guide to Creating Personalized Maps using Google My Maps指導,以創造個性化地圖使用Google我的地圖
- How to add website shortcuts to the Windows Start Menu如何添加網站的捷徑Windows開始菜單
- Google Search Tips - Shortcuts search methods Google搜索提示-快捷的搜索方法
- Google Maps Traffic! Google地圖的交通!

























Really cool feature.真的很酷的功能。 I have tried it before, it’s really helpful.我曾嘗試之前,它的真正幫助。
Thanks.謝謝。