From a47c4eecff79c1d57650b46c437b628d873705b2 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Tue, 12 Nov 2013 18:24:00 +0000 Subject: bisher uncommitete aenderungen am www.ffgraz.net (nicht von mir) --- config.php | 5 +- data.php | 534 +++++++++++++++++++++++++++++++++++++++++++---------------- db.class.php | 94 +++++------ index.php | 282 +++++++++++++++++++------------ map.css | 20 ++- map.js | 264 +++++++++++++++++++++++++++-- 6 files changed, 870 insertions(+), 329 deletions(-) diff --git a/config.php b/config.php index 063a41f..3f0e272 100644 --- a/config.php +++ b/config.php @@ -6,15 +6,16 @@ $conf['db']['host'] = 'localhost'; $conf['db']['database'] = 'mappe'; $conf['topo']['file'] = 'topology.dot.plain'; +$conf['router']['file'] = 'InfoRouter.plain'; /* neue eintraege bitte kommentieren !!!! */ $conf['acl']['range'] = array( "10.0.0.0/8", // Funkfeuer Graz Private - "83.64.208.18/32", // Funkfeuer Graz Nat + "217.29.149.64/28", // 0xFF Citycom IP Bereich "193.33.150.0/23", // Funkfeuer Graz Public "193.238.156.0/22", // Funkfeuer Wien "89.106.208.0/21", // mur.at -// "84.119.56.63/32", // equinox home test +// "84.119.56.63/32", // equinox home test "212.17.113.195/32" // roland home wien ); diff --git a/data.php b/data.php index adcdbfa..2735c0b 100644 --- a/data.php +++ b/data.php @@ -1,145 +1,389 @@ -query("SELECT ip, location.id as locid,location.name as locname, node.name as nodename FROM ip, node, location WHERE ip.node_id = node.id and node.location_id=location.id"); -while ($data = $db->getNextObject()) { - $locids[$data->ip]= $data->locid; - $nodename[$data->ip]= $data->nodename; -} - -if($conf['acl']['auth']) - $db->query("SELECT id as locid, name as locname, pixel_x, pixel_y, gallery_link, location.hastinc as hastinc FROM location ORDER BY name ASC"); -else - $db->query("SELECT id as locid, name as locname, pixel_x, pixel_y, gallery_link, location.hastinc as hastinc FROM location WHERE location.hidden = 0 ORDER BY name ASC"); - -while ($data = $db->getNextObject()) { - if ($data->pixel_x == "0") - continue; - - $data->lng = $lng_startpoint + ($data->pixel_x - $x_startpoint) / $dx_dLng; - $data->lat = $lat_startpoint + ($y_startpoint - $data->pixel_y) / $dy_dLat; - $data->state = "offline"; - $locations[$data->locid] = $data; -} - -$regmatch = '#\"(.+)\" -> \"(.+)\"\[label=\"([0-9]+.[0-9]+)\"]#'; -$lines = file($conf['topo']['file']); - -$linecnt=0; -$i =0; -foreach ($lines as $num => $line) -{ - $linecnt++; - preg_match($regmatch,$line,$matches); - list( , $ipfromLoc, $iptoLoc, $label) = $matches; - - if (empty($ipfromLoc) || empty($iptoLoc) || empty($label)) - continue; - - if(empty($locations[$locids[$ipfromLoc]]->locid) || empty($locations[$locids[$iptoLoc]]->locid)) - continue; - - if($locations[$locids[$ipfromLoc]]->locid == $locations[$locids[$iptoLoc]]->locid) - continue; - - if($already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid]->used == true) { - $jot = $already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid]->i; - if($links[$jot]->label != -1) - $links[$jot]->label = ($links[$jot]->label + $label)/2; - } - elseif($already[$locations[$locids[$iptoLoc]]->locid . '-' . $locations[$locids[$ipfromLoc]]->locid]->used == true) { - $jot = $already[$locations[$locids[$iptoLoc]]->locid . '-' . $locations[$locids[$ipfromLoc]]->locid]->i; - if($links[$jot]->label != -1) - $links[$jot]->label = ($links[$jot]->label + $label)/2; - } - else { - $already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid]->used = true; - $already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid]->i = $i; - - $links[$i]->ipfromLoc = $ipfromLoc; - $links[$i]->iptoLoc = $iptoLoc; - if($links[$i]->label != -1) - $links[$i]->label = $label; - if($locations[$locids[$ipfromLoc]]->state == "offline") - $locations[$locids[$ipfromLoc]]->state = "online"; - if($locations[$locids[$iptoLoc]]->state == "offline") - $locations[$locids[$iptoLoc]]->state = "online"; - - if (($nodename[$ipfromLoc] == "tunnel" && $locations[$locids[$ipfromLoc]]->locname=="housing") || - ($nodename[$iptoLoc] == "tunnel" && $locations[$locids[$iptoLoc]]->locname=="housing" ) || - ($locations[$locids[$iptoLoc]]->hastinc && $locations[$locids[$ipfromLoc]]->hastinc)) { - $links[$i]->label = -1; - $locations[$locids[$ipfromLoc]]->state = "tunnel"; - $locations[$locids[$iptoLoc]]->state = "tunnel"; - } - - $i++; - } -} - - -echo "\n"; -echo "\n"; - -echo "\n"; -foreach ($locations as $location) { - $data = $locations[$location->locid]; - printf("\t" . '' . "\n", - $data->locid, $data->locname, $data->lat, $data->lng, $data->pixel_x, $data->pixel_y, $data->state, $data->gallery_link); -} -echo "\n"; - -echo "\n"; -foreach ($links as $link) -{ - $data1 = $locations[$locids[$link->ipfromLoc]]; - $data2 = $locations[$locids[$link->iptoLoc]]; - - $count[$data1->locid]=true; - $count[$data2->locid]=true; - - printf("\t" . '' . "\n", - $data1->locid, $data1->locname, $data1->lat,$data1->lng,$data2->locid, $data2->locname, $data2->lat, $data2->lng, $link->label); -} -echo "\n"; - -echo "\n"; -printf("\t" . '' . "\n"); -echo "\n"; - -echo ""; - -?> +query("SELECT ip, ip.name as ipname,location.id as locid,location.name as locname, node.name as nodename FROM ip, node, location WHERE ip.node_id = node.id and node.location_id=location.id"); +while ($data = $db->getNextObject()) { + $locids[$data->ip]= $data->locid; + $nodename[$data->ip]= $data->nodename; + $locname[$data->ip]= $data->locname; + $ipname[$data->ip]= $data->ipname; + $dnsname = $data->ipname.'.'.$data->nodename.'.'.$data->locname; + $dnsnames[$data->locid][]=$dnsname; + $ip[$dnsname]=$data->ip; + $nodelocname = $data->nodename.'.'.$data->locname; + $nodelocnames[$data->locid][]=$nodelocname; + $ipnodelocnames[$nodelocname][]=$data->ipname; +} +if($conf['acl']['auth']) + $db->query("SELECT id as locid, name as locname, pixel_x, pixel_y, gallery_link, location.hastinc as hastinc FROM location ORDER BY name ASC"); +else + $db->query("SELECT id as locid, name as locname, pixel_x, pixel_y, gallery_link, location.hastinc as hastinc FROM location WHERE location.hidden = 0 ORDER BY name ASC"); + +while ($data = $db->getNextObject()) { + if ($data->pixel_x == "0") + continue; + + $data->lng = $lng_startpoint + ($data->pixel_x - $x_startpoint) / $dx_dLng; + $data->lat = $lat_startpoint + ($y_startpoint - $data->pixel_y) / $dy_dLat; + $data->state = "offline"; + if($conf['acl']['auth']){ + foreach($nodelocnames[$data->locid] as $nodelocname){ + while(strpos($data->dnsnames,$nodelocname)===false){ + foreach($ipnodelocnames[$nodelocname] as $ipnodelocname){ +// echo $nodelocname; +// echo "\n"; +// print_r($ipnodelocnames[$nodelocname]); +// echo "\n"; +// echo $ipnodelocname; +// echo "\n"; + $channel=""; + $frequence=""; + $dnsname=$ipnodelocname.".".$nodelocname; + if($routerhash[$ip[$dnsname]][4]!=""){ + $channel= $routerhash[$ip[$dnsname]][4]; + } + if ($routerhash[$ip[$dnsname]][5]!=""){ + $frequence = $routerhash[$ip[$dnsname]][5]; + } + if ($channel!="" or $frequence!=""){ + $data->dnsnames = $dnsname." (Kanal: ".$channel." / ".$frequence." GHz);".$data->dnsnames; + break 2; + } + } + $data->dnsnames = $dnsname.";".$data->dnsnames; + } + } +/* foreach($dnsnames[$data->locid] as $dnsname){ + if(strpos($data->dnsnames,substr($dnsname,strpos($dnsname,".")))===false){ + $channel=""; + $frequence=""; + if($routerhash[$ip[$dnsname]][4]!=""){ + $channel= $routerhash[$ip[$dnsname]][4]; + } + if ($routerhash[$ip[$dnsname]][5]!=""){ + $frequence = $routerhash[$ip[$dnsname]][5]; + } + if ($channel!="" or $frequence!=""){ + $data->dnsnames = $dnsname." (Kanal: ".$channel." / ".$frequence."GHz);".$data->dnsnames; + break; + } else { + $data->dnsnames = $dnsname.";".$data->dnsnames; + } + } + } +*/ + } + $locations[$data->locid] = $data; +} + +$regmatch = '#\"(.+)\" -> \"(.+)\"\[label=\"([0-9]+.[0-9]+)\"]#'; +$lines = file($conf['topo']['file']); + +$linecnt=0; +$i =0; +foreach ($lines as $num => $line) +{ + + $linecnt++; + if(preg_match($regmatch,$line,$matches)==0) + continue; + + list( , $ipfromLoc, $iptoLoc, $label) = $matches; + + if (empty($ipfromLoc) || empty($iptoLoc) || empty($label)) + continue; + + if (empty($locids[$ipfromLoc]) || empty($locids[$iptoLoc])) + continue; + + if(empty($locations[$locids[$ipfromLoc]]->locid) || empty($locations[$locids[$iptoLoc]]->locid)) + continue; + + if($locations[$locids[$ipfromLoc]]->locid == $locations[$locids[$iptoLoc]]->locid) + continue; +// echo $locations[$locids[$ipfromLoc]]->locid; +// echo "-"; +// echo "$ipfromLoc\n"; +// echo $locations[$locids[$iptoLoc]]->locid; +// echo "\n\n"; +// echo "$iptoLoc\n"; + + + + if(isset($already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid])&& + ($already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid]->used == true)) { + $jot = $already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid]->i; + if($links[$jot]->label != -1){ + if (($links[$jot]->$ipfromLoc==$iptoLoc) || ($links[$jot]->$iptoLoc==$ipfromLoc)){ + $links[$jot]->label = ($links[$jot]->label + $label)/2; + } else if ($links[$jot]->label > $label){ + $links[$jot]->label = $label; + } + } + if (array_key_exists($ipfromLoc,$routerhash)){ + if ($routerhash[$ipfromLoc][4]!==""){ + $links[$jot]->channel = $routerhash[$ipfromLoc][4]; + + } + if ($routerhash[$ipfromLoc][5]!==""){ + $links[$jot]->frequence = $routerhash[$ipfromLoc][5]; + } + + } else if (array_key_exists($iptoLoc,$routerhash)){ + if ($routerhash[$iptoLoc][4]!==""){ + $links[$jot]->channel = $routerhash[$iptoLoc][4]; + } + if ($routerhash[$iptoLoc][5]!==""){ + $links[$jot]->frequence = $routerhash[$iptoLoc][5]; + } + } else{ + $links[$jot]->channel ="undef"; + $links[$jot]->frequence ="undef"; + // echo "keine IP\n"; + } + if (array_key_exists($ipfromLoc,$routerhash)){ + if($conf['acl']['auth']){ + if (strpos($links[$jot]->dnsfrom ,$routerhash[$ipfromLoc][1])===false){ + + $links[$jot]->dnsfrom =($routerhash[$ipfromLoc][1].' (Kanal: '.$links[$jot]->channel.' / '.$links[$jot]->frequence.' GHz)'.';'.($links[$jot]->dnsfrom)); + } + + } + if ($routerhash[$ipfromLoc][3]==$iptoLoc){ + $links[$jot]->defaultroute = "1"; + } + } + if (array_key_exists($iptoLoc,$routerhash)){ + if($conf['acl']['auth']){ + if (strpos($links[$jot]->dnsto ,$routerhash[$iptoLoc][1])===false){ +// echo "B\n"; + $links[$jot]->dnsto =($routerhash[$iptoLoc][1].' (Kanal: '.$links[$jot]->channel.' / '.$links[$jot]->frequence.' GHz)'.';'.($links[$jot]->dnsto)); + } + } + if ($routerhash[$iptoLoc][3]==$ipfromLoc){ + $links[$jot]->defaultroute = "1"; + } + } + + } + elseif(isset($already[$locations[$locids[$iptoLoc]]->locid . '-' . $locations[$locids[$ipfromLoc]]->locid])&& + ($already[$locations[$locids[$iptoLoc]]->locid . '-' . $locations[$locids[$ipfromLoc]]->locid]->used == true)) { + $jot = $already[$locations[$locids[$iptoLoc]]->locid . '-' . $locations[$locids[$ipfromLoc]]->locid]->i; + if($links[$jot]->label != -1){ + if (($links[$jot]->$ipfromLoc==$iptoLoc) || ($links[$jot]->$iptoLoc==$ipfromLoc)){ + $links[$jot]->label = ($links[$jot]->label + $label)/2; + } else if ($links[$jot]->label > $label){ + $links[$jot]->label = $label; + } + } + if (array_key_exists($ipfromLoc,$routerhash)){ + if ($routerhash[$ipfromLoc][4]!==""){ + $links[$jot]->channel = $routerhash[$ipfromLoc][4]; + + } + if ($routerhash[$ipfromLoc][5]!==""){ + $links[$jot]->frequence = $routerhash[$ipfromLoc][5]; + } + + } else if (array_key_exists($iptoLoc,$routerhash)){ + if ($routerhash[$iptoLoc][4]!==""){ + $links[$jot]->channel = $routerhash[$iptoLoc][4]; + } + if ($routerhash[$iptoLoc][5]!==""){ + $links[$jot]->frequence = $routerhash[$iptoLoc][5]; + } + } else{ + $links[$jot]->channel ="undef"; + $links[$jot]->frequence ="undef"; + // echo "keine IP\n"; + } + if (array_key_exists($ipfromLoc,$routerhash)){ + if($conf['acl']['auth']){ + if (strpos($links[$jot]->dnsto,$routerhash[$ipfromLoc][1])===false){ +// echo "C\n"; + $links[$jot]->dnsto =($routerhash[$ipfromLoc][1].' (Kanal: '.$links[$jot]->channel.' / '.$links[$jot]->frequence.' GHz)'.';'.($links[$jot]->dnsto)); + } + } + if ($routerhash[$ipfromLoc][3]==$iptoLoc){ + $links[$jot]->defaultroute = "1"; + } + } + if (array_key_exists($iptoLoc,$routerhash)){ + if($conf['acl']['auth']){ + if (strpos($links[$jot]->dnsfrom,$routerhash[$iptoLoc][1])===false){ +// echo "D\n"; + $links[$jot]->dnsfrom =($routerhash[$iptoLoc][1].' (Kanal: '.$links[$jot]->channel.' / '.$links[$jot]->frequence.' GHz)'.';'.($links[$jot]->dnsfrom)); + } + } + if ($routerhash[$iptoLoc][3]==$ipfromLoc){ + $links[$jot]->defaultroute = "1"; + } + } + + } + else { +// if(isset($already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid])) { + $already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid]->used = true; + $already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid]->i = $i; +// + $links[$i]->ipfromLoc = $ipfromLoc; + $links[$i]->iptoLoc = $iptoLoc; + + if (array_key_exists($ipfromLoc,$routerhash)){ + if ($routerhash[$ipfromLoc][4]!==""){ + $links[$i]->channel = $routerhash[$ipfromLoc][4]; + + } + if ($routerhash[$ipfromLoc][5]!==""){ + $links[$i]->frequence = $routerhash[$ipfromLoc][5]; + } + + } else if (array_key_exists($iptoLoc,$routerhash)){ + if ($routerhash[$iptoLoc][4]!==""){ + $links[$i]->channel = $routerhash[$iptoLoc][4]; + } + if ($routerhash[$iptoLoc][5]!==""){ + $links[$i]->frequence = $routerhash[$iptoLoc][5]; + } + } else{ + $links[$i]->channel ="undef"; + $links[$i]->frequence ="undef"; + // echo "keine IP\n"; + } + $links[$i]->defaultroute = "0"; + + if($conf['acl']['auth']){ + $links[$i]->dnsfrom =$ipname[$ipfromLoc].'.'.$nodename[$ipfromLoc].'.'.$locname[$ipfromLoc].' (Kanal: '.$links[$i]->channel.' / '.$links[$i]->frequence.' GHz )'; + $links[$i]->dnsto =$ipname[$iptoLoc].'.'.$nodename[$iptoLoc].'.'.$locname[$iptoLoc].' (Kanal: '.$links[$i]->channel.' / '.$links[$i]->frequence.' GHz)'; + } + + if (array_key_exists($ipfromLoc,$routerhash)){ + + if($conf['acl']['auth']){ + $links[$i]->dnsfrom =$routerhash[$ipfromLoc][1].' (Kanal: '.$links[$i]->channel.' / '.$links[$i]->frequence.' GHz)'; + } + if ($routerhash[$ipfromLoc][3]==$iptoLoc){ + $links[$i]->defaultroute = "1"; + } + } + if (array_key_exists($iptoLoc,$routerhash)){ + if($conf['acl']['auth']){ + $links[$i]->dnsto =$routerhash[$iptoLoc][1].' (Kanal: '.$links[$i]->channel.' / '.$links[$i]->frequence.' GHz)'; + } + + if ($routerhash[$iptoLoc][3]==$ipfromLoc){ + $links[$i]->defaultroute = "1"; + } + } + + + + if($links[$i]->label != -1){ + $links[$i]->label = $label; + if($locations[$locids[$ipfromLoc]]->state == "offline") + $locations[$locids[$ipfromLoc]]->state = "online"; + if($locations[$locids[$iptoLoc]]->state == "offline") + $locations[$locids[$iptoLoc]]->state = "online"; + } + if (($nodename[$ipfromLoc] == "tunnel" && $locations[$locids[$ipfromLoc]]->locname=="housing") || + ($nodename[$iptoLoc] == "tunnel" && $locations[$locids[$iptoLoc]]->locname=="housing" ) || + ($locations[$locids[$iptoLoc]]->hastinc && $locations[$locids[$ipfromLoc]]->hastinc)) { + $links[$i]->label = -1; + + $links[$i]->defaultroute ="1"; + $locations[$locids[$ipfromLoc]]->state = "tunnel"; + $locations[$locids[$iptoLoc]]->state = "tunnel"; + } + if (($nodename[$ipfromLoc] == "tunnel" && $locations[$locids[$ipfromLoc]]->locname=="housing") || + ($nodename[$iptoLoc] == "tunnel" && $locations[$locids[$iptoLoc]]->locname=="housing" )){ + $links[$i]->frequence ="LAN"; + $links[$i]->channel ="undef"; + } + + $i++; + } +} + + +echo "\n"; +echo "\n"; + +echo "\n"; +foreach ($locations as $location) { + $data = $locations[$location->locid]; + printf("\t" . '' . "\n", + $data->locid, $data->locname, $data->lat, $data->lng, $data->pixel_x, $data->pixel_y, $data->state, $data->gallery_link, $data->dnsnames); +} +echo "\n"; + +echo "\n"; + +foreach ($links as $link) + + +{ + $data1 = $locations[$locids[$link->ipfromLoc]]; + $data2 = $locations[$locids[$link->iptoLoc]]; + + $count[$data1->locid]=true; + $count[$data2->locid]=true; + + printf("\t" . '' . "\n", + $data1->locid, $data1->locname, $data1->lat,$data1->lng,$data2->locid, $data2->locname, $data2->lat, $data2->lng, $link->label, $link->channel, $link->defaultroute, $link->frequence, $link->dnsfrom,$link->dnsto); +} +echo "\n"; + +echo "\n"; +printf("\t" . '' . "\n"); +echo "\n"; + +echo ""; + +?> diff --git a/db.class.php b/db.class.php index 28dba49..0921bc8 100644 --- a/db.class.php +++ b/db.class.php @@ -1,47 +1,47 @@ -user = $user; - $this->pass = $pass; - $this->host = $host; - $this->dbname = $dbname; - $this->connect(); -} - -function connect() { - $this->db = mysql_connect($this->host, $this->user, $this->pass) - or $this->error("Verbindungsaufbau fehlgeschlagen"); - mysql_select_db($this->dbname); -} - -function error($msg) { - die($msg . ": " . @mysql_error()); -} - -function query($query) { - $this->res = mysql_query($query, $this->db) - or $this->error("Fehler bei Datenbankanfrage"); -} - -function escape_string($string) { - return mysql_real_escape_string($string, $this->db); -} - -function numObjects() { - return mysql_num_rows($this->res); -} - -function getNextObject() { - if (!$this->res) { - return; - } - return mysql_fetch_object($this->res); - } -} - - -?> +user = $user; + $this->pass = $pass; + $this->host = $host; + $this->dbname = $dbname; + $this->connect(); +} + +function connect() { + $this->db = mysql_connect($this->host, $this->user, $this->pass) + or $this->error("Verbindungsaufbau fehlgeschlagen"); + mysql_select_db($this->dbname); +} + +function error($msg) { + die($msg . ": " . @mysql_error()); +} + +function query($query) { + $this->res = mysql_query($query, $this->db) + or $this->error("Fehler bei Datenbankanfrage"); +} + +function escape_string($string) { + return mysql_real_escape_string($string, $this->db); +} + +function numObjects() { + return mysql_num_rows($this->res); +} + +function getNextObject() { + if (!$this->res) { + return; + } + return mysql_fetch_object($this->res); + } +} + + +?> diff --git a/index.php b/index.php index 8233594..28ac469 100644 --- a/index.php +++ b/index.php @@ -1,110 +1,172 @@ - - - - - - Funkfeuer Graz: Map - - - - - - - -
-
-
- Legende: - - - - - - - - -
 Online
 Offline
 Tunnel
 Gut
 Mittel
 Schlecht
 Tunnel
-
-
-
-
- Elemente
ausblenden
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
 
  
 
 
 
 
-
-
-
-
-
- -
-
- Adresse suchen: -
-

- - -

-
-
-
- - + + + + + + Funkfeuer Graz: Map + + + + + + + +
+
+
+
+ Legende: + + + + + + + + +
 Online
 Offline
 Tunnel
 Gut
 Mittel
 Schlecht
 Tunnel
+
+
+
+
+ Elemente
aus-/einblenden
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 !Default
 
  
 
 
 
 
+ + + +
 Kanaele undef.
+ + + + + +
 Alle 5GHz Kanaele
+ + + + + +
 Alle 2.4GHz Kanaele
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 1 2 3
 4 5 6
 7 8 9
 10 11 12
 13
+
+
+
+
+
+ +
+
+ Adresse suchen (Strassenname Nr. <, Ort>): +
+

+ + +

+
+
+
+ + diff --git a/map.css b/map.css index 0466143..fcc97f0 100644 --- a/map.css +++ b/map.css @@ -27,6 +27,7 @@ div.box { } #northeastcontainer { + position: absolute; right: 10px; top: 5ex; @@ -34,13 +35,14 @@ div.box { } #legendbox { + width: 90%; margin-top: 0; margin-left: auto; margin-right: 0; } #countbox { - width: 70%; + width: 90%; margin-top: 1ex; margin-left: auto; margin-right: 0; @@ -49,7 +51,7 @@ div.box { } #visibox { - width: 70%; + width: 90%; margin-top: 1ex; margin-left: auto; margin-right: 0; @@ -57,21 +59,21 @@ div.box { #southeastcontainer { position: absolute; - right: 10px; - bottom: 10px; + right: center; + bottom: 40px; padding: 0; } #loginbox { margin-top: 0; margin-left: auto; - marign-right: 0; + marign-right: center; } #addressbox { - margin-top: 1ex; + margin-top: 0; margin-left: auto; - margin-bottom: 0; + margin-bottom: 1ex; } #distboxouter { @@ -114,6 +116,10 @@ div.btn { color: black; } +*.linkinfo,table { + font-size: 8pt; + color: black; +} table.legend { margin-top: 3px; } diff --git a/map.js b/map.js index 3ac9685..e51aea5 100644 --- a/map.js +++ b/map.js @@ -1,10 +1,11 @@ var map = null; +var linkinfo; var physicalMaxLevel; var geocoder = null; var reloadcon = null; var countboxText = null; var overlays = new Array(); -overlays["newmarker"] = null; +overlays["new"] = null; overlays["ruler"] = new Array(); overlays["locations"] = new Array(); overlays["links"] = new Array(); @@ -21,10 +22,25 @@ function initialize(lat, lng, res) { map.disableDoubleClickZoom(); map.enableScrollWheelZoom(); - map.removeMapType(G_HYBRID_MAP); - map.removeMapType(G_SATELLITE_MAP); +// map.removeMapType(G_HYBRID_MAP); +// map.removeMapType(G_SATELLITE_MAP); map.addMapType(G_PHYSICAL_MAP); - map.setMapType(G_PHYSICAL_MAP); +// map.setMapType(G_HYBRID_MAP); + + // openStreetMap + var copyOSM = new GCopyrightCollection("OpenStreetMap"); + var copyOGDGraz = new GCopyrightCollection("Open Government Data Graz"); + copyOSM.addCopyright(new GCopyright(1, new GLatLngBounds(new GLatLng(-90,-180), new GLatLng(90,180)), 0, " ")); + var tilesOsmarender = new GTileLayer(copyOSM, 1, 17, {tileUrlTemplate: 'http://tah.openstreetmap.org/Tiles/tile/{Z}/{X}/{Y}.png'}); + var mapOsmarender = new GMapType([tilesOsmarender], G_NORMAL_MAP.getProjection(), "openSM", {urlArg: 'y'}); + map.addMapType(mapOsmarender); + var tilesMapnik = new GTileLayer(copyOSM, 1, 17, {tileUrlTemplate: 'http://tile.openstreetmap.org/{Z}/{X}/{Y}.png'}); + var mapMapnik = new GMapType([tilesMapnik], G_NORMAL_MAP.getProjection(), "Mapnik", {urlArg: 'x'}); + map.addMapType(mapMapnik); +// var tilesOpenGeoServer = new GTileLayer(copyOGDGraz, 1, 17, {tileUrlTemplate: 'http://services.opengeoserver.org/tiles/1.0.0/globe.aerial_EPSG3857/${Z}/${X}/${Y}.png?origin=nw'}); +// var mapOpenGeoServer = new GMapType([tilesOpenGeoServer], G_NORMAL_MAP.getProjection(), "OpenGeoServer"); +// map.addMapType(mapOpenGeoServer); + physicalMaxLevel = map.getCurrentMapType().getMaximumResolution(); if(res > physicalMaxLevel) { map.setMapType(G_NORMAL_MAP); @@ -39,11 +55,19 @@ function initialize(lat, lng, res) { GEvent.addListener(map, "addoverlay", onAddOverlay); GEvent.addListener(map, "zoomend", onZoom); GEvent.addListener(map, "click", onMapClick); - + + lineinfo = document.createElement("div"); + document.getElementById("map").appendChild(lineinfo); + lineinfo.style.visibility = "hidden" + + dnsinfo = document.createElement("div"); + document.getElementById("map").appendChild(dnsinfo); + dnsinfo.style.visibility = "hidden" + var mt = map.getMapTypes(); for (var i=0; i physicalMaxLevel) { - map.setMapType(G_NORMAL_MAP); + // map.setMapType(G_SATELLITE_MAP); } } function onMapClick(overlay, point) { if(!overlay) { + map.setCenter(point); setNewMarker(point); } } @@ -162,6 +187,7 @@ function Location(element) { location.pixel_y = parseInt(element.getAttribute("pixel_y")); location.state = element.getAttribute("state"); location.gallery_link = element.getAttribute("gallery_link"); + location.dnsnames = element.getAttribute("router_links"); return location; } @@ -172,18 +198,64 @@ function onLocationClick(latlng) { html += ''; html += ''; html += ''; - html += ''; - html += ''; + html += ''; + html += ''; if(locations[this.locid].gallery_link) { - html += ''; + html += ''; } else { - html += ''; - } + html += ''; + } + if (locations[this.locid].dnsnames){ + var dnsname = locations[this.locid].dnsnames.split(";"); + for (var i = 0;i < dnsname.length; ++i){ + if (dnsname[i]!==""){ + if(dnsname[i].indexOf(" (")>=0) { + link=dnsname[i].substring(0,dnsname[i].indexOf(" (")); + } else { + link=dnsname[i]; + } + html += ''; + } + } + } html += '
Breitengrad: ' + convertCoords(locations[this.locid].point.lat()) + '
Längengrad: ' + convertCoords(locations[this.locid].point.lng()) + '
Datenbank: Link
Smokeping: Link
Datenbank: Link-Database
Smokeping: Link-Smokeping
Galerie: Link
Galerie: Link-Galerie/Knoten
Galerie: Link
Galerie: Link-Galerie
Router: '+dnsname[i]+'
'; html += ''; this.openInfoWindowHtml(html); } +function onLineClick(line,latlng) { +// var html ='