Skip to content

Instantly share code, notes, and snippets.

@ryanisnhp
Created May 31, 2020 17:54
Show Gist options
  • Save ryanisnhp/a0efb6cb3513243851e198686ce3b244 to your computer and use it in GitHub Desktop.
Save ryanisnhp/a0efb6cb3513243851e198686ce3b244 to your computer and use it in GitHub Desktop.
@objc func animatePolylineWithGradient() {
//Iterate each valid coordinate on the path
if i < path.count() {
newPath.add(path.coordinate(at: i))
newPolyline.path = newPath
newPolyline.strokeWidth = 4
newPolyline.spans = [GMSStyleSpan(style: .gradient(from: UIColor(rgb: 0x38726E), to: UIColor(rgb: 0x404969)))]
newPolyline.map = mapView
i += 1
} else {
resetTimer()
startAnimationTimer()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment