I have draw the polylines, but I don\'t no that what coding can remove the tracked polyline in the google map. I\'m trying some coding in below.
this is no wor
Maybe a better solution: define your routePolyline as an optional variable then each time you want assign it a path, check it with if let... and set map to nil
if let routePolyline = routePolyline {
routePolyline.map = nil
}
// create new polyline
let path: GMSPath = GMSPath(fromEncodedPath: p)!
routePolyline = GMSPolyline(path: path)
routePolyline?.map = mapView