i want to draw route between multiple points using start location and end location, i am following some examples and this link to get json to get waypoints https://directionsdebug.firebaseapp.com/?origin=place_id%3AChIJ59dGBGBwTDkRlQsbxkBkqNw&destination=place_id%3AChIJ0TGAdgh6TDkRTFcRvOIXIOY&mode=driving&waypoints=Kotri%2C%20Jamshoro%2C%20Sindh%2C%20Pakistan&alternatives=true
and this is my code i am not getting all the points using link please guide me how to this using start end and waypoints
func drawpath() {
let url = "https://maps.googleapis.com/maps/api/directions/json?origin=place_id%3AChIJ59dGBGBwTDkRlQsbxkBkqNw&destination=place_id%3AChIJ0TGAdgh6TDkRTFcRvOIXIOY&mode=driving&waypoints=Kotri%2C%20Jamshoro%2C%20Sindh%2C%20Pakistan&alternatives=true&key=AIzaSyCct09KdoyIc3VV5Bziw5Tk9MF0RhWXTNE"
Alamofire.request(url).responseJSON { response in
print(response.request as Any) // original URL request
print(response.response as Any) // HTTP URL response
print(response.data as Any) // server data
print(response.result as Any) // result of response serialization
let json = try! JSON(data: response.data!)
let routes = json["routes"][0]["legs"][0]["steps"].arrayValue
print("route is\(routes)")
// print route using Polyline
for route in routes
{
let routeOverviewPolyline = route["polyline"].dictionary
let points = routeOverviewPolyline?["points"]?.stringValue
print("ppoint\(String(describing: points))")
print("routeOverviewPolyline\(String(describing: routeOverviewPolyline))")
let path = GMSPath.init(fromEncodedPath: points!)
let polyline = GMSPolyline.init(path: path)
polyline.strokeWidth = 4
polyline.strokeColor = UIColor.red
polyline.map = self.mapview
}
}