diff options
-rw-r--r-- | kml/data.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/kml/data.php b/kml/data.php index f5360d0..c301f33 100644 --- a/kml/data.php +++ b/kml/data.php @@ -430,7 +430,7 @@ foreach ($locations as $location) { ?> </Folder> <Folder> - <name>Links</name> + <name>Bodenlinks</name> <visibility>1</visibility> <?php foreach ($links as $link) { @@ -453,5 +453,28 @@ foreach ($links as $link) { } ?> </Folder> + <Folder> + <name>Linienlinks</name> + <visibility>0</visibility> +<?php +foreach ($links as $link) { + $data1 = $locations[$locids[$link->ipfromLoc]]; + $data2 = $locations[$locids[$link->iptoLoc]]; + //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" .' <altitudeMode>clampedToGround</altitudeMode><visibility>0</visibility>' . "\n"); + printf("\t" .' <coordinates>' . "\n"); + printf("\t" .' %s,%s' . "\n", $data1->lng, $data1->lat); + printf("\t" .' %s,%s' . "\n", $data2->lng, $data2->lat); + printf("\t" .' </coordinates>' . "\n"); + printf("\t" .' </LineString>' . "\n"); + printf("\t" .'</Placemark>' . "\n"); +} +?> + </Folder> </Document> </kml> |