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


当前回答

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

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

其他回答

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

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

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

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

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

这也是可行的:

https://www.google.pl/maps/@<lat>,<lon>,<zoom>z

的例子。

指针:

https://www.google.com/maps/place/<lat>,<lon>/@<lat>,<lon>,<zoom>z

的例子。

截至今天(2014/09/23),我发现要在确切的地方(不是近似值)得到标记,你可以使用:

http://www.google.com/maps/place/49.46800006494457,17.11514008755796

此外,如果你想指定地图中心和缩放:

http://www.google.com/maps/place/49.46800006494457,17.11514008755796/@49.46800006494457,17.11514008755796,17z

如果你想使用卫星地图类型,那么追加/data=!3m1!1 e3

http://www.google.com/maps/place/49.46800006494457,17.11514008755796/@49.46800006494457,17.11514008755796,17z/data=!3m1!1e3

如果你想要地形视图的地图,然后追加/data=!3m1!4 b1

https://www.google.com/maps/place/49.46800006494457,17.11514008755796/@49.46800006494457,17.11514008755796,17z/data=!3m1!4b1

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

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