Make a href which open a Google map with specific address [closed]

给你一囗甜甜゛ 提交于 2020-05-09 19:31:11

问题


Suppose I have a variable address - myAddress

I want to create a - <a href="..."></a>

which will open a Google Map with this address .

How to achieve that ?


回答1:


You can do it like this:

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

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

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



来源:https://stackoverflow.com/questions/27419509/make-a-href-which-open-a-google-map-with-specific-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!