I have recently been incorporating the Google Maps for iOS SDK within an iOS app. This app is designed to retrieve position of aircraft (including aircraft model, lat/lng, s
Instead of setting marker's iconView, set marker's icon. That too initialize the image outside of for loop, as below
func displayMarkers() {
let iconImage = UIImage(named: "locationgreen")
for partner in partners {
let lat : Double = Double(partner.location?.coordinates![1] ?? 0)
let lng : Double = Double(partner.location?.coordinates![0] ?? 0)
let position = CLLocationCoordinate2D(latitude: lat, longitude: lng)
let marker = GMSMarker(position: position)
marker.title = partner.name
marker.icon = iconImage
}
}