谷歌地图方向API等效URL
Google Maps Directions API Equivalent URL
一直在寻找答案,却找不到。我正在使用谷歌地图V3 API来获取方向和地图。这一切都很好……
但我想提供一个沼泽标准的a标签链接到谷歌地图本身的等效方向。我有两个邮政编码。我如何生成一个谷歌地图方向URL基于2邮政编码或我的
google.maps.DirectionsService
我将使用URL生成一个"View on google maps"按钮和一个"printable"按钮。
干杯!艾登
以下是不同Google Maps功能的一些标准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
查看这个Stackoverflow问题的链接
http://www.seomoz.org/ugc/everything-you-never-wanted-to-know-about-google-maps-parameterssaddr =
设置方向搜索的起始点。你也可以在侧边栏的方括号中添加文本,使其加粗。
daddr =
设置方向搜索的结束点,并再次将添加到括号中的文本加粗。你也可以添加"+to:",这将设置通过点。可以多次添加。
示例自2014年11月4日起,此功能适用于iOS 8、Safari和iPhone 5C:
https://www.google.com/maps/dir/current+location/100 N Arlington Ave, Reno, NV 89509
它会自动打开谷歌地图,如果安装并带你到方向选择器屏幕。还请注意:如果您使用%20
, 或CC_4作为空格,则无关紧要。
相关文章:
- 如何使用url加载程序在webpack中导入多个图像
- 使用php或javascript从facebook相册URL中删除多余的部分
- Angular JS IE9 Hashbang url rewriting
- JavaScript下拉菜单-点击按钮并根据所选值重定向到url
- 直接下载文件,而不是从window.open(url)
- 动态地改变“”的URL;添加新项目”;链接使用javascript/jquery
- 通过js在新选项卡中有条件地打开url
- CKFinder 3为所选文件返回错误的URL
- 如何获取不属于我项目的上一页的URL
- ReactJS映射:如何仅在url变量不为空时呈现html链接
- 在URL中传递JS对象
- 将纯文本URL转换为可单击链接
- Javascript html每点击一次就会更改url
- 以角度管理动态URL
- Mathias URL shortener
- 如何有效地将游戏数据存储在URL查询字符串中
- 使用带括号的图像URL作为jQuery的背景
- JS:检查URL中的参数,然后迭代一个参数为var的函数
- 在javascript中,从给定的url下载文件的等效wget是什么?
- 谷歌地图方向API等效URL