'; infowindow = new google.maps.InfoWindow({ content: content }); google.maps.event.addListener(Marker, 'click', function() { infowindow.open(map,Marker); }); google.maps.event.addListener(directionsDisplay, 'directions_changed', function() { }); } function getSelectedTravelMode() { var travelvalue = document.getElementById('travel-mode-input').value; if (travelvalue == 'driving') { travelvalue = google.maps.DirectionsTravelMode.DRIVING; } else if (travelvalue == 'bicycling') { travelvalue = google.maps.DirectionsTravelMode.BICYCLING; } else if (travelvalue == 'walking') { travelvalue = google.maps.DirectionsTravelMode.WALKING; } else { alert('Unsupported travel mode.'); } return travelvalue; } function calcRoute() { var destination_val = document.getElementById('fromAddress').value; var request = { origin: destination_val, destination: "44.848788652506926, 8.025789861901785", travelMode: google.maps.DirectionsTravelMode.DRIVING }; directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); }else {alert('Address not found for:'+ destination_val);} }); } google.maps.event.addDomListener(window, 'load', initialize); /* ]]> */