Changeset 9276 for src/django_gheat
- Timestamp:
- Jun 22, 2011, 1:51:11 PM (13 years ago)
- Location:
- src/django_gheat/website
- Files:
-
- 4 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 -
src/django_gheat/website/templates/home.html
r9275 r9276 59 59 </div> 60 60 <div id="layer_switcher"> 61 <div id="layer_switcher_cat">Default layers</div><p><span id="default"></span><p> 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 <div id="layer_switcher_cat">Users</div><p><span id="user"></span><input type="button" id="user_filter" value="Add userfilter"/><br /><P> 64 <div id="layer_switcher_cat">Custom filters</div><p><span id="custom"></span><p> 61 <div id="layer_switcher_cat"> 62 <input type=checkbox id=togglecat checked /> 63 Default layers 64 </div> 65 <p><span id="default"></span><p> 66 <div id="layer_switcher_cat"> 67 <input type=checkbox id=togglecat checked /> 68 Nodes <a style="margin-top:4px;font-size:10px;float:right;" id="node_filter">(Add all nodes)</a> 69 </div> 70 <p><span id="node"></span><p> 71 <div id="layer_switcher_cat"> 72 <input type=checkbox id=togglecat checked /> 73 Users <a style="margin-top:4px;font-size:10px;float:right;" id="user_filter">(Add all users)</a> 74 </div> 75 <p><span id="user"></span><P> 76 <div id="layer_switcher_cat"> 77 <input type=checkbox id=togglecat checked /> 78 Custom filters 79 </div><p><span id="custom"></span><p> 65 80 </div> 66 81 </body>
Note:
See TracChangeset
for help on using the changeset viewer.