<script type="text/javascript">
var map; var drds = []; var drdds = []; var rqs = [];
window.onload = function () {
var chicago = new google.maps.LatLng(41.850033, -87.6500523);
var mapOptions = {
zoom: 7,
mapTypeId:
google.maps.MapTypeId.ROADMAP,
center: chicago
}
map = new google.maps.Map(document.getElementById('map_canvas'),
mapOptions);
var ltlgn = ["Hyderabad", "Mumabai", "Pune", "Shirdi", "Bangalore"];
for (var i = 0; i < ltlgn.length; i++) {
var request = {
origin: ltlgn[i],
destination: ltlgn[i + 1],
travelMode:
google.maps.DirectionsTravelMode.DRIVING
};
rqs.push(request);
}
for (var i = 0; i < 3; i++) {
var directionsDisplay = directionsDisplay + i;
directionsDisplay = new
google.maps.DirectionsRenderer();
directionsDisplay.setMap(map);
drds.push(directionsDisplay);
var directionsService = directionsService + i;
directionsService = new
google.maps.DirectionsService();
drdds.push(directionsService);
setTimeout(d(i), 2000)
}
}
function d(i) {
drdds[i].route(rqs[i], function (response, status)
{
if (status == google.maps.DirectionsStatus.OK) {
drds[i].setDirections(response);
}
});
}
</script>
<div id=""></div>