18

答えを探していますが、見つかりません。Google Maps V3 API を使用して、道順と地図を取得しています。これですべてOKです...

しかし、Google マップ自体の同等のルートへの標準的な A タグ リンクを提供したいと考えています。私は2つの郵便番号を持っています。2 つの郵便番号または私の住所に基づいて Google マップのルート URL を生成するにはどうすればよいですか?

 google.maps.DirectionsService

この URL を使用して、[Google マップで表示] ボタンと [印刷可能] ボタンを作成します。

乾杯!エイデン

4

3 に答える 3

31

Google マップのさまざまな機能の標準的な HTML リンクを次に示します。ここに最新の投稿を保管します。

//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
于 2014-06-05T16:15:25.460 に答える
11

このStackoverflowの質問のリンクを参照してください

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

saddr=

経路検索の開始点を設定します。角括弧内にテキストを追加して、ルート サイドバーで太字にすることもできます。

お父さん=

ルート検索の終点を設定し、括弧内に追加されたテキストを再び太字にします。また、経由地を設定する「+to:」を追加することもできます。これらは複数回追加できます。

于 2013-05-01T20:53:13.797 に答える
3

2014 年 11 月 4 日現在、これは iPhone 5C の Safari の iOS 8 で動作します。

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

インストールされている場合は自動的に Google マップが開き、ルート選択画面が表示されます。また、スペース%20に 、、またはを使用しても問題ありません。+

于 2014-11-04T22:11:46.937 に答える