- Timestamp:
- Apr 13, 2010, 3:47:43 PM (15 years ago)
- Location:
- trunk/src/map/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/map/inc/node_info.php
r7725 r7734 1 1 <?php 2 $view = "";3 4 2 if(isset($_GET['view'])) 5 3 { 4 setcookie("view", $_GET['view']); 6 5 $view = $_GET['view']; 7 6 } 8 7 else 9 8 { 10 $view = "gebruiker"; 9 if(isset($_COOKIE['view'])) 10 { 11 $view = $_COOKIE['view']; 12 } 13 else 14 $view = "gebruiker"; 11 15 } 12 16 13 if($view == "beheerder") 17 //TYPES van nodes. 'cluster' is een cluster node. 'single' is een individuele node. 18 if(!isset($_GET['type'])) 14 19 { 15 20 echo <<<EOF 16 <div id="nodeinfo"> 17 <h1>Nodenaam</h1> 18 <h2> 19 Locatie: Oude Adeweg Leiderdorp <br/> 20 Meer info: <br/> 21 >>>>>>: <br/> 22 >>>>>>: <br/> 23 >>>>>>: <br/> 24 >>>>>>: <br/> 25 26 BEHEERDERSVIEW 27 </h2> 28 </div> 29 <div id="timestamp"> 30 Laatste update: 15:42 <br/> 31 Do 25 maart 32 </div> 21 <div id="nodeinfo"> 22 <b>Mouse over</b> een node voor meer informatie.<br/><br/> 23 <b>Klik</b> op een node om deze te selecteren.<br/><br/> 24 Gebruik de <b>zoekfunctie</b> om de een specifieke node te zoeken. 25 </div> 26 <div id="timestamp"> 27 Laatste update: 15:42 <br/> 28 Do 25 maart 29 </div> 33 30 EOF; 31 34 32 } 35 elseif($ view == "gebruiker")33 elseif($_GET['type'] == "single") 36 34 { 37 echo <<<EOF 38 <div id="nodeinfo"> 39 <h1>Nodenaam</h1> 40 <h2> 41 Locatie: Oude Adeweg Leiderdorp <br/> 42 Meer info: <br/> 43 >>>>>>: <br/> 44 >>>>>>: <br/> 45 >>>>>>: <br/> 46 >>>>>>: <br/> 47 48 GEBRUIKERSVIEW 49 </h2> 50 </div> 51 <div id="timestamp"> 52 Laatste update: 15:42 <br/> 53 Do 25 maart 54 </div> 35 if($view == "beheerder") 36 { 37 echo <<<EOF 38 <div id="nodeinfo"> 39 <h1>Nodenaam</h1> 40 <h2> 41 Locatie: Oude Adeweg Leiderdorp <br/> 42 Meer info: <br/> 43 >>>>>>: <br/> 44 >>>>>>: <br/> 45 >>>>>>: <br/> 46 >>>>>>: <br/> 47 48 BEHEERDERSVIEW 49 </h2> 50 </div> 51 <div id="timestamp"> 52 Laatste update: 15:42 <br/> 53 Do 25 maart 54 </div> 55 55 EOF; 56 } 56 } 57 elseif($view == "gebruiker") 58 { 59 echo <<<EOF 60 <div id="nodeinfo"> 61 <h1>Nodenaam</h1> 62 <h2> 63 Locatie: Oude Adeweg Leiderdorp <br/> 64 Meer info: <br/> 65 >>>>>>: <br/> 66 >>>>>>: <br/> 67 >>>>>>: <br/> 68 >>>>>>: <br/> 69 70 GEBRUIKERSVIEW 71 </h2> 72 </div> 73 <div id="timestamp"> 74 Laatste update: 15:42 <br/> 75 Do 25 maart 76 </div> 77 EOF; 78 } 79 } 80 elseif($_GET['type'] == "cluster") 81 { 82 if($view == "beheerder") 83 { 84 echo <<<EOF 85 <div id="nodeinfo"> 86 <h1>Nodes:</h1> 87 <h2> 88 Lijst met nodes in deze cluster<br/> 89 90 BEHEERDERSVIEW 91 </h2> 92 </div> 93 <div id="timestamp"> 94 Laatste update: 15:42 <br/> 95 Do 25 maart 96 </div> 97 EOF; 98 } 99 elseif($view == "gebruiker") 100 { 101 echo <<<EOF 102 <div id="nodeinfo"> 103 <h1>Nodes:</h1> 104 <h2> 105 Lijst met nodes in deze cluster<br/> 106 107 GEBRUIKERSVIEW 108 </h2> 109 </div> 110 <div id="timestamp"> 111 Laatste update: 15:42 <br/> 112 Do 25 maart 113 </div> 114 EOF; 115 } 116 } -
trunk/src/map/inc/nodemapWL.js
r7733 r7734 4 4 var marker_hash = {}; 5 5 var markerArray = new Array(); 6 var xmlhttp; 7 var targetDiv = "infotop"; 6 8 7 //This function is called from index.php 8 function initialize_map() { 9 //We will only do this function if the browser is compatible 10 if (GBrowserIsCompatible()) { 11 //Adding the google map into the div called #mapcanvas 12 map = new GMap2(document.getElementById("mapcanvas")); 13 //Center the map on Leiden 14 map.setCenter(new GLatLng(52.162687, 4.493294), 11); 15 map.setUIToDefault(); 16 17 //Go through the array 'markers' (Declared in index.php) and add a marker for each marker stored in the array using our addMarker function 18 for (var i=0; i<markers.length; i++) { 19 var current = markers[i]; 20 var marker = addMarker(current, i); 21 marker_hash[current.id] = {marker : marker}; 22 } 23 24 var markerClusterer = new MarkerClusterer(map, markerArray); 25 } 26 } 27 28 //This function will contain the displaying and not displaying of nodes on the map 29 function toggleMyKml() { 30 9 //This function is called from index.php 10 function initialize_map() { 11 //We will only do this function if the browser is compatible 12 if (GBrowserIsCompatible()) { 13 //Adding the google map into the div called #mapcanvas 14 map = new GMap2(document.getElementById("mapcanvas")); 15 //Center the map on Leiden 16 map.setCenter(new GLatLng(52.162687, 4.493294), 11); 17 map.setUIToDefault(); 18 19 //Go through the array 'markers' (Declared in index.php) and add a marker for each marker stored in the array using our addMarker function 20 for (var i=0; i<markers.length; i++) { 21 var current = markers[i]; 22 var marker = addMarker(current, i); 23 marker_hash[current.id] = {marker : marker}; 31 24 } 32 25 33 //This function adds a marker with an object from our 'marker'array defined in index.php 34 function addMarker(current, i) { 35 var id = current.id; 36 var marker = new GMarker(new GLatLng(current.latitude[0], current.longitude[0]), {title: id}); 37 //Added mouseover listener that calls on our mouseOver function when the mouse moves over a marker on the map 38 GEvent.addListener(marker, 'mouseover', function() { 39 mouseOver(current.id, current.name[0]); 40 }); 41 markerArray[i] = marker; 42 return marker; 43 } 26 var markerClusterer = new MarkerClusterer(map, markerArray); 27 } 28 } 29 30 //This function will contain the displaying and not displaying of nodes on the map 31 function toggleMyKml() { 32 33 } 34 35 //This function adds a marker with an object from our 'marker'array defined in index.php 36 function addMarker(current, i) { 37 var id = current.id; 38 var marker = new GMarker(new GLatLng(current.latitude[0], current.longitude[0]), {title: id}); 39 //Added mouseover listener that calls on our mouseOver function when the mouse moves over a marker on the map 40 GEvent.addListener(marker, 'mouseover', function() { 41 mouseOver(current.id, current.name[0]); 42 }); 43 markerArray[i] = marker; 44 return marker; 45 } 46 47 //Our mouseover function for single nodes. Gives the ID(our own given ID) and the name of the node. 48 function mouseOver(id, name) 49 { 50 //this.obj = document.getElementById("infotop"); 51 loadXMLDoc("inc/node_info.php?type=single") 52 //We will replace this function with a httprequest to a php file in the future 44 53 45 //Our mouseover function for single nodes. Gives the ID(our own given ID) and the name of the node.46 function mouseOver(id, name)47 {48 //For now we only post the id(We made ourself in kmlHandler) and the name of the node49 this.obj = document.getElementById("infotop"); 50 obj.innerHTML = id+" - "+name; 51 //We will replace this function with a httprequest to a php file in the future 52 53 54 /*55 *Hieronder verdergaan met dekking56 */54 55 /* 56 *Hieronder verdergaan met dekking 57 */ 58 } 59 60 //Our mouseover function for Cluster nodes. 'markers' is an array containing all markers within the cluster 61 function mouseOverCluster(markers) 62 { 63 var markerTitles = new Array; 64 for(var i=0; i<markers.length; i++) { 65 markerTitles.push(markers[i].marker.getTitle()); 57 66 } 58 67 59 //Our mouseover function for Cluster nodes. 'markers' is an array containing all markers within the cluster 60 function mouseOverCluster(markers) 61 { 62 var markerTitles = new Array; 63 this.obj = document.getElementById("infotop"); 64 for(var i=0; i<markers.length; i++) { 65 markerTitles.push(markers[i].marker.getTitle()+"<br/>"); 66 } 67 obj.innerHTML = markerTitles; 68 69 /* 70 *Hieronder verdergaan met dekking 71 */ 72 } 68 loadXMLDoc("inc/node_info.php?type=cluster") 69 /* 70 *Hieronder verdergaan met dekking 71 */ 72 } 73 73 74 75 //Code from w3schools. http://www.w3schools.com/dom/dom_http.asp 76 function loadXMLDoc(url) 77 { 78 xmlhttp=null; 79 if (window.XMLHttpRequest) 80 {// code for Firefox, Opera, IE7, etc. 81 xmlhttp=new XMLHttpRequest(); 82 } 83 else if (window.ActiveXObject) 84 {// code for IE6, IE5 85 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 86 } 87 if (xmlhttp!=null) 88 { 89 xmlhttp.onreadystatechange=state_Change; 90 xmlhttp.open("GET",url,true); 91 xmlhttp.send(null); 92 } 93 else 94 { 95 alert("Your browser does not support XMLHTTP."); 96 } 97 } 98 99 function state_Change() 100 { 101 if (xmlhttp.readyState==4) 102 {// 4 = "loaded" 103 if (xmlhttp.status==200) 104 {// 200 = "OK" 105 document.getElementById(targetDiv).innerHTML=xmlhttp.responseText; 106 } 107 else 108 { 109 alert("Problem retrieving data:" + xmlhttp.statusText); 110 } 111 } 112 }
Note:
See TracChangeset
for help on using the changeset viewer.