Changeset 9207
- Timestamp:
- May 19, 2011, 3:12:41 PM (14 years ago)
- Location:
- src/django_gheat/website
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/website/static/heatmap.js
r9203 r9207 47 47 map.setCenter (lonLat, zoom); 48 48 } 49 50 function getNodeList(zoomlevel, mousepos){51 var nodelist;52 if (window.XMLHttpRequest){53 // code for IE7+, Firefox, Chrome, Opera, Safari54 nodelist=new XMLHttpRequest();55 }56 else{57 // code for IE6, IE558 nodelist=new ActiveXObject("Microsoft.XMLHTTP");59 }60 61 nodelist.onreadystatechange=function(){62 if (nodelist.readyState==4 && nodelist.status==200){63 json=eval('(' + nodelist.responseText + ')');64 var list = '<br>';65 for (var i=0; i<json.length; i++){66 list += json[i].fields.ssid + '<br>';67 }68 document.getElementById('filters').innerHTML=list;69 }70 }71 nodelist.open("GET","/website/nodelist/" + zoomlevel + "," + mousepos.lat + "," + mousepos.lon,true);72 nodelist.send();73 }74 75 var apid = 1;76 77 function filters(){78 var filter;79 if (window.XMLHttpRequest){80 // code for IE7+, Firefox, Chrome, Opera, Safari81 filter=new XMLHttpRequest();82 }83 else{84 // code for IE6, IE585 filter=new ActiveXObject("Microsoft.XMLHTTP");86 }87 88 filter.onreadystatechange=function(){89 if (filter.readyState==4 && filter.status==200){90 map.addLayer(layerHeatmap3);91 }92 }93 var apid = encodeURIComponent(document.getElementById("apid").value);94 addFilter(apid);95 }96 97 function addFilter(apid){98 OpenLayers.Layer.OSM.Overlay = OpenLayers.Class(OpenLayers.Layer.OSM, {99 initialize: function(name, options) {100 var url = [101 "/website/tile/${z}/${x},${y}.png?colour=0,0,255&accespoint__id=" + apid102 ];103 options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);104 var newArguments = [name, url, options];105 OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);106 },107 CLASS_NAME: "OpenLayers.Layer.Overlay"108 });109 110 testlayer = new OpenLayers.Layer.OSM.Overlay("addFilter layer", {isBaseLayer: false, visibility: true});111 map.addLayer(testlayer);112 } -
src/django_gheat/website/templates/home.html
r9203 r9207 5 5 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}OpenStreetMap.js"></script> 6 6 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}heatmap.js"></script> 7 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}heatmap_extensions.js"></script> 7 8 </head> 8 9 <body onload="init()"> … … 18 19 Info 19 20 <form method="get" action=""> 20 Accespoint ID: <input type="text" id="apid" name="apid" size="25" /> <br /> 21 <input type="button" value="submit" onClick="filters()" /> 21 Gebruiker: <input type="text" id="user" name="user" size="25"/> <br /> 22 Meetrondje: <input type="text" id="dataset" name="dataset" size="25"/> <br /> 23 WirelessLeiden Node: <input type="text" id="wlnode" name="wlnode" size="25"/> <br /> 24 Encrypted: <input type="checkbox" id="enc" name="enc"/> <br /> 25 Datum: <input type="text" id="date" name="date" size="25"/> <br /> 26 Colour: <input type="text" id="colour" name="colour" size="25"/> <br /> 27 Layernaam: <input type="text" id="lname" name="lname" size="25"/> <br /> 28 <input type="button" value="Add filter" onClick="filters()"/> 22 29 </form> 23 30 <div id="nodelist"></div>
Note:
See TracChangeset
for help on using the changeset viewer.