var Demo = { mapContainer: document.getElementById('map-container'), dirContainer: document.getElementById('dir-container'), fromInput: document.getElementById('from-input'), dirService: new google.maps.DirectionsService(), dirRenderer: new google.maps.DirectionsRenderer(), map: null, showDirections: function(dirResult, dirStatus) { if (dirStatus != google.maps.DirectionsStatus.OK) { alert('Directions failed: ' + dirStatus); return; } Demo.dirRenderer.setMap(Demo.map); Demo.dirRenderer.setPanel(Demo.dirContainer); Demo.dirRenderer.setDirections(dirResult); document.getElementById('dir-print').innerHTML=''; }, getDirections: function() { var fromStr = Demo.fromInput.value; var toStr = "46.25593061659222, 15.099178000000051"; var dirRequest = { origin: fromStr, destination: toStr, travelMode: google.maps.DirectionsTravelMode.DRIVING, unitSystem: google.maps.DirectionsUnitSystem.METRIC, provideRouteAlternatives: true }; Demo.dirService.route(dirRequest, Demo.showDirections); }, init: function() { var latLng = new google.maps.LatLng(46.25593061659222, 15.099178000000051); Demo.map = new google.maps.Map(Demo.mapContainer, { zoom: 8, scrollwheel: false, backgroundColor: "#FAF4E6", center: latLng, mapTypeId: google.maps.MapTypeId.ROADMAP }); var platzmarkerIMG = new google.maps.MarkerImage('/pics/icon/platz16.png', new google.maps.Size(16, 14), new google.maps.Point(0,0), new google.maps.Point(8, 7) ); var platzmarker = new google.maps.Marker({ position: latLng, map: Demo.map, icon: platzmarkerIMG, title:"Camping Park" }); } } function print_route() { html=document.getElementById("dir-container").innerHTML; a=window.open("","print","width=700,height=600,left=100,top=10,location=no,menubar=yes,resizable=no,screenX=100,screenY=10,status=no,toolbar=no,scrollbars=yes"); a.document.open(); a.document.write("\n\n"); a.document.write("\n") a.document.write("\n\n
www.camping-in-europa.com

\n"); a.document.write(html); a.document.write("\n\n"); a.document.close(); } //google.maps.event.addDomListener(window, 'load', Demo.init);