There is a task on the Google map to make an animation of the flight of airplanes. How to make an animation from one point to another I know:

var departure = new google.maps.LatLng(this.coordinates[i][0], this.coordinates[i][1]), arrival = new google.maps.LatLng(this.coordinates[i + 1][0], this.coordinates[i + 1][1]), line = new google.maps.Polyline({ path: [ departure, arrival ], geodesic: true, strokeOpacity: 0, icons: [{ icon: this.plane }], map: map }), step = 0, numSteps = 250, timePerStep = 9; var interval = await setInterval(function() { step += 1; if (step > numSteps) { setTimeout(function() { step = 0; }, PLANE_ANIMATION_DELAY); } else { var areWeThereYet = google.maps.geometry.spherical.interpolate(departure, arrival, step / numSteps); line.setPath([departure, areWeThereYet]); } }, timePerStep); 

But the problem is that the flight can be with a transfer. In this case, I paint the polylines like this:

 function initMap() { var map = new google.maps.Map(document.getElementById('map'), { zoom: 3, center: {lat: 0, lng: -180}, mapTypeId: 'terrain' }); var flightPlanCoordinates = [ {lat: 37.772, lng: -122.214}, {lat: 21.291, lng: -157.821}, {lat: -18.142, lng: 178.431}, {lat: -27.467, lng: 153.027} ]; var flightPath = new google.maps.Polyline({ path: flightPlanCoordinates, geodesic: true, strokeColor: '#FF0000', strokeOpacity: 1.0, strokeWeight: 2 }); flightPath.setMap(map); } 

Question: Can I make a flight animation for a transfer route?

    0