Changeset 9782 for src/django_gheat/wlheatmap
- Timestamp:
- Dec 14, 2011, 10:24:31 PM (13 years ago)
- Location:
- src/django_gheat/wlheatmap/static
- Files:
-
- 2 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(), -
src/django_gheat/wlheatmap/static/heatmap_extensions.js
r9781 r9782 445 445 for (var i=0; i < items.length; i++) { 446 446 var y = items[i].split('!'); 447 var label = y[0]; 448 var url = y[1]; 449 add_filter(label, url); 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 } 450 454 } 451 455 });
Note:
See TracChangeset
for help on using the changeset viewer.