<html><head><style data-externalstyle="true"><!--
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}

p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style></head><body><div data-externalstyle="false" dir="ltr" style="font-family:Calibri,'Segoe UI',Meiryo,'Microsoft YaHei UI','Microsoft JhengHei UI','Malgun Gothic','Khmer UI','Nirmala UI',Tunga,'Lao UI',Ebrima,sans-serif;font-size:12pt;"><div>Hi,</div><div> </div><div>I’m trying to use a WMS with the EPSG:27700 projection. The WMS uses version 1.3.0, which is causing a few problems. I have got to a point where I cannot figure out what’s wrong.</div><div> </div><div>I am currently getting the following error:</div><div> </div><div>Cannot read property ‘yx’ of undefined</div><div> </div><div>and having read up a little, it appears that it’s due to the WMS version wanting to know whether to reverse the coordinates or not for the bbox parameter, but as the projection is unknown to OpenLayers there’s no yx property to query.</div><div> </div><div>My problem is that I have no idea where to add that property to.</div><div> </div><div>Here’s the code I have so far:</div><div> </div><div data-signatureblock="true"><script src="~/Scripts/proj4js.js"></script><br><script><br>    Proj4js.defs["EPSG:27700"] = "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs";<br></script><br><script src="/Scripts/openlayers/openlayers.js"></script><br><script><br>    var map, opus;</div><div> </div><div>    function init() {<br>        OpenLayers.ImgPath = "/Scripts/openlayers/img/";</div><div> </div><div>        var options = {<br>            maxExtent: new OpenLayers.Bounds(0, 0, 700000, 1300000),<br>            restrictedExtent: new OpenLayers.Bounds(0, 0, 700000, 1300000),<br>            projection: new OpenLayers.Projection('EPSG:27700'),<br>            units: 'm',<br>            scales: [10000, 25000, 50000, 75000, 100000, 150000, 175000, 200000],<br>            controls: [<br>                new OpenLayers.Control.Navigation({ 'zoomWheelEnabled': false }),<br>                new OpenLayers.Control.MousePosition(),<br>                new OpenLayers.Control.PanZoomBar(),<br>                new OpenLayers.Control.LayerSwitcher()<br>            ]<br>        };</div><div> </div><div>        map = new OpenLayers.Map('map', options);</div><div> </div><div>        opus = new OpenLayers.Layer.WMS(<br>            'OpenStreetMap via Opus',<br>            'http://server/wms',<br>            {<br>                layers: 'OpenStreetMap',<br>                version: '1.3.0',<br>                crs: 'EPSG:27700',<br>                format: 'image/png',<br>            },<br>            {<br>                isBaseLayer: true,<br>                transitionEffect: 'resize'<br>            }<br>        );<br>        map.addLayer(opus);</div><div> </div><div>        map.zoomToMaxExtent();<br>        map.zoomToScale(10000, true);<br>        map.setCenter(new OpenLayers.LonLat(195775, 223755));<br>    }<br></script></div><div> </div><div>I also have an onload event that calls the init() function to draw the map on the page.</div><div> </div><div>Any idea how to fix the error I’m getting? I’ve tried adding an xy property to the WMS bit of the code where ‘isBaseLayer’ is defined, but that didn’t seem to work.</div><div> </div><div>Thanks,</div><div> </div><div>-- <br>Dylan Parry<br><br>Blue Fox Technology Ltd<br>Tel: 01492 532100<br>Web: http://www.bluefoxtech.co.uk<br><br>Registered in England and Wales, Company No. 0508226.<br>Registered office: Windsor House, 26 Mostyn Avenue, Craig-Y-Don,<br>Llandudno, Conwy LL30 1YY</div><div> </div></div></body></html>