Changeset 7767 for trunk/src/map/inc
- Timestamp:
- Apr 15, 2010, 3:16:24 PM (15 years ago)
- Location:
- trunk/src/map/inc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/map/inc/kmlHandler.php
r7725 r7767 1 1 <?php 2 //$file contains place of the KML file we will be getting our node information from 3 $file = "inc/example.kml"; 2 require_once($config['root']."/inc/LogHandler.class.php"); 4 3 5 //Check if the file exists, if it does we load it. If it doesn't we exit and return an error message 6 if (file_exists($file)) 4 function getArrayFromKML() 7 5 { 8 $xml = simplexml_load_file($file); 9 } 10 else 11 { 12 exit('Failed to open example.xml.'); 6 global $config; 7 $file = $config['kml_file']; 8 9 //Check if the file exists, if it does we load it. If it doesn't we exit and return an error message 10 if (file_exists($file)) 11 { 12 $xml = simplexml_load_file($file); 13 } 14 else 15 { 16 trigger_log(SYSLOG_CRIT, "Failed to open KML file $file", __FILE__, __LINE__); 17 } 18 19 //Counter starts at 0. For every foreach done counter will go up by one. Thus resulting in total nodes added(counter starts at 0 so add 1 to the total ) 20 $counter = 0; 21 22 //Now we go through the xml files, storing the data in an array called $markers. More data can be stored by adding more rows in the array 23 foreach($xml->Document->Folder->Placemark as $placemark) 24 { 25 26 $markers[(string)$placemark->name] = array( "latitude"=>$placemark->LookAt->latitude, 27 "longitude"=>$placemark->LookAt->longitude, 28 "name"=>$placemark->name, 29 "description"=>$placemark->description, 30 "id"=>$counter); 31 $counter++; 32 } 33 return $markers; 13 34 } 14 15 //Counter starts at 0. For every foreach done counter will go up by one. Thus resulting in total nodes added(counter starts at 0 so add 1 to the total )16 $counter = 0;17 18 //Now we go through the xml files, storing the data in an array called $markers. More data can be stored by adding more rows in the array19 foreach($xml->Document->Folder->Placemark as $placemark)20 {21 22 $markers[] = array( "latitude"=>$placemark->LookAt->latitude,23 "longitude"=>$placemark->LookAt->longitude,24 "name"=>$placemark->name,25 "description"=>$placemark->description,26 "id"=>$counter);27 $counter++;28 } -
trunk/src/map/inc/node_info.php
r7756 r7767 1 <?php 2 require_once("../../config.php"); 3 require_once($config['root']."/map/inc/kmlHandler.php"); 1 4 2 <?php3 5 if(isset($_GET['view'])) 4 6 { … … 43 45 elseif($_GET['type'] == "single") //Info for single nodes is stored here 44 46 { 47 $markers = getArrayFromKML(); 48 45 49 if($view == "beheerder")//Display part for beheerder view of a single node 46 50 { 47 echo <<<EOF 48 <div id="nodeinfo"> 49 <h1>Nodenaam</h1> 50 <h2> 51 Locatie: Oude Adeweg Leiderdorp <br/> 52 Meer info: <br/> 53 >>>>>>: <br/> 54 >>>>>>: <br/> 55 >>>>>>: <br/> 56 >>>>>>: <br/> 57 58 BEHEERDERSVIEW 59 </h2> 60 </div> 61 <div id="timestamp"> 62 Laatste update: 15:42 <br/> 63 Do 25 maart 64 </div> 65 EOF; 51 print $markers[$_GET['name']]['description']; 52 53 66 54 } 67 55 elseif($view == "gebruiker")//Display part for gebruiker view of a single node 68 56 { 69 echo <<<EOF 70 <div id="nodeinfo"> 71 <h1>Nodenaam</h1> 72 <h2> 73 Locatie: Oude Adeweg Leiderdorp <br/> 74 Meer info: <br/> 75 >>>>>>: <br/> 76 >>>>>>: <br/> 77 >>>>>>: <br/> 78 >>>>>>: <br/> 79 80 GEBRUIKERSVIEW 81 </h2> 82 </div> 83 <div id="timestamp"> 84 Laatste update: 15:42 <br/> 85 Do 25 maart 86 </div> 87 EOF; 57 88 58 } 89 59 } -
trunk/src/map/inc/nodemapWL.js
r7756 r7767 22 22 for (var i=0; i<markers.length; i++) { 23 23 var current = markers[i]; 24 var marker = addMarker(current, i); 25 marker_hash[current.id] = {marker : marker}; 24 var gMarker = addMarker(current, i); 26 25 } 27 26 … … 30 29 deSelect(); 31 30 }); 31 32 /* 33 * Hier zo circles toevoegen. 34 */ 32 35 33 36 var markerClusterer = new MarkerClusterer(map, markerArray); … … 76 79 { 77 80 overNode = true; 78 loadXMLDoc("inc/node_info.php?type=single ");81 loadXMLDoc("inc/node_info.php?type=single&name="+name+""); 79 82 /* 80 83 *Hieronder verdergaan met dekking
Note:
See TracChangeset
for help on using the changeset viewer.