diff --git a/lib/OpenLayers/Control/LayerSwitcher.js b/lib/OpenLayers/Control/LayerSwitcher.js index 4ff1de2de0..d808868e86 100644 --- a/lib/OpenLayers/Control/LayerSwitcher.js +++ b/lib/OpenLayers/Control/LayerSwitcher.js @@ -165,7 +165,7 @@ OpenLayers.Control.LayerSwitcher = OpenLayers.Class(OpenLayers.Control, { } } this[layersType + "LayersDiv"].innerHTML = ""; - this[layersType + "Layers"] = new Array(); + this[layersType + "Layers"] = []; }, diff --git a/lib/OpenLayers/Control/OverviewMap.js b/lib/OpenLayers/Control/OverviewMap.js index a418803b7b..977cb09e0d 100644 --- a/lib/OpenLayers/Control/OverviewMap.js +++ b/lib/OpenLayers/Control/OverviewMap.js @@ -83,7 +83,7 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, { * control, set as one of the options properties. */ initialize: function(options) { - this.layers = new Array(); + this.layers = []; OpenLayers.Control.prototype.initialize.apply(this, [options]); }, diff --git a/lib/OpenLayers/Control/PanZoom.js b/lib/OpenLayers/Control/PanZoom.js index ff65f392f7..53695e57b2 100644 --- a/lib/OpenLayers/Control/PanZoom.js +++ b/lib/OpenLayers/Control/PanZoom.js @@ -69,7 +69,7 @@ OpenLayers.Control.PanZoom = OpenLayers.Class(OpenLayers.Control, { px = this.position; // place the controls - this.buttons = new Array(); + this.buttons = []; var sz = new OpenLayers.Size(18,18); var centered = new OpenLayers.Pixel(px.x+sz.w/2, px.y); diff --git a/lib/OpenLayers/Control/PanZoomBar.js b/lib/OpenLayers/Control/PanZoomBar.js index 3451d058b6..f8d96e6e93 100644 --- a/lib/OpenLayers/Control/PanZoomBar.js +++ b/lib/OpenLayers/Control/PanZoomBar.js @@ -111,7 +111,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, { px = this.position.clone(); // place the controls - this.buttons = new Array(); + this.buttons = []; var sz = new OpenLayers.Size(18,18); var centered = new OpenLayers.Pixel(px.x+sz.w/2, px.y); diff --git a/lib/OpenLayers/Events.js b/lib/OpenLayers/Events.js index ca77f65706..1ed65ec6ca 100644 --- a/lib/OpenLayers/Events.js +++ b/lib/OpenLayers/Events.js @@ -187,7 +187,7 @@ OpenLayers.Event = { //if there is not yet a hash entry for this element, add one if (!this.observers[cacheID]) { - this.observers[cacheID] = new Array(); + this.observers[cacheID] = []; } //add a new observer to this element's list @@ -445,7 +445,7 @@ OpenLayers.Events = OpenLayers.Class({ */ addEventType: function(eventName) { if (!this.listeners[eventName]) { - this.listeners[eventName] = new Array(); + this.listeners[eventName] = []; } }, @@ -573,7 +573,7 @@ OpenLayers.Events = OpenLayers.Class({ */ remove: function(type) { if (this.listeners[type] != null) { - this.listeners[type] = new Array(); + this.listeners[type] = []; } }, diff --git a/lib/OpenLayers/Geometry/Collection.js b/lib/OpenLayers/Geometry/Collection.js index deb4fe1a40..e3e5181c49 100644 --- a/lib/OpenLayers/Geometry/Collection.js +++ b/lib/OpenLayers/Geometry/Collection.js @@ -48,7 +48,7 @@ OpenLayers.Geometry.Collection = OpenLayers.Class(OpenLayers.Geometry, { */ initialize: function (components) { OpenLayers.Geometry.prototype.initialize.apply(this, arguments); - this.components = new Array(); + this.components = []; if (components != null) { this.addComponents(components); } diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js index 1c8ff472ea..9b0126d90a 100644 --- a/lib/OpenLayers/Layer.js +++ b/lib/OpenLayers/Layer.js @@ -588,7 +588,7 @@ OpenLayers.Layer = OpenLayers.Class({ if ((confProps.scales != null) || (confProps.resolutions != null)) { //preset levels if (confProps.scales != null) { - confProps.resolutions = new Array(); + confProps.resolutions = []; for(var i = 0; i < confProps.scales.length; i++) { var scale = confProps.scales[i]; confProps.resolutions[i] = @@ -601,7 +601,7 @@ OpenLayers.Layer = OpenLayers.Class({ } else { //maxResolution and numZoomLevels based calculation - confProps.resolutions = new Array(); + confProps.resolutions = []; // determine maxResolution if (confProps.minScale) { @@ -658,7 +658,7 @@ OpenLayers.Layer = OpenLayers.Class({ var lastIndex = confProps.resolutions.length - 1; this.minResolution = confProps.resolutions[lastIndex]; - this.scales = new Array(); + this.scales = []; for(var i = 0; i < confProps.resolutions.length; i++) { this.scales[i] = OpenLayers.Util.getScaleFromResolution(confProps.resolutions[i], diff --git a/lib/OpenLayers/Layer/GML.js b/lib/OpenLayers/Layer/GML.js index 778ccdb80c..8ca145055d 100644 --- a/lib/OpenLayers/Layer/GML.js +++ b/lib/OpenLayers/Layer/GML.js @@ -38,7 +38,7 @@ OpenLayers.Layer.GML = OpenLayers.Class(OpenLayers.Layer.Vector, { * options - {Object} Hashtable of extra options to tag onto the layer. */ initialize: function(name, url, options) { - var newArguments = new Array() + var newArguments = []; newArguments.push(name, options); OpenLayers.Layer.Vector.prototype.initialize.apply(this, newArguments); this.url = url; diff --git a/lib/OpenLayers/Layer/GeoRSS.js b/lib/OpenLayers/Layer/GeoRSS.js index da48193238..767907ea40 100644 --- a/lib/OpenLayers/Layer/GeoRSS.js +++ b/lib/OpenLayers/Layer/GeoRSS.js @@ -53,7 +53,7 @@ OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, { initialize: function(name, location, options) { OpenLayers.Layer.Markers.prototype.initialize.apply(this, [name, options]); this.location = location; - this.features = new Array(); + this.features = []; OpenLayers.loadURL(location, null, this, this.parseData); }, diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index 6aa1856a45..ae4bd7ce3e 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -68,7 +68,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { // this.events.addEventType("tileloaded"); - this.grid = new Array(); + this.grid = []; }, /** @@ -129,7 +129,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { } // we do not want to copy reference to grid, so we make a new array - obj.grid = new Array(); + obj.grid = []; return obj; }, @@ -269,7 +269,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { var px = this.map.getLayerPxFromLonLat(ul); if (!this.grid.length) { - this.grid[0] = new Array(); + this.grid[0] = []; } var tile = this.grid[0][0]; @@ -331,7 +331,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { do { var row = this.grid[rowidx++]; if (!row) { - row = new Array(); + row = []; this.grid.push(row); } @@ -390,7 +390,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { * outside-in to inside-out), calling draw() on each tile. */ spiralTileLoad: function() { - var tileQueue = new Array(); + var tileQueue = []; var directions = ["right", "down", "left", "up"]; diff --git a/lib/OpenLayers/Layer/KaMap.js b/lib/OpenLayers/Layer/KaMap.js index 9edfbfdeca..102446e61f 100644 --- a/lib/OpenLayers/Layer/KaMap.js +++ b/lib/OpenLayers/Layer/KaMap.js @@ -59,7 +59,7 @@ OpenLayers.Layer.KaMap = OpenLayers.Class(OpenLayers.Layer.Grid, { * extends, can be overridden through the options parameter. */ initialize: function(name, url, params, options) { - var newArguments = new Array(); + var newArguments = []; newArguments.push(name, url, params, options); OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments); this.params = (params ? params : {}); @@ -150,7 +150,7 @@ OpenLayers.Layer.KaMap = OpenLayers.Class(OpenLayers.Layer.Grid, { row = this.grid[rowidx++]; if (!row) { - row = new Array(); + row = []; this.grid.push(row); } @@ -221,7 +221,7 @@ OpenLayers.Layer.KaMap = OpenLayers.Class(OpenLayers.Layer.Grid, { } // we do not want to copy reference to grid, so we make a new array - obj.grid = new Array(); + obj.grid = []; return obj; }, diff --git a/lib/OpenLayers/Layer/MapServer.js b/lib/OpenLayers/Layer/MapServer.js index 0f71281683..3a3838ae25 100644 --- a/lib/OpenLayers/Layer/MapServer.js +++ b/lib/OpenLayers/Layer/MapServer.js @@ -36,7 +36,7 @@ OpenLayers.Layer.MapServer = OpenLayers.Class(OpenLayers.Layer.Grid, { * options - {Ojbect} Hashtable of extra options to tag onto the layer */ initialize: function(name, url, params, options) { - var newArguments = new Array(); + var newArguments = []; newArguments.push(name, url, params, options); OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments); diff --git a/lib/OpenLayers/Layer/Markers.js b/lib/OpenLayers/Layer/Markers.js index f70b01bcb9..75c5f485be 100644 --- a/lib/OpenLayers/Layer/Markers.js +++ b/lib/OpenLayers/Layer/Markers.js @@ -45,7 +45,7 @@ OpenLayers.Layer.Markers = OpenLayers.Class(OpenLayers.Layer, { */ initialize: function(name, options) { OpenLayers.Layer.prototype.initialize.apply(this, arguments); - this.markers = new Array(); + this.markers = []; }, /** diff --git a/lib/OpenLayers/Layer/TMS.js b/lib/OpenLayers/Layer/TMS.js index ce29ebfa50..ebe07ebcc1 100644 --- a/lib/OpenLayers/Layer/TMS.js +++ b/lib/OpenLayers/Layer/TMS.js @@ -41,7 +41,7 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * options - {Object} Hashtable of extra options to tag onto the layer */ initialize: function(name, url, options) { - var newArguments = new Array(); + var newArguments = []; newArguments.push(name, url, {}, options); OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments); }, diff --git a/lib/OpenLayers/Layer/Vector.js b/lib/OpenLayers/Layer/Vector.js index 01146150bc..091f4d2a6b 100644 --- a/lib/OpenLayers/Layer/Vector.js +++ b/lib/OpenLayers/Layer/Vector.js @@ -121,8 +121,8 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, { this.displayError(); } - this.features = new Array(); - this.selectedFeatures = new Array(); + this.features = []; + this.selectedFeatures = []; }, /** @@ -310,7 +310,7 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, { * Destroy all features on the layer and empty the selected features array. */ destroyFeatures: function () { - this.selectedFeatures = new Array(); + this.selectedFeatures = []; for (var i = this.features.length - 1; i >= 0; i--) { this.features[i].destroy(); } diff --git a/lib/OpenLayers/Layer/WFS.js b/lib/OpenLayers/Layer/WFS.js index cdbe4d7ff2..5f3d526e73 100644 --- a/lib/OpenLayers/Layer/WFS.js +++ b/lib/OpenLayers/Layer/WFS.js @@ -73,7 +73,7 @@ OpenLayers.Layer.WFS = OpenLayers.Class( // Turn off error reporting, browsers like Safari may work // depending on the setup, and we don't want an unneccesary alert. OpenLayers.Util.extend(options, {'reportError': false}); - var newArguments=new Array() + var newArguments = []; newArguments.push(name, options); OpenLayers.Layer.Vector.prototype.initialize.apply(this, newArguments); if (!this.renderer || !this.vectorMode) { diff --git a/lib/OpenLayers/Layer/WMS.js b/lib/OpenLayers/Layer/WMS.js index 8719e072bc..4331de90c1 100644 --- a/lib/OpenLayers/Layer/WMS.js +++ b/lib/OpenLayers/Layer/WMS.js @@ -64,7 +64,7 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * options - {Ojbect} Hashtable of extra options to tag onto the layer */ initialize: function(name, url, params, options) { - var newArguments = new Array(); + var newArguments = []; //uppercase params params = OpenLayers.Util.upperCaseObject(params); newArguments.push(name, url, params, options); diff --git a/lib/OpenLayers/Layer/WorldWind.js b/lib/OpenLayers/Layer/WorldWind.js index 99aae97b55..998b2e159c 100644 --- a/lib/OpenLayers/Layer/WorldWind.js +++ b/lib/OpenLayers/Layer/WorldWind.js @@ -49,7 +49,7 @@ OpenLayers.Layer.WorldWind = OpenLayers.Class(OpenLayers.Layer.Grid, { initialize: function(name, url, lzd, zoomLevels, params, options) { this.lzd = lzd; this.zoomLevels = zoomLevels; - var newArguments = new Array(); + var newArguments = []; newArguments.push(name, url, params, options); OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments); this.params = (params ? params : {}); diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index ac45c31adf..769af6c54d 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -341,7 +341,7 @@ OpenLayers.Map = OpenLayers.Class({ this.addControlToMap(this.controls[i]); } - this.popups = new Array(); + this.popups = []; this.unloadDestroy = this.destroy.bind(this); diff --git a/lib/OpenLayers/Tile/WFS.js b/lib/OpenLayers/Tile/WFS.js index 34eb91230f..2ab53670e5 100644 --- a/lib/OpenLayers/Tile/WFS.js +++ b/lib/OpenLayers/Tile/WFS.js @@ -45,7 +45,7 @@ OpenLayers.Tile.WFS = OpenLayers.Class(OpenLayers.Tile, { initialize: function(layer, position, bounds, url, size) { OpenLayers.Tile.prototype.initialize.apply(this, arguments); this.url = url; - this.features = new Array(); + this.features = []; }, /** diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index 41cd9b9e6c..33f81102d7 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -13,7 +13,7 @@ OpenLayers.Util = {}; * This is the old $() from prototype */ OpenLayers.Util.getElement = function() { - var elements = new Array(); + var elements = []; for (var i = 0; i < arguments.length; i++) { var element = arguments[i]; @@ -499,7 +499,7 @@ OpenLayers.Util.applyDefaults = function (to, from) { * of being URL escaped (foo%3Abar). */ OpenLayers.Util.getParameterString = function(params) { - paramsArray = new Array(); + paramsArray = []; for (var key in params) { var value = params[key]; @@ -507,7 +507,7 @@ OpenLayers.Util.getParameterString = function(params) { var encodedValue; if (typeof value == 'object' && value.constructor == Array) { /* value is an array; encode items and separate with "," */ - var encodedItemArray = new Array(); + var encodedItemArray = []; for (var itemIndex=0; itemIndex 0"); t.eq(g_events.length, 1, "loadend event not triggered when numLoadingTiles is > 0"); t.eq(layer.numLoadingTiles, 1, "numLoadingTiles decremented"); - g_events = new Array(); + g_events = []; tile.onLoadEnd.apply(layer); t.eq(g_events[0], "tileloaded", "tileloaded triggered when numLoadingTiles is 0"); t.eq(g_events[1], "loadend", "loadend event triggered when numLoadingTiles is 0");