Changeset 9781
- Timestamp:
- Dec 14, 2011, 9:16:40 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/wlheatmap/static/heatmap_extensions.js
r9779 r9781 408 408 * Blank parameters are ignored. 409 409 */ 410 $('#add_filter').click(function(){ 411 // get values from elements 412 413 lname = $("#lname").val(); 414 if (lname == ''){ 415 lname= 'Custom Filter'; 416 } 417 410 function add_filter(lname, filter) { 418 411 // setting layer 419 412 OpenLayers.Layer.OSM.Overlay = OpenLayers.Class(OpenLayers.Layer.OSM, { 420 413 initialize: function(name, options) { 421 414 var url = [ 422 "tile/${z}/${x},${y}.png?" + $("#raw_filter").val(),415 "tile/${z}/${x},${y}.png?" + filter, 423 416 ]; 424 417 options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options); … … 435 428 436 429 $("#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>"); 430 } 431 432 $('#add_filter').click(function(){ 433 lname = $("#lname").val(); 434 if (lname == ''){ 435 lname= 'Custom Filter'; 436 } 437 add_filter(lname, $("#raw_filter").val()); 438 437 439 }); 438 440 init_heatmap(); 439 441 init_slider(35,75); 442 443 // Initiate the custom filters 444 var items = window.location.hash.split('#').slice(1); 445 for (var i=0; i < items.length; i++) { 446 var y = items[i].split('!'); 447 var label = y[0]; 448 var url = y[1]; 449 add_filter(label, url); 450 } 440 451 });
Note:
See TracChangeset
for help on using the changeset viewer.