GoogleMaps die 3.
Verfasst: Fr 29. Dez 2006, 01:01
Mit Datenbankanbindung
Server key beantragen und in Output oben eintragen
Schatten und Icon in Verzeichniss upload schieben
Datenbank SQL (mit Beispielen):
Javascript für Zoomfunktion
Namen: gzoom.js in Ordner MANDANT/js/gzoom.js
Download: http://earthcode.com/blog/2006/07/gzoom.html
Input:
Output:
Backend:
Frontend1:
Frontend2:
Server key beantragen und in Output oben eintragen
Schatten und Icon in Verzeichniss upload schieben
Datenbank SQL (mit Beispielen):
Code: Alles auswählen
CREATE TABLE `GoogleMaps` (
`ID` int(255) NOT NULL auto_increment,
`Lon` double NOT NULL,
`Lat` double NOT NULL,
`Art` text collate latin1_german1_ci NOT NULL,
`Ort` text collate latin1_german1_ci NOT NULL,
`Strasse` text collate latin1_german1_ci NOT NULL,
`Nr` varchar(6) collate latin1_german1_ci NOT NULL,
`PLZ` int(6) NOT NULL,
`Telefon` text collate latin1_german1_ci NOT NULL,
`Fax` text collate latin1_german1_ci NOT NULL,
`Beschreibung` text collate latin1_german1_ci NOT NULL,
`Bild` text collate latin1_german1_ci NOT NULL,
`Url` text collate latin1_german1_ci NOT NULL,
`Aktualisiert` datetime NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci AUTO_INCREMENT=13 ;
--
-- Daten für Tabelle `GoogleMaps`
--
INSERT INTO `GoogleMaps` (`ID`, `Lon`, `Lat`, `Art`, `Ort`, `Strasse`, `Nr`, `PLZ`, `Telefon`, `Fax`, `Beschreibung`, `Bild`, `Url`, `Aktualisiert`) VALUES (1, 7.892711, 48.648491, 'Gerätehaus', 'Diersheim', '', '', 0, '', '', '', '', '', '2006-12-27 23:00:23'),
(2, 7.967818, 48.707527, 'Gerätehaus', 'Helmlingen', '', '', 0, '', '', '', '', '', '2006-12-27 23:15:14'),
(3, 7.929774, 48.644663, 'Gerätehaus', 'Hausgereut', '', '', 0, '', '', '', '', '', '2006-12-27 23:15:01'),
(4, 7.924045, 48.653531, 'Gerätehaus', 'Rheinbischofsheim', '', '', 0, '', '', '', '', '', '2006-12-27 23:14:46'),
(5, 7.945706, 48.662127, 'Gerätehaus', 'Freistett', 'Maiwaldstraße', '37', 77866, '07844/2497', '', '', 'http://www.feuerwehr-rheinau.de/images/geratehauser/Freistett.JPG', '', '2006-12-27 23:11:28'),
(6, 7.920434, 48.625619, 'Gerätehaus', 'Holzhausen', '', '', 0, '', '', '', '', '', '2006-12-27 23:15:25'),
(7, 7.870449, 48.64164, 'Gerätehaus', 'Honau', '', '', 0, '', '', '', '', '', '2006-12-27 23:15:37'),
(8, 7.894873, 48.625513, 'Gerätehaus', 'Linx', '', '', 0, '', '', '', '', '', '2006-12-27 23:15:47'),
(9, 7.983128, 48.682167, 'Gerätehaus', 'Memprechtshofen', '', '', 0, '', '', '', '', '', '2006-12-27 23:15:57'),
(11, 7.89077351801098, 48.6437278892845, 'Schriftführer', 'Diersheim', '', '', 0, '', '', '', '', '', '0000-00-00 00:00:00');
Namen: gzoom.js in Ordner MANDANT/js/gzoom.js
Download: http://earthcode.com/blog/2006/07/gzoom.html
Input:
Code: Alles auswählen
?><?php
/***********************************************
* CONTENIDO MODUL - INPUT
*
* Modulname : GoogleMaps With Database 1.0
* Author(s) : DJ W. Markus Grampp
* Copyright : DJ W. Event- & IT-Service Markus Grampp
* Created : 28.12.06
************************************************/
/*
Server key beantragen
Schatten und Icon in Verzeichniss upload schieben
Belegte Variablen:
1
2
3
4
5
6
7
8
9
10
11
12
15
16
17
18
19
*/
/////////////////////////////// Art aus Tabelle lesen //////////////////////
$ArtAuflisten = "SELECT `Art` FROM `GoogleMaps` GROUP by `Art`";
$db->query($ArtAuflisten);
$SelectArtOutput .= "<strong>Art</strong> Wird automatisch aus der Tabellenspalte 'Art' ausgelesen.<br>";
$SelectArtOutput .= "<select name=\"CMS_VAR[5]\">";
while ($db->next_record())
{
if (CMS_VALUE[5] == $db->f(Art)) {
$SelectArtOutput .= '<option value="'.$db->f(Art).'" selected="selected">'.$db->f(Art).'</option>';
} else {
$SelectArtOutput .= '<option value="'.$db->f(Art).'">'.$db->f(Art).'</option>';
}
}
$SelectArtOutput .= "</select><hr>";
/////////////////////////////// Icon //////////////////////
#Selected img directory
$cms_dirname = "CMS_VALUE[1]";
#Selected img
$cms_filename = "CMS_VALUE[2]";
if ($cms_dirname == '' || $cms_dirname == '0') {
$cms_dirname = 'bilder/';
}
#Get paths
$sql = "SELECT
htmlpath, frontendpath
FROM
".$cfg["tab"]["clients"]."
WHERE
idclient = ".$client." ";
$db->query($sql);
if ($db->next_record()) {
$htmlpath = $db->f('htmlpath');
$frontendpath = $db->f('frontendpath');
}
#Choose image folder
$IconOutput = '<table cellpadding="0" cellspacing="0" border="0">
<tr><td class="text_medium" style="padding:5px">'.mi18n("Icon wählen").': </td></tr>
<tr><td class="text_medium" style="padding:5px">'.mi18n("Bildverzeichnis wählen").': </td></tr>
<tr><td class="text_medium" style="padding:5px">';
$IconOutput .= '<select name="CMS_VAR[1]" style="width:200px">';
#Get upload directories
$sql = "SELECT DISTINCT
dirname
FROM
".$cfg["tab"]["upl"]."
WHERE
idclient='$client' AND
filetype IN ('jpeg','jpg','gif','png')
ORDER BY
dirname";
$db->query($sql);
$selected = false;
while ($db->next_record()) {
$dirname = $db->f('dirname');
if ($cms_dirname != $dirname) {
$IconOutput .= '<option value="'.$dirname.'"> '.$dirname.'</option>';
} else {
$selected = true;
$IconOutput .= '<option value="'.$dirname.'" selected="selected"> '.$dirname.'</option>';
}
}
if (!$selected) {
$IconOutput .= '<option value="0" selected="selected">'.i18n("Bitte wählen").'</option>';
} else {
$IconOutput .= '<option value="0">'.i18n("Bitte wählen").'</option>';
}
#Choose image file
$IconOutput .= '</select> <input type="image" src="images/submit.gif">
<tr><td class="text_medium" style="padding:5px">'.mi18n("Bild wählen").': </td></tr>
<tr><td class="text_medium" style="padding:5px">';
$IconOutput .= '<select name="CMS_VAR[2]" style="width:200px">';
$IconOutput .= '<option value="0" selected="selected">'.i18n("Bitte wählen").'</option>';
if ($cms_dirname != '0') {
#Get uploaded files
$sql = "SELECT
filename
FROM
".$cfg["tab"]["upl"]."
WHERE
idclient = '$client' AND
filetype IN ('jpeg','jpg','gif','png','swf') AND
dirname = '$cms_dirname'
ORDER BY
filename";
$db->query($sql);
while ($db->next_record()) {
$img_name = $db->f('filename');
if ($cms_filename != $img_name) {
$IconOutput .= '<option value="'.$img_name.'"> '.$img_name.'</option>';
} else {
$IconOutput .= '<option selected="selected" value="'.$img_name.'"> '.$img_name.'</option>';
}
}
}
$IconOutput .= '</select> <input type="image" src="images/submit.gif">';
#Preview image
if ($cms_dirname != '0' AND $cms_filename != '0' AND strlen($cms_dirname) > 0 AND strlen($cms_filename) > 0) {
$img_path = $htmlpath.$cfgClient[$client]['upload'].$cms_dirname.$cms_filename;
$img_split = preg_split("/\./", $cms_filename);
$count = count($img_split);
$type = $img_split[$count -1];
$IconOutput .= '<tr><td colspan="2" style="padding:5px">
<img src="'.$img_path.'">
</td></tr> ';
}
$IconOutput .= '</td></tr>';
$IconOutput .= '</table>';
/////////////////////////////// Icon Schatten //////////////////////
#Selected img directory
$cms_dirname = "CMS_VALUE[3]";
#Selected img
$cms_filename = "CMS_VALUE[4]";
if ($cms_dirname == '' || $cms_dirname == '0') {
$cms_dirname = 'bilder/';
}
#Get paths
$sql = "SELECT
htmlpath, frontendpath
FROM
".$cfg["tab"]["clients"]."
WHERE
idclient = ".$client." ";
$db->query($sql);
if ($db->next_record()) {
$htmlpath = $db->f('htmlpath');
$frontendpath = $db->f('frontendpath');
}
#Choose image folder
$IconShadowOutput .= '<table cellpadding="0" cellspacing="0" border="0">
<tr><td class="text_medium" style="padding:5px">'.mi18n("Schatten für Icon wählen").': </td></tr>
<tr><td class="text_medium" style="padding:5px">'.mi18n("Bildverzeichnis wählen").': </td></tr>
<tr><td class="text_medium" style="padding:5px">';
$IconShadowOutput .= '<select name="CMS_VAR[3]" style="width:200px">';
#Get upload directories
$sql = "SELECT DISTINCT
dirname
FROM
".$cfg["tab"]["upl"]."
WHERE
idclient='$client' AND
filetype IN ('jpeg','jpg','gif','png')
ORDER BY
dirname";
$db->query($sql);
$selected = false;
while ($db->next_record()) {
$dirname = $db->f('dirname');
if ($cms_dirname != $dirname) {
$IconShadowOutput .= '<option value="'.$dirname.'"> '.$dirname.'</option>';
} else {
$selected = true;
$IconShadowOutput .= '<option value="'.$dirname.'" selected="selected"> '.$dirname.'</option>';
}
}
if (!$selected) {
$IconShadowOutput .= '<option value="0" selected="selected">'.i18n("Bitte wählen").'</option>';
} else {
$IconShadowOutput .= '<option value="0">'.i18n("Bitte wählen").'</option>';
}
#Choose image file
$IconShadowOutput .= '</select> <input type="image" src="images/submit.gif">
<tr><td class="text_medium" style="padding:5px">'.mi18n("Bild wählen").': </td></tr>
<tr><td class="text_medium" style="padding:5px">';
$IconShadowOutput .= '<select name="CMS_VAR[4]" style="width:200px">';
$IconShadowOutput .= '<option value="0" selected="selected">'.i18n("Bitte wählen").'</option>';
if ($cms_dirname != '0') {
#Get uploaded files
$sql = "SELECT
filename
FROM
".$cfg["tab"]["upl"]."
WHERE
idclient = '$client' AND
filetype IN ('jpeg','jpg','gif','png','swf') AND
dirname = '$cms_dirname'
ORDER BY
filename";
$db->query($sql);
while ($db->next_record()) {
$img_name = $db->f('filename');
if ($cms_filename != $img_name) {
$IconShadowOutput .= '<option value="'.$img_name.'"> '.$img_name.'</option>';
} else {
$IconShadowOutput .= '<option selected="selected" value="'.$img_name.'"> '.$img_name.'</option>';
}
}
}
$IconShadowOutput .= '</select> <input type="image" src="images/submit.gif">';
#Preview image
if ($cms_dirname != '0' AND $cms_filename != '0' AND strlen($cms_dirname) > 0 AND strlen($cms_filename) > 0) {
$img_path = $htmlpath.$cfgClient[$client]['upload'].$cms_dirname.$cms_filename;
$img_split = preg_split("/\./", $cms_filename);
$count = count($img_split);
$type = $img_split[$count -1];
$IconShadowOutput .= '<tr><td colspan="2" style="padding:5px">
<img src="'.$img_path.'">
</td></tr> ';
}
$IconShadowOutput .= '</td></tr>';
$IconShadowOutput .= '</table>';
/////////////////////////////// Start Coordinaten //////////////////////
$StartPosition .= "
<tr valign=\"top\">
<td colspan=\"2\"><strong>Mittelpunkt</strong></td>
</tr>
<tr valign=\"top\">
<td width=\"302\">Lat</td>
<td><INPUT TYPE=\"text\" NAME=\"CMS_VAR[11]\" VALUE=\"CMS_VALUE[11]\"></td>
</tr>
";
$StartPosition .= "
<tr valign=\"top\">
<td width=\"302\">Lon</td>
<td><INPUT TYPE=\"text\" NAME=\"CMS_VAR[12]\" VALUE=\"CMS_VALUE[12]\"></td>
</tr>
";
/////////////////////////////// Breite der Karte //////////////////////
$MapWidthOutput = "
<tr valign=\"top\">
<td width=\"302\">Breite der Karte</td>
<td><INPUT TYPE=\"text\" NAME=\"CMS_VAR[6]\" VALUE=\"CMS_VALUE[6]\">px</td>
</tr>
";
/////////////////////////////// Höhe der Karte //////////////////////
$MapHeightOutput = "
<tr valign=\"top\">
<td width=\"302\">Höhe der Karte</td>
<td><INPUT TYPE=\"text\" NAME=\"CMS_VAR[7]\" VALUE=\"CMS_VALUE[7]\">px</td>
</tr>";
/////////////////////////////// Karten Modus //////////////////////
$MapModeOutput = "
<tr valign=\"top\">
<td width=\"302\">Kartenart</td>
<td>
<select name=\"CMS_VAR[8]\">
<option value=\"0\">Karte</option>";
if (CMS_VALUE[8] == 1) {
$MapModeOutput .= '<option value="1" selected="selected">Satellit</option>';
} else {
$MapModeOutput .= '<option value="1">Satellit</option>';
}
if (CMS_VALUE[8] == 2) {
$MapModeOutput .= '<option value="2" selected="selected">Hybrid</option>';
} else {
$MapModeOutput .= '<option value="2">Hybrid</option>';
}
$MapModeOutput .= "
</select>
</td>
</tr>
";
/////////////////////////////// Zoom Modus //////////////////////
$ZoomModusOutput = "
<tr valign=\"top\">
<td width=\"302\">Zoomfunktion aneigen</td>
<td>
<select name=\"CMS_VAR[10]\">
";
if (CMS_VALUE[10] == 1) {
$ZoomModusOutput .= '<option value="1" selected="selected">Aus</option>';
} else {
$ZoomModusOutput .= '<option value="1">Aus</option>';
}
if (CMS_VALUE[10] == 2) {
$ZoomModusOutput .= '<option value="2" selected="selected">Kleine Richtungszeiger und +/-</option>';
} else {
$ZoomModusOutput .= '<option value="2">Kleine Richtungszeiger und +/-</option></option>';
}
if (CMS_VALUE[10] == 3) {
$ZoomModusOutput .= '<option value="4" selected="selected">nur +/-</option>';
} else {
$ZoomModusOutput .= '<option value="4">nur +/-</option>';
}
if (CMS_VALUE[10] == 4) {
$ZoomModusOutput .= '<option value="4" selected="selected">Karte verschieben, Zoombalken, Zentrieren</option>';
} else {
$ZoomModusOutput .= '<option value="4">Karte verschieben, Zoombalken, Zentrieren</option>';
}
$ZoomModusOutput .= "
</select>
</td>
</tr>";
/////////////////////////////// Kartenmodus schaltbar //////////////////////
if ("CMS_VALUE[15]" == 'true') {
$Mapmode = 'checked';
}
$MapmodeSwitchOutput = '
<tr>
<td class="text_medium" style="padding:5px;">Modus umschaltbar:</td>
<td style="padding:5px;"><input type="checkbox" name="CMS_VAR[15]" value="true" '.$Mapmode.'></td>
</tr>';
/////////////////////////////// Zoombox //////////////////////
if ("CMS_VALUE[16]" == 'true') {
$ZoomBox = 'checked';
}
$ZoomBoxOutput = '
<tr>
<td class="text_medium" style="padding:5px;">Zoombox anzeigen:</td>
<td style="padding:5px;"><input type="checkbox" name="CMS_VAR[16]" value="true" '.$ZoomBox.'></td>
</tr>';
/////////////////////////////// Massstab //////////////////////
if ("CMS_VALUE[17]" == 'true') {
$ScaleControl = 'checked';
}
$ScaleControlOutput = '
<tr>
<td class="text_medium" style="padding:5px;">Massstab anzeigen:</td>
<td style="padding:5px;"><input type="checkbox" name="CMS_VAR[17]" value="true" '.$ScaleControl.'></td>
</tr>';
/////////////////////////////// Übersichtskarte //////////////////////
if ("CMS_VALUE[18]" == 'true') {
$MiniMap = 'checked';
}
$MiniMapOutput = '
<tr>
<td class="text_medium" style="padding:5px;">Übersichtskarte anzeigen:</td>
<td style="padding:5px;"><input type="checkbox" name="CMS_VAR[18]" value="true" '.$MiniMap.'></td>
</tr>';
/////////////////////////////// Zoomstufe START //////////////////////
$ZoomstufenOutput="";
$ZoomstufenOutput .= '
<tr>
<td class="text_medium" style="padding:5px;">Zoomstufe:</td>
<td style="padding:5px;">
<select name="CMS_VAR[19]" size="1">';
$i=1;
while ($i <= 30) {
if ("CMS_VALUE[19]" == $i) {
$ZoomstufenOutput .= '<option value="'.$i.'" selected>'.$i.'</option>';
} else {
$ZoomstufenOutput .= '<option value="'.$i.'">'.$i.'</option>';
}
$i++;
}
$ZoomstufenOutput .= '</select></td></tr>';
/////////////////////////////// Zoomstufe ENDE //////////////////////
echo $SelectArtOutput; // Art aus Tabelle auslesen
echo $IconOutput; // Icon
echo $IconShadowOutput; // Icon Schatten
echo "<hr><table>";
echo $StartPosition; // Startposition
echo $MapWidthOutput; // Karten Breite
echo $MapHeightOutput; // Karten Höhe
echo $MapModeOutput; // Karten Modus
echo $ZoomModusOutput; // Zoommodus
echo $MapmodeSwitchOutput; // Kartenmodus
echo $ZoomBoxOutput; //Zoombox
echo $ScaleControlOutput; // Masstab
echo $MiniMapOutput; // Übersichtskarte
echo $ZoomstufenOutput; // Zoomstufe
echo "</table>";
?><?php
Output:
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : GoogleMaps With Database 1.0
* Author(s) : DJ W. Markus Grampp
* Copyright : DJ W. Event- & IT-Service Markus Grampp
* Created : 28.12.06
************************************************/
$ServerKey = 'ABQIAAAAX2fHWOqOFL9D9i7caE-s8BSTch4a3dgv1k47C2YOrhT8YXVm7kSW8zpbAUqHK2PWAvtg3Q'; //Lokal
$SelectArt ="CMS_VALUE[5]";// nach Art aus der Tabelle auswählen
$IconDirName = "CMS_VALUE[1]"; // Icon Verzeichniss Name
$IconFileName = "CMS_VALUE[2]"; // Icon Datei Name
$IconShadowDirName = "CMS_VALUE[3]"; // Schatten Verzeichniss Name
$IconShadowFileName = "CMS_VALUE[4]"; // Schatten Datei Name
$maptyp = CMS_VALUE[8];
$mapcontrol = CMS_VALUE[9];
$zoomcontrol = CMS_VALUE[10];
$MapModus = CMS_VALUE[15];
$ZoomBox = CMS_VALUE[16];
$ScaleControl = CMS_VALUE[17];
$MiniMap = CMS_VALUE[18];
$Zoomstufe = CMS_VALUE[19]; // 1 = weit 30 = nah
$KoordinatenArray[Ausrichtung][Breite] = "CMS_VALUE[11]";
$KoordinatenArray[Ausrichtung][Lange] = "CMS_VALUE[12]";
$KoordinatenArray[Kartengroesse][Hohe] = "CMS_VALUE[7]";
$KoordinatenArray[Kartengroesse][Breite] = "CMS_VALUE[6]";
////////////////////////////////////////////////////////////
// Controllelemente
if ($zoomcontrol == 1){
} elseif ($zoomcontrol == 2){
$KoordinatenArray[Controls][SmallMapControl] = "1"; // Oben Links: Kleine Richtungszeiger und +/-
} elseif ($zoomcontrol == 3){
$KoordinatenArray[Controls][SmallZoomControl] = "1"; // nur +/-
} elseif ($zoomcontrol == 4){
$KoordinatenArray[Controls][LargeMapControl] = "1"; // Karte verschieben, Zoombalken, Zentrieren
}
if ($MiniMap == true){$KoordinatenArray[Controls][OverviewMapControl] = "1"; } // Übersichtskarte
if ($ScaleControl == true){$KoordinatenArray[Controls][ScaleControl] = "1"; } // Massstab
if ($ZoomBox == true){$KoordinatenArray[Controls][ZoomBox] = "1";} // Zoombox
if ($MapModus == true){$KoordinatenArray[Controls][MapTypeControl]="1";} // Satelitten, Karte und Hybrid
////////////////////////////////////////////////////////////
// Kartentyp
// G_SATELLITE_MAP = Satkarte
// G_NORMAL_MAP = Strassenkarte
// G_HYBRID_MAP = Hybridkarte
$KoordinatenArray[MapType] = "G_HYBRID_MAP"; //
if ($maptyp==2){
$KoordinatenArray[MapType] = "G_HYBRID_MAP";
}elseif ($maptyp==1) {
$KoordinatenArray[MapType] = "G_SATELLITE_MAP";
}else{
$KoordinatenArray[MapType] = "G_NORMAL_MAP";
}
////////////////////////////////////////////////////////////
// Marker erstellen
$DatensaetzeLaden = "SELECT * FROM `GoogleMaps` WHERE `Art` = '".$SelectArt."' ";
$db->query($DatensaetzeLaden);
while ($db->next_record()) {
$FirstTab = "<strong>";
if ($db->f(Art)!="") {$FirstTab .= $db->f(Art)." ";}
if ($db->f(Ort)!="") {$FirstTab .= $db->f(Ort)."";}
$FirstTab .= "</strong><br>";
if ($db->f(Strasse)!="") {$FirstTab .= $db->f(Strasse)." ";}
if ($db->f(Nr)!="" && $db->f(Strasse)!="") {$FirstTab .= $db->f(Nr)."<br>";}
if ($db->f(PLZ)> 1) {$FirstTab .= $db->f(PLZ)." ";}
if ($db->f(Ort)!="") {$FirstTab .= $db->f(Ort)."<br>";}
if ($db->f(Telefon)!="") {$FirstTab .= "Telefon: ". $db->f(Telefon)."<br>";}
if ($db->f(Fax)!="") {$FirstTab .= "Fax: ". $db->f(Fax)."<br>";}
$Tab1='new GInfoWindowTab("Name", "'.$FirstTab.'")';
$Tab2='new GInfoWindowTab("Position", "<strong>Lon: </strong>'.$db->f(Lon).'<br><strong>Lat: </strong>'.$db->f(Lat).'")';
$Tab3="";
if ($db->f(Bild) != "") {
$Tab3=',
new GInfoWindowTab("Bild", "<a href=\"'.$db->f(Url).'\"><img src=\"'.$db->f(Bild).'\" width=\"300\" height=\"200\" border=\"0\"></a>" )';
}
$OutputMarkerCreate .='
// Tabs
var infoTabs'.$db->f(ID).' = [
'.$Tab1.',
'.$Tab2.'
'.$Tab3.'
];
// Marker platzieren
var marker'.$db->f(ID).' = new GMarker(new GLatLng('.$db->f(Lat).','.$db->f(Lon).'),iconsm);
GEvent.addListener(marker'.$db->f(ID).', "click", function() {
// Bei Klick auf Marker Fenster an
marker'.$db->f(ID).'.openInfoWindowTabsHtml(infoTabs'.$db->f(ID).');
});
map.addOverlay(marker'.$db->f(ID).');
';
}
//////////////////////////////////////////////////////////////////////////////////////////////////
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script src="http://maps.google.com/maps?file=api&v=2&key=<?php echo $ServerKey ?>" type="text/javascript"></script>
<script src="js/gzoom.js" type="text/javascript"></script>
<?php
//Kontrollelemente
$ControlOut="";
// Oben Links: Kleine Richtungszeiger und +/-
if ($KoordinatenArray[Controls][SmallMapControl] == "1") {
$ControlOut .= 'map.addControl(new GSmallMapControl());';
}
// Karte verschieben, Zoombalken, Zentrieren
if ($KoordinatenArray[Controls][LargeMapControl] == "1") {
$ControlOut .= 'map.addControl(new GLargeMapControl());';
}
// Satelitten, Karte und Hybrid
if ($KoordinatenArray[Controls][MapTypeControl] == "1") {
$ControlOut .= 'map.addControl(new GMapTypeControl());';
}
// nur +/-
if ($KoordinatenArray[Controls][SmallZoomControl] == "1") {
$ControlOut .= 'map.addControl(new GSmallZoomControl());';
}
// Massstab unten
if ($KoordinatenArray[Controls][ScaleControl] == "1") {
$ControlOut .= 'map.addControl(new GScaleControl()); ';
}
// Übersichtskarte
if ($KoordinatenArray[Controls][OverviewMapControl] == "1") {
$ControlOut .= 'map.addControl(new GOverviewMapControl(),new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(20,60)));';
}
// Zoom Box
if ($KoordinatenArray[Controls][ZoomBox] == "1") {
$ControlOut .= 'map.addControl(new GZoomControl(),new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(10,30)));';
}
$JavascriptOutput .= '
var map = new GMap2(document.getElementById("map"));
////////////////////////////////////////////////////////////////////////////////
// Keyboard Bedienbarkeit
new GKeyboardHandler(map);
GEvent.addListener(map,\'moveend\',makeMove);
';
////////////////////////////////////////////////////////////////////////////////
//Bedienelemente
$JavascriptOutput .= $ControlOut;
////////////////////////////////////////////////////////////////////////////////
$JavascriptOutput .= '
// Mittelpunkt setzen
map.setCenter(new GLatLng('.$KoordinatenArray[Ausrichtung][Breite].','.$KoordinatenArray[Ausrichtung][Lange].'),'.$Zoomstufe.');
';
////////////////////////////////////////////////////////////////////////////////
// Auf alle Punkte Zoomen
////////////////////////////////////////////////////////////////////////////////
//Kartentyp einstellen
$JavascriptOutput .= '
map.setMapType('.$KoordinatenArray[MapType].');
';
////////////////////////////////////////////////////////////////////////////////
$JavascriptOutput .= '
// Marker in Karte setzen
// Icon
var iconsm = new GIcon();
iconsm.image = "upload/'.$IconDirName.$IconFileName.'"; // Icon
iconsm.shadow = "upload/'.$IconShadowDirName.$IconShadowFileName.'"; // Schatten für Icon
iconsm.iconSize = new GSize(32, 32); // Größe Icon
iconsm.shadowSize = new GSize(56, 32); // Größe Schatten
iconsm.iconAnchor = new GPoint(16, 32);
iconsm.infoWindowAnchor = new GPoint(16, 0);
// vorher in Schleife zusammengestellte Punkte
'. $OutputMarkerCreate;
////////////////////////////////////////////////////////////////////////////////
?>
<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var map;
<?php
echo $JavascriptOutput;
?>
}
}
var moveX = 0;
var moveY = 0;
var moving = false;
// adjust scale to change the continious pan speed
var scale = 2;
function makeMove() {
if (!moving) return;
//GLog.write("pan "+moveX+","+moveY);
map.panBy(new GSize(moveX*scale,moveY*scale));
}
//]]>
</script>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map" style="width: <?php echo $KoordinatenArray[Kartengroesse][Breite];?>px; height: <?php echo $KoordinatenArray[Kartengroesse][Hohe];?>px"></div>
</body>
</html>
Frontend1:
Frontend2: