- Timestamp:
- Apr 14, 2010, 9:43:42 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/index.php
r7728 r7750 11 11 // Make it parse properly within Firefox so that it will display a DOM tree 12 12 header('Content-Type: text/xml'); 13 14 // And echo the result to the screen15 // TODO: Need to fix this wierd error... Or is it just USBWebserver? Line is invisible!16 13 echo '<?xml version="1.0" encoding="UTF-8"?>'; 17 14 18 // Creating a placemark using our class 19 $kmlPlacemark1 = new KMLPlacemark(); 20 $kmlPlacemark1->setName('Test name'); 21 $kmlPlacemark1->setDescriptionLocation('Test location description'); 22 $kmlPlacemark1->setDescriptionStatus('Test status description'); 23 $kmlPlacemark1->setLatitude(52.138476); 24 $kmlPlacemark1->setLongitude(4.463046); 25 $kmlPlacemark1->setStyle(PLACEMARK_GREEN); 26 27 // Creating a second placemark using our class 28 $kmlPlacemark2 = new KMLPlacemark(); 29 $kmlPlacemark2->setName('Placemark 2 name'); 30 $kmlPlacemark2->setDescriptionLocation('This is the second placemark location description'); 31 $kmlPlacemark2->setDescriptionStatus('This is the second placemark status description'); 32 $kmlPlacemark2->setLatitude(52.638476); 33 $kmlPlacemark2->setLongitude(4.063046); 34 $kmlPlacemark2->setStyle(PLACEMARK_ORANGE); 35 36 // Creating a KMLFile using our class, add our placemarks and echo 37 $kml = new KMLFile(); 38 $kml->addPlacemark($kmlPlacemark1); 39 $kml->addPlacemark($kmlPlacemark2); 40 /* 41 * For testing, echo the example KML file 42 * echo $kml->toString(); 43 * echo "\r\n\r\n\r\n\r\n\r\n -------------------------------------------------- \r\n\r\n\r\n\r\n\r\n"; 44 */ 45 46 // Now let's try reading from files and parsing the data in the files. 15 // Let's try reading from files and parsing the data in the files. 47 16 // First off, we create a new KMLFile object 48 17 $kmlFile = new KMLFile(); … … 51 20 $nodeLocation = new FileHandler($config['node_location_file'], 'r'); 52 21 $kmlFile->parseLocationFile($nodeLocation->read()); 53 /*54 * For testing, echo the example KML file55 * echo $kmlFile->toString();56 * echo "\r\n\r\n\r\n\r\n\r\n -------------------------------------------------- \r\n\r\n\r\n\r\n\r\n";57 */58 22 59 23 // Let's try to read the node status file … … 61 25 $kmlFile->parseStatusFile($nodeStatus->read()); 62 26 27 if ($_GET['write'] == true) { 28 // TODO: David: Write the KML file to a folder with date stamp 29 } 30 31 // And echo the result to the screen 63 32 echo $kmlFile->toString(); 64 33 ?>
Note:
See TracChangeset
for help on using the changeset viewer.