title: Google Maps: How to add multiple markers to google maps
body: <p>I searched a lot but didn't get any exact solution for my question with Swift 3 context. I need to plot multiple markers (of type GMSMarker) in my application. My code is as below.</p>
  
  <pre><code>var markerDict: [Int: GMSMarker] = [:]
  var custlatt = [13.093781,13.034893,13.034893]
  var custlong = [77.576284,77.596372, 77.596372]
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      for i in 0...2{
          let camera = GMSCameraPosition.camera(withLatitude:custlatt[i], longitude: custlong[i], zoom: 10.0)
          let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
          view = mapView
  
          markerDict[i] = GMSMarker()
          markerDict[i]?.position = CLLocationCoordinate2D(latitude:custlatt[i], longitude: custlong[i])
          markerDict[i]?.title = "NAGAVARA"
          markerDict[i]?.snippet = "Bengaluru"
          markerDict[i]?.map = mapView
      }
  </code></pre>
  
  <p>Even though I'm using array of marker only one position (last value of custlatt,custlong array) is being marked. Can anyone suggest where I'm going wrong? Or is there any other method of implementation?</p>