Ich möchte gerne auf meiner seite ein menü mit anfahrt erstellen.
jetzt habe ich den google routenplaner eingebaut und möchte gerne noch einen fahrplanauskunft der VVT anzeigen lassen. ( oberhalb dess routenplaners)
doch immer wenn ich den code einfüge, dann ist der routenplaner immer weg und es funktioniert nichts mehr!
könnt ihr mir helfen?
orginal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" <head> <meta http-equiv= "content-type" content= "text/html; charset=utf-8" /> <?php defined ( 'main' ) or die ( 'no direct access' ); ?><!--@title=@--><!--@hmenu=Routenplaner@--><!--@view=normal@--><!--@viewoptions=@--><php> <title>Alpengasthof Lüsens</title> type= "text/javascript" ></script> <style type= "text/css" >body { font-family: Verdana, Arial, sans serif; font-size: 11px; margin: 10px; } table.directions th { background-color:#EEEEEE; } img { color: #000000; } </style> <script type= "text/javascript" > //<![CDATA[ var map; var gdir; var geocoder = null; var addressMarker; function load() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById( "map" )); gdir = new GDirections(map, document.getElementById( "directions" )); GEvent.addListener(gdir, "load" , onGDirectionsLoad); GEvent.addListener(gdir, "error" , handleErrors); //setDirections("San Francisco", "Mountain View", "en_US"); geocoder = new GClientGeocoder(); map.addControl( new GLargeMapControl()); map.addControl( new GMapTypeControl()); showAddress( "Lüsens" , "Alpengasthof Lüsens<br><br>Lüsens 1<br>A-6182 Lüsens<br>Telefon und Fax 0043 (0) 5236 215<br>http://www.alpengasthof-luesens.com<br><br><br></p>" ); } } function setDirections(fromAddress, toAddress, locale) { gdir.load( "from: " + fromAddress + " to: " + toAddress, { "locale" : "de" }); } function showAddress(address, popUpHtml) { if (geocoder) { geocoder.getLatLng( address, function (point) { if (!point) { alert(address + " nicht gefunden" ); } else { map.setCenter(point, 13); var marker = new GMarker(point); map.addOverlay(marker); marker.openInfoWindowHtml(popUpHtml); } } ); } } function handleErrors(){ if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS) alert( "Start- oder auch Zieladresse konnten nicht gefunden werden. Entweder sind sie nicht bekannt, nicht eindeutig oder die Eingabe ist nicht korrekt. Bitte überprüfen Sie die Eingabe.\nError code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_SERVER_ERROR) alert( "Die Route konnte nicht berechnet werden.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_MISSING_QUERY) alert( "Bitte geben Sie eine Startadresse ein.\n Error code: " + gdir.getStatus().code); // else if (gdir.getStatus().code == G_UNAVAILABLE_ADDRESS) <--- Doc bug... this is either not defined, or Doc is wrong // alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_KEY) alert( "Falscher Google Maps Key. \n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_REQUEST) alert( "Die Anfrage konnte nicht geparsed werden.\n Error code: " + gdir.getStatus().code); else alert( "Unbekannter Fehler. Bitte überprüfen Sie die Eingabe." ); } function onGDirectionsLoad(){ // Use this function to access information about the latest load() // results. // e.g. // document.getElementById("getStatus").innerHTML = gdir.getStatus().code; // and yada yada yada... } //]]> </script> </head> <body onload= "load()" onunload= "GUnload()" > <h2>Routenplaner</h2> <form action= "#" onsubmit= "setDirections(this.from.value, this.to.value, 'de'); return false" > <table> <tr><th align= "right" >Startadresse: </th> <td><input size= "25" id= "fromAddress" name= "from" ></td> <th align= "right" > Zieladresse: </th> <td align= "right" ><input size= "25" id= "toAddress" name= "to" value= "Lüsens 1, A-6182 Lüsens (Alpengasthof Lüsens)" ></td> <td align= "right" > </td> </tr> <tr><th align= "right" > </th> <td colspan= "4" >Straße (optional), Ort, Land (optional) <INPUT type=submit value= "Route berechnen!" name=submit> </td> </tr> </table> </form> <br> <DIV align=center> <table class = "directions" align=center> <tr><th>Karte</th><th></th></tr> <tr> <td valign= "top" ><div id= "map" style= "WIDTH: 573px; HEIGHT: 396px" ></div></td> <td valign= "top" ></td> </tr> </table></DIV> <P align=center> </P> <P align=center> <TABLE> <TR> <TD> <P align=center>Route</P></TD></TR> <TR> <TD><div id= "directions" style= "WIDTH: 275px" ></div></TD></TR></TABLE></P> </body> </html> |
uund mein versuch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" <head> <meta http-equiv= "content-type" content= "text/html; charset=utf-8" /> <?php defined ( 'main' ) or die ( 'no direct access' ); ?><!--@title=@--><!--@hmenu=Routenplaner@--><!--@view=normal@--><!--@viewoptions=@--><php> <title>Alpengasthof Lüsens</title> type= "text/javascript" ></script> <style type= "text/css" >body { font-family: Verdana, Arial, sans serif; font-size: 11px; margin: 10px; } table.directions th { background-color:#EEEEEE; } img { color: #000000; } </style> <script type= "text/javascript" > //<![CDATA[ var map; var gdir; var geocoder = null; var addressMarker; function load() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById( "map" )); gdir = new GDirections(map, document.getElementById( "directions" )); GEvent.addListener(gdir, "load" , onGDirectionsLoad); GEvent.addListener(gdir, "error" , handleErrors); //setDirections("San Francisco", "Mountain View", "en_US"); geocoder = new GClientGeocoder(); map.addControl( new GLargeMapControl()); map.addControl( new GMapTypeControl()); showAddress( "Lüsens" , "Alpengasthof Lüsens<br><br>Lüsens 1<br>A-6182 Lüsens<br>Telefon und Fax 0043 (0) 5236 215<br>http://www.alpengasthof-luesens.com<br><br><br></p>" ); } } function setDirections(fromAddress, toAddress, locale) { gdir.load( "from: " + fromAddress + " to: " + toAddress, { "locale" : "de" }); } function showAddress(address, popUpHtml) { if (geocoder) { geocoder.getLatLng( address, function (point) { if (!point) { alert(address + " nicht gefunden" ); } else { map.setCenter(point, 13); var marker = new GMarker(point); map.addOverlay(marker); marker.openInfoWindowHtml(popUpHtml); } } ); } } function handleErrors(){ if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS) alert( "Start- oder auch Zieladresse konnten nicht gefunden werden. Entweder sind sie nicht bekannt, nicht eindeutig oder die Eingabe ist nicht korrekt. Bitte überprüfen Sie die Eingabe.\nError code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_SERVER_ERROR) alert( "Die Route konnte nicht berechnet werden.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_MISSING_QUERY) alert( "Bitte geben Sie eine Startadresse ein.\n Error code: " + gdir.getStatus().code); // else if (gdir.getStatus().code == G_UNAVAILABLE_ADDRESS) <--- Doc bug... this is either not defined, or Doc is wrong // alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_KEY) alert( "Falscher Google Maps Key. \n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_REQUEST) alert( "Die Anfrage konnte nicht geparsed werden.\n Error code: " + gdir.getStatus().code); else alert( "Unbekannter Fehler. Bitte überprüfen Sie die Eingabe." ); } function onGDirectionsLoad(){ // Use this function to access information about the latest load() // results. // e.g. // document.getElementById("getStatus").innerHTML = gdir.getStatus().code; // and yada yada yada... } //]]> </script> </head> <body> <iframe src= "http://www.vvt.at/page.cfm?vpath=timetables/efa_light/efalightform&uuid=0BBFE12F-C152-C17A-5C79884DF1FE9217" width= "190" height= "255" scrolling= "no" frameborder= "1" /> < onload= "load()" onunload= "GUnload()" > <h2>Routenplaner</h2> <form action= "#" onsubmit= "setDirections(this.from.value, this.to.value, 'de'); return false" > <table> <tr><th align= "right" >Startadresse: </th> <td><input size= "25" id= "fromAddress" name= "from" ></td> <th align= "right" > Zieladresse: </th> <td align= "right" ><input size= "25" id= "toAddress" name= "to" value= "Lüsens 1, A-6182 Lüsens (Alpengasthof Lüsens)" ></td> <td align= "right" > </td> </tr> <tr><th align= "right" > </th> <td colspan= "4" >Straße (optional), Ort, Land (optional) <INPUT type=submit value= "Route berechnen!" name=submit> </td> </tr> </table> </form> <br> <DIV align=center> <table class = "directions" align=center> <tr><th>Karte</th><th></th></tr> <tr> <td valign= "top" ><div id= "map" style= "WIDTH: 573px; HEIGHT: 396px" ></div></td> <td valign= "top" ></td> </tr> </table></DIV> <P align=center> </P> <P align=center> <TABLE> <TR> <TD> <P align=center>Route</P></TD></TR> <TR> <TD><div id= "directions" style= "WIDTH: 275px" ></div></TD></TR></TABLE></P> </body> </html> |
verwendete ilchClan Version: 1.1
betroffene Homepage: externer Link