- Timestamp:
- Apr 15, 2010, 6:14:05 PM (15 years ago)
- Location:
- trunk/src/map
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/map/inc/kmlHandler.php
r7767 r7769 1 1 <?php 2 require_once($config['root']."/inc/LogHandler.class.php"); 3 4 function getArrayFromKML() 2 //$file contains place of the KML file we will be getting our node information from 3 function get_node_array($file) 5 4 { 6 global $config;7 $file = $config['kml_file'];8 9 5 //Check if the file exists, if it does we load it. If it doesn't we exit and return an error message 10 6 if (file_exists($file)) … … 14 10 else 15 11 { 16 trigger_log(SYSLOG_CRIT, "Failed to open KML file $file", __FILE__, __LINE__);12 exit('Failed to open example.xml.'); 17 13 } 18 14 … … 24 20 { 25 21 26 $markers[ (string)$placemark->name] = array( "latitude"=>$placemark->LookAt->latitude,22 $markers[] = array( "latitude"=>$placemark->LookAt->latitude, 27 23 "longitude"=>$placemark->LookAt->longitude, 28 24 "name"=>$placemark->name, -
trunk/src/map/inc/node_info.php
r7767 r7769 1 1 <?php 2 require_once("../../config.php"); 3 require_once($config['root']."/map/inc/kmlHandler.php"); 2 require_once("kmlHandler.php"); 3 4 $markers = get_node_array("example.kml"); 4 5 5 6 if(isset($_GET['view'])) … … 45 46 elseif($_GET['type'] == "single") //Info for single nodes is stored here 46 47 { 47 $markers = getArrayFromKML();48 49 48 if($view == "beheerder")//Display part for beheerder view of a single node 50 49 { 51 print $markers[$_GET['name']]['description']; 52 53 50 echo <<<EOF 51 <div id="nodeinfo"> 52 <h1>Nodenaam</h1> 53 <h2> 54 Locatie: Oude Adeweg Leiderdorp <br/> 55 Meer info: <br/> 56 >>>>>>: <br/> 57 >>>>>>: <br/> 58 >>>>>>: <br/> 59 >>>>>>: <br/> 60 61 BEHEERDERSVIEW 62 </h2> 63 </div> 64 <div id="timestamp"> 65 Laatste update: 15:42 <br/> 66 Do 25 maart 67 </div> 68 EOF; 54 69 } 55 70 elseif($view == "gebruiker")//Display part for gebruiker view of a single node 56 71 { 57 72 echo <<<EOF 73 <div id="nodeinfo"> 74 <h1>Nodenaam</h1> 75 <h2> 76 Locatie: Oude Adeweg Leiderdorp <br/> 77 Meer info: <br/> 78 >>>>>>: <br/> 79 >>>>>>: <br/> 80 >>>>>>: <br/> 81 >>>>>>: <br/> 82 83 GEBRUIKERSVIEW 84 </h2> 85 </div> 86 <div id="timestamp"> 87 Laatste update: 15:42 <br/> 88 Do 25 maart 89 </div> 90 EOF; 58 91 } 59 92 } -
trunk/src/map/index.php
r7767 r7769 1 1 <?php 2 require_once("inc/kmlHandler.php"); 2 3 require_once("../config.php"); 3 require_once( $config['root']."/map/inc/kmlHandler.php");4 require_once("inc/node_info_start.php"); 4 5 5 $markers = getArrayFromKML(); 6 #getting array from kmlHandler 7 $markers = get_node_array($config['root']."/map/inc/example.kml"); 6 8 7 9 # Key is defined to be the domain name if exists … … 55 57 <div id="infotop"> 56 58 <!-- Calling on the node information from an external php file. inc/node_info.php --> 57 <?php ?>59 <?php node_info_start(); ?> 58 60 </div> 59 61
Note:
See TracChangeset
for help on using the changeset viewer.