Use the layer's projection.
In setMap, the layer gets the map's projection if it doesn't have its own. And since a layer can have a different SRS code than the map (but a compatible one, i.e. with OpenLayers.Projection.transforms[mapProj][layerProj] being OpenLayer.Projection.nullTransform), the axis order can be different.
This commit is contained in:
@@ -175,7 +175,7 @@ OpenLayers.Layer.WMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
* {Boolean} true if the axis order is reversed, false otherwise.
|
||||
*/
|
||||
reverseAxisOrder: function() {
|
||||
var projCode = this.map.getProjectionObject().getCode();
|
||||
var projCode = this.projection.getCode();
|
||||
return parseFloat(this.params.VERSION) >= 1.3 &&
|
||||
!!(this.yx[projCode] || OpenLayers.Projection.defaults[projCode].yx);
|
||||
},
|
||||
|
||||
@@ -290,19 +290,19 @@
|
||||
function test_mixedParams(t) {
|
||||
t.plan(5);
|
||||
var map = new OpenLayers.Map("map", {
|
||||
getExtent: function() {return(new OpenLayers.Bounds(-180,-90,180,90));},
|
||||
getProjectionObject: function() {return new OpenLayers.Projection("EPSG:4326");}
|
||||
getExtent: function() {return(new OpenLayers.Bounds(-180,-90,180,90));}
|
||||
});
|
||||
var geographic = new OpenLayers.Projection("EPSG:4326");
|
||||
|
||||
var a = new OpenLayers.Layer.WMS("dummy","http://localhost/wms", {
|
||||
layers: "a,b,c,d",
|
||||
styles: "a,b,c,d"
|
||||
}, {map: map});
|
||||
}, {projection: geographic});
|
||||
|
||||
var b = new OpenLayers.Layer.WMS("dummy","http://localhost/wms", {
|
||||
layers: ["a","b","c","d"],
|
||||
styles: ["a","b","c","d"]
|
||||
}, {map: map});
|
||||
}, {projection: geographic});
|
||||
|
||||
var c = new OpenLayers.Layer.WMS("dummy","http://localhost/wms", {
|
||||
layers: ["a","b","c","d"]
|
||||
@@ -310,13 +310,13 @@
|
||||
|
||||
var d = new OpenLayers.Layer.WMS("dummy","http://localhost/wms", {
|
||||
layers: "a,b,c,d"
|
||||
}, {map: map});
|
||||
}, {projection: geographic});
|
||||
|
||||
var click = new OpenLayers.Control.WMSGetFeatureInfo({
|
||||
featureType: 'type',
|
||||
featureNS: 'ns',
|
||||
layers: [a, b, c, d]
|
||||
}, {map: map});
|
||||
}, {projection: geographic});
|
||||
|
||||
map.addControl(click);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user