title: How to fix flickering images after downloading from URL and setting it as GMSMarker?
body: <p>This is what I have done so far. When I call functions apply image all the markers in view have their images set but the problems occurs when I zoom out of maps and check other markers, their images keeps flickering and doesn't stop whatsoever. Also I want my images to be circular but they keep turning into hexagon shape. <a href="https://i.stack.imgur.com/lWo9R.gif" rel="nofollow noreferrer">Here is the gif showing the problem.</a></p>
  
  <pre><code>func showCurrentLocationWithOnlineMarkers() {
      guard let locationObj = locationManager.location else {
          return
      }
      viwMaps.delegate = self
      let coord = locationObj.coordinate
      userLat = coord.latitude
      userLng = coord.longitude
      let camera: GMSCameraPosition = GMSCameraPosition.camera(withLatitude: userLat, longitude: userLng, zoom: Float(17.0))
      viwMaps.isMyLocationEnabled = true
      viwMaps.settings.myLocationButton = true
      self.viwMaps.animate(to: camera)
      for data in arrGetDriverModal{
              let driver_lat = CLLocationDegrees(data.driver_lat ?? "")
              let driver_long = CLLocationDegrees(data.driver_long ?? "")
              let location = CLLocationCoordinate2D(latitude: driver_lat!, longitude: driver_long!)
              let marker = GMSMarker()
              marker.position = location
              marker.userData = data
          marker.map = self.viwMaps
              let imageURL = URL(string: API.imgbaseURL+data.driver_image!)
                  self.applyImage(from: imageURL!, to: marker)
      }
  
  }
  
  func applyImage(from url: URL, to marker: GMSMarker) {
      let imageView = UIImageView(image: #imageLiteral(resourceName: "marker"))
      imageView.frame = CGRect.init(x: 0, y: 0, width: 44, height: 44)
      DispatchQueue.global(qos: .background).async {
          guard let data = try? Data(contentsOf: url),
              let image = UIImage(data: data)
              else { return }
  
          DispatchQueue.main.async {
              imageView.image = image
              imageView.layer.cornerRadius = 22
              imageView.clipsToBounds = true
              imageView.layer.masksToBounds = true
              marker.iconView = imageView
          }
      }
  }
  </code></pre>