From cc78cf3a13ffafa67c944b0c69676e364f018faf Mon Sep 17 00:00:00 2001 From: crschmidt Date: Mon, 17 Sep 2007 22:49:25 +0000 Subject: [PATCH] Fix Layer.Image typo in setUrl (See #985) reported by Linda on the mailing list. Thanks for the review Tim. git-svn-id: http://svn.openlayers.org/trunk/openlayers@4355 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/Image.js | 2 +- tests/Layer/test_Image.html | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Layer/Image.js b/lib/OpenLayers/Layer/Image.js index 31b1890756..cd8abd3f65 100644 --- a/lib/OpenLayers/Layer/Image.js +++ b/lib/OpenLayers/Layer/Image.js @@ -186,7 +186,7 @@ OpenLayers.Layer.Image = OpenLayers.Class(OpenLayers.Layer, { */ setUrl: function(newUrl) { this.url = newUrl; - this.draw(); + this.tile.draw(); }, /** diff --git a/tests/Layer/test_Image.html b/tests/Layer/test_Image.html index b851e5884b..21da2c13df 100644 --- a/tests/Layer/test_Image.html +++ b/tests/Layer/test_Image.html @@ -39,7 +39,7 @@ } function test_50_Layer_Image_tileTests (t) { - t.plan(6); + t.plan(7); var map = new OpenLayers.Map('map'); layer = new OpenLayers.Layer.Image('Test Layer', @@ -63,6 +63,8 @@ t.eq(layer.tile.imgDiv.src, "http://earthtrends.wri.org/images/maps/4_m_citylights_lg.gif", "URL is correct"); map.zoomIn(); t.eq(layer.tile.imgDiv.src, "http://earthtrends.wri.org/images/maps/4_m_citylights_lg.gif", "URL is correct"); + layer.setUrl('http://labs.metacarta.com/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fjpeg&SRS=EPSG%3A4326&BBOX=-180,-90,0,90&WIDTH=256&HEIGHT=256'); + t.eq(layer.tile.imgDiv.src, "http://labs.metacarta.com/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fjpeg&SRS=EPSG%3A4326&BBOX=-180,-90,0,90&WIDTH=256&HEIGHT=256", "URL is correct after setURL"); } /****** *