【问题标题】:marker google maps swift infowindow标记谷歌地图快速信息窗口
【发布时间】: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


    【解决方案1】:

    试试下面的代码

    func mapView(mapView: GMSMapView!, didTapMarker marker: GMSMarker!) -> Bool {
        self.nameService.text = "example"
        return false
    }
    

    【讨论】:

      猜你喜欢
      • 2011-08-21
      • 1970-01-01
      • 1970-01-01
      • 2016-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-20
      相关资源
      最近更新 更多