Last change
on this file since 7858 was 7858, checked in by Pieter Naber, 15 years ago |
Handover documentation
|
-
Property svn:eol-style
set to
native
|
File size:
907 bytes
|
Rev | Line | |
---|
[7725] | 1 | <?php
|
---|
| 2 | /*
|
---|
| 3 | * Project: NodeMap2.0
|
---|
[7789] | 4 | * File: kml-echo.php
|
---|
| 5 | * Purpose: Echo our KML file directly (great for testing)
|
---|
[7725] | 6 | */
|
---|
| 7 |
|
---|
| 8 | require_once('config.php');
|
---|
| 9 | require_once($config['file_init']);
|
---|
| 10 |
|
---|
[7728] | 11 | // Make it parse properly within Firefox so that it will display a DOM tree
|
---|
| 12 | header('Content-Type: text/xml');
|
---|
| 13 | echo '<?xml version="1.0" encoding="UTF-8"?>';
|
---|
[7858] | 14 | // XXX: Doesn't show in Google Chrome
|
---|
[7728] | 15 |
|
---|
[7750] | 16 | // Let's try reading from files and parsing the data in the files.
|
---|
[7725] | 17 | // First off, we create a new KMLFile object
|
---|
| 18 | $kmlFile = new KMLFile();
|
---|
| 19 |
|
---|
| 20 | // Let's try to read the node location file
|
---|
| 21 | $nodeLocation = new FileHandler($config['node_location_file'], 'r');
|
---|
| 22 | $kmlFile->parseLocationFile($nodeLocation->read());
|
---|
| 23 |
|
---|
| 24 | // Let's try to read the node status file
|
---|
| 25 | $nodeStatus = new FileHandler($config['node_status_file'], 'r');
|
---|
| 26 | $kmlFile->parseStatusFile($nodeStatus->read());
|
---|
| 27 |
|
---|
[7750] | 28 | // And echo the result to the screen
|
---|
[7725] | 29 | echo $kmlFile->toString();
|
---|
[7726] | 30 | ?>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.