Function to buffer an extent

This commit is contained in:
Tim Schaub
2013-09-23 19:22:28 +02:00
parent 10b6b5f2c5
commit b0cea7139b
2 changed files with 23 additions and 0 deletions

View File

@@ -52,6 +52,19 @@ ol.extent.boundingExtentXYs_ = function(xs, ys, opt_extent) {
};
/**
* Increase an extent by the provided value.
* @param {ol.Extent} extent The extent to buffer.
* @param {number} value The amount by wich the extent should be buffered.
*/
ol.extent.buffer = function(extent, value) {
extent[0] -= value;
extent[1] -= value;
extent[2] += value;
extent[3] += value;
};
/**
* Creates a clone of an extent.
*