Html 指向谷歌地图页面的 URL 以显示给定纬度/经度的图钉?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5807063/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 08:16:55  来源:igfitidea点击:

Url to a google maps page to show a pin given a latitude / longitude?

htmlgoogle-maps

提问by user291701

Is there some url I can construct with a latitude,longitude pair that will lead me directly to a google maps page to visualize that location?

是否有一些 url 我可以用纬度,经度对构建,将我直接引导到谷歌地图页面以可视化该位置?

For example, the following pseudocode:

例如,以下伪代码:

var lat = 43.23;
var lng = 114.08;

var url = 'http://google.com/maps/bylatlng?lat=' + lat + '&lng=' + lng';

print 'click here to see this location in google maps!: <a href="' + url + '">go</a>';

Something like that?

类似的东西?

Thanks

谢谢

回答by dawebber

You should be able to do something like this:

你应该能够做这样的事情:

http://maps.google.com/maps?q=24.197611,120.780512

http://maps.google.com/maps?q=24.197611,120.780512

Some more info on the query parameters available at this location

有关此位置可用查询参数的更多信息

Here's another link to an SO thread

这是SO 线程的另一个链接

回答by Edward Falk

From my notes:

从我的笔记:

http://maps.google.com/maps?q=37.4185N+122.08774W+(label)&ll=37.419731,-122.088715&spn=0.004250,0.011579&t=h&iwloc=A&hl=en

http://maps.google.com/maps?q=37.4185N+122.08774W+(label)&ll=37.419731,-122.088715&spn=0.004250,0.011579&t=h&iwloc=A&hl=en

Which parses like this:

解析如下:

    q=latN+lonW+(label)     location of teardrop

    t=k             keyhole (satelite map)
    t=h             hybrid

    ll=lat,-lon     center of map
    spn=w.w,h.h     span of map, degrees

iwloc has something to do with the info window. hl is obviously language.

iwloc 与信息窗口有关。hl 显然是语言。

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

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