From ab81a690d372d4ed34db102ab8928b426ca1fdbe Mon Sep 17 00:00:00 2001 From: euzuro Date: Tue, 21 Aug 2007 19:06:49 +0000 Subject: [PATCH] patch for #910 - removing extraneous moveTo() from tile/image.js git-svn-id: http://svn.openlayers.org/trunk/openlayers@3928 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Tile/Image.js | 19 +------------------ tests/Layer/test_KaMap.html | 9 +++++---- tests/Layer/test_MapServer.html | 6 ++++-- tests/Layer/test_WMS.html | 7 +++++-- 4 files changed, 15 insertions(+), 26 deletions(-) diff --git a/lib/OpenLayers/Tile/Image.js b/lib/OpenLayers/Tile/Image.js index a01802dea0..ec93afaa9a 100644 --- a/lib/OpenLayers/Tile/Image.js +++ b/lib/OpenLayers/Tile/Image.js @@ -38,7 +38,7 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, { /** 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. + * each draw(), so no need to specify it here. * * Constructor: OpenLayers.Tile.Image * Constructor for a new instance. @@ -139,23 +139,6 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, { } }, - /** - * Method: moveTo - * Reposition the tile. - * - * Parameters: - * bounds - {} - * position - {} - * redraw - {Boolean} Call draw method on tile after moving? Default is true - */ - moveTo: function (bounds, position, redraw) { - if (this.layer != this.layer.map.baseLayer && this.layer.reproject) { - bounds = this.getBoundsFromBaseLayer(position); - } - this.url = this.layer.getURL(bounds); - OpenLayers.Tile.prototype.moveTo.apply(this, arguments); - }, - /** * Method: initImgDiv * Creates the imgDiv property on the tile. diff --git a/tests/Layer/test_KaMap.html b/tests/Layer/test_KaMap.html index 47623df5f3..7d9876961f 100644 --- a/tests/Layer/test_KaMap.html +++ b/tests/Layer/test_KaMap.html @@ -103,7 +103,7 @@ } function test_06_Layer_kaMap_mergeNewParams (t) { - t.plan( 5 ); + t.plan( 4 ); var map = new OpenLayers.Map("map"); var url = "http://octo.metacarta.com/cgi-bin/mapserv"; @@ -114,13 +114,14 @@ 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.redraw = function() { + t.ok(true, "layer is redrawn after new params merged"); + } + layer.mergeNewParams(newParams); t.eq( layer.params.layers, "sooper", "mergeNewParams() overwrites well"); t.eq( layer.params.chickpeas, "image/png", "mergeNewParams() adds well"); - t.ok( layer.grid[0][0].url.match("chickpeas"), "CHICKPEAS is in URL of first tile in grid" ); newParams.chickpeas = 151; diff --git a/tests/Layer/test_MapServer.html b/tests/Layer/test_MapServer.html index 25b59f31f7..661feac35e 100644 --- a/tests/Layer/test_MapServer.html +++ b/tests/Layer/test_MapServer.html @@ -136,12 +136,14 @@ map.addLayer(layer); map.zoomToMaxExtent(); + layer.redraw = function() { + t.ok(true, "layer is redrawn after new params merged"); + } layer.mergeNewParams(newParams); t.eq( layer.params.layers, "sooper", "mergeNewParams() overwrites well"); t.eq( layer.params.chickpeas, "image/png", "mergeNewParams() adds well"); - t.ok( layer.grid[0][0].url.match("chickpeas"), "chickpeas is in URL of first tile in grid" ); - + newParams.chickpeas = 151; t.eq( layer.params.chickpeas, "image/png", "mergeNewParams() makes clean copy of hashtable"); diff --git a/tests/Layer/test_WMS.html b/tests/Layer/test_WMS.html index 67b2b45727..6b2c033382 100644 --- a/tests/Layer/test_WMS.html +++ b/tests/Layer/test_WMS.html @@ -160,12 +160,15 @@ map.addLayer(layer); map.zoomToMaxExtent(); + layer.redraw = function() { + t.ok(true, "layer is redrawn after new params merged"); + } + layer.mergeNewParams(newParams); t.eq( layer.params.LAYERS, "sooper", "mergeNewParams() overwrites well"); t.eq( layer.params.CHICKPEAS, "image/png", "mergeNewParams() adds well"); - t.ok( layer.grid[0][0].url.match("CHICKPEAS"), "CHICKPEAS is in URL of first tile in grid" ); - + newParams.CHICKPEAS = 151; t.eq( layer.params.CHICKPEAS, "image/png", "mergeNewParams() makes clean copy of hashtable");