<!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"
>
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);
geocoder =
new
GClientGeocoder();
map.addControl(
new
GLargeMapControl());
map.addControl(
new
GMapTypeControl());
}
}
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_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(){
}
</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 16, 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>