Changeset 9813 for src/django_gheat/wlheatmap/static/heatmap.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.js
r9811 r9813 21 21 new OpenLayers.Control.Navigation(), 22 22 new OpenLayers.Control.Permalink({ 23 anchor : true,23 anchor : false, 24 24 createParams: function(center, zoom, layers) { 25 25 center = center || this.map.getCenter(); … … 64 64 // Update permalink URL to reflect new location and filters 65 65 layerid = 0; 66 for (var i=1, len=layers.length; i < len; i++) { 66 // First two and last one should be ignored 67 for (var i=4, len=layers.length; i < len; i++) { 67 68 var layer = layers[i]; 68 69 if ($.isArray(layer.url)) { … … 73 74 var filter = url.split('?')[1]; 74 75 layerid += 1; 75 params['layername' + i] = layer.name; 76 params['layerfilter' + i] = filter; 76 params['layername' + layerid] = layer.name; 77 params['layercolour' + layerid] = layer.colour; 78 params['layerfilter' + layerid] = filter; 77 79 } 78 80 params['layercount'] = layerid; 79 81 } 80 82 return params; 81 } 83 }, 84 draw: function() { 85 OpenLayers.Control.prototype.draw.apply(this, arguments); 86 87 if (!this.element && !this.anchor) { 88 this.element = document.createElement("a"); 89 this.element.innerHTML = OpenLayers.i18n("Permalink"); 90 this.element.href=""; 91 this.div.appendChild(this.element); 92 } 93 this.map.events.on({ 94 'moveend': this.updateLink, 95 'changelayer': this.updateLink, 96 'addlayer': this.updateLink, 97 'removelayer': this.updateLink, 98 'changebaselayer': this.updateLink, 99 scope: this 100 }); 101 102 // Make it so there is at least a link even though the map may not have 103 // moved yet. 104 this.updateLink(); 105 106 return this.div; 107 }, 82 108 }), 83 109 new OpenLayers.Control.PanZoomBar(),
Note:
See TracChangeset
for help on using the changeset viewer.