在浏览器中打开带有特定地址的谷歌地图 [英] Open Google map with specific address in a browser

查看:36
本文介绍了在浏览器中打开带有特定地址的谷歌地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Google 地图中搜索地址的 url 结构是什么?

What is the url structure to search for an address in Google Maps?

我想在我的网站上提供一个地址,当点击该地址时,它将直接打开谷歌地图到我脚本中的地址.

I want to offer an address on my website that, when clicked, it will open google maps directly to an address from my script.

我想创建一个链接 <a href="..."></a> 这将打开一个显示街道地图的 Google 地图浏览器页面地址来自我的脚本.

I want to create a link <a href="..."></a> which will open a Google Maps browser page that shows a map of a street address from my script.

推荐答案

你可以这样做:

这是您的 href:http://maps.google.com/?q=q 之后的所有内容都将填写在已填写并提交的搜索中,例如:1200 宾夕法尼亚大道东南,华盛顿哥伦比亚特区,20003 年

this is your href: http://maps.google.com/?q= everything that goes after q will be filled in the search filled and submitted, for example: 1200 Pennsylvania Ave SE, Washington, District of Columbia, 20003

所以链接看起来像这样:<a href="http://maps.google.com/?q=1200 Pennsylvania Ave SE, Washington, District of Columbia, 20003">...

So the link looks like this: <a href="http://maps.google.com/?q=1200 Pennsylvania Ave SE, Washington, District of Columbia, 20003">...</a>

如果您需要动态的q",您可以使用简单的 jQuery 代码来更新您的 href.

If you need the "q" to be dynamic you can do it with simple jQuery code to update your href.

这篇关于在浏览器中打开带有特定地址的谷歌地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆