Changeset 9276 for src/django_gheat/website/static
- Timestamp:
- Jun 22, 2011, 1:51:11 PM (13 years ago)
- Location:
- src/django_gheat/website/static
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/website/static/heatmap.js
r9275 r9276 19 19 //new OpenLayers.Control.ScaleLine(), 20 20 new OpenLayers.Control.Permalink(), 21 new OpenLayers.Control.LayerSwitcher(),21 //new OpenLayers.Control.LayerSwitcher(), 22 22 new OpenLayers.Control.MousePosition({ 'displayProjection' : projection_wgs }), 23 23 ], … … 56 56 map.addLayer(signallayer); 57 57 58 $("#default").append("<span id=\"" + layerHeatmap.name + "\"><input type=checkbox id=togglelayer />< font style='color:rgb(" + layerHeatmap.colour + ")'>" + layerHeatmap.name + " </font><br /></span>");58 $("#default").append("<span id=\"" + layerHeatmap.name + "\"><input type=checkbox id=togglelayer /><div id='layer_switcher_colour' style='background-color:rgb(" + layerHeatmap.colour + ")' /><font>" + layerHeatmap.name + " </font><br /></span>"); 59 59 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 $("#default").append("<span id=\"" + layerHeatmap2.name + "\"><input type=checkbox id=togglelayer checked/><div id='layer_switcher_colour' style='background-color:rgb(" + layerHeatmap2.colour + ")' /><font>" + layerHeatmap2.name + " </font><br /></span>"); 61 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>");62 $("#default").append("<span id=\"" + layerHeatmap3.name + "\"><input type=checkbox id=togglelayer checked/><div id='layer_switcher_colour' style='background-color:rgb(" + layerHeatmap3.colour + ")' /><font>" + layerHeatmap3.name + " </font><br /></span>"); 63 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 $("#default").append("<span id=\"" + signallayer.name + "\"><input type=checkbox id=togglelayer checked /><div id='layer_switcher_colour' style='background-color:rgb(" + signallayer.colour + ")' /><font>Signal strength: 0 - 100</font><br /></span>"); 65 65 } -
src/django_gheat/website/static/heatmap_extensions.js
r9275 r9276 69 69 }); 70 70 71 // toggle layer visibility per categorie 72 $("#togglecat").click(function(){ 73 layertype = $(this).closest('div').attr('id'); 74 75 76 }); 77 71 78 // remove layer 72 79 $("#rmvlayer").live("click", function(){ … … 122 129 // add filter per user 123 130 $('#user_filter').click(function(){ 124 if(this. value=='Add userfilter'){131 if(this.text=='(Add all users)'){ 125 132 $.each(userlist, function(u, user){ 126 133 colour = Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256); … … 138 145 filterlayer = new OpenLayers.Layer.OSM.Overlay(user, {isBaseLayer: false, visibility: true}); 139 146 map.addLayer(filterlayer); 140 $("#user").append("<span id=\"" + user + "\"><input type=checkbox id=togglelayer checked />< font style='color:rgb(" + colour + ")'>" + user + " </font><a id=rmvlayer>X</a><br /></span>");141 }); 142 $(this). attr('value', 'Del userfilter');147 $("#user").append("<span id=\"" + user + "\"><input type=checkbox id=togglelayer checked /><div id='layer_switcher_colour' style='background-color:rgb(" + colour + ")' /><font>" + user + " </font><a id=rmvlayer>X</a><br /></span>"); 148 }); 149 $(this).text('(Del all users'); 143 150 } 144 151 else{ 145 $(this). attr('value', 'Add userfilter');152 $(this).text('(Add all users)'); 146 153 $.each(userlist, function(u, user){ 147 154 layer = map.getLayersByName(user); … … 153 160 // add filter per node 154 161 $('#node_filter').click(function(){ 155 if(this. value=='Add nodefilter'){162 if(this.text=='(Add all nodes)'){ 156 163 $.each(nodelist, function(n, node){ 157 164 colour = Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256); … … 169 176 nodefilterlayer = new OpenLayers.Layer.OSM.Overlay(node, {isBaseLayer: false, visibility: true}); 170 177 map.addLayer(nodefilterlayer); 171 console.log(nodefilterlayer); 172 $("#node").append("<span id=\"" + node + "\"><input type=checkbox id=togglelayer checked /><font style='color:rgb(" + colour + ")'>" + node + " </font><a id=rmvlayer>X</a><br /></span>"); 173 }); 174 $(this).attr('value', 'Del nodefilter'); 178 $("#node").append("<span class='node' id=\"" + node + "\"><input type=checkbox id=togglelayer checked /><div id='layer_switcher_colour' style='background-color:rgb(" + colour + ")' /><font>" + node + " </font><a id=rmvlayer>X</a><br /></span>"); 179 }); 180 $(this).text('(Del all nodes)'); 175 181 } 176 182 else{ 177 $(this). attr('value', 'Add nodefilter');178 $.each( nodelist, function(n, node){179 layer = map.getLayersByName( node);183 $(this).text('(Add all nodes)'); 184 $.each($('#node span'), function(s, span){ 185 layer = map.getLayersByName(span.id); 180 186 map.removeLayer(layer[0]); 187 $(span).remove(); 181 188 }); 182 189 } … … 251 258 map.addLayer(filterlayer); 252 259 253 $("#custom").append("<span id=\"" + lname + "\"><input type=checkbox id=togglelayer checked />< font style='color:rgb(" + colour + ")'>" + lname + " </font><a id=rmvlayer>X</a><br /></span>");260 $("#custom").append("<span id=\"" + lname + "\"><input type=checkbox id=togglelayer checked /><div id='layer_switcher_colour' style='background-color:rgb(" + colour + ")' /><font>" + lname + " </font><a id=rmvlayer>X</a><br /></span>"); 254 261 }); 255 262 }); -
src/django_gheat/website/static/style.css
r9274 r9276 94 94 position:absolute; 95 95 right:-2px; 96 top:50%; 97 margin-top:-200px; 98 width:180px; 99 height:400px; 96 top:100px; 97 width:200px; 98 bottom:100px; 100 99 background-color:#FFF; 101 100 border:2px solid #BA0000; … … 103 102 padding:0; 104 103 font-size:10px; 105 overflow: 104 overflow:auto; 106 105 } 107 106 … … 119 118 position:absolute; 120 119 right:-2px; 121 top:50%; 122 margin-top:-200px; 120 top:101px; 123 121 width:17px; 124 122 height:17px; … … 129 127 font-size:15px; 130 128 overflow: auto; 129 } 130 131 #layer_switcher_colour{ 132 margin-top:4px; 133 margin-left:4px; 134 padding:0; 135 width:10px; 136 height:10px; 137 border:1px solid #000; 138 float:left; 131 139 } 132 140
Note:
See TracChangeset
for help on using the changeset viewer.