diff --git a/src/ol/extent.js b/src/ol/extent.js index 5a28036f51..cf393fd61b 100644 --- a/src/ol/extent.js +++ b/src/ol/extent.js @@ -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.