Add ol.Extent.get{Bottom,Top}{Left,Right}

This commit is contained in:
Tom Payne
2012-10-18 13:49:10 +02:00
parent cd7627f626
commit 860b4407b7

View File

@@ -50,6 +50,38 @@ ol.Extent.prototype.contains = function(coordinate) {
};
/**
* @return {ol.Coordinate} Bottom left coordinate.
*/
ol.Extent.prototype.getBottomLeft = function() {
return new ol.Coordinate(this.minX, this.minY);
};
/**
* @return {ol.Coordinate} Bottom right coordinate.
*/
ol.Extent.prototype.getBottomRight = function() {
return new ol.Coordinate(this.maxX, this.minY);
};
/**
* @return {ol.Coordinate} Top left coordinate.
*/
ol.Extent.prototype.getTopLeft = function() {
return new ol.Coordinate(this.minX, this.maxY);
};
/**
* @return {ol.Coordinate} Top right coordinate.
*/
ol.Extent.prototype.getTopRight = function() {
return new ol.Coordinate(this.maxX, this.maxY);
};
/**
* @param {ol.TransformFunction} transformFn Transform function.
* @return {ol.Extent} Extent.