summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Mayrhofer <mtmayr@mtmayr.com>2020-02-23 13:21:51 +0100
committerMathias Mayrhofer <mtmayr@mtmayr.com>2020-02-23 13:21:51 +0100
commit6752d4defb195739c66a7dec94570d41ea8d295a (patch)
treee9e1377739ea815913ac5b1be8c4b3de12a0791b
parentae0b9a9782c7b781e688191018a66d5c1554437a (diff)
Links/Nodes fertiggestellt
-rw-r--r--kml/data.php59
1 files changed, 46 insertions, 13 deletions
diff --git a/kml/data.php b/kml/data.php
index 2513390..0eef510 100644
--- a/kml/data.php
+++ b/kml/data.php
@@ -383,19 +383,21 @@ foreach ($lines as $num => $line)
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" state="%s" gallery_link="%s" router_links="%s"/>' . "\n",
- // $data->locid, $data->locname, $data->lat, $data->lng, $data->pixel_x, $data->pixel_y, $data->state, $data->gallery_link, $data->dnsnames);
- printf("\t" .' <Placemark id="%s">' . "\n", $data->locid);
- printf("\t" .' <name>%s</name>' . "\n", $data->locname);
- printf("\t" .' <description><br>%s</br><br>%s</br><br>#%s, %s</br></description>' . "\n", $data->gallery_link, $data->dnsnames, $data->locid, $data->state);
- printf("\t" .' <styleUrl>#ffstyle_online</styleUrl>' . "\n");
- printf("\t" .' <Point>' . "\n");
- printf("\t" .' <extrude>1</extrude>' . "\n");
- printf("\t" .' <altitudeMode>relativeToGround</altitudeMode>' . "\n");
- printf("\t" .' <coordinates>' . "\n");
- printf("\t" .' %s,%s,60' . "\n", $data->lng, $data->lat);
- printf("\t" .' </coordinates>' . "\n");
- printf("\t" .' </Point>' . "\n");
- printf("\t" .' </Placemark>' . "\n");
+ // $data->locid, $data->locname, $data->lat, $data->lng, $data->pixel_x, $data->pixel_y, $data->state, $data->gallery_link, $data->dnsnames);
+ if ($data->state=='online') {
+ printf("\t" .'<Placemark id="%s">' . "\n", $data->locid);
+ printf("\t" .' <name>%s</name>' . "\n", $data->locname);
+ printf("\t" .' <description><br>%s</br><br>%s</br><br>#%s, %s</br></description>' . "\n", $data->gallery_link, $data->dnsnames, $data->locid, $data->state);
+ printf("\t" .' <styleUrl>#ffstyle_online</styleUrl>' . "\n");
+ printf("\t" .' <Point>' . "\n");
+ printf("\t" .' <extrude>1</extrude>' . "\n");
+ printf("\t" .' <altitudeMode>relativeToGround</altitudeMode>' . "\n");
+ printf("\t" .' <coordinates>' . "\n");
+ printf("\t" .' %s,%s,60' . "\n", $data->lng, $data->lat);
+ printf("\t" .' </coordinates>' . "\n");
+ printf("\t" .' </Point>' . "\n");
+ printf("\t" .'</Placemark>' . "\n");
+ }
}
?>
</Folder>
@@ -403,6 +405,25 @@ foreach ($locations as $location) {
<name>Offline</name>
<visibility>0</visibility>
<?php
+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" state="%s" gallery_link="%s" router_links="%s"/>' . "\n",
+ // $data->locid, $data->locname, $data->lat, $data->lng, $data->pixel_x, $data->pixel_y, $data->state, $data->gallery_link, $data->dnsnames);
+ if ($data->state=='offline') {
+ printf("\t" .'<Placemark id="%s">' . "\n", $data->locid);
+ printf("\t" .' <name>%s</name>' . "\n", $data->locname);
+ printf("\t" .' <description><br>%s</br><br>%s</br><br>#%s, %s</br></description>' . "\n", $data->gallery_link, $data->dnsnames, $data->locid, $data->state);
+ printf("\t" .' <styleUrl>#ffstyle_offline</styleUrl><visibility>0</visibility>' . "\n");
+ printf("\t" .' <Point>' . "\n");
+ printf("\t" .' <extrude>1</extrude>' . "\n");
+ printf("\t" .' <altitudeMode>relativeToGround</altitudeMode>' . "\n");
+ printf("\t" .' <coordinates>' . "\n");
+ printf("\t" .' %s,%s,60' . "\n", $data->lng, $data->lat);
+ printf("\t" .' </coordinates>' . "\n");
+ printf("\t" .' </Point>' . "\n");
+ printf("\t" .'</Placemark>' . "\n");
+ }
+}
?>
</Folder>
<Folder>
@@ -416,6 +437,18 @@ foreach ($links as $link) {
$count[$data2->locid]=true;
//printf("\t" . '<link fromid="%s" from="%s" latfrom="%s" lngfrom="%s" toid="%s" to="%s" latto="%s" lngto="%s" value="%s" channel="%s" defaultroute="%s" frequency="%s" dnsfrom="%s" dnsto="%s"/>' . "\n",
// $data1->locid, $data1->locname, $data1->lat,$data1->lng,$data2->locid, $data2->locname, $data2->lat, $data2->lng, $link->label, $link->channel, $link->defaultroute, $link->frequency, $link->dnsfrom,$link->dnsto);
+ printf("\t" .'<Placemark id="%s_%s">' . "\n", $data1->locid, $data2->locid);
+ printf("\t" .' <name>%s - %s</name>' . "\n", $data1->locname, $data2->locname);
+ printf("\t" .' <styleUrl>%s</styleUrl>' . "\n", ($link->label=='-1' ? '#ffstyle_vpn' : '#ffstyle_link'));
+ printf("\t" .' <LineString>' . "\n");
+ printf("\t" .' <extrude>1</extrude><tessellate>1</tessellate>' . "\n");
+ printf("\t" .' <altitudeMode>relativeToGround</altitudeMode>' . "\n");
+ printf("\t" .' <coordinates>' . "\n");
+ printf("\t" .' %s,%s,60' . "\n", $data1->lng, $data1->lat);
+ printf("\t" .' %s,%s,60' . "\n", $data2->lng, $data2->lat);
+ printf("\t" .' </coordinates>' . "\n");
+ printf("\t" .' </LineString>' . "\n");
+ printf("\t" .'</Placemark>' . "\n");
}
?>
</Folder>