From f339e3a93dc83e7792a7ab70926b92bfc46bfa7c Mon Sep 17 00:00:00 2001 From: euzuro Date: Wed, 9 Aug 2006 04:36:39 +0000 Subject: [PATCH] hash -> hashtable and Hash -> Object -- let there be no confusion, we are *not* using prototype git-svn-id: http://svn.openlayers.org/trunk/openlayers@1144 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control.js | 2 +- lib/OpenLayers/Events.js | 3 ++- lib/OpenLayers/Layer.js | 4 ++-- lib/OpenLayers/Layer/Grid.js | 2 +- lib/OpenLayers/Layer/HTTPRequest.js | 9 +++++---- lib/OpenLayers/Layer/Markers.js | 2 +- lib/OpenLayers/Layer/Text.js | 5 +++-- lib/OpenLayers/Layer/WFS.js | 9 +++++---- lib/OpenLayers/Layer/WMS.js | 9 +++++---- lib/OpenLayers/Layer/WMS/Untiled.js | 5 +++-- lib/OpenLayers/Map.js | 6 +++--- lib/OpenLayers/Util.js | 6 +++--- tests/test_Layer_WMS.html | 2 +- tests/test_Map.html | 4 ++-- 14 files changed, 37 insertions(+), 31 deletions(-) diff --git a/lib/OpenLayers/Control.js b/lib/OpenLayers/Control.js index bac86c70e2..442132bc1d 100644 --- a/lib/OpenLayers/Control.js +++ b/lib/OpenLayers/Control.js @@ -21,7 +21,7 @@ OpenLayers.Control.prototype = { /** * @constructor * - * @param {Hash} options + * @param {Object} options */ initialize: function (options) { Object.extend(this, options); diff --git a/lib/OpenLayers/Events.js b/lib/OpenLayers/Events.js index cc11b70f64..5502a37d1d 100644 --- a/lib/OpenLayers/Events.js +++ b/lib/OpenLayers/Events.js @@ -16,7 +16,8 @@ OpenLayers.Events.prototype = { "resize", "focus", "blur" ], - /** @type Hash of Array(Function): events listener functions */ + /** Hashtable of Array(Function): events listener functions + * @type Object */ listeners: null, /** @type Object: the code object issuing application events */ diff --git a/lib/OpenLayers/Layer.js b/lib/OpenLayers/Layer.js index b073b9b8d4..1c43161083 100644 --- a/lib/OpenLayers/Layer.js +++ b/lib/OpenLayers/Layer.js @@ -60,7 +60,7 @@ OpenLayers.Layer.prototype = { * @constructor * * @param {String} name - * @param {Object} options Hash of extra options to tag onto the layer + * @param {Object} options Hashtable of extra options to tag onto the layer */ initialize: function(name, options) { if (arguments.length > 0) { @@ -126,7 +126,7 @@ OpenLayers.Layer.prototype = { }, /** - * @param {Hash} newOptions + * @param {Object} newOptions */ addOptions: function (newOptions) { diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index ae4b72d3f8..52de570d15 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -29,7 +29,7 @@ OpenLayers.Layer.Grid.prototype = * @param {String} name * @param {String} url * @param {Object} params - * @param {Object} options Hash of extra options to tag onto the layer + * @param {Object} options Hashtable of extra options to tag onto the layer */ initialize: function(name, url, params, options) { OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this, diff --git a/lib/OpenLayers/Layer/HTTPRequest.js b/lib/OpenLayers/Layer/HTTPRequest.js index d28eb6d49e..99f6c0190d 100644 --- a/lib/OpenLayers/Layer/HTTPRequest.js +++ b/lib/OpenLayers/Layer/HTTPRequest.js @@ -14,7 +14,8 @@ OpenLayers.Layer.HTTPRequest.prototype = /** @type String */ url: null, - /** @type Hash */ + /** Hashtable of key/value parameters + * @type Object */ params: null, /** @@ -22,8 +23,8 @@ OpenLayers.Layer.HTTPRequest.prototype = * * @param {String} name * @param {String} url - * @param {hash} params - * @param {Object} options Hash of extra options to tag onto the layer + * @param {Object} params + * @param {Object} options Hashtable of extra options to tag onto the layer */ initialize: function(name, url, params, options) { var newArguments = arguments; @@ -114,7 +115,7 @@ OpenLayers.Layer.HTTPRequest.prototype = // requestString always starts with url var requestString = url; - // create a new params hash with all the layer params and the + // create a new params hashtable with all the layer params and the // new params together. then convert to string var allParams = Object.extend(new Object(), this.params); var allParams = Object.extend(allParams, newParams); diff --git a/lib/OpenLayers/Layer/Markers.js b/lib/OpenLayers/Layer/Markers.js index f3a102d645..4bb540872e 100644 --- a/lib/OpenLayers/Layer/Markers.js +++ b/lib/OpenLayers/Layer/Markers.js @@ -23,7 +23,7 @@ OpenLayers.Layer.Markers.prototype = * @constructor * * @param {String} name - * @param {Object} options Hash of extra options to tag onto the layer + * @param {Object} options Hashtable of extra options to tag onto the layer */ initialize: function(name, options) { OpenLayers.Layer.prototype.initialize.apply(this, arguments); diff --git a/lib/OpenLayers/Layer/Text.js b/lib/OpenLayers/Layer/Text.js index 3e960d40c6..0386b03657 100644 --- a/lib/OpenLayers/Layer/Text.js +++ b/lib/OpenLayers/Layer/Text.js @@ -16,7 +16,8 @@ OpenLayers.Layer.Text.prototype = */ isBaseLayer: false, - /** store url of text file - this should be specified in the "options" hash + /** store url of text file - this should be specified in the + * "options" hashtable * @type str */ location:null, @@ -31,7 +32,7 @@ OpenLayers.Layer.Text.prototype = * * @param {String} name * @param {String} location - * @param {Object} options Hash of extra options to tag onto the layer + * @param {Object} options Hashtable of extra options to tag onto the layer */ initialize: function(name, options) { OpenLayers.Layer.Markers.prototype.initialize.apply(this, arguments); diff --git a/lib/OpenLayers/Layer/WFS.js b/lib/OpenLayers/Layer/WFS.js index 18a2af59a7..171926d62c 100644 --- a/lib/OpenLayers/Layer/WFS.js +++ b/lib/OpenLayers/Layer/WFS.js @@ -30,7 +30,8 @@ OpenLayers.Layer.WFS.prototype = /** @type Object */ tileClass: OpenLayers.Tile.WFS, - /** @final @type hash */ + /** Hashtable of default key/value parameters + * @final @type Object */ DEFAULT_PARAMS: { service: "WFS", version: "1.0.0", request: "GetFeature", @@ -42,8 +43,8 @@ OpenLayers.Layer.WFS.prototype = * * @param {String} name * @param {String} url - * @param {hash} params - * @param {Object} options Hash of extra options to tag onto the layer + * @param {Object} params + * @param {Object} options Hashtable of extra options to tag onto the layer */ initialize: function(name, url, params, options) { var newArguments = new Array(); @@ -156,7 +157,7 @@ OpenLayers.Layer.WFS.prototype = * * Once params have been changed, we will need to re-init our tiles * - * @param {Object} params Hash of new params to use + * @param {Object} params Hashtable of new params to use */ mergeNewParams:function(params) { var upperParams = OpenLayers.Util.upperCaseObject(params); diff --git a/lib/OpenLayers/Layer/WMS.js b/lib/OpenLayers/Layer/WMS.js index f903103a01..71c0d97c3e 100644 --- a/lib/OpenLayers/Layer/WMS.js +++ b/lib/OpenLayers/Layer/WMS.js @@ -9,7 +9,8 @@ OpenLayers.Layer.WMS = Class.create(); OpenLayers.Layer.WMS.prototype = Object.extend( new OpenLayers.Layer.Grid(), { - /** @final @type hash */ + /** Hashtable of default parameter key/value pairs + * @final @type Object */ DEFAULT_PARAMS: { service: "WMS", version: "1.1.1", request: "GetMap", @@ -31,8 +32,8 @@ OpenLayers.Layer.WMS.prototype = * * @param {String} name * @param {String} url - * @param {hash} params - * @param {Object} options Hash of extra options to tag onto the layer + * @param {Object} params + * @param {Object} options Hashtable of extra options to tag onto the layer */ initialize: function(name, url, params, options) { var newArguments = new Array(); @@ -111,7 +112,7 @@ OpenLayers.Layer.WMS.prototype = * * Once params have been changed, we will need to re-init our tiles * - * @param {Object} params Hash of new params to use + * @param {Object} params Hashtable of new params to use */ mergeNewParams:function(params) { var upperParams = OpenLayers.Util.upperCaseObject(params); diff --git a/lib/OpenLayers/Layer/WMS/Untiled.js b/lib/OpenLayers/Layer/WMS/Untiled.js index 0060364a49..41c30a9a1f 100644 --- a/lib/OpenLayers/Layer/WMS/Untiled.js +++ b/lib/OpenLayers/Layer/WMS/Untiled.js @@ -11,7 +11,8 @@ OpenLayers.Layer.WMS.Untiled = Class.create(); OpenLayers.Layer.WMS.Untiled.prototype = Object.extend( new OpenLayers.Layer.HTTPRequest(), { - /** @final @type hash */ + /** Hashtable of default parameter key/value pairs + * @final @type Object */ DEFAULT_PARAMS: { service: "WMS", version: "1.1.1", request: "GetMap", @@ -35,7 +36,7 @@ OpenLayers.Layer.WMS.Untiled.prototype = * * @param {String} name * @param {String} url - * @param {hash} params + * @param {Object} params */ initialize: function(name, url, params) { var newArguments = new Array(); diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 508615b837..5f575a7e7e 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -14,7 +14,7 @@ OpenLayers.Map.prototype = { /** base z-indexes for different classes of thing * - * @type Hash + * @type Object */ Z_INDEX_BASE: { Layer: 100, Popup: 200, Control: 1000 }, @@ -109,7 +109,7 @@ OpenLayers.Map.prototype = { * @constructor * * @param {DOMElement} div - * @param {Object} options Hash of extra options to tag onto the map + * @param {Object} options Hashtable of extra options to tag onto the map */ initialize: function (div, options) { @@ -191,7 +191,7 @@ OpenLayers.Map.prototype = { /** * @private * - * @param {Object} options Hash of options to tag to the map + * @param {Object} options Hashtable of options to tag to the map */ setOptions: function(options) { diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index 1117bc41d1..8c28ea4432 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -904,7 +904,7 @@ OpenLayers.Util.createAlphaImageDiv = function(id, px, sz, imgURL, }; -/** Creates a new hash and copies over all the keys from the +/** Creates a new hashtable and copies over all the keys from the * passed-in object, but storing them under an uppercased * version of the key at which they were stored. * @@ -921,8 +921,8 @@ OpenLayers.Util.upperCaseObject = function (object) { return uObject; }; -/** Takes a hash and copies any keys that don't exist from -* another hash, by analogy with Object.extend() from +/** Takes a hashtable and copies any keys that don't exist from +* another hashtable, by analogy with Object.extend() from * Prototype.js. * * @param {Object} to diff --git a/tests/test_Layer_WMS.html b/tests/test_Layer_WMS.html index 16536f5f45..b36de977b4 100644 --- a/tests/test_Layer_WMS.html +++ b/tests/test_Layer_WMS.html @@ -123,7 +123,7 @@ newParams.CHICKPEAS = 151; - t.eq( layer.params.CHICKPEAS, "image/png", "mergeNewParams() makes clean copy of hash"); + t.eq( layer.params.CHICKPEAS, "image/png", "mergeNewParams() makes clean copy of hashtable"); } function test_07_Layer_WMS_getFullRequestString (t) { diff --git a/tests/test_Map.html b/tests/test_Map.html index 047e03c889..026c4ddbbc 100644 --- a/tests/test_Map.html +++ b/tests/test_Map.html @@ -62,8 +62,8 @@ function test_04_Map_options(t) { t.plan(2); map = new OpenLayers.Map($('map'), {maxZoomLevel: 5, maxResolution: 3.14159}); - t.eq( map.maxZoomLevel, 5, "map.maxZoomLevel set correctly via options hash" ); - t.eq( map.maxResolution, 3.14159, "map.maxResolution set correctly via options hash" ); + t.eq( map.maxZoomLevel, 5, "map.maxZoomLevel set correctly via options hashtable" ); + t.eq( map.maxResolution, 3.14159, "map.maxResolution set correctly via options hashtable" ); } function test_05_Map_center(t) { t.plan(4);