首页 > 解决方案 > 如何检测何时点击谷歌地图 iOS Swift?

问题描述

我想检查并检测何时点击地图标记或任何东西。iOS Swift 4 中的谷歌地图在这种情况下是否存在任何代表?

谢谢。

标签: iosswiftgoogle-mapsgesturetap

解决方案


 func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) {
 //Write your code here...
 }

如果未调用委托函数,则在viewDidAppear()方法或LocationManager didUpdateLocations()方法中设置 mapview 委托。


推荐阅读