Google maps 有没有一种方法可以将参数传递给google map';s获取方向功能?

Google maps 有没有一种方法可以将参数传递给google map';s获取方向功能?,google-maps,Google Maps,有没有一种方法可以使用maps.google.com的get direction功能,这样我就可以从url传递方向的参数 您可以使用以下url参数 saddr用于起始地址 目标地址的daddr url将是http://maps.google.com/maps?saddr=new+约克和达德=巴尔的摩 您传入的值几乎可以是您在web应用程序中键入的任何内容,即地名/纬度/长度等。此外,请确保使用+字符表示空格。当然可以 从ATL到LAX的方向: 更新: 亚特兰大到拉瓜迪亚到洛杉矶到安卓机场 只要

有没有一种方法可以使用maps.google.com的get direction功能,这样我就可以从url传递方向的参数

您可以使用以下url参数

saddr
用于起始地址

目标地址的daddr

url将是
http://maps.google.com/maps?saddr=new+约克和达德=巴尔的摩

您传入的值几乎可以是您在web应用程序中键入的任何内容,即地名/纬度/长度等。此外,请确保使用
+
字符表示空格。

当然可以

从ATL到LAX的方向:

更新:

亚特兰大到拉瓜迪亚到洛杉矶到安卓机场


只要你有一个SADD和一个daddr,你似乎可以在daddr之前或之后加分。换句话说,这两者是等价的:



以下是一些针对不同谷歌地图功能的标准HTML链接。使用新语法,您可以有一个指向多个目的地方向的链接(但是,使用查询参数是不可能的)-请参见下面的最后一个示例


嘿,谢谢你提供的信息……我还有一个问题:如果你想知道两个以上地方的方向怎么办……比如说,纽约到巴尔的摩,然后到费城,或者其他任意数量的方向。所以,daddr总是第二站。要添加更多的航路点,只需添加“+到:随便什么”。因此,您的示例是查看我的更新以响应您的更新:)
//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

//Multiple destination directions (using new syntax). Check my linked post above for the most up-to-date versions.
https://www.google.com/maps/dir/760+W+Genesee+St+Syracuse+NY+13204/314+Avery+Ave+Syracuse+NY+13204/9090+Destiny+USA+Dr+Syracuse+NY+13204