Changeset 9207 for src/django_gheat/website/static
- Timestamp:
- May 19, 2011, 3:12:41 PM (14 years ago)
- Location:
- src/django_gheat/website/static
- Files:
-
- 1 added
- 1 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 }
Note:
See TracChangeset
for help on using the changeset viewer.