【发布时间】:2016-03-20 07:56:38
【问题描述】:
您好,我正在使用谷歌地图并有以下问题
我想在一个固定的标签中显示一个标记的信息,每次触摸都会改变标签。
我有以下代码,我知道我可以将事件设为标记
func mapView(mapView: GMSMapView!, didTapMarker marker: GMSMarker!) -> Bool {
self.nameService.text = "example"
return true
}
但是这个功能不起作用,请问上面的功能是为了那个?
我也测试了这个函数来改变信息窗口,但都不管用
func mapView(mapView: GMSMapView, markerInfoWindow marker: GMSMarker) -> UIView? {
let index:Int! = Int(marker.accessibilityLabel!)
let customInfoWindow = NSBundle.mainBundle().loadNibNamed("CustomInfoWindow", owner: self, options: nil)[0] as! CustomInfoWindow
customInfoWindow.label.text = "example"
self.nameService.text = "example"
return customInfoWindow
}
我犯了那个错误?
谢谢
【问题讨论】:
标签: ios xcode swift google-maps marker