Add ol.extent.extendXY

This commit is contained in:
Tom Payne
2013-11-06 12:06:32 +01:00
parent 400b946354
commit 530d8b67a3

View File

@@ -201,6 +201,19 @@ ol.extent.extendCoordinate = function(extent, coordinate) {
};
/**
* @param {ol.Extent} extent Extent.
* @param {number} x X.
* @param {number} y Y.
*/
ol.extent.extendXY = function(extent, x, y) {
extent[0] = Math.min(extent[0], x);
extent[1] = Math.min(extent[1], y);
extent[2] = Math.max(extent[2], x);
extent[3] = Math.max(extent[3], y);
};
/**
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Bottom left coordinate.