adding OpenLayers.Bounds.fromArray() function and adaptor for fromString()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@486 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -470,12 +470,25 @@ OpenLayers.Bounds.prototype = {
|
||||
*/
|
||||
OpenLayers.Bounds.fromString = function(str) {
|
||||
var bounds = str.split(",");
|
||||
return new OpenLayers.Bounds(parseFloat(bounds[0]),
|
||||
parseFloat(bounds[1]),
|
||||
parseFloat(bounds[2]),
|
||||
parseFloat(bounds[3]));
|
||||
return OpenLayers.Bounds.fromArray(bounds);
|
||||
};
|
||||
|
||||
/** Alternative constructor that builds a new OpenLayers.Bounds
|
||||
* from an array
|
||||
*
|
||||
* @constructor
|
||||
*
|
||||
* @param {Array} bbox Array of bounds values (ex. <i>[5,42,10,45]</i>)
|
||||
*
|
||||
* @returns New OpenLayers.Bounds object built from the passed-in Array.
|
||||
* @type OpenLayers.Bounds
|
||||
*/
|
||||
OpenLayers.Bounds.fromArray = function(bbox) {
|
||||
return new OpenLayers.Bounds(parseFloat(bbox[0]),
|
||||
parseFloat(bbox[1]),
|
||||
parseFloat(bbox[2]),
|
||||
parseFloat(bbox[3]));
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {String} quadrant
|
||||
|
||||
Reference in New Issue
Block a user