<?
/*
 * Project: NodeMap2.0
 * File: index.php
 * Purpose: Main index file of application
 */

require_once('config.php');
require_once($config['file_init']);

// Creating a placemark using our class
$kmlPlacemark = new KMLPlacemark();
$kmlPlacemark->setName('Test name');
$kmlPlacemark->setDescription('Test description');
$kmlPlacemark->setXCoordinate(52.138476);
$kmlPlacemark->setYCoordinate(4.463046);

// Creating a KMLFile using our class, add our placemark and echo
$kml = new KMLFile();
$kml->addPlacemark($kmlPlacemark);
echo $kml->toString();

// Let's try to read the node status file
$nodeStatus = new FileHandler($config['node_status_file']);
$kmlFile = KMLFile::parseFile($nodeStatus);
?>