diff --git a/src/ol/featureoverlay.js b/src/ol/featureoverlay.js index 12e6c7a4c4..b82f83ac2f 100644 --- a/src/ol/featureoverlay.js +++ b/src/ol/featureoverlay.js @@ -78,7 +78,7 @@ ol.FeatureOverlay = function(opt_options) { if (goog.isDef(options.features)) { if (goog.isArray(options.features)) { - this.setFeatures(new ol.Collection(goog.array.clone(options.features))); + this.setFeatures(new ol.Collection(options.features.slice())); } else { goog.asserts.assertInstanceof(options.features, ol.Collection); this.setFeatures(options.features); diff --git a/src/ol/format/featureformat.js b/src/ol/format/featureformat.js index 363428e9af..5490dd1c4f 100644 --- a/src/ol/format/featureformat.js +++ b/src/ol/format/featureformat.js @@ -1,6 +1,5 @@ goog.provide('ol.format.Feature'); -goog.require('goog.array'); goog.require('ol.geom.Geometry'); goog.require('ol.proj'); @@ -177,7 +176,7 @@ ol.format.Feature.transformWithOptions = function( // FIXME this is necessary because ol.format.GML treats extents // as geometries return ol.proj.transformExtent( - write ? goog.array.clone(geometry) : geometry, + write ? geometry.slice() : geometry, write ? featureProjection : dataProjection, write ? dataProjection : featureProjection); } diff --git a/src/ol/layer/layergroup.js b/src/ol/layer/layergroup.js index dcb420fc5f..b973710a1e 100644 --- a/src/ol/layer/layergroup.js +++ b/src/ol/layer/layergroup.js @@ -58,7 +58,7 @@ ol.layer.Group = function(opt_options) { if (goog.isDefAndNotNull(layers)) { if (goog.isArray(layers)) { - layers = new ol.Collection(goog.array.clone(layers)); + layers = new ol.Collection(layers.slice()); } else { goog.asserts.assertInstanceof(layers, ol.Collection); layers = layers; diff --git a/src/ol/map.js b/src/ol/map.js index e0651c225d..38bf57732d 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -1500,7 +1500,7 @@ ol.Map.createOptionsInternal = function(options) { var controls; if (goog.isDef(options.controls)) { if (goog.isArray(options.controls)) { - controls = new ol.Collection(goog.array.clone(options.controls)); + controls = new ol.Collection(options.controls.slice()); } else { goog.asserts.assertInstanceof(options.controls, ol.Collection); controls = options.controls; @@ -1512,7 +1512,7 @@ ol.Map.createOptionsInternal = function(options) { var interactions; if (goog.isDef(options.interactions)) { if (goog.isArray(options.interactions)) { - interactions = new ol.Collection(goog.array.clone(options.interactions)); + interactions = new ol.Collection(options.interactions.slice()); } else { goog.asserts.assertInstanceof(options.interactions, ol.Collection); interactions = options.interactions; @@ -1524,7 +1524,7 @@ ol.Map.createOptionsInternal = function(options) { var overlays; if (goog.isDef(options.overlays)) { if (goog.isArray(options.overlays)) { - overlays = new ol.Collection(goog.array.clone(options.overlays)); + overlays = new ol.Collection(options.overlays.slice()); } else { goog.asserts.assertInstanceof(options.overlays, ol.Collection); overlays = options.overlays; diff --git a/src/ol/view.js b/src/ol/view.js index 2a02b6b555..9544521f66 100644 --- a/src/ol/view.js +++ b/src/ol/view.js @@ -260,7 +260,7 @@ goog.exportProperty( * @return {Array.} Hint. */ ol.View.prototype.getHints = function() { - return goog.array.clone(this.hints_); + return this.hints_.slice(); };