[OpenLayers-Users] 2.12RC3 WMSGetFeatureInfo event problem caused by change in WMS.js reverseAxisOrder function

Eric Lemoine eric.lemoine at camptocamp.com
Tue May 8 02:02:18 EDT 2012


On Monday, May 7, 2012, Daniel Behr wrote:

> Hello,
> thanks for the great work on new OL 2.12, some cool new features...
> I just tested RC3 and one thing doesnt work in my app as before with 2.11.



The issue is related to you giving the wms gfi control a layer that's not
in the map. I really don't know whether the GFI control is supposed to work
in that case.




>
>
> Firebug gives an error which leads to a change in WMS.js from this in 2.11:
>
> reverseAxisOrder: function() {
>        return (parseFloat(this.params.**VERSION) >= 1.3 &&
>        !!this.yx[this.map.**getProjectionObject().getCode(**)]);
> }



Since VERSION is < 1.3 in your case this.map is not dereferenced here so
you don't get any error. If you woked with a WMS 1.3 layer you'd get an
error with OL 2.11 as well. So it looks like the GFI control does not
really support working with layers that aren't in the map.



>
> to this since 2.12RC3:
>
> reverseAxisOrder: function() {
>        var projCode = this.projection.getCode();
>        return parseFloat(this.params.**VERSION) >= 1.3 &&
>        !!(this.yx[projCode] || OpenLayers.Projection.**
> defaults[projCode].yx);
> }



I guess you get an error when getCode is called because this.projection is
null. this.projection is null because no projection is set in the config
object passed to the layer constructor, and because the layer could not
inherit a projection from the map.

But it sounds to me that the GFI control in 2.12 does no longer require
that the layer is in the map, as long as the layer has a projection.



>
> Both this.map and this.projection are null at this point, which breaks the
> GFI call in 2.12RCs.
>
> Is this expected behaviour or am I missing something in my GFI definition
> [1]



 Try providing a projection in the config object passes to the layer
constructor:

    layers: [
        new OpenLayers.Layer.WMS("_",
            "../geoserver/wms",
            {layers: ["wimo:bathyInfo_N","wimo:**bathyInfo_O"]},
            {projection: 'EPSG:4326'} // use your wms layer orojection code
here
        )
    ]


I hooe it'll work for you.


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120508/7f6606d1/attachment.html


More information about the Users mailing list