[Solved] I’ve number of latitude and longitude in array. I want to display multiple markers in Google Map [closed]


First integrate Google Maps with the your app
Google Maps iOS SDK

Then try to add marker to the map
Adding a Map with a Marker

var marker = GMSMarker()
marker.position = CLLocationCoordinate2D(latitude: -33.86, longitude: 151.20)
marker.title = "Sydney"
marker.snippet = "Australia"
marker.map = mapView

Finally use for loop to add multiple markers to the map. Swift Control Flow

var coords = [[-33.86,151.20],[-33.85,151.18],[-33.76,151.14]]
for coord in coords {
var marker = GMSMarker()
marker.position = CLLocationCoordinate2D(latitude: coord[0], longitude: coord[1])
marker.map = mapView
}

6

solved I’ve number of latitude and longitude in array. I want to display multiple markers in Google Map [closed]