SWIFT 3.0 試試這個
您可以在標註設置服務器URL圖像。
func mapView(_ mapView: GMSMapView, markerInfoWindow marker: GMSMarker) -> UIView? {
marker.tracksInfoWindowChanges = true
let CustomWindowDisplay:CustomWindow = Bundle.main.loadNibNamed("View", owner: self, options: nil)![0] as! CustomWindow
let arrImages:NSArray = (dictDataOfPropertyData.value(forKey: "property_images") as? NSArray)!
if arrImages.count != 0{
let strImage:String = (arrImages1.object(at: 0) as! NSDictionary).value(forKey: "property_photo") as! String
let urlofImg:NSURL = NSURL.init(string: strImage)!
CustomWindowDisplay.imgPropertyPhoto.sd_setImage(with: urlofImg as URL, placeholderImage: UIImage(named: "placeholder_main_list.png"), options: .highPriority)
}
}
它可能是有趣的。也許。 https://stackoverflow.com/questions/43407978/how-to-add-two-or-more-buttons-to-annotationview-mkannotationview –