在swift中实现自定义markerInfoWindow不起作用
我一直在使用下面张贴的方法来显示自定义信息窗口,但是每当我运行它,只有默认的窗口(与标题/代码段)出现? 我为以下方法创build了xib和swift文件,并试图使用标准函数表示法(即mapView(mapView,markerInfoWindow:mapView.currentMarker))来实现它,但这不是编译(尝试使用和不使用明确的实现)任何想法?
谢谢,
雅各
func mapView(mapView: GMSMapView!, markerInfoWindow marker: GMSMarker!) -> UIView! { var infoWindow = NSBundle.mainBundle().loadNibNamed("InfoWindow", owner: self, options: nil).first! as InfoWindow infoWindow.label.text = "\(marker.position.latitude) \(marker.position.longitude)" return infoWindow }
InfoWindow的内容:
class InfoWindow: UIView { @IBOutlet var label: UILabel! /* // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. override func drawRect(rect: CGRect) { // Drawing code } */ }
- iOS – 从代码运行第三方导航应用程序
- 当使用GoogleMaps时,myLocationEnabled在swift上更改为isMyLocationEnabled
- iPhone HTML链接到在移动版Safari中打开页面的maps.google.com,而不是Maps App
- 在iOS中更改GMSMapView默认地图背景颜色
- iOS谷歌地图textField没有响应
- NSThread gtm_performBlock错误
- 如何确定GMSMarker是否位于GMSPolygon(iOS Google Map SDK)
- 在Google地图iOS SDK中跟踪用户path
- Google Maps for iOS – 如何判断一个标记是否在屏幕的边界内?