I have added a route and i have also added the way point markers. i want to move the marker smoothly from one gps coordinate point to another smoothly along the route. can anyone help me with this? here is the code that is used to add markers.
func configureMapAndMarkersForRoute() {
viewGMap.camera = GMSCameraPosition.cameraWithTarget(mapTasks.originCoordinate, zoom: 9.0)
originMarker = GMSMarker(position: self.mapTasks.originCoordinate)
originMarker.map = self.viewGMap
originMarker.icon = GMSMarker.markerImageWithColor(UIColor.greenColor())
originMarker.title = self.mapTasks.originAddress
destinationMarker = GMSMarker(position: self.mapTasks.destinationCoordinate)
destinationMarker.map = self.viewGMap
destinationMarker.icon = GMSMarker.markerImageWithColor(UIColor.redColor())
destinationMarker.title = self.mapTasks.destinationAddress
if waypointsArray.count > 0 {
var i = 0
for waypoint in waypointsArray {
let lat: Double = (waypoint.componentsSeparatedByString(",")[0] as NSString).doubleValue
let lng: Double = (waypoint.componentsSeparatedByString(",")[1] as NSString).doubleValue
let marker = GMSMarker(position: CLLocationCoordinate2DMake(lat, lng))
marker.map = viewGMap
marker.icon = GMSMarker.markerImageWithColor(UIColor.purpleColor())
marker.title = locationNameArray[i]
markersArray.append(marker)
i += 1
}
}
}