Changeset 7750 for trunk/src


Ignore:
Timestamp:
Apr 14, 2010, 9:43:42 AM (15 years ago)
Author:
Pieter Naber
Message:

Cleaned up index.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/index.php

    r7728 r7750  
    1111// Make it parse properly within Firefox so that it will display a DOM tree
    1212header('Content-Type: text/xml');
    13 
    14 // And echo the result to the screen
    15 // TODO: Need to fix this wierd error... Or is it just USBWebserver? Line is invisible!
    1613echo '<?xml version="1.0" encoding="UTF-8"?>';
    1714
    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.
    4716// First off, we create a new KMLFile object
    4817$kmlFile = new KMLFile();
     
    5120$nodeLocation = new FileHandler($config['node_location_file'], 'r');
    5221$kmlFile->parseLocationFile($nodeLocation->read());
    53 /*
    54  * For testing, echo the example KML file
    55  * 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  */
    5822
    5923// Let's try to read the node status file
     
    6125$kmlFile->parseStatusFile($nodeStatus->read());
    6226
     27if ($_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
    6332echo $kmlFile->toString();
    6433?>
Note: See TracChangeset for help on using the changeset viewer.