From 057d574ec1bd495cd408bf0d56cb04bd21233710 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Mon, 9 Apr 2007 14:08:09 +0000 Subject: [PATCH] From Erik, "add strategic TBD 3.0 comments to remind us to remove the 'url' var from OpenLayers.Tile's constructor." This has no affects other than to let people know now that this behavior will change in future versions of OpenLayers. #647. git-svn-id: http://svn.openlayers.org/trunk/openlayers@3034 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Tile.js | 13 +++++++++++-- lib/OpenLayers/Tile/Image.js | 11 ++++++++++- lib/OpenLayers/Tile/WFS.js | 5 ++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/lib/OpenLayers/Tile.js b/lib/OpenLayers/Tile.js index b1e5d96c2f..e4219a074d 100644 --- a/lib/OpenLayers/Tile.js +++ b/lib/OpenLayers/Tile.js @@ -12,6 +12,9 @@ * about themselves -- such as the URL that they are related to, and their * size - but do not add themselves to the layer div automatically, for * example. + * + * TBD 3.0 - remove reference to url in above paragraph + * */ OpenLayers.Tile = OpenLayers.Class.create(); OpenLayers.Tile.prototype = { @@ -22,7 +25,11 @@ OpenLayers.Tile.prototype = { /** @type OpenLayers.Layer */ layer: null, - /** @type String url of the request */ + /** TBD 3.0 + * @deprecated The base tile class does not need an url. This should be + * handled in subclasses. Does not belong here. + * + * @type String url of the request */ url:null, /** @type OpenLayers.Bounds */ @@ -38,7 +45,9 @@ OpenLayers.Tile.prototype = { /** @type Boolean */ drawn: false, - /** + /** TBD 3.0 -- remove 'url' from the list of parameters to the constructor. + * there is no need for the base tile class to have a url. + * * @constructor * * @param {OpenLayers.Layer} layer diff --git a/lib/OpenLayers/Tile/Image.js b/lib/OpenLayers/Tile/Image.js index c3b4c8aab4..d930a3e0a9 100644 --- a/lib/OpenLayers/Tile/Image.js +++ b/lib/OpenLayers/Tile/Image.js @@ -11,6 +11,9 @@ OpenLayers.Tile.Image = OpenLayers.Class.create(); OpenLayers.Tile.Image.prototype = OpenLayers.Class.inherit( OpenLayers.Tile, { + + /** @type String */ + url: null, /** @type DOMElement img */ imgDiv: null, @@ -22,7 +25,10 @@ OpenLayers.Tile.Image.prototype = * @type DOMElement div */ frame: null, - /** + /** TBD 3.0 - reorder the parameters to the init function to put URL + * as last, so we can continue to call tile.initialize() + * without changing the arguments. + * * @constructor * * @param {OpenLayers.Grid} layer @@ -33,6 +39,9 @@ OpenLayers.Tile.Image.prototype = */ initialize: function(layer, position, bounds, url, size) { OpenLayers.Tile.prototype.initialize.apply(this, arguments); + + this.url = url; + this.frame = document.createElement('div'); this.frame.style.overflow = 'hidden'; this.frame.style.position = 'absolute'; diff --git a/lib/OpenLayers/Tile/WFS.js b/lib/OpenLayers/Tile/WFS.js index 5142f1c031..6406a48814 100644 --- a/lib/OpenLayers/Tile/WFS.js +++ b/lib/OpenLayers/Tile/WFS.js @@ -18,7 +18,10 @@ OpenLayers.Tile.WFS.prototype = /** @type Array(String) */ url: null, - /** + /** TBD 3.0 - reorder the parameters to the init function to put URL + * as last, so we can continue to call tile.initialize() + * without changing the arguments. + * * @constructor * * @param {OpenLayers.Layer} layer