Bounds transforms.

This commit is contained in:
Tim Schaub
2012-06-21 19:58:35 +02:00
parent 6198df9381
commit 948e792ddd
3 changed files with 114 additions and 0 deletions

View File

@@ -132,3 +132,17 @@ ol.Bounds.prototype.maxY = function(opt_arg){
return this.getMaxY();
}
};
/**
* Transform this node into another coordinate reference system. Returns a new
* bounds instead of modifying this bounds.
*
* @param {ol.Projection|string} proj Target projection (or string identifier).
* @return {ol.Bounds} A new bounds in the target projection.
*/
ol.Bounds.prototype.transform = function(proj) {
if (goog.isString(proj)) {
proj = new ol.Projection(proj);
}
return this.doTransform(proj);
};