Changeset 9570
- Timestamp:
- Aug 25, 2011, 3:07:00 PM (13 years ago)
- Location:
- src/django_gheat/wlheatmap
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/wlheatmap/static/heatmap.js
r9549 r9570 4 4 var map; 5 5 6 function init(){ 7 6 function init_heatmap(){ 8 7 var lat = getURLParameter('lat'); 9 8 var lon = getURLParameter('lon'); … … 54 53 55 54 layerHeatmap2 = new OpenLayers.Layer.OSM.Overlay2("All Access points", {isBaseLayer: false, visibility: false}); 56 map.addLayer(layerHeatmap2); 55 //map.addLayer(layerHeatmap2); 56 57 signallayer = new OpenLayers.Layer.OSM.Overlay4("signallayer", {isBaseLayer: false, visibility: false}); 58 map.addLayer(signallayer); 57 59 58 60 layerHeatmap3 = new OpenLayers.Layer.OSM.Overlay3("Wireless Leiden Only", {isBaseLayer: false, visibility: true}); … … 60 62 61 63 layerHeatmap = new OpenLayers.Layer.OSM.Overlay1("Original Heatmap generator", {isBaseLayer: false, visibility: false}); 62 map.addLayer(layerHeatmap);64 //map.addLayer(layerHeatmap); 63 65 64 66 var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()); 65 67 map.setCenter (lonLat, zoom); 66 68 67 signallayer = new OpenLayers.Layer.OSM.Overlay4("signallayer", {isBaseLayer: false, visibility: false});68 map.addLayer(signallayer);69 69 70 70 /** … … 73 73 */ 74 74 75 $("#default").append("<span id=\"" + layerHeatmap.name + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + layerHeatmap.colour + ")' /><input type=checkbox id=togglelayer /><font>" + layerHeatmap.name + " </font><br /></span>");75 //$("#default").append("<span id=\"" + layerHeatmap.name + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + layerHeatmap.colour + ")' /><input type=checkbox id=togglelayer /><font>" + layerHeatmap.name + " </font><br /></span>"); 76 76 77 $("#default").append("<span id=\"" + layerHeatmap2.name + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + layerHeatmap2.colour + ")' /><input type=checkbox id=togglelayer /><font>" + layerHeatmap2.name + " </font><br /></span>"); 77 //$("#default").append("<span id=\"" + layerHeatmap2.name + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + layerHeatmap2.colour + ")' /><input type=checkbox id=togglelayer /><font>" + layerHeatmap2.name + " </font><br /></span>"); 78 79 $("#default").append("<span id=\"" + signallayer.name + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + signallayer.colour + ")' /><input type=checkbox id=togglelayer /><font>Signal strength: 0 - 100</font><br /></span>"); 78 80 79 81 $("#default").append("<span id=\"" + layerHeatmap3.name + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + layerHeatmap3.colour + ")' /><input type=checkbox id=togglelayer checked/><font>" + layerHeatmap3.name + " </font><br /></span>"); 80 82 81 $("#default").append("<span id=\"" + signallayer.name + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + signallayer.colour + ")' /><input type=checkbox id=togglelayer /><font>Signal strength: 0 - 100</font><br /></span>");82 83 } -
src/django_gheat/wlheatmap/static/heatmap_extensions.js
r9406 r9570 55 55 * Function set in: 'jquery-ui-1.8.13.custom.min.js' 56 56 */ 57 function update_slider(min,max) { 58 $("#sig_value").text("Signal strength: " + min + " - " + max); 59 $("#signallayer font").text("All Signal strength: " + min + " - " + max); 60 }; 61 57 62 $("#slider").slider({ 58 63 range: true, … … 62 67 // while sliding, it changes the text above the slider to show the values realtime 63 68 slide: function(event, sig){ 64 $("#sig_value").text("Signal strength: " + sig.values[0] + " - " + sig.values[1]); 65 $("#signallayer font").text("Signal strength: " + sig.values[0] + " - " + sig.values[1]); 69 update_slider(sig.values[0], sig.values[1]); 66 70 }, 67 71 // on slider stop, it sets a new URL with updated values and redraws the layer 68 72 stop: function(event, sig){ 69 73 signallayer = map.getLayersByName('signallayer'); 70 signallayer[0].setUrl("tile/${z}/${x},${y}.png?colour= 250,250,0&signaal__gte=" + sig.values[0] + "&signaal__lte=" + sig.values[1]);74 signallayer[0].setUrl("tile/${z}/${x},${y}.png?colour=90,90,90&signaal__gte=" + sig.values[0] + "&signaal__lte=" + sig.values[1]); 71 75 signallayer[0].redraw(); 72 76 }, 73 77 }); 78 79 80 function init_slider(min, max) { 81 $("#slider").slider( "option", "values", [min,max] ); 82 signallayer = map.getLayersByName('signallayer'); 83 signallayer[0].setUrl("tile/${z}/${x},${y}.png?colour=90,90,90&signaal__gte=" + min + "&signaal__lte=" + max); 84 signallayer[0].redraw(); 85 update_slider(min,max); 86 }; 87 88 74 89 75 90 /** … … 349 364 $("#custom").append("<span id=\"" + lname + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + colour + ")' /><input type=checkbox id=togglelayer checked /><font>" + lname + " </font><a id=rmvlayer>X</a><br /></span>"); 350 365 }); 366 init_heatmap(); 367 init_slider(35,75); 351 368 }); -
src/django_gheat/wlheatmap/templates/home.html
r9544 r9570 8 8 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}heatmap.js"></script> 9 9 <script type="text/javascript" language="javascript" src="{{ STATIC_URL }}jquery.chained.js"></script> 10 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}heatmap_extensions.js"></script>11 10 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}colorpicker.js"></script> 12 11 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}jquery-ui-1.8.13.custom.min.js"></script> 12 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}heatmap_extensions.js"></script> 13 13 </head> 14 <body onload="init()">14 <body> 15 15 <div id="heatmap"></div> 16 16 <div id="container">
Note:
See TracChangeset
for help on using the changeset viewer.