Changeset 9203
- Timestamp:
- May 18, 2011, 10:46:53 AM (14 years ago)
- Location:
- src/django_gheat/website
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/website/static/heatmap.js
r9201 r9203 1 var map; 1 2 function init(){ 2 3 … … 19 20 }); 20 21 21 map.events.register(' mouseover', map, GetMousePos);22 map.events.register('click', map, GetMousePos); 22 23 function GetMousePos(pos) { 23 24 var pix = map.getLonLatFromPixel(new OpenLayers.Pixel(pos.xy.x,pos.xy.y)); … … 65 66 list += json[i].fields.ssid + '<br>'; 66 67 } 67 document.getElementById(' nodelist').innerHTML=list;68 document.getElementById('filters').innerHTML=list; 68 69 } 69 70 } 70 71 71 nodelist.open("GET","/website/nodelist/" + zoomlevel + "," + mousepos.lat + "," + mousepos.lon,true); 72 72 nodelist.send(); 73 73 } 74 75 var apid = 1; 76 77 function filters(){ 78 var filter; 79 if (window.XMLHttpRequest){ 80 // code for IE7+, Firefox, Chrome, Opera, Safari 81 filter=new XMLHttpRequest(); 82 } 83 else{ 84 // code for IE6, IE5 85 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=" + apid 102 ]; 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
r9191 r9203 17 17 <h1>Info</h1><br /> 18 18 Info 19 <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()" /> 22 </form> 19 23 <div id="nodelist"></div> 20 24 </div>
Note:
See TracChangeset
for help on using the changeset viewer.