Changeset 9302 for src/django_gheat/website/static
- Timestamp:
- Jun 27, 2011, 4:00:01 PM (13 years ago)
- Location:
- src/django_gheat/website/static
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/website/static/OpenStreetMap.js
r9275 r9302 139 139 }); 140 140 141 141 /** 142 * Gheat layer 143 */ 142 144 OpenLayers.Layer.OSM.Overlay1 = OpenLayers.Class(OpenLayers.Layer.OSM, { 143 145 initialize: function(name, options) { … … 153 155 }); 154 156 157 /** 158 * All accespoints 159 */ 155 160 OpenLayers.Layer.OSM.Overlay2 = OpenLayers.Class(OpenLayers.Layer.OSM, { 156 161 initialize: function(name, options) { … … 166 171 }); 167 172 173 /** 174 * Wireless Leiden nodes 175 */ 168 176 OpenLayers.Layer.OSM.Overlay3 = OpenLayers.Class(OpenLayers.Layer.OSM, { 169 177 initialize: function(name, options) { … … 179 187 }); 180 188 189 /** 190 * Signal strength 191 */ 181 192 OpenLayers.Layer.OSM.Overlay4 = OpenLayers.Class(OpenLayers.Layer.OSM, { 182 193 initialize: function(name, options) { -
src/django_gheat/website/static/heatmap.js
r9276 r9302 1 /** 2 * Var 'map' is set global, used in 'heatmap_extensions.js'. 3 */ 1 4 var map; 5 2 6 function init(){ 3 7 … … 16 20 controls: [ 17 21 new OpenLayers.Control.Navigation(), 22 new OpenLayers.Control.Permalink(), 23 new OpenLayers.Control.MousePosition({ 'displayProjection' : projection_wgs }), 24 25 /** 26 * Decided to disable these controls. 27 * The layerswitcher has been replaced with a custom one. If you want the original back, 28 * make sure to disable the custom one to prevent collision. 29 */ 30 18 31 //new OpenLayers.Control.PanZoomBar(), 19 32 //new OpenLayers.Control.ScaleLine(), 20 new OpenLayers.Control.Permalink(),21 33 //new OpenLayers.Control.LayerSwitcher(), 22 new OpenLayers.Control.MousePosition({ 'displayProjection' : projection_wgs }),23 34 ], 24 35 maxExtent: new OpenLayers.Bounds(-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892), … … 56 67 map.addLayer(signallayer); 57 68 69 /** 70 * Layers above are put in switcher, category 'default', with code below. 71 * TODO: Make process for putting layers into layerswitcher dynamic instead of putting every layer there manually. 72 */ 73 58 74 $("#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 75 -
src/django_gheat/website/static/heatmap_extensions.js
r9297 r9302 1 // Uses zoomlevel and mouseposition to call the nodelist.py view. View returns nodes in json format which is read and printed in document element. 1 /** 2 * Uses zoomleven and mouseposition to call nodelist.py view. 3 * View returns nodes in json format, values are printed in doc element. 4 */ 2 5 function getNodeList(zoomlevel, mousepos){ 3 6 $.getJSON("/website/nodelist/" + zoomlevel + "," + mousepos.lat + "," + mousepos.lon, … … 13 16 } 14 17 15 // Right way to get url parameters?: http://stackoverflow.com/questions/1403888/get-url-parameter-with-jquery/1404100#1404100 18 /** 19 * Right way to get url parameters? 20 * http://stackoverflow.com/questions/1403888/get-url-parameter-with-jquery/1404100#1404100 21 */ 16 22 function getURLParameter(name) { 17 23 return decodeURI( … … 25 31 var nodelist = new Array(); 26 32 27 // add colour picker 33 /** 34 * Adds colourpicker for layer colour. 35 * Function set in: 'colourpicker.js' 36 */ 28 37 $("#colour").colorPicker(); 29 38 30 // add date picker for start date 39 /** 40 * Adds datepicker for start & end date 41 * Function set in: 'jquery-ui-1.8.13.custom.min.js' 42 */ 31 43 $("#start_date").datepicker({ 32 44 dateFormat: "dd/mm/yy", … … 35 47 } 36 48 }); 37 38 // add date picker for end date39 49 $("#end_date").datepicker({ 40 50 dateFormat: "dd/mm/yy", 41 51 }); 42 52 43 // add slider for signal strength filter 53 /** 54 * Adds slider for signal strength layer. 55 * Function set in: 'jquery-ui-1.8.13.custom.min.js' 56 */ 44 57 $("#slider").slider({ 45 58 range: true, … … 61 74 }); 62 75 63 // toggle layer visibility 76 /** 77 * Toggles layer visibility on checkbox use from layerswitcher. 78 */ 64 79 $("#togglelayer").live('click', function(){ 65 80 status = $(this).attr("checked"); … … 69 84 }); 70 85 71 // toggle layer visibility per category 86 /** 87 * Toggles layer visibility per category on checkbox use from layerswitcher. 88 */ 72 89 $("#togglecat").live("click", function(){ 73 90 if($(this).attr("checked")){ … … 87 104 }); 88 105 89 // remove layer 106 /** 107 * Removes layer from map and layerswitcher. 108 */ 90 109 $("#rmvlayer").live("click", function(){ 91 110 layername = $(this).closest('span').attr('id'); … … 95 114 }); 96 115 97 // menu toggle 116 /** 117 * Toggles text shown on website. 118 * 'info' shows info text. 119 * 'filter' page shows text on filters & filter options. 120 */ 98 121 $("#menu_filter").click(function(){ 99 122 $("#filter").slideToggle("fast"); … … 105 128 }); 106 129 107 // switcher toggle 130 /** 131 * Toggles layerswitcher visibility. 132 * On 'off', toggler shows a '+'. 133 * On 'on', toggler shows a '-'. 134 */ 108 135 $("#layer_switcher_toggle").click(function(){ 109 136 $("#layer_switcher").toggle(); … … 116 143 }); 117 144 118 // Fastest?: http://stackoverflow.com/questions/170986/what-is-the-best-way-to-add-options-to-a-select-from-an-array-with-jquery 145 /** 146 * Fastest? 147 * http://stackoverflow.com/questions/170986/what-is-the-best-way-to-add-options-to-a-select-from-an-array-with-jquery 148 */ 119 149 $.getJSON("/website/filters/", 120 150 function(json) { … … 123 153 userlist.push(json.gebruiker); 124 154 $.each(json.meetrondje, function(m, meetrondje){ 155 console.log(meetrondje.datum); 125 156 $("#select_dataset").append($("<option/>").attr({"class":json.gebruiker, "value":meetrondje.naam}).text(meetrondje.naam)); 126 157 $.each(meetrondje.nodes, function(n, nodes){ … … 138 169 ); 139 170 140 // add filter per user 171 /** 172 * Earlier process got all users in JSON and put them in array. 173 * For each user in array, new layer is added with username as parameter. 174 * Layercolour is randomized. 175 * If button is pressed again, layers will be deleted. 176 */ 141 177 $('#user_filter').click(function(){ 142 178 if(this.text=='(Add all users)'){ … … 169 205 }); 170 206 171 // add filter per node 207 /** 208 * Earlier process got all nodes in JSON and put them in array. 209 * For each node in array, new layer is added with node as parameter. 210 * Layercolour is randomized. 211 * If button is pressed again, layers will be deleted. 212 */ 172 213 $('#node_filter').click(function(){ 173 214 if(this.text=='(Add all nodes)'){ … … 201 242 }); 202 243 203 // add custom filter 244 /** 245 * Adds a new layer when clicked. 246 * Filters set by user are used as layer parameters. 247 * Colour is either chosen or randomized. 248 * Blank parameters are ignored. 249 */ 204 250 $('#add_filter').click(function(){ 205 // get values from elements251 // get values from elements 206 252 user = $('#select_user option:selected').text(); 207 253 dataset = $('#select_dataset option:selected').text(); … … 212 258 lname = encodeURIComponent(document.getElementById("lname").value); 213 259 214 // HEX to RGB: http://stackoverflow.com/questions/5798868/need-some-tips-with-how-to-convert-a-hexadecimal-color-value-to-a-rgb-one/5798900#5798900 215 // '#' comes out as '%23', so substr() starts at char 3 260 /** 261 * On HEX to RGB: 262 * http://stackoverflow.com/questions/5798868/need-some-tips-with-how-to-convert-a-hexadecimal-color-value-to-a-rgb-one/5798900#5798900 263 * Note that '#' comes out as '%23', so substr() starts at char 3 264 */ 216 265 colour = parseInt((colour.substr(3, 2)),16) + ',' + parseInt((colour.substr(5, 2)),16) + ',' + parseInt((colour.substr(7, 2)),16); 217 266 -
src/django_gheat/website/static/style.css
r9297 r9302 1 /** 2 * Body 3 */ 4 1 5 body,html{ 2 6 height:100%; … … 10 14 } 11 15 16 /** 17 * Divs 18 */ 19 12 20 #heatmap{ 13 21 position:absolute; … … 156 164 width:10px; 157 165 } 158 166 167 /** 168 * Text settings 169 */ 170 159 171 h1{ 160 172 color:#C20000; … … 186 198 } 187 199 188 /* Colorpicker */ 200 /** 201 * Colorpicker 202 */ 189 203 190 204 div.color_picker {
Note:
See TracChangeset
for help on using the changeset viewer.