- Timestamp:
- 11/04/09 03:21:06 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
contribs/mapfish-api/trunk/MapFishApi/js/Permalink.js
r2968 r3213 48 48 draw: function() { 49 49 OpenLayers.Control.prototype.draw.apply(this, arguments); 50 50 51 51 this.map.events.on({ 52 52 'moveend': this.updateLink, … … 59 59 // moved yet. 60 60 this.updateLink(); 61 61 62 62 return this.div; 63 }, 64 65 /** 63 }, 64 65 /** 66 66 * Method: updateLink() 67 67 * … … 71 71 var href = this.base; 72 72 if (href.indexOf('?') != -1) { 73 href = href.substring( 0, href.indexOf('?'));73 href = href.substring(0, href.indexOf('?')); 74 74 } 75 75 76 76 href += '?' + OpenLayers.Util.getParameterString(this.createParams()); 77 77 if (this.element) { 78 this.element.value = href; // FIXME: only OK for input fields78 this.element.value = href; // FIXME: only OK for input fields 79 79 } 80 80 }, … … 92 92 createParams: function(center, zoom, layers) { 93 93 if (this.map) { 94 center = center || this.map.getCenter();94 center = center || this.map.getCenter(); 95 95 } else { 96 96 return ''; 97 97 } 98 ; 99 100 if (OpenLayers.String.contains(this.base, '?')) { 101 } else { 102 this.base = this.base + "?"; 103 } 104 ; 98 105 99 106 var params = OpenLayers.Util.getParameters(this.base); … … 113 120 if (this.displayProjection) { 114 121 var mapPosition = OpenLayers.Projection.transform( 115 { x: lon, y: lat },116 this.map.getProjectionObject(),117 this.displayProjection);122 { x: lon, y: lat }, 123 this.map.getProjectionObject(), 124 this.displayProjection); 118 125 lon = mapPosition.x; 119 126 lat = mapPosition.y; 120 127 } 121 params[this.coordsParams.lat] = Math.round(lat *100000)/100000;122 params[this.coordsParams.lon] = Math.round(lon *100000)/100000;128 params[this.coordsParams.lat] = Math.round(lat * 100000) / 100000; 129 params[this.coordsParams.lon] = Math.round(lon * 100000) / 100000; 123 130 124 131 // layers selection … … 126 133 var layertree = this.api.tree; 127 134 if (layertree) { 128 var nodes = []; 135 var nodes = []; 129 136 var checkedNodes = layertree.getChecked(); 130 137 for (var i = 0, len = checkedNodes.length; i < len; i++) {
