<br><br>On Monday, May 7, 2012, Daniel Behr wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
thanks for the great work on new OL 2.12, some cool new features...<br>
I just tested RC3 and one thing doesnt work in my app as before with 2.11.</blockquote><div><br></div><div><br></div><div>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.</div>
<div><br></div><div><br></div><div> </div><span class="Apple-style-span" style> </span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Firebug gives an error which leads to a change in WMS.js from this in 2.11:<br>
<br>
reverseAxisOrder: function() {<br>
return (parseFloat(this.params.<u></u>VERSION) >= 1.3 &&<br>
!!this.yx[this.map.<u></u>getProjectionObject().getCode(<u></u>)]);<br>
}</blockquote><div><br></div><div><br></div><div>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.</div>
<div><br></div><div> </div><div><div><div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
to this since 2.12RC3:<br>
<br>
reverseAxisOrder: function() {<br>
var projCode = this.projection.getCode();<br>
return parseFloat(this.params.<u></u>VERSION) >= 1.3 &&<br>
!!(this.yx[projCode] || OpenLayers.Projection.<u></u>defaults[projCode].yx);<br>
}</blockquote><div><br></div><div><br></div><div>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.</div>
<div><br></div><div>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.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Both this.map and this.projection are null at this point, which breaks the GFI call in 2.12RCs.<br>
<br>
Is this expected behaviour or am I missing something in my GFI definition [1]</blockquote><div><br></div><br><div> Try providing a projection in the config object passes to the layer constructor:</div><div><br></div><span class="Apple-style-span" style> layers: [</span></div>
<div><span class="Apple-style-span" style> new OpenLayers.Layer.WMS("_",<br> "../geoserver/wms",</span></div><div><span class="Apple-style-span" style> {layers: ["wimo:bathyInfo_N","wimo:<u></u>bath</span><span class="Apple-style-span" style>yInfo_O"]</span><span class="Apple-style-span" style>},</span></div>
<div><span class="Apple-style-span" style> {projection: 'EPSG:4326'} // use your wms layer orojection code here</span></div><div><span class="Apple-style-span" style> )</span></div><div><span class="Apple-style-span" style> ]</span></div>
<div><span class="Apple-style-span" style><br></span></div><div><span class="Apple-style-span" style><br></span></div><div><span class="Apple-style-span" style>I hooe it'll work for you.<span></span></span></div><div>
</div></div><br><br>-- <br>Eric Lemoine<br><br>Camptocamp France SAS<br>Savoie Technolac, BP 352<br>73377 Le Bourget du Lac, Cedex<br><br>Tel : 00 33 4 79 44 44 96<br>Mail : <a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a><br>
<a href="http://www.camptocamp.com">http://www.camptocamp.com</a><br><br>