Changeset 211 for trunk/map/index.php
- Timestamp:
- May 10, 2009, 11:35:41 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 2 2 php_script_error.log 3 3 statistic 4 4 webis
-
- Property svn:ignore
-
trunk/map/index.php
r209 r211 17 17 $Output .= '<script type="text/javascript"> 18 18 19 var map; 20 19 21 function initialize() 20 22 { 21 23 if (GBrowserIsCompatible()) 22 24 { 23 varmap = new GMap2(document.getElementById("map_canvas"));25 map = new GMap2(document.getElementById("map_canvas")); 24 26 map.setMapType(G_SATELLITE_MAP); 25 27 map.setCenter(new GLatLng(49.260422, 18.081179), 15); 26 28 map.setUIToDefault(); 29 map.addControl(new GOverviewMapControl(new GSize(128, 96))); 30 27 31 28 32 // Create our "tiny" marker icon … … 37 41 // Set up our GMarkerOptions object literal 38 42 markerOptions = { icon:tinyIcon };'; 39 40 41 $DbResult = $this->Database->query('SELECT * FROM NetworkDevice'); 42 while($Device = $DbResult->fetch_assoc()) 43 { 44 $Output .= 'map.addOverlay(new GMarker(new GLatLng('.$Device['PositionLatitude'].', '.$Device['PositionLongitude'].'), markerOptions)); '; 43 44 $Output .= ' 45 } 45 46 } 46 47 48 function toggleLabel(id) 49 { 50 var ele = document.getElementById(id); 51 ele.checked = !ele.checked; 52 ele.onclick( ); 53 } 54 55 function UpdateNetworkLinks() 56 { 57 if ((document.getElementById("NetworkLinks")).checked == true) 58 { 59 NetworkLinks = ['; 47 60 $DbResult = $this->Database->query('SELECT * FROM NetworkLink WHERE Interface1 <> 0 AND Interface2 <> 0'); 48 61 while($Link = $DbResult->fetch_assoc()) … … 54 67 $Device1 = $DbResult2->fetch_assoc(); 55 68 $Device2 = $DbResult3->fetch_assoc(); 56 $Output .= ' map.addOverlay(new GPolyline([new GLatLng('.$Device1['PositionLatitude'].', '.$Device1['PositionLongitude'].'),new GLatLng('.$Device2['PositionLatitude'].', '.$Device2['PositionLongitude'].')], "#FFFFFF", 3, 0.8));';69 $Output .= 'new GPolyline([new GLatLng('.$Device1['PositionLatitude'].', '.$Device1['PositionLongitude'].'),new GLatLng('.$Device2['PositionLatitude'].', '.$Device2['PositionLongitude'].')], "#4F4FBF", 3, 0.8), '; 57 70 } 58 71 } 59 $Output .= ' 60 } 72 $Output .= ']; 73 for (var i in NetworkLinks) 74 { 75 map.addOverlay(NetworkLinks[i]); 76 } 77 78 } else { //checkbox turned off 79 for (var i in NetworkLinks) 80 { 81 map.removeOverlay(NetworkLinks[i]); 82 NetworkLinks[i] = null; 83 } 84 } 85 } 86 87 function toggleLabel(id) 88 { 89 var ele = document.getElementById(id); 90 ele.checked = !ele.checked; 91 ele.onclick( ); 92 } 93 94 function UpdateNetworkDevices() 95 { 96 if ((document.getElementById("NetworkDevices")).checked == true) 97 { 98 NetworkDevices = ['; 99 100 $DbResult = $this->Database->query('SELECT * FROM NetworkDevice'); 101 while($Device = $DbResult->fetch_assoc()) 102 { 103 $Output .= 'new GMarker(new GLatLng('.$Device['PositionLatitude'].', '.$Device['PositionLongitude'].'), markerOptions), '; 61 104 } 105 $Output .= ']; 106 for (var i in NetworkDevices) 107 { 108 map.addOverlay(NetworkDevices[i]); 109 } 110 111 } else { //checkbox turned off 112 for (var i in NetworkDevices) 113 { 114 map.removeOverlay(NetworkDevices[i]); 115 NetworkDevices[i] = null; 116 } 117 } 118 } 119 62 120 </script>'; 63 $Output .= '<div align="center"> 64 <div id="map_canvas" style="width: 800px; height: 500px;"></div> 65 <div id="message"></div> 66 <div id="message2"></div> 67 </div>'; 121 $Output .= '<table style="margin-left: auto; margin-right: auto; width: 100%; height: 80%;"> 122 <tr> 123 <td style="width: 80%; height: 100%;"> 124 <div id="map_canvas" style="width: 100%; height: 100%;"></div></td> 125 <td style="width: 20%"> 126 <form> 127 <input type="checkbox" id="NetworkLinks" onClick="UpdateNetworkLinks();" > 128 <a href="" onClick="toggleLabel(\'NetworkLinks\');return false;">Ukázat spoje</a> 129 </input><br /> 130 <input type="checkbox" id="NetworkDevices" onClick="UpdateNetworkDevices();" > 131 <a href="" onClick="toggleLabel(\'NetworkDevices\');return false;">Ukázat zařízení</a> 132 </input> 133 </form></td> 134 </tr> 135 </table>'; 68 136 return($Output); 69 137 }
Note:
See TracChangeset
for help on using the changeset viewer.