Changeset 9813 for src/django_gheat/wlheatmap/static/heatmap_extensions.js
- Timestamp:
- Dec 21, 2011, 8:42:40 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/wlheatmap/static/heatmap_extensions.js
r9782 r9813 408 408 * Blank parameters are ignored. 409 409 */ 410 function add_filter(lname, filter ) {410 function add_filter(lname, filter, colour) { 411 411 // setting layer 412 412 OpenLayers.Layer.OSM.Overlay = OpenLayers.Class(OpenLayers.Layer.OSM, { … … 419 419 OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); 420 420 }, 421 422 CLASS_NAME: "OpenLayers.Layer.Overlay"421 colour: colour, 422 CLASS_NAME: "OpenLayers.Layer.Overlay" 423 423 }); 424 424 … … 435 435 lname= 'Custom Filter'; 436 436 } 437 add_filter(lname, $("#raw_filter").val()); 438 439 }); 437 add_filter(lname, $("#raw_filter").val(), colour); 438 439 }); 440 441 // Parse the parameters 442 var items = window.location.search.slice(1).split('&'); 443 var params = new Object; 444 for (var i=0; i < items.length; i++) { 445 var kv = items[i].split('='); 446 params[kv[0]] = decodeURIComponent(kv[1]); 447 } 448 440 449 init_heatmap(); 441 450 init_slider(35,75); 442 451 452 443 453 // 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 type = y[0]; 448 if ( type == 'filter') { 449 add_filter(y[1], y[2]); 450 } else if ( type == 'focus') { 451 var lonLat = new OpenLayers.LonLat(y[1], y[2]).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()); 452 map.setCenter (lonLat, y[3]); 453 } 454 } 454 if (params['layercount']) { 455 for (var i=1; i <= params['layercount']; i++) { 456 add_filter(params['layername' + i], params['layerfilter' + i], params['layercolour' + i]); 457 } 458 } 459 var pl = map.getControlsByClass('OpenLayers.Control.Permalink'); 460 pl.updateLink(); 455 461 });
Note:
See TracChangeset
for help on using the changeset viewer.