Add ol.extent.extendXY
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user