我有一个小应用程序,提供当前位置:经度和纬度。 现在我必须浏览谷歌地图的经度和纬度。 请建议我该怎么做。


当前回答

简单说http://www.google.com/maps/place/lat,lng格式

示例url:

http://www.google.com/maps/place/30.364124,48.227034

其他回答

如果你想要一个dir旅行模式=步行

https://www.google.es/maps/dir/'52.51758801683297,13.397978515625027'/'52.49083837044266,13.369826049804715'/data=!4m2!4m1!3e2

最好的方法是使用q参数,这样它就会显示带有标记点的地图。如:

https://maps.google.com/?q=<lat>,<lng>

打开谷歌地图并显示URL方案位置和位置引脚

UIApplication.shared.openURL(URL(string:"https://maps.google.com/?q=\(dicLocation.stringValueForKey("latitude")),\(dicLocation.stringValueForKey("longitude")),15z")!)

这种模式再次发生了变化(2018年10月23日)。请看Kushagr的最新回答。

这是一个带有标记的地图(通过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

使用查询参数将不起作用,谷歌将尝试近似位置。

我想去的地方:http://maps.google.com/maps?ll=43.7920533400153,6.37761393942265

大致位置(实际位置以西):http://maps.google.com/?q=43.7920533400153,6.37761393942265