我应该在 Google 地图 URL 中使用哪些参数来转到经纬度? [英] What parameters should I use in a Google Maps URL to go to a lat-lon?

查看:19
本文介绍了我应该在 Google 地图 URL 中使用哪些参数来转到经纬度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为 Google 地图生成一个指向特定纬度和经度的网址.现在,我生成一个这样的网址:

I would like to produce a url for Google Maps that goes to a specific latitude and longitude. Now, I generate a url such as this:

http://maps.google.com/maps?z=11&t=k&q=58 41.881N 152 31.324W

生成的地图有一个圆形的A"气球指针,它似乎指向最近的命名对象,还有一个绿色箭头,指向经纬度.有时,在本例中,A"指针居中且距离足够远以至于您看不到指向经纬度的指针.(缩小以查看此示例中的两个指针.A"指针位于阿拉斯加的中心,而经纬度指针位于科迪亚克岛.)

The resulting map comes up with a round "A" balloon pointer, which seems to point to the nearest named object, and a green arrow, which points to the lat-lon. Sometimes, as in this example, the "A" pointer is centered and is far enough away that you cannot see the pointer to the lat-lon. (Zoom out to see both pointers in this example. The "A" pointer is in the center of Alaska, while the lat-long pointer is on Kodiak Island.)

是否可以在 Google 地图 URL 中使用一些参数来生成指向指定经纬度的单个指针?(这会在单独的窗口中加载.它不是嵌入的.)

Are there some parameters I can use in the Google Maps URL that will produce a single pointer to a designated lat-lon? (This loads in a separate window. It is not embedded.)

推荐答案

2017 年 5 月,Google 宣布了 Google Maps URLs API,允许构建通用的跨平台链接.现在,您可以使用表单中的相同 URL 字符串在网络、Android 或 iOS 上打开 Google 地图:

In May 2017 Google announced the Google Maps URLs API that allows to construct universal cross-platform links. Now you can open Google maps on web, Android or iOS using the same URL string in form:

https://www.google.com/maps/search/?api=1&parameters

您可以使用多种模式:搜索、路线、显示地图和显示街景.

There are several modes that you can use: search, directions, show map and show street view.

所以你可以使用类似

https://www.google.com/maps/search/?api=1&query=58.698017,-152.522067

打开地图并在一些纬度和经度上放置标记.

to open map and place marker on some lat and lng.

更多详情请参考:

https://developers.google.com/maps/documentation/urls/guide

这篇关于我应该在 Google 地图 URL 中使用哪些参数来转到经纬度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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