Changeset 9782 for src/django_gheat/wlheatmap/static/heatmap.js
- Timestamp:
- Dec 14, 2011, 10:24:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/wlheatmap/static/heatmap.js
r9649 r9782 20 20 controls: [ 21 21 new OpenLayers.Control.Navigation(), 22 new OpenLayers.Control.Permalink(), 22 new OpenLayers.Control.Permalink({ 23 anchor : true, 24 createParams: function(center, zoom, layers) { 25 center = center || this.map.getCenter(); 26 27 var params = OpenLayers.Util.getParameters(this.base); 28 29 // If there's still no center, map is not initialized yet. 30 // Break out of this function, and simply return the params from the 31 // base link. 32 if (center) { 33 34 //zoom 35 params.zoom = zoom || this.map.getZoom(); 36 37 //lon,lat 38 var lat = center.lat; 39 var lon = center.lon; 40 41 if (this.displayProjection) { 42 var mapPosition = OpenLayers.Projection.transform( 43 { x: lon, y: lat }, 44 this.map.getProjectionObject(), 45 this.displayProjection ); 46 lon = mapPosition.x; 47 lat = mapPosition.y; 48 } 49 params.lat = Math.round(lat*100000)/100000; 50 params.lon = Math.round(lon*100000)/100000; 51 52 //layers 53 layers = layers || this.map.layers; 54 params.layers = ''; 55 for (var i=0, len=layers.length; i<len; i++) { 56 var layer = layers[i]; 57 58 if (layer.isBaseLayer) { 59 params.layers += (layer == this.map.baseLayer) ? "B" : "0"; 60 } else { 61 params.layers += (layer.getVisibility()) ? "T" : "F"; 62 } 63 } 64 } 65 //XXX: Hack custom filters in here 66 params.customParam = "foo"; 67 return params; 68 } 69 }), 23 70 new OpenLayers.Control.PanZoomBar(), 24 71 new OpenLayers.Control.ZoomBox(),
Note:
See TracChangeset
for help on using the changeset viewer.