source: trunk/src/index.php@ 7639

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

Added location of the file with the latitudes and longitudes of the nodes in config.php

File size: 1.4 KB
RevLine 
[7622]1<?
2/*
3 * Project: NodeMap2.0
4 * File: index.php
5 * Purpose: Main index file of application
6 */
7
[7629]8require_once('config.php');
9require_once($config['file_init']);
[7622]10
[7629]11// Creating a placemark using our class
[7637]12$kmlPlacemark1 = new KMLPlacemark();
13$kmlPlacemark1->setName('Test name');
14$kmlPlacemark1->setDescription('Test description');
15$kmlPlacemark1->setLatitude(52.138476);
16$kmlPlacemark1->setLongitude(4.463046);
17$kmlPlacemark1->setStyle(PLACEMARK_GREEN);
[7628]18
[7637]19// Creating a second placemark using our class
20$kmlPlacemark2 = new KMLPlacemark();
21$kmlPlacemark2->setName('Placemark 2 name');
22$kmlPlacemark2->setDescription('This is the second placemark description');
23$kmlPlacemark2->setLatitude(52.638476);
24$kmlPlacemark2->setLongitude(4.063046);
25$kmlPlacemark2->setStyle(PLACEMARK_ORANGE);
26
27// Creating a KMLFile using our class, add our placemarks and echo
[7627]28$kml = new KMLFile();
[7637]29$kml->addPlacemark($kmlPlacemark1);
30$kml->addPlacemark($kmlPlacemark2);
[7628]31echo $kml->toString();
[7629]32
[7639]33// Let's try to read the node location file
34$nodeLocation = new FileHandler($config['node_location_file']);
35// TODO: Needs parsing
36
[7629]37// Let's try to read the node status file
38$nodeStatus = new FileHandler($config['node_status_file']);
[7637]39$kmlFile = KMLFile::parseFile($nodeStatus->getFile());
[7639]40/*
41 * TODO: Needs better parsing of the file now we have two seperate
42 * files for the location and the status of the nodes
43 */
[7622]44?>
Note: See TracBrowser for help on using the repository browser.