我有一个小应用程序,提供当前位置:经度和纬度 . 现在我必须浏览经度和纬度的谷歌 Map . 请建议我如何做到这一点 .
此架构已再次更改(2018年10月23日) . 有关最新信息,请参阅Kushagr's answer .
这是带有标记的 Map (通过aaronm的评论):
https://www.google.com/maps/?q=-15.623037,18.388672
对于较旧的示例(此处没有标记):
https://www.google.com/maps/preview/@-15.623037,18.388672,8z
最古老的格式:
http://maps.google.com/maps?ll=-15.623037,18.388672&spn=65.61535,79.013672
最好的方法是使用 q 参数,以便显示带有标记点的 Map . 例如 . :
q
https://maps.google.com/?q=<lat>,<lng>
截至今天(2014/09/23),我发现要获得确切位置(不是近似值)的标记,您可以使用:
http://www.google.com/maps/place/49.46800006494457,17.11514008755796
此外,如果要指定 Map 中心和缩放:
http://www.google.com/maps/place/49.46800006494457,17.11514008755796/@49.46800006494457,17.11514008755796,17z
如果要使用卫星 Map 类型,请追加 /data=!3m1!1e3
/data=!3m1!1e3
http://www.google.com/maps/place/49.46800006494457,17.11514008755796/@49.46800006494457,17.11514008755796,17z/data=!3m1!1e3
如果你想要 Map 的地形视图,那么追加 /data=!3m1!4b1
/data=!3m1!4b1
https://www.google.com/maps/place/49.46800006494457,17.11514008755796/@49.46800006494457,17.11514008755796,17z/data=!3m1!4b1
如果您想在浏览器中打开Google Map :
http://maps.google.com/?q=<lat>,<lng>
要在iOS移动设备上打开Google Map 应用,请使用Google Maps URL Scheme:
comgooglemaps://?q=<lat>,<lng>
要在Android上打开Google Map 应用,请使用geo: intent:
geo:<lat>,<lng>?z=<zoom>
这超出了问题的范围,但我认为知道如何链接到路线可能也很有趣 . 查询看起来像这样:
https://www.google.es/maps/dir/'52.51758801683297,13.397978515625027'/'52.49083837044266,13.369826049804715'
These are URLs that work:
http://maps.google.com/?q=<LAT>,<LNG>
https://maps.google.com/?q=<LAT>,<LNG>&ll=<LAT>,<LNG>&z=18
https://www.google.com/maps/@<LAT>,<LNG>,16z
https://maps.google.com/?q=<LAT>,<LNG>&z=16
Although (for avid readers) This is the latest from google (August 22 2017):
Maps URLsMaps URLs with map displayMaps URLs with search action
From google
搜索:搜索特定位置时,生成的 Map 会将图钉放在指定位置并显示可用的位置详细信息 . 重要提示:参数api = 1标识此URL用于的 Map 网址的版本 . 每个请求都需要此参数 . 唯一有效值为1.如果网址中不存在api = 1,则会忽略所有参数,并在浏览器或Google Map 移动应用中启动默认的Google Map 应用,具体取决于所使用的平台(适用于例如,https://www.google.com/maps) .
要在android中打开谷歌 Map 应用程序: -
用标记打开应用程序给出位置: -
geo:<lat>,<lng>?q=<lat>,<lng>(Label,Name)
在ios中打开谷歌 Map : -
使用以下参数在浏览器中打开谷歌 Map : -
http://maps.google.com/maps?z=12&t=m&q=<lat>,<lng>
z 是缩放级别(1-21)
z
t 是 Map 类型(“ m " map, " k " satellite, " h " hybrid, " p " terrain, " e ”GoogleEarth)
t
q 是搜索查询
使用查询参数将无法正常工作,Google将尝试近似该位置 .
我想要的位置:http://maps.google.com/maps?ll=43.7920533400153,6.37761393942265
大致位置(实际位置以西):http://maps.google.com/?q=43.7920533400153,6.37761393942265
截至今天(2018年10月23日),Google提供了一个通用URL的规定,它在跨平台上非常有效,因此Google建议使用此方法 .
语法: https://www.google.com/maps/search/?api=1&query=<lat>,<lng>
https://www.google.com/maps/search/?api=1&query=<lat>,<lng>
示例:https://www.google.com/maps/search/?api=1&query=28.6139,77.2090(印度新德里)
文档/来源:https://developers.google.com/maps/documentation/urls/guide
轻松说 http://www.google.com/maps/place/lat,lng 格式
http://www.google.com/maps/place/lat,lng
示例网址:
http://www.google.com/maps/place/30.364124,48.227034
这也有效:
https://www.google.pl/maps/@<lat>,<lon>,<zoom>z
示例:https://www.google.pl/maps/@51.5088233,-0.1296787,13z
用指针:
https://www.google.com/maps/place/<lat>,<lon>/@<lat>,<lon>,<zoom>z
示例:https://www.google.com/maps/search/51.5088233,-0.1296787/@51.5088233,-0.1296787,13z
在Google地球计划中找到您的位置,然后点击“在Google Map 中查看”图标 . 浏览器中的URL栏将显示您需要的URL .
使用纬度和经度以及缩放级别打开以下网址 .
https://maps.google.com/?q=23.22,88.32&z=8
13 回答
此架构已再次更改(2018年10月23日) . 有关最新信息,请参阅Kushagr's answer .
这是带有标记的 Map (通过aaronm的评论):
https://www.google.com/maps/?q=-15.623037,18.388672
对于较旧的示例(此处没有标记):
https://www.google.com/maps/preview/@-15.623037,18.388672,8z
最古老的格式:
http://maps.google.com/maps?ll=-15.623037,18.388672&spn=65.61535,79.013672
最好的方法是使用
q
参数,以便显示带有标记点的 Map . 例如 . :截至今天(2014/09/23),我发现要获得确切位置(不是近似值)的标记,您可以使用:
此外,如果要指定 Map 中心和缩放:
如果要使用卫星 Map 类型,请追加
/data=!3m1!1e3
如果你想要 Map 的地形视图,那么追加
/data=!3m1!4b1
如果您想在浏览器中打开Google Map :
http://maps.google.com/?q=<lat>,<lng>
要在iOS移动设备上打开Google Map 应用,请使用Google Maps URL Scheme:
comgooglemaps://?q=<lat>,<lng>
要在Android上打开Google Map 应用,请使用geo: intent:
geo:<lat>,<lng>?z=<zoom>
这超出了问题的范围,但我认为知道如何链接到路线可能也很有趣 . 查询看起来像这样:
These are URLs that work:
http://maps.google.com/?q=<LAT>,<LNG>
https://maps.google.com/?q=<LAT>,<LNG>&ll=<LAT>,<LNG>&z=18
https://www.google.com/maps/@<LAT>,<LNG>,16z
https://maps.google.com/?q=<LAT>,<LNG>&z=16
Although (for avid readers) This is the latest from google (August 22 2017):
Maps URLs
Maps URLs with map display
Maps URLs with search action
From google
要在android中打开谷歌 Map 应用程序: -
用标记打开应用程序给出位置: -
在ios中打开谷歌 Map : -
使用以下参数在浏览器中打开谷歌 Map : -
z
是缩放级别(1-21)t
是 Map 类型(“ m " map, " k " satellite, " h " hybrid, " p " terrain, " e ”GoogleEarth)q
是搜索查询使用查询参数将无法正常工作,Google将尝试近似该位置 .
我想要的位置:http://maps.google.com/maps?ll=43.7920533400153,6.37761393942265
大致位置(实际位置以西):http://maps.google.com/?q=43.7920533400153,6.37761393942265
截至今天(2018年10月23日),Google提供了一个通用URL的规定,它在跨平台上非常有效,因此Google建议使用此方法 .
语法:
https://www.google.com/maps/search/?api=1&query=<lat>,<lng>
示例:https://www.google.com/maps/search/?api=1&query=28.6139,77.2090(印度新德里)
文档/来源:https://developers.google.com/maps/documentation/urls/guide
轻松说
http://www.google.com/maps/place/lat,lng
格式示例网址:
http://www.google.com/maps/place/30.364124,48.227034
这也有效:
示例:https://www.google.pl/maps/@51.5088233,-0.1296787,13z
用指针:
示例:https://www.google.com/maps/search/51.5088233,-0.1296787/@51.5088233,-0.1296787,13z
在Google地球计划中找到您的位置,然后点击“在Google Map 中查看”图标 . 浏览器中的URL栏将显示您需要的URL .
使用纬度和经度以及缩放级别打开以下网址 .
https://maps.google.com/?q=23.22,88.32&z=8