2013-05-01 11 views
12

回答を検索しましたが見つかりませんでした。私はGoogle Maps V3 APIを使用して道順と地図を取得しています。これはすべてOKです...Google Maps Directions API同等のURL

しかし、私はGoogle Maps自体に相当する指示にbog-standard A-tagリンクを提供したいと思います。私は2つのポストコードを持っています。どのように私は2郵便番号や私

google.maps.DirectionsService 

をもとにGoogleマップの方向のURLを生成することができ、私はボタンと「印刷可能な」ボタン「Googleマップ上に表示」を生産するためにURLを使用するつもりです。

乾杯!エイデン

答えて

10

は方向検索の開始点を設定します

this Stackoverflow question

http://www.seomoz.org/ugc/everything-you-never-wanted-to-know-about-google-maps-parameters

にsaddr =

内のリンクを参照してください。角括弧内にテキストを追加して、方向のサイドバーで太字にすることもできます。

DADDRは=

は方向検索のためのエンドポイントを設定し、再度brackets.Youで添加太字のテキストは、「に+:」を追加することができるであろう点を介して設定されます。これらは複数回追加できます。ここで

Example

+0

+1と承諾します。完璧。私はもっ​​と捜しておくべきだったと私に伝えます。いくつかの担当者を持って、私の脳は今晩frazzledです。 –

+1

開始点は 'saddr'で区切る必要があります –

16

異なるGoogleマップの機能のためのいくつかの標準的なHTMLリンクです。 I keep an updated post here.

//Spaces can be changed to "+" or encoded as "%20". 

//Linking to a location (No directions) 
https://www.google.com/maps?q=760+West+Genesee+Street+Syracuse+NY+13204 

//No starting point (User input required to generate directions). 
https://www.google.com/maps?daddr=760+West+Genesee+Street+Syracuse+NY+13204 

//With a set location as starting point (Automatically generates directions with no user input required). 
https://www.google.com/maps?saddr=760+West+Genesee+Street+Syracuse+NY+13204&daddr=314+Avery+Avenue+Syracuse+NY+13204 

//With "My Location" as starting point (Automatically generates directions with no user input required). 
https://www.google.com/maps?saddr=My+Location&daddr=760+West+Genesee+Street+Syracuse+NY+13204 

//Current Location to Latitude and Longitude 
https://www.google.com/maps?saddr=My+Location&daddr=43.12345,-76.12345 

//Query search of a Latitude and Longitude 
//Also shows setting a default zoom level 
https://www.google.com/maps?ll=43.12345,-76.12345&q=food&z=14 

//String search as destination 
https://www.google.com/maps?saddr=My+Location&daddr=Pinckney+Hugo+Group 
+0

どのように変更されているのかわかりませんが、My + Locationを使用しても動作しません。代わりにCurrent + Locationを使用しました –

+0

これはchrome/firefox/IE11しかし、私はIE9で、このパラメータが「My + Location」/「Current + Location」のときにはうまく動作しません。 – aceanindita

+0

IE9で問題が発生し、「My + Location」/「Current + Location」を使用しています。私の場所を解釈するのではなく、実際のテキストを探しているようです。 https://www.google.com/maps?saddr=My+Location&daddr=760+West+Genesee+Street+Syracuse+NY+13204 – aceanindita

2

これはiPhone 5C上のSafari上でのiOS 8で動作します2014年11月4日の時点で:

https://www.google.com/maps/dir/current+location/100 N Arlington Ave, Reno, NV 89509

それが自動的にインストールされている場合、Googleマップを開き、方向の選択画面が表示されます。また、スペースには%20,、または+を使用するかどうかは関係ありません。