Function for cloning extents

This commit is contained in:
Tim Schaub
2013-09-03 17:38:10 -06:00
parent fcf00dea8b
commit dbccb8b231
2 changed files with 24 additions and 0 deletions

View File

@@ -48,6 +48,17 @@ ol.extent.boundingExtentXYs_ = function(xs, ys, opt_extent) {
};
/**
* Creates a clone of an extent.
*
* @param {ol.Extent} extent Extent to clone.
* @return {ol.Extent} The clone.
*/
ol.extent.clone = function(extent) {
return [[extent[0][0], extent[0][1]], [extent[1][0], extent[1][1]]];
};
/**
* Checks if the passed coordinate is contained or on the edge of the extent.
*