source: trunk/src/kml-echo.php@ 7867

Last change on this file since 7867 was 7858, checked in by Pieter Naber, 15 years ago

Handover documentation

  • Property svn:eol-style set to native
File size: 907 bytes
Line 
1<?php
2/*
3 * Project: NodeMap2.0
4 * File: kml-echo.php
5 * Purpose: Echo our KML file directly (great for testing)
6 */
7
8require_once('config.php');
9require_once($config['file_init']);
10
11// Make it parse properly within Firefox so that it will display a DOM tree
12header('Content-Type: text/xml');
13echo '<?xml version="1.0" encoding="UTF-8"?>';
14// XXX: Doesn't show in Google Chrome
15
16// Let's try reading from files and parsing the data in the files.
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
28// And echo the result to the screen
29echo $kmlFile->toString();
30?>
Note: See TracBrowser for help on using the repository browser.