Remove private static members from ol/geom/GeometryCollection
This commit is contained in:
@@ -36,16 +36,15 @@ inherits(GeometryCollection, Geometry);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<ol.geom.Geometry>} geometries Geometries.
|
* @param {Array.<ol.geom.Geometry>} geometries Geometries.
|
||||||
* @private
|
|
||||||
* @return {Array.<ol.geom.Geometry>} Cloned geometries.
|
* @return {Array.<ol.geom.Geometry>} Cloned geometries.
|
||||||
*/
|
*/
|
||||||
GeometryCollection.cloneGeometries_ = function(geometries) {
|
function cloneGeometries(geometries) {
|
||||||
const clonedGeometries = [];
|
const clonedGeometries = [];
|
||||||
for (let i = 0, ii = geometries.length; i < ii; ++i) {
|
for (let i = 0, ii = geometries.length; i < ii; ++i) {
|
||||||
clonedGeometries.push(geometries[i].clone());
|
clonedGeometries.push(geometries[i].clone());
|
||||||
}
|
}
|
||||||
return clonedGeometries;
|
return clonedGeometries;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -140,7 +139,7 @@ GeometryCollection.prototype.computeExtent = function(extent) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GeometryCollection.prototype.getGeometries = function() {
|
GeometryCollection.prototype.getGeometries = function() {
|
||||||
return GeometryCollection.cloneGeometries_(this.geometries_);
|
return cloneGeometries(this.geometries_);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -262,8 +261,7 @@ GeometryCollection.prototype.scale = function(sx, opt_sy, opt_anchor) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GeometryCollection.prototype.setGeometries = function(geometries) {
|
GeometryCollection.prototype.setGeometries = function(geometries) {
|
||||||
this.setGeometriesArray(
|
this.setGeometriesArray(cloneGeometries(geometries));
|
||||||
GeometryCollection.cloneGeometries_(geometries));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user