Changeset 9275
- Timestamp:
- Jun 22, 2011, 10:46:13 AM (14 years ago)
- Location:
- src/django_gheat/website
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/website/static/OpenStreetMap.js
r9274 r9275 178 178 CLASS_NAME: "OpenLayers.Layer.Overlay" 179 179 }); 180 181 OpenLayers.Layer.OSM.Overlay4 = OpenLayers.Class(OpenLayers.Layer.OSM, { 182 initialize: function(name, options) { 183 var url = [ 184 "/website/tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=0&signaal__lte=100" 185 ]; 186 options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options); 187 var newArguments = [name, url, options]; 188 OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); 189 }, 190 colour: "250,250,0", 191 CLASS_NAME: "OpenLayers.Layer.Overlay" 192 }); -
src/django_gheat/website/static/heatmap.js
r9274 r9275 53 53 map.setCenter (lonLat, zoom); 54 54 55 $("#default").append("<span id=\"" + layerHeatmap.name + "\"><input type=checkbox id=togglelayer /><font style='color:rgb(" + layerHeatmap.colour + ")'>" + layerHeatmap.name + " </font><a id=rmvlayer>X</a><br /></span>"); 55 signallayer = new OpenLayers.Layer.OSM.Overlay4("signallayer", {isBaseLayer: false, visibility: true}); 56 map.addLayer(signallayer); 56 57 57 $("#default").append("<span id=\"" + layerHeatmap 2.name + "\"><input type=checkbox id=togglelayer checked/><font style='color:rgb(" + layerHeatmap2.colour + ")'>" + layerHeatmap2.name + " </font><a id=rmvlayer>X</a><br /></span>");58 $("#default").append("<span id=\"" + layerHeatmap.name + "\"><input type=checkbox id=togglelayer /><font style='color:rgb(" + layerHeatmap.colour + ")'>" + layerHeatmap.name + " </font><br /></span>"); 58 59 59 $("#default").append("<span id=\"" + layerHeatmap 3.name + "\"><input type=checkbox id=togglelayer checked/><font style='color:rgb(" + layerHeatmap3.colour + ")'>" + layerHeatmap3.name + " </font><a id=rmvlayer>X</a><br /></span>");60 $("#default").append("<span id=\"" + layerHeatmap2.name + "\"><input type=checkbox id=togglelayer checked/><font style='color:rgb(" + layerHeatmap2.colour + ")'>" + layerHeatmap2.name + " </font><br /></span>"); 60 61 62 $("#default").append("<span id=\"" + layerHeatmap3.name + "\"><input type=checkbox id=togglelayer checked/><font style='color:rgb(" + layerHeatmap3.colour + ")'>" + layerHeatmap3.name + " </font><br /></span>"); 61 63 62 63 64 $("#default").append("<span id=\"" + signallayer.name + "\"><input type=checkbox id=togglelayer checked /><font style='color:rgb(" + signallayer.colour + ")'>Signal strength: 0 - 100</font><br /></span>"); 64 65 } -
src/django_gheat/website/static/heatmap_extensions.js
r9274 r9275 50 50 slide: function(event, sig){ 51 51 $("#sig_value").text("Signal strength: " + sig.values[0] + " - " + sig.values[1]); 52 $("#signallayer font").text("Signal strength: " + sig.values[0] + " - " + sig.values[1]); 52 53 }, 53 54 // on slider stop, it tries to delete the old layer and creates a new layer with the slider values 54 55 stop: function(event, sig){ 55 if(signallayer){ 56 map.removeLayer(signallayer); 57 } 58 OpenLayers.Layer.OSM.Overlay = OpenLayers.Class(OpenLayers.Layer.OSM, { 59 initialize: function(name, options) { 60 var url = [ 61 "/website/tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=" + sig.values[0] + "&signaal__lte=" + sig.values[1] 62 ]; 63 options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options); 64 var newArguments = [name, url, options]; 65 OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); 66 }, 67 CLASS_NAME: "OpenLayers.Layer.Overlay" 68 }); 69 lname = "Signal strength: " + sig.values[0] + " - " + sig.values[1]; 70 signallayer = new OpenLayers.Layer.OSM.Overlay(lname, {isBaseLayer: false, visibility: true}); 71 map.addLayer(signallayer); 56 signallayer = map.getLayersByName('signallayer'); 57 console.log(signallayer[0]); 58 signallayer[0].setUrl("/website/tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=" + sig.values[0] + "&signaal__lte=" + sig.values[1]); 59 signallayer[0].redraw(); 72 60 }, 73 61 }); -
src/django_gheat/website/templates/home.html
r9274 r9275 59 59 </div> 60 60 <div id="layer_switcher"> 61 <div id="layer_switcher_cat"> Baselayers</div><p><span id="default"></span><p>61 <div id="layer_switcher_cat">Default layers</div><p><span id="default"></span><p> 62 62 <div id="layer_switcher_cat">Nodes</div><p><span id="node"></span><input type="button" id="node_filter" value="Add nodefilter"/><br /><p> 63 63 <div id="layer_switcher_cat">Users</div><p><span id="user"></span><input type="button" id="user_filter" value="Add userfilter"/><br /><P>
Note:
See TracChangeset
for help on using the changeset viewer.