diff --git a/lib/OpenLayers/Layer/Image.js b/lib/OpenLayers/Layer/Image.js index 6c7c49bc09..eee88265c2 100644 --- a/lib/OpenLayers/Layer/Image.js +++ b/lib/OpenLayers/Layer/Image.js @@ -159,7 +159,7 @@ OpenLayers.Layer.Image = OpenLayers.Class(OpenLayers.Layer, { if(firstRendering) { //create the new tile this.tile = new OpenLayers.Tile.Image(this, ulPx, this.extent, - this.url, this.tileSize); + null, this.tileSize); } else { //just resize the tile and set it's new position this.tile.size = this.tileSize.clone(); diff --git a/lib/OpenLayers/Layer/MapServer.js b/lib/OpenLayers/Layer/MapServer.js index dfe9352806..7665b19998 100644 --- a/lib/OpenLayers/Layer/MapServer.js +++ b/lib/OpenLayers/Layer/MapServer.js @@ -88,8 +88,8 @@ OpenLayers.Layer.MapServer = OpenLayers.Class(OpenLayers.Layer.Grid, { * {} The added OpenLayers.Tile.Image */ addTile:function(bounds,position) { - var url = this.getURL(bounds); - return new OpenLayers.Tile.Image(this, position, bounds, url, this.tileSize); + return new OpenLayers.Tile.Image(this, position, bounds, + null, this.tileSize); }, /** diff --git a/lib/OpenLayers/Layer/MapServer/Untiled.js b/lib/OpenLayers/Layer/MapServer/Untiled.js index 8343161727..5b1f870eaa 100644 --- a/lib/OpenLayers/Layer/MapServer/Untiled.js +++ b/lib/OpenLayers/Layer/MapServer/Untiled.js @@ -181,9 +181,6 @@ OpenLayers.Layer.MapServer.Untiled = OpenLayers.Class( //determine new tile size this.setTileSize(); - //formulate request url string - var url = this.getURL(tileBounds); - //determine new position (upper left corner of new bounds) var ul = new OpenLayers.LonLat(tileBounds.left, tileBounds.top); var pos = this.map.getLayerPxFromLonLat(ul); @@ -197,7 +194,7 @@ OpenLayers.Layer.MapServer.Untiled = OpenLayers.Class( this.doneLoading = false; if (!this.tile) { this.tile = new OpenLayers.Tile.Image(this, pos, tileBounds, - url, this.tileSize); + null, this.tileSize); this.tile.draw(); var onload = function() { this.doneLoading = true; diff --git a/lib/OpenLayers/Layer/TMS.js b/lib/OpenLayers/Layer/TMS.js index d3ba9128f0..d3c3c2fd52 100644 --- a/lib/OpenLayers/Layer/TMS.js +++ b/lib/OpenLayers/Layer/TMS.js @@ -116,9 +116,8 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * {} The added OpenLayers.Tile.Image */ addTile:function(bounds,position) { - var url = this.getURL(bounds); return new OpenLayers.Tile.Image(this, position, bounds, - url, this.tileSize); + null, this.tileSize); }, /** diff --git a/lib/OpenLayers/Layer/WMS.js b/lib/OpenLayers/Layer/WMS.js index 3f5853ed37..3684d9f8bf 100644 --- a/lib/OpenLayers/Layer/WMS.js +++ b/lib/OpenLayers/Layer/WMS.js @@ -162,9 +162,8 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, { * {} The added OpenLayers.Tile.Image */ addTile:function(bounds,position) { - var url = this.getURL(bounds); return new OpenLayers.Tile.Image(this, position, bounds, - url, this.tileSize); + null, this.tileSize); }, /** diff --git a/lib/OpenLayers/Layer/WorldWind.js b/lib/OpenLayers/Layer/WorldWind.js index f62667af65..89067a4e84 100644 --- a/lib/OpenLayers/Layer/WorldWind.js +++ b/lib/OpenLayers/Layer/WorldWind.js @@ -64,16 +64,8 @@ OpenLayers.Layer.WorldWind = OpenLayers.Class(OpenLayers.Layer.Grid, { * Method: addTile */ addTile:function(bounds,position) { - if (this.map.getResolution() <= (this.lzd/512) - && this.getZoom() <= this.zoomLevels) { - var url = this.getURL(bounds); - return new OpenLayers.Tile.Image(this, position, bounds, - url, this.tileSize); - } else { - return new OpenLayers.Tile.Image(this, position, bounds, - OpenLayers.Util.getImagesLocation() + "blank.gif", - this.tileSize); - } + return new OpenLayers.Tile.Image(this, position, bounds, + null, this.tileSize); }, /** diff --git a/lib/OpenLayers/Tile/Image.js b/lib/OpenLayers/Tile/Image.js index b8751bcc26..a448d2030b 100644 --- a/lib/OpenLayers/Tile/Image.js +++ b/lib/OpenLayers/Tile/Image.js @@ -36,9 +36,9 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, { */ 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. + /** TBD 3.0 - reorder the parameters to the init function to remove + * URL. the getUrl() function on the layer gets called on + * each draw() and moveTo(), so no need to specify it here. * * Constructor: OpenLayers.Tile.Image * Constructor for a new instance. @@ -47,14 +47,14 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, { * layer - {} layer that the tile will go in. * position - {} * bounds - {} - * url - {} + * url - {} Deprecated. Remove me in 3.0. * size - {} */ initialize: function(layer, position, bounds, url, size) { OpenLayers.Tile.prototype.initialize.apply(this, arguments); - this.url = url; - + this.url = url; //deprecated remove me + this.frame = document.createElement('div'); this.frame.style.overflow = 'hidden'; this.frame.style.position = 'absolute'; diff --git a/tests/Layer/test_MapServer.html b/tests/Layer/test_MapServer.html index a0ee514605..daf4242349 100644 --- a/tests/Layer/test_MapServer.html +++ b/tests/Layer/test_MapServer.html @@ -124,7 +124,7 @@ } function test_06_Layer_MapServer_mergeNewParams (t) { - t.plan( 5 ); + t.plan( 4 ); var map = new OpenLayers.Map("map"); var url = "http://labs.metacarta.com/cgi-bin/mapserv"; @@ -135,8 +135,7 @@ map.addLayer(layer); map.zoomToMaxExtent(); - t.ok( !layer.grid[0][0].url.match("chickpeas"), "chickpeas is not in URL of first tile in grid" ); - + layer.mergeNewParams(newParams); t.eq( layer.params.layers, "sooper", "mergeNewParams() overwrites well"); diff --git a/tests/Layer/test_WMS.html b/tests/Layer/test_WMS.html index d17230c9c7..3402548329 100644 --- a/tests/Layer/test_WMS.html +++ b/tests/Layer/test_WMS.html @@ -148,7 +148,7 @@ } function test_06_Layer_WMS_mergeNewParams (t) { - t.plan( 5 ); + t.plan( 4 ); var map = new OpenLayers.Map("map"); var url = "http://octo.metacarta.com/cgi-bin/mapserv"; @@ -159,7 +159,6 @@ map.addLayer(layer); map.zoomToMaxExtent(); - t.ok( !layer.grid[0][0].url.match("CHICKPEAS"), "CHICKPEAS is not in URL of first tile in grid" ); layer.mergeNewParams(newParams);