diff --git a/src/ol/array.js b/src/ol/array.js index 6c0e28ab62..df93d69eb8 100644 --- a/src/ol/array.js +++ b/src/ol/array.js @@ -169,7 +169,7 @@ ol.array.reverseSubArray = function(arr, begin, end) { */ ol.array.flatten = function(arr) { var data = arr.reduce(function(flattened, value) { - if (goog.isArray(value)) { + if (Array.isArray(value)) { return flattened.concat(ol.array.flatten(value)); } else { return flattened.concat(value); diff --git a/src/ol/color/color.js b/src/ol/color/color.js index 9f6d631573..4953ef43b2 100644 --- a/src/ol/color/color.js +++ b/src/ol/color/color.js @@ -61,7 +61,7 @@ ol.color.rgbaColorRe_ = * @api */ ol.color.asArray = function(color) { - if (goog.isArray(color)) { + if (Array.isArray(color)) { return color; } else { goog.asserts.assert(typeof color === 'string', 'Color should be a string'); @@ -80,7 +80,7 @@ ol.color.asString = function(color) { if (typeof color === 'string') { return color; } else { - goog.asserts.assert(goog.isArray(color), 'Color should be an array'); + goog.asserts.assert(Array.isArray(color), 'Color should be an array'); return ol.color.toString(color); } }; diff --git a/src/ol/feature.js b/src/ol/feature.js index 3d730a337f..9d07bd8c82 100644 --- a/src/ol/feature.js +++ b/src/ol/feature.js @@ -314,7 +314,7 @@ ol.Feature.createStyleFunction = function(obj) { * @type {Array.} */ var styles; - if (goog.isArray(obj)) { + if (Array.isArray(obj)) { styles = obj; } else { goog.asserts.assertInstanceof(obj, ol.style.Style, diff --git a/src/ol/format/esrijsonformat.js b/src/ol/format/esrijsonformat.js index ccc57cbf6c..6bed7afb51 100644 --- a/src/ol/format/esrijsonformat.js +++ b/src/ol/format/esrijsonformat.js @@ -170,7 +170,7 @@ ol.format.EsriJSON.readPointGeometry_ = function(object) { * @return {ol.geom.Geometry} LineString. */ ol.format.EsriJSON.readLineStringGeometry_ = function(object) { - goog.asserts.assert(goog.isArray(object.paths), + goog.asserts.assert(Array.isArray(object.paths), 'object.paths should be an array'); goog.asserts.assert(object.paths.length === 1, 'object.paths array length should be 1'); @@ -185,7 +185,7 @@ ol.format.EsriJSON.readLineStringGeometry_ = function(object) { * @return {ol.geom.Geometry} MultiLineString. */ ol.format.EsriJSON.readMultiLineStringGeometry_ = function(object) { - goog.asserts.assert(goog.isArray(object.paths), + goog.asserts.assert(Array.isArray(object.paths), 'object.paths should be an array'); goog.asserts.assert(object.paths.length > 1, 'object.paths array length should be more than 1'); diff --git a/src/ol/format/featureformat.js b/src/ol/format/featureformat.js index 43de17c15c..e031bbc5d3 100644 --- a/src/ol/format/featureformat.js +++ b/src/ol/format/featureformat.js @@ -203,7 +203,7 @@ ol.format.Feature.transformWithOptions = function( return coordinates; }; if (Array.isArray(transformed)) { - transform(/** @type {ol.Extent} */ (transformed)); + transform(transformed); } else { transformed.applyTransform(transform); } diff --git a/src/ol/format/gml/gml2format.js b/src/ol/format/gml/gml2format.js index 74943de1de..087253e740 100644 --- a/src/ol/format/gml/gml2format.js +++ b/src/ol/format/gml/gml2format.js @@ -130,7 +130,7 @@ ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) { if (flatLinearRing) { var flatLinearRings = /** @type {Array.>} */ (objectStack[objectStack.length - 1]); - goog.asserts.assert(goog.isArray(flatLinearRings), + goog.asserts.assert(Array.isArray(flatLinearRings), 'flatLinearRings should be an array'); goog.asserts.assert(flatLinearRings.length > 0, 'flatLinearRings should have an array length larger than 0'); @@ -155,7 +155,7 @@ ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) { if (flatLinearRing) { var flatLinearRings = /** @type {Array.>} */ (objectStack[objectStack.length - 1]); - goog.asserts.assert(goog.isArray(flatLinearRings), + goog.asserts.assert(Array.isArray(flatLinearRings), 'flatLinearRings should be an array'); goog.asserts.assert(flatLinearRings.length > 0, 'flatLinearRings should have an array length larger than 0'); diff --git a/src/ol/format/gml/gml3format.js b/src/ol/format/gml/gml3format.js index d6520546e9..f8362433ff 100644 --- a/src/ol/format/gml/gml3format.js +++ b/src/ol/format/gml/gml3format.js @@ -247,7 +247,7 @@ ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) { if (flatLinearRing) { var flatLinearRings = /** @type {Array.>} */ (objectStack[objectStack.length - 1]); - goog.asserts.assert(goog.isArray(flatLinearRings), + goog.asserts.assert(Array.isArray(flatLinearRings), 'flatLinearRings should be an array'); goog.asserts.assert(flatLinearRings.length > 0, 'flatLinearRings should have an array length of 1 or more'); @@ -272,7 +272,7 @@ ol.format.GML3.prototype.exteriorParser_ = function(node, objectStack) { if (flatLinearRing) { var flatLinearRings = /** @type {Array.>} */ (objectStack[objectStack.length - 1]); - goog.asserts.assert(goog.isArray(flatLinearRings), + goog.asserts.assert(Array.isArray(flatLinearRings), 'flatLinearRings should be an array'); goog.asserts.assert(flatLinearRings.length > 0, 'flatLinearRings should have an array length of 1 or more'); @@ -1006,7 +1006,7 @@ ol.format.GML3.prototype.writeGeometryElement = function(node, geometry, objectS var item = ol.object.assign({}, context); item.node = node; var value; - if (goog.isArray(geometry)) { + if (Array.isArray(geometry)) { if (context.dataProjection) { value = ol.proj.transformExtent( geometry, context.featureProjection, context.dataProjection); @@ -1233,7 +1233,7 @@ ol.format.GML3.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, o goog.asserts.assert(ol.xml.isNode(parentNode), 'parentNode should be a node'); var nodeName; - if (!goog.isArray(value)) { + if (!Array.isArray(value)) { goog.asserts.assertInstanceof(value, ol.geom.Geometry, 'value should be an ol.geom.Geometry'); nodeName = value.getType(); diff --git a/src/ol/format/gml/gmlbaseformat.js b/src/ol/format/gml/gmlbaseformat.js index 64d0fe914d..c09891056c 100644 --- a/src/ol/format/gml/gmlbaseformat.js +++ b/src/ol/format/gml/gmlbaseformat.js @@ -163,7 +163,7 @@ ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) { featureNS[defaultPrefix] = ns; } var parsersNS = {}; - var featureTypes = goog.isArray(featureType) ? featureType : [featureType]; + var featureTypes = Array.isArray(featureType) ? featureType : [featureType]; for (var p in featureNS) { var parsers = {}; for (i = 0, ii = featureTypes.length; i < ii; ++i) { diff --git a/src/ol/format/kmlformat.js b/src/ol/format/kmlformat.js index f7cc7fe3d9..c068ba1100 100644 --- a/src/ol/format/kmlformat.js +++ b/src/ol/format/kmlformat.js @@ -426,7 +426,7 @@ ol.format.KML.createFeatureStyleFunction_ = function(style, styleUrl, * @private */ ol.format.KML.findStyle_ = function(styleValue, defaultStyle, sharedStyles) { - if (goog.isArray(styleValue)) { + if (Array.isArray(styleValue)) { return styleValue; } else if (typeof styleValue === 'string') { // KML files in the wild occasionally forget the leading `#` on styleUrls @@ -1267,7 +1267,7 @@ ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) { var placemarkObject = objectStack[objectStack.length - 1]; goog.asserts.assert(goog.isObject(placemarkObject), 'placemarkObject should be an Object'); - if (goog.isArray(styleMapValue)) { + if (Array.isArray(styleMapValue)) { placemarkObject['Style'] = styleMapValue; } else if (typeof styleMapValue === 'string') { placemarkObject['styleUrl'] = styleMapValue; @@ -1327,7 +1327,7 @@ ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) { if (flatLinearRing) { var flatLinearRings = /** @type {Array.>} */ (objectStack[objectStack.length - 1]); - goog.asserts.assert(goog.isArray(flatLinearRings), + goog.asserts.assert(Array.isArray(flatLinearRings), 'flatLinearRings should be an array'); goog.asserts.assert(flatLinearRings.length > 0, 'flatLinearRings array should not be empty'); @@ -1352,7 +1352,7 @@ ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) { if (flatLinearRing) { var flatLinearRings = /** @type {Array.>} */ (objectStack[objectStack.length - 1]); - goog.asserts.assert(goog.isArray(flatLinearRings), + goog.asserts.assert(Array.isArray(flatLinearRings), 'flatLinearRings should be an array'); goog.asserts.assert(flatLinearRings.length > 0, 'flatLinearRings array should not be empty'); @@ -2386,7 +2386,7 @@ ol.format.KML.writePlacemark_ = function(node, feature, objectStack) { // resolution-independent here var styles = styleFunction.call(feature, 0); if (styles) { - var style = goog.isArray(styles) ? styles[0] : styles; + var style = Array.isArray(styles) ? styles[0] : styles; if (this.writeStyles_) { properties['Style'] = style; } diff --git a/src/ol/format/wfsformat.js b/src/ol/format/wfsformat.js index 6c6e16303d..c9f1633b86 100644 --- a/src/ol/format/wfsformat.js +++ b/src/ol/format/wfsformat.js @@ -664,7 +664,7 @@ ol.format.WFS.prototype.writeGetFeature = function(options) { bbox: options.bbox, propertyNames: options.propertyNames ? options.propertyNames : [] }; - goog.asserts.assert(goog.isArray(options.featureTypes), + goog.asserts.assert(Array.isArray(options.featureTypes), 'options.featureTypes should be an array'); ol.format.WFS.writeGetFeature_(node, options.featureTypes, [context]); return node; diff --git a/src/ol/layer/layergroup.js b/src/ol/layer/layergroup.js index 3307a0ae82..24ef53260c 100644 --- a/src/ol/layer/layergroup.js +++ b/src/ol/layer/layergroup.js @@ -61,7 +61,7 @@ ol.layer.Group = function(opt_options) { this.handleLayersChanged_, this); if (layers) { - if (goog.isArray(layers)) { + if (Array.isArray(layers)) { layers = new ol.Collection(layers.slice()); } else { goog.asserts.assertInstanceof(layers, ol.Collection, diff --git a/src/ol/map.js b/src/ol/map.js index eb1bd4ca3c..c0bec0d241 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -1515,7 +1515,7 @@ ol.Map.createOptionsInternal = function(options) { */ var rendererTypes; if (options.renderer !== undefined) { - if (goog.isArray(options.renderer)) { + if (Array.isArray(options.renderer)) { rendererTypes = options.renderer; } else if (typeof options.renderer === 'string') { rendererTypes = [options.renderer]; @@ -1550,7 +1550,7 @@ ol.Map.createOptionsInternal = function(options) { var controls; if (options.controls !== undefined) { - if (goog.isArray(options.controls)) { + if (Array.isArray(options.controls)) { controls = new ol.Collection(options.controls.slice()); } else { goog.asserts.assertInstanceof(options.controls, ol.Collection, @@ -1563,7 +1563,7 @@ ol.Map.createOptionsInternal = function(options) { var interactions; if (options.interactions !== undefined) { - if (goog.isArray(options.interactions)) { + if (Array.isArray(options.interactions)) { interactions = new ol.Collection(options.interactions.slice()); } else { goog.asserts.assertInstanceof(options.interactions, ol.Collection, @@ -1576,7 +1576,7 @@ ol.Map.createOptionsInternal = function(options) { var overlays; if (options.overlays !== undefined) { - if (goog.isArray(options.overlays)) { + if (Array.isArray(options.overlays)) { overlays = new ol.Collection(options.overlays.slice()); } else { goog.asserts.assertInstanceof(options.overlays, ol.Collection, diff --git a/src/ol/overlay.js b/src/ol/overlay.js index 22e6378bee..72e5c62b10 100644 --- a/src/ol/overlay.js +++ b/src/ol/overlay.js @@ -505,7 +505,7 @@ ol.Overlay.prototype.updateRenderedPosition = function(pixel, mapSize) { goog.asserts.assert(mapSize !== undefined, 'mapSize should be defined'); var style = this.element_.style; var offset = this.getOffset(); - goog.asserts.assert(goog.isArray(offset), 'offset should be an array'); + goog.asserts.assert(Array.isArray(offset), 'offset should be an array'); var positioning = this.getPositioning(); goog.asserts.assert(positioning !== undefined, diff --git a/src/ol/renderer/canvas/canvasvectorlayerrenderer.js b/src/ol/renderer/canvas/canvasvectorlayerrenderer.js index d87dc6250f..579c7afc80 100644 --- a/src/ol/renderer/canvas/canvasvectorlayerrenderer.js +++ b/src/ol/renderer/canvas/canvasvectorlayerrenderer.js @@ -328,7 +328,7 @@ ol.renderer.canvas.VectorLayer.prototype.renderFeature = function(feature, resol return false; } var loading = false; - if (goog.isArray(styles)) { + if (Array.isArray(styles)) { for (var i = 0, ii = styles.length; i < ii; ++i) { loading = ol.renderer.vector.renderFeature( replayGroup, feature, styles[i], diff --git a/src/ol/renderer/canvas/canvasvectortilelayerrenderer.js b/src/ol/renderer/canvas/canvasvectortilelayerrenderer.js index 3fa67c1908..51a39fa76c 100644 --- a/src/ol/renderer/canvas/canvasvectortilelayerrenderer.js +++ b/src/ol/renderer/canvas/canvasvectortilelayerrenderer.js @@ -264,7 +264,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.createReplayGroup = function(tile, } } if (styles) { - if (!goog.isArray(styles)) { + if (!Array.isArray(styles)) { styles = [styles]; } var dirty = this.renderFeature(feature, squaredTolerance, styles, @@ -495,7 +495,7 @@ ol.renderer.canvas.VectorTileLayer.prototype.renderFeature = function(feature, s return false; } var loading = false; - if (goog.isArray(styles)) { + if (Array.isArray(styles)) { for (var i = 0, ii = styles.length; i < ii; ++i) { loading = ol.renderer.vector.renderFeature( replayGroup, feature, styles[i], squaredTolerance, diff --git a/src/ol/renderer/dom/domvectorlayerrenderer.js b/src/ol/renderer/dom/domvectorlayerrenderer.js index 30bae5161c..d025ef6103 100644 --- a/src/ol/renderer/dom/domvectorlayerrenderer.js +++ b/src/ol/renderer/dom/domvectorlayerrenderer.js @@ -338,7 +338,7 @@ ol.renderer.dom.VectorLayer.prototype.renderFeature = function(feature, resoluti return false; } var loading = false; - if (goog.isArray(styles)) { + if (Array.isArray(styles)) { for (var i = 0, ii = styles.length; i < ii; ++i) { loading = ol.renderer.vector.renderFeature( replayGroup, feature, styles[i], diff --git a/src/ol/renderer/webgl/webglvectorlayerrenderer.js b/src/ol/renderer/webgl/webglvectorlayerrenderer.js index 96ddf4136d..4f4cf4deed 100644 --- a/src/ol/renderer/webgl/webglvectorlayerrenderer.js +++ b/src/ol/renderer/webgl/webglvectorlayerrenderer.js @@ -298,7 +298,7 @@ ol.renderer.webgl.VectorLayer.prototype.renderFeature = function(feature, resolu return false; } var loading = false; - if (goog.isArray(styles)) { + if (Array.isArray(styles)) { for (var i = 0, ii = styles.length; i < ii; ++i) { loading = ol.renderer.vector.renderFeature( replayGroup, feature, styles[i], diff --git a/src/ol/size.js b/src/ol/size.js index 2dba83bb72..5e73a5b7ac 100644 --- a/src/ol/size.js +++ b/src/ol/size.js @@ -78,7 +78,7 @@ ol.size.scale = function(size, ratio, opt_size) { * @api stable */ ol.size.toSize = function(size, opt_size) { - if (goog.isArray(size)) { + if (Array.isArray(size)) { return size; } else { goog.asserts.assert(goog.isNumber(size)); diff --git a/src/ol/source/imagevectorsource.js b/src/ol/source/imagevectorsource.js index 97c02e34d6..228fa8e905 100644 --- a/src/ol/source/imagevectorsource.js +++ b/src/ol/source/imagevectorsource.js @@ -264,7 +264,7 @@ ol.source.ImageVector.prototype.renderFeature_ = function(feature, resolution, p return false; } var i, ii, loading = false; - if (!goog.isArray(styles)) { + if (!Array.isArray(styles)) { styles = [styles]; } for (i = 0, ii = styles.length; i < ii; ++i) { diff --git a/src/ol/source/vectorsource.js b/src/ol/source/vectorsource.js index e40de37d66..b00d7acefa 100644 --- a/src/ol/source/vectorsource.js +++ b/src/ol/source/vectorsource.js @@ -172,7 +172,7 @@ ol.source.Vector = function(opt_options) { if (options.features instanceof ol.Collection) { collection = options.features; features = collection.getArray(); - } else if (goog.isArray(options.features)) { + } else if (Array.isArray(options.features)) { features = options.features; } if (!useSpatialIndex && collection === undefined) { diff --git a/src/ol/style/style.js b/src/ol/style/style.js index 1e037366ef..b0b2119138 100644 --- a/src/ol/style/style.js +++ b/src/ol/style/style.js @@ -223,7 +223,7 @@ ol.style.createStyleFunction = function(obj) { * @type {Array.} */ var styles; - if (goog.isArray(obj)) { + if (Array.isArray(obj)) { styles = obj; } else { goog.asserts.assertInstanceof(obj, ol.style.Style, diff --git a/src/ol/view.js b/src/ol/view.js index 9bec014084..68a384448d 100644 --- a/src/ol/view.js +++ b/src/ol/view.js @@ -447,7 +447,7 @@ ol.View.prototype.getZoom = function() { */ ol.View.prototype.fit = function(geometry, size, opt_options) { if (!(geometry instanceof ol.geom.SimpleGeometry)) { - goog.asserts.assert(goog.isArray(geometry), + goog.asserts.assert(Array.isArray(geometry), 'invalid extent or geometry'); goog.asserts.assert(!ol.extent.isEmpty(geometry), 'cannot fit empty extent'); diff --git a/src/ol/xml.js b/src/ol/xml.js index 3a14ac5419..c4556fdf84 100644 --- a/src/ol/xml.js +++ b/src/ol/xml.js @@ -156,11 +156,11 @@ ol.xml.makeArrayExtender = function(valueReader, opt_this) { function(node, objectStack) { var value = valueReader.call(opt_this, node, objectStack); if (value !== undefined) { - goog.asserts.assert(goog.isArray(value), + goog.asserts.assert(Array.isArray(value), 'valueReader function is expected to return an array of values'); var array = /** @type {Array.<*>} */ (objectStack[objectStack.length - 1]); - goog.asserts.assert(goog.isArray(array), + goog.asserts.assert(Array.isArray(array), 'objectStack is supposed to be an array of arrays'); ol.array.extend(array, value); } @@ -187,7 +187,7 @@ ol.xml.makeArrayPusher = function(valueReader, opt_this) { node, objectStack); if (value !== undefined) { var array = objectStack[objectStack.length - 1]; - goog.asserts.assert(goog.isArray(array), + goog.asserts.assert(Array.isArray(array), 'objectStack is supposed to be an array of arrays'); array.push(value); }