reinsertion of r1572

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1607 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-10-05 20:01:09 +00:00
parent 2b7c6cc844
commit 6366edc515
+14 -11
View File
@@ -367,21 +367,24 @@ OpenLayers.Bounds.prototype = {
}, },
/** /**
* @return Simple String representation of OpenLayers.Bounds object. * @param {int} decimal How many significant digits in the bbox coords?
* Default is 6
*
* @returns Simple String representation of OpenLayers.Bounds object.
* (ex. <i>"5,42,10,45"</i>) * (ex. <i>"5,42,10,45"</i>)
* @type String * @type String
*/ */
toBBOX:function(power) { toBBOX:function(decimal) {
var mult; if (decimal== null) {
if (power) { decimal = 6;
mult = Math.pow(10,power);
} else {
mult = Math.pow(10,6);
} }
return (Math.round(this.left*mult)/mult + "," + var mult = Math.pow(10, decimal);
Math.round(this.bottom*mult)/mult + "," + var bbox = Math.round(this.left * mult) / mult + "," +
Math.round(this.right*mult)/mult + "," + Math.round(this.bottom * mult) / mult + "," +
Math.round(this.top*mult)/mult); Math.round(this.right * mult) / mult + "," +
Math.round(this.top * mult) / mult;
return bbox;
}, },
/** /**