diff options
author | Christian Pointner <equinox@ffgraz.net> | 2008-12-06 09:48:44 +0000 |
---|---|---|
committer | Christian Pointner <equinox@ffgraz.net> | 2008-12-06 09:48:44 +0000 |
commit | 551c3222b65f5c68d2e0e45ddff7c5e814316ed1 (patch) | |
tree | f7bbd520bd452dfd7df1d3a45079f2553fdbef30 /data.php | |
parent | 61448e4c2aabaf06cdae4160de77aaac8c7ad692 (diff) |
added drawLocations
Diffstat (limited to 'data.php')
-rw-r--r-- | data.php | 25 |
1 files changed, 16 insertions, 9 deletions
@@ -59,6 +59,7 @@ while ($data = $db->getNextObject()) { $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;
}
@@ -97,6 +98,19 @@ foreach ($lines as $num => $line) $links[$i]->ipfromLoc = $ipfromLoc;
$links[$i]->iptoLoc = $iptoLoc;
$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)) {
+ $link->label = -1;
+ $locations[$locids[$ipfromLoc]]->state = "tunnel";
+ $locations[$locids[$iptoLoc]]->state = "tunnel";
+ }
+
$i++;
}
}
@@ -108,21 +122,14 @@ echo "<root>\n"; echo "<nodes>\n";
foreach ($locations as $location) {
$data = $locations[$location->locid];
- printf("\t" . '<node id="%s" name="%s" lat="%s" lng="%s" pixel_x="%s" pixel_y="%s" gallery_link="%s"/>' . "\n",
- $data->locid, $data->locname, $data->lat, $data->lng, $data->pixel_x, $data->pixel_y, $data->gallery_link);
+ printf("\t" . '<node id="%s" name="%s" lat="%s" lng="%s" pixel_x="%s" pixel_y="%s" state="%s" gallery_link="%s"/>' . "\n",
+ $data->locid, $data->locname, $data->lat, $data->lng, $data->pixel_x, $data->pixel_y, $data->state, $data->gallery_link);
}
echo "</nodes>\n";
echo "<links>\n";
foreach ($links as $link)
{
- if (($nodename[$link->ipfromLoc] == "tunnel" && $locations[$locids[$link->ipfromLoc]]->locname=="housing") ||
- ($nodename[$link->iptoLoc] == "tunnel" && $locations[$locids[$link->iptoLoc]]->locname=="housing" ))
- $link->label = -1;
-
- if ($locations[$locids[$link->iptoLoc]]->hastinc && $locations[$locids[$link->ipfromLoc]]->hastinc)
- $link->label = -1;
-
$data1 = $locations[$locids[$link->ipfromLoc]];
$data2 = $locations[$locids[$link->iptoLoc]];
|