<html>
<head>
<meta name="generator" content="Windows Mail 17.4.9600.16384">
<style><!--
p.MsoNormal, li.MsoNormal, div.MsoNormal {
margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
}

a:link, span.MsoHyperlink {
color:blue;
text-decoration:underline;
}

span.MsoHyperlinkFollowed {
color:purple;
text-decoration:underline;
}

p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
}

p.msolistparagraphcxspfirst, li.msolistparagraphcxspfirst, div.msolistparagraphcxspfirst {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
font-size:12.0pt;
font-family:"Times New Roman","serif";
}

p.msolistparagraphcxspmiddle, li.msolistparagraphcxspmiddle, div.msolistparagraphcxspmiddle {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
font-size:12.0pt;
font-family:"Times New Roman","serif";
}

p.msolistparagraphcxsplast, li.msolistparagraphcxsplast, div.msolistparagraphcxsplast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
font-size:12.0pt;
font-family:"Times New Roman","serif";
}

span.EmailStyle21 {
font-family:"Calibri","sans-serif";
color:#1F497D;
}

.MsoChpDefault {
font-size:10.0pt;
}

div.WordSection1 {
}
--></style><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 dir="ltr">
<div data-externalstyle="false" dir="ltr" style="font-family:Calibri,'Segoe UI',Meiryo,'Microsoft YaHei UI','Microsoft JhengHei UI','Malgun Gothic',sans-serif;font-size:12pt;"><div>Hi,</div><div><br></div><div>That’s similar to what I tried before, ie.</div><div><br></div><div>yx: { ‘EPSG:27700’: false }</div><div><br></div><div>Strangely, the error goes away when I set the above to ‘true’ but then of course the coordinates are all wrong so the tiles won’t load. I can’t understand why setting it to false would bring up an error when false is still a valid value?<br></div><div data-signatureblock="true"><div><br></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><br></div></div><div style="padding-top: 5px; border-top-color: rgb(229, 229, 229); border-top-width: 1px; border-top-style: solid;"><div><font face="Calibri, 'Segoe UI', Meiryo, 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'Khmer UI', 'Nirmala UI', Tunga, 'Lao UI', Ebrima, sans-serif" style='line-height: 15pt; letter-spacing: 0.02em; 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;'><b>From:</b> <a href="mailto:jawendell@suddenlink.net" target="_parent">Jerome A. Wendell</a><br><b>Sent:</b> ‎Friday‎, ‎18‎ ‎October‎ ‎2013 ‎13‎:‎25<br><b>To:</b> <a href="mailto:dylan.parry@bluefoxtech.co.uk" target="_parent">Dylan Parry</a>, <a href="mailto:openlayers-users@lists.osgeo.org" target="_parent">openlayers-users@lists.osgeo.org</a></font></div></div><div><br></div><div class="WordSection1"><p class="MsoNormal"><span style='color: rgb(31, 73, 125); font-family: "Calibri","sans-serif"; font-size: 11pt;'>Dylan,</span></p><p class="MsoNormal"><span style='color: rgb(31, 73, 125); font-family: "Calibri","sans-serif"; font-size: 11pt;'> </span></p><p class="MsoNormal"><span style='color: rgb(31, 73, 125); font-family: "Calibri","sans-serif"; font-size: 11pt;'>I have added the following to the same section of code that you referred to for some of my layers:</span></p><p class="MsoNormal" style="text-indent: 0.5in;"><span style='color: rgb(31, 73, 125); font-family: "Calibri","sans-serif"; font-size: 11pt;'> </span></p><p class="MsoNormal" style="text-indent: 0.5in;"><span style='color: rgb(31, 73, 125); font-family: "Calibri","sans-serif"; font-size: 11pt;'> yx : {'EPSG:4326' : true}</span></p><p class="MsoNormal"><span style='color: rgb(31, 73, 125); font-family: "Calibri","sans-serif"; font-size: 11pt;'> </span></p><p class="MsoNormal"><span style='color: rgb(31, 73, 125); font-family: "Calibri","sans-serif"; font-size: 11pt;'>See if adapting it to your projection makes any difference.</span></p><p class="MsoNormal"><span style='color: rgb(31, 73, 125); font-family: "Calibri","sans-serif"; font-size: 11pt;'> </span></p><p class="MsoNormal"><span style='color: rgb(31, 73, 125); font-family: "Calibri","sans-serif"; font-size: 11pt;'>Jerome Wendell</span></p><p class="MsoNormal"><span style='color: rgb(31, 73, 125); font-family: "Calibri","sans-serif"; font-size: 11pt;'> </span></p><p class="MsoNormal"><span style='color: rgb(31, 73, 125); font-family: "Calibri","sans-serif"; font-size: 11pt;'> </span></p><div><div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) black black; padding: 3pt 0in 0in; border-image: none;"><p class="MsoNormal"><b><span style='font-family: "Tahoma","sans-serif"; font-size: 10pt;'>From:</span></b><span style='font-family: "Tahoma","sans-serif"; font-size: 10pt;'> openlayers-users-bounces@lists.osgeo.org [mailto:openlayers-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Dylan Parry<br><b>Sent:</b> Friday, October 18, 2013 8:06 AM<br><b>To:</b> openlayers-users@lists.osgeo.org<br><b>Subject:</b> [OpenLayers-Users] Cannot read property 'yx' of undefined</span></p></div></div><p class="MsoNormal"> </p><div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>Hi,</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>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.</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>I am currently getting the following error:</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>Cannot read property ‘yx’ of undefined</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>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.</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>My problem is that I have no idea where to add that property to.</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>Here’s the code I have so far:</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'><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;</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>    function init() {<br>        OpenLayers.ImgPath = "/Scripts/openlayers/img/";</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>        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>        };</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>        map = new OpenLayers.Map('map', options);</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>        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);</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>        map.zoomToMaxExtent();<br>        map.zoomToScale(10000, true);<br>        map.setCenter(new OpenLayers.LonLat(195775, 223755));<br>    }<br></script></span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>I also have an onload event that calls the init() function to draw the map on the page.</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>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.</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>Thanks,</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'>-- <br>Dylan Parry<br><br>Blue Fox Technology Ltd<br>Tel: 01492 532100<br>Web: <a href="http://www.bluefoxtech.co.uk" target="_parent">http://www.bluefoxtech.co.uk</a><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</span></p></div><div><p class="MsoNormal"><span style='font-family: "Calibri","sans-serif";'> </span></p></div></div></div></div>
</body>
</html>