<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><base target="_blank"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
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
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
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
{mso-style-name: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
{mso-style-name: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
{mso-style-name: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";}
p.msochpdefault, li.msochpdefault, div.msochpdefault
{mso-style-name:msochpdefault;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:10.0pt;
font-family:"Times New Roman","serif";}
span.emailstyle21
{mso-style-name:emailstyle21;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.EmailStyle25
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Dylan,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Have you looked at the following page in the documentation:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><a href="http://docs.geoserver.org/stable/en/user/services/wms/basics.html#differences-between-wms-versions">http://docs.geoserver.org/stable/en/user/services/wms/basics.html#differences-between-wms-versions</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Jerome Wendell<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Dylan Parry [mailto:dylan.parry@bluefoxtech.co.uk] <br><b>Sent:</b> Friday, October 18, 2013 10:12 AM<br><b>To:</b> openlayers-users@lists.osgeo.org; jawendell@suddenlink.net<br><b>Subject:</b> Re: [OpenLayers-Users] Cannot read property 'yx' of undefined<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'>Hi,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'>That’s similar to what I tried before, ie.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'>yx: { ‘EPSG:27700’: false }<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'>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?<o:p></o:p></span></p></div><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'><o:p> </o:p></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">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<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div></div><div style='border:none;border-top:solid #E5E5E5 1.0pt;padding:4.0pt 0in 0in 0in'><div><p class=MsoNormal><b><span style='font-family:"Calibri","sans-serif";letter-spacing:.25pt'>From:</span></b><span style='font-family:"Calibri","sans-serif";letter-spacing:.25pt'> <a href="mailto:jawendell@suddenlink.net" target="_parent">Jerome A. Wendell</a><br><b>Sent:</b> </span><span style='font-family:"Arial","sans-serif";letter-spacing:.25pt'></span><span style='font-family:"Calibri","sans-serif";letter-spacing:.25pt'>Friday</span><span style='font-family:"Arial","sans-serif";letter-spacing:.25pt'></span><span style='font-family:"Calibri","sans-serif";letter-spacing:.25pt'>, </span><span style='font-family:"Arial","sans-serif";letter-spacing:.25pt'></span><span style='font-family:"Calibri","sans-serif";letter-spacing:.25pt'>18</span><span style='font-family:"Arial","sans-serif";letter-spacing:.25pt'></span><span style='font-family:"Calibri","sans-serif";letter-spacing:.25pt'> </span><span style='font-family:"Arial","sans-serif";letter-spacing:.25pt'></span><span style='font-family:"Calibri","sans-serif";letter-spacing:.25pt'>October</span><span style='font-family:"Arial","sans-serif";letter-spacing:.25pt'></span><span style='font-family:"Calibri","sans-serif";letter-spacing:.25pt'> </span><span style='font-family:"Arial","sans-serif";letter-spacing:.25pt'></span><span style='font-family:"Calibri","sans-serif";letter-spacing:.25pt'>2013 </span><span style='font-family:"Arial","sans-serif";letter-spacing:.25pt'></span><span style='font-family:"Calibri","sans-serif";letter-spacing:.25pt'>13</span><span style='font-family:"Arial","sans-serif";letter-spacing:.25pt'></span><span style='font-family:"Calibri","sans-serif";letter-spacing:.25pt'>:</span><span style='font-family:"Arial","sans-serif";letter-spacing:.25pt'></span><span style='font-family:"Calibri","sans-serif";letter-spacing:.25pt'>25</span><span style='font-family:"Calibri","sans-serif";letter-spacing:.25pt'><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></span><span style='font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Dylan,</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I have added the following to the same section of code that you referred to for some of my layers:</span><o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>yx : {'EPSG:4326' : true}</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>See if adapting it to your projection makes any difference.</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Jerome Wendell</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in;border-image: none'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> <a href="mailto:openlayers-users-bounces@lists.osgeo.org">openlayers-users-bounces@lists.osgeo.org</a> [<a href="mailto:openlayers-users-bounces@lists.osgeo.org">mailto:openlayers-users-bounces@lists.osgeo.org</a>] <b>On Behalf Of </b>Dylan Parry<br><b>Sent:</b> Friday, October 18, 2013 8:06 AM<br><b>To:</b> <a href="mailto:openlayers-users@lists.osgeo.org">openlayers-users@lists.osgeo.org</a><br><b>Subject:</b> [OpenLayers-Users] Cannot read property 'yx' of undefined</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'>Hi,</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></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><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'>I am currently getting the following error:</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'>Cannot read property ‘yx’ of undefined</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></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><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></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><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'>Here’s the code I have so far:</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></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><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> function init() {<br> OpenLayers.ImgPath = "/Scripts/openlayers/img/";</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></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><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> map = new OpenLayers.Map('map', options);</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></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><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></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><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></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><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></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><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'>Thanks,</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></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><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p></div></div></div></div></div></body></html>