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
This commit is contained in:
@@ -21,7 +21,7 @@ OpenLayers.Control.prototype = {
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {Hash} options
|
||||
* @param {Object} options
|
||||
*/
|
||||
initialize: function (options) {
|
||||
Object.extend(this, options);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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) {
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user