0
我已经设置了实现GMSMapViewDelegate
,将它设置为self,并且我仍然无法让任何代理函数工作。以下是我的代码示例:iOS上没有调用GMSMapViewDelegate函数
class UserViewController: UIViewController, CLLocationManagerDelegate, GMSMapViewDelegate {
var mapView: GMSMapView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
if mapView == nil {
mapView = GMSMapView()
}
mapView.delegate = self
}
func mapView(mapView: GMSMapView, didChangeCameraPosition position: GMSCameraPosition) {
print(position)
}
func mapView(mapView: GMSMapView, willMove gesture: Bool) {
print(gesture)
}
func mapView(mapView: GMSMapView, idleAtCameraPosition position: GMSCameraPosition) {
print(position)
}
的MapView功能打印任何东西都没有。我已经检查了代表并知道它已正确设置。我错过了什么吗?
我对使用Google地图的其他方面(例如设置地点和标记)没有任何问题。这只是代表职能,我一直在遇到问题。 –
给你的代码,你想实现这些,编辑你的文章:)不能真的帮助否则阅读: - http://stackoverflow.com/help/how-to-ask – Dravidian
你是否从你的地图视图连接到当前类 –