- Timestamp:
- Apr 7, 2010, 12:24:40 PM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/inc/KMLFile.class.php
r7661 r7692 12 12 class KMLFile { 13 13 private $template = ' 14 < ?xml version="1.0" encoding="UTF-8"?>14 <\?xml version="1.0" encoding="UTF-8"?> 15 15 <kml xmlns="http://www.opengis.net/kml/2.2"> 16 16 <Document> … … 135 135 } else { 136 136 $placemark = new KMLPlacemark(); 137 $placemark->setID($name); 137 138 $placemark->setName($name); 138 139 $placemark->setDescriptionLocation($descriptionLocation); … … 196 197 } else { 197 198 $placemark = new KMLPlacemark(); 199 $placemark->setID($host_name); 198 200 $placemark->setName($host_name); 199 201 $placemark->setDescriptionStatus($descriptionStatus); -
trunk/src/inc/KMLPlacemark.class.php
r7661 r7692 8 8 class KMLPlacemark { 9 9 private $template = ' 10 <Placemark >10 <Placemark id="%ID%"> 11 11 <name>%NAME%</name> 12 <visibility>0</visibility> 13 <description>%DESCRIPTION%</description> 12 <description> 13 <![CDATA[ 14 <img src="http://www.wirelessleiden.nl/sites/wirelessleiden.nl/files/garland-wl_logo.png" alt="Wireless Leiden" title="Wireless Leiden" style="float: right;"/> 15 %DESCRIPTION% 16 ]]> 17 </description> 14 18 <LookAt> 15 19 <longitude>%LONGITUDE%</longitude> … … 27 31 </Placemark>'; 28 32 33 private $id; // ID of the node 29 34 private $name; // Name of the node 30 35 private $descriptionLocation; // Location information of the node … … 40 45 */ 41 46 function __construct() { 47 $this->id = ''; 42 48 $this->name = ''; 43 49 $this->descriptionLocation = ''; … … 46 52 $this->latitude = 0; 47 53 $this->style = 'orangeArrowIcon'; 54 } 55 56 function setID($newID) { 57 $this->id = $newID; 48 58 } 49 59 … … 79 89 $toString = $this->template; 80 90 91 $toString = str_replace('%ID%', $this->id, $toString); 81 92 $toString = str_replace('%NAME%', $this->name, $toString); 82 93 $toString = str_replace('%DESCRIPTION%', $this->descriptionLocation . $this->descriptionStatus, $toString); -
trunk/src/index.php
r7661 r7692 31 31 $kml->addPlacemark($kmlPlacemark1); 32 32 $kml->addPlacemark($kmlPlacemark2); 33 echo $kml->toString(); 34 35 echo "\r\n\r\n\r\n\r\n\r\n -------------------------------------------------- \r\n\r\n\r\n\r\n\r\n"; 33 /* 34 * For testing, echo the example KML file 35 * echo $kml->toString(); 36 * echo "\r\n\r\n\r\n\r\n\r\n -------------------------------------------------- \r\n\r\n\r\n\r\n\r\n"; 37 */ 36 38 37 39 // Now let's try reading from files and parsing the data in the files. … … 42 44 $nodeLocation = new FileHandler($config['node_location_file']); 43 45 $kmlFile->parseLocationFile($nodeLocation->getFile()); 44 echo $kmlFile->toString(); 45 46 echo "\r\n\r\n\r\n\r\n\r\n -------------------------------------------------- \r\n\r\n\r\n\r\n\r\n"; 46 /* 47 * For testing, echo the example KML file 48 * echo $kmlFile->toString(); 49 * echo "\r\n\r\n\r\n\r\n\r\n -------------------------------------------------- \r\n\r\n\r\n\r\n\r\n"; 50 */ 47 51 48 52 // Let's try to read the node status file … … 50 54 $kmlFile->parseStatusFile($nodeStatus->getFile()); 51 55 echo $kmlFile->toString(); 52 /*53 * TODO: Needs better parsing of the file now we have two seperate54 * files for the location and the status of the nodes55 */56 56 ?>
Note:
See TracChangeset
for help on using the changeset viewer.