diff --git a/lib/OpenLayers/Control/WMSGetFeatureInfo.js b/lib/OpenLayers/Control/WMSGetFeatureInfo.js index 9b89bae9db..82c37d6e69 100644 --- a/lib/OpenLayers/Control/WMSGetFeatureInfo.js +++ b/lib/OpenLayers/Control/WMSGetFeatureInfo.js @@ -287,7 +287,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, { var candidates = this.layers || this.map.layers; var layers = []; var layer, url; - for(var i=0, len=candidates.length; i= 0; --i) { layer = candidates[i]; if(layer instanceof OpenLayers.Layer.WMS && (!this.queryVisible || layer.getVisibility())) { diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1.js b/lib/OpenLayers/Format/WMSCapabilities/v1.js index 7283760ec1..dd3c498b6c 100644 --- a/lib/OpenLayers/Format/WMSCapabilities/v1.js +++ b/lib/OpenLayers/Format/WMSCapabilities/v1.js @@ -112,6 +112,9 @@ OpenLayers.Format.WMSCapabilities.v1 = OpenLayers.Class( if (layer.formats === undefined) { layer.formats = capability.request.getmap.formats; } + if (layer.infoFormats === undefined && capability.request.getfeatureinfo) { + layer.infoFormats = capability.request.getfeatureinfo.formats; + } var i, len; diff --git a/lib/OpenLayers/Layer/PointTrack.js b/lib/OpenLayers/Layer/PointTrack.js index 8e9e639b2d..62d831cac1 100644 --- a/lib/OpenLayers/Layer/PointTrack.js +++ b/lib/OpenLayers/Layer/PointTrack.js @@ -18,8 +18,8 @@ OpenLayers.Layer.PointTrack = OpenLayers.Class(OpenLayers.Layer.Vector, { /** - * APIProperty: - * dataFrom - {} or + * APIProperty: dataFrom + * {} or * {} optional. If the lines * should get the data/attributes from one of the two points it is * composed of, which one should it be? @@ -27,8 +27,8 @@ OpenLayers.Layer.PointTrack = OpenLayers.Class(OpenLayers.Layer.Vector, { dataFrom: null, /** - * APIProperty: - * styleFrom - {} or + * APIProperty: styleFrom + * {} or * {} optional. If the lines * should get the style from one of the two points it is composed of, * which one should it be? diff --git a/lib/OpenLayers/Tile/Image.js b/lib/OpenLayers/Tile/Image.js index c3037256b6..087693d79f 100644 --- a/lib/OpenLayers/Tile/Image.js +++ b/lib/OpenLayers/Tile/Image.js @@ -346,6 +346,20 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile.BackBufferable, { this.isLoading = false; this.events.triggerEvent("loadend"); + // IE<7 needs a reflow when the tiles are loaded because of the + // percentage based positioning. Otherwise nothing is shown + // until the user interacts with the map in some way. + if (parseFloat(navigator.appVersion.split("MSIE")[1]) < 7 && + this.layer && this.layer.div) { + var span = document.createElement("span"); + span.style.display = "none"; + var layerDiv = this.layer.div; + layerDiv.appendChild(span); + window.setTimeout(function() { + span.parentNode === layerDiv && span.parentNode.removeChild(span); + }, 0); + } + if (this.layerAlphaHack === true) { img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + diff --git a/tests/Control/WMSGetFeatureInfo.html b/tests/Control/WMSGetFeatureInfo.html index 8d63f788c4..9aa0283bb3 100644 --- a/tests/Control/WMSGetFeatureInfo.html +++ b/tests/Control/WMSGetFeatureInfo.html @@ -348,7 +348,7 @@ ); t.eq( log.options && log.options.params.STYLES.join(","), - "a,b,c,d,a,b,c,d,,,,,,,,", + ",,,,,,,,a,b,c,d,a,b,c,d", "Styles merged correctly" ); @@ -424,7 +424,7 @@ control.layerUrls = ["http://a.mirror/wms", "http://b.mirror/wms"]; control.getInfoForClick({xy: {x: 50, y: 50}}); t.eq(log.options && log.options.url, "http://host/wms", "some match, request issued"); - t.eq(log.options && log.options.params["QUERY_LAYERS"].join(","), "a,b", "selected layers queried"); + t.eq(log.options && log.options.params["QUERY_LAYERS"].join(","), "b,a", "selected layers queried"); // show that a layer can be matched if it has a urls array itself (first needs to be matched) log = {}; @@ -508,13 +508,13 @@ var _request = OpenLayers.Request.GET; OpenLayers.Request.GET = function(options) { count++; - if (count == 1) { + if (count == 2) { t.eq(options.params["INFO_FORMAT"], "application/vnd.ogc.gml", "Default info format of the control is used"); - t.eq(options.params["QUERY_LAYERS"].join(","), "a,c", "Layers should be grouped by service url"); - t.eq(options.url, "http://localhost/wms", "Correct url used for first request"); - } else if (count == 2) { + t.eq(options.params["QUERY_LAYERS"].join(","), "c,a", "Layers should be grouped by service url"); + t.eq(options.url, "http://localhost/wms", "Correct url used for second request"); + } else if (count == 1) { t.eq(options.params["INFO_FORMAT"], "text/xml", "Overridden info format is used instead of the control's infoFormat"); - t.eq(options.url, "http://myhost/wms", "Correct url used for second request"); + t.eq(options.url, "http://myhost/wms", "Correct url used for first request"); } }; click.activate(); diff --git a/tests/Format/WMSCapabilities/v1_1_1.html b/tests/Format/WMSCapabilities/v1_1_1.html index cc0c784469..8309bd75ad 100644 --- a/tests/Format/WMSCapabilities/v1_1_1.html +++ b/tests/Format/WMSCapabilities/v1_1_1.html @@ -14,7 +14,7 @@ function test_read(t) { - t.plan(23); + t.plan(24); var xml = document.getElementById("gssample").firstChild.nodeValue; var doc = new OpenLayers.Format.XML().read(xml); @@ -80,6 +80,7 @@ t.eq(capability.layers.length, 22, "correct number of layers parsed"); var layer = capability.layers[2]; + t.eq(layer.infoFormats, ["text/plain", "text/html", "application/vnd.ogc.gml"], "infoFormats set on layer"); t.eq(layer.name, "tiger:tiger_roads", "[2] correct layer name"); t.eq(layer.prefix, "tiger", "[2] correct layer prefix"); t.eq(layer.title, "Manhattan (NY) roads", "[2] correct layer title"); diff --git a/tests/Format/WMSCapabilities/v1_3_0.html b/tests/Format/WMSCapabilities/v1_3_0.html index 9d7eecdac5..7120b8c1a4 100644 --- a/tests/Format/WMSCapabilities/v1_3_0.html +++ b/tests/Format/WMSCapabilities/v1_3_0.html @@ -14,7 +14,7 @@ function test_layers(t) { - t.plan(24); + t.plan(25); var xml = document.getElementById("ogcsample").firstChild.nodeValue; var doc = new OpenLayers.Format.XML().read(xml); @@ -40,7 +40,7 @@ t.eq(layers["Temperature"].srs, {"CRS:84": true}, "Inheritance of SRS handled correctly when redeclaring an inherited SRS"); - + t.eq(layers["Temperature"].infoFormats, ["text/xml", "text/plain", "text/html"], "infoFormats set correctly on layer"); var bbox = layers["ROADS_RIVERS"].bbox["EPSG:26986"]; t.eq(bbox.bbox, [189000, 834000, 285000, 962000], diff --git a/tests/Layer/PointTrack.html b/tests/Layer/PointTrack.html index d889db27f3..95b8ced361 100644 --- a/tests/Layer/PointTrack.html +++ b/tests/Layer/PointTrack.html @@ -66,7 +66,7 @@ t.eq(layer.map.layers.length, 1, "layer added to the map successfully"); layer.destroy(); t.eq(layer.map, null, "layer.map is null after destroy"); - t.eq(layer.getFeatureFromEvent({'target':'map'}), null, "getFeatureIdFromEvent doesn't cause an error when called on layer which has been destroyed."); + t.ok(!layer.renderer, "layer.renderer is falsey after destroy"); } diff --git a/tests/Layer/Vector.html b/tests/Layer/Vector.html index cc8c3fcf43..f449e151b0 100644 --- a/tests/Layer/Vector.html +++ b/tests/Layer/Vector.html @@ -575,7 +575,7 @@ } function test_Layer_Vector_destroy (t) { - t.plan(5); + t.plan(6); var options = {protocol: new OpenLayers.Protocol(), strategies: [new OpenLayers.Strategy(), new OpenLayers.Strategy()]} @@ -584,8 +584,14 @@ map.addLayer(layer); layer.destroy(); t.eq(layer.map, null, "layer.map is null after destroy"); - t.eq(layer.getFeatureFromEvent({'target':'map'}), null, - "getFeatureIdFromEvent doesn't cause an error when called on layer which has been destroyed."); + t.ok(!layer.renderer, "layer.renderer is falsey"); + var err; + try { + layer.getFeatureFromEvent({target: "map"}); + } catch (ex) { + err = ex; + } + t.ok(err, "Error thrown when calling getFeatureFromEvent on destroyed layer"); t.eq(layer.protocol, null, "layer.protocol is null after destroy"); t.eq(layer.strategies, null, "layer.strategies is null after destroy");