The line number doesn't say much if I don't have your OpenLayers.js file.

Can you debug this part:

https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Layer/WMS.js#L180:L181

Maybe for some reason yx on your layer is undefined? But it should be set by 
the prototype of the WMS layer here:

https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Layer/WMS.js#L63

Best regards,
Bart

On Oct 18, 2013, at 4:44 PM, Dylan Parry <[email protected]> wrote:

> Of course, here’s the stack trace:
> 
> Uncaught TypeError: Cannot read property 'yx' of undefined openlayers.js:951
> OpenLayers.Layer.WMS.OpenLayers.Class.reverseAxisOrder openlayers.js:951
> OpenLayers.Layer.WMS.OpenLayers.Class.getURL openlayers.js:951
> OpenLayers.Tile.Image.OpenLayers.Class.renderTile openlayers.js:446
> OpenLayers.Tile.Image.OpenLayers.Class.draw openlayers.js:446
> OpenLayers.Layer.Grid.OpenLayers.Class.drawTileFromQueue openlayers.js:460
> (anonymous function) openlayers.js:62
> e.(anonymous function)
> 
> OpenLayers.Projection.defaults[‘EPSG:27700’] gives me ‘undefined’.
> 
> -- 
> Dylan Parry
> 
> Blue Fox Technology Ltd
> Tel: 01492 532100
> Web: http://www.bluefoxtech.co.uk
> 
> Registered in England and Wales, Company No. 0508226.
> Registered office: Windsor House, 26 Mostyn Avenue, Craig-Y-Don,
> Llandudno, Conwy LL30 1YY
> 
> From: Bart van den Eijnden
> Sent: ‎Friday‎, ‎18‎ ‎October‎ ‎2013 ‎15‎:‎41
> To: Dylan Parry
> 
> Can you paste the full stack trace? There are multiple occurrences where this 
> could happen.
> 
> Make sure you don't set yx at all on your WMS layer.
> 
> What does OpenLayers.Projection.defaults['EPSG:27700'] give you back?
> 
> Best regards,
> Bart
> 
> On Oct 18, 2013, at 4:33 PM, Dylan Parry <[email protected]> 
> wrote:
> 
> It’s supposed to be XY, but I get the error:
> 
> Cannot read property ‘yx’ of undefined
> 
> when I don’t use the line suggested by Jerome, of course if I do use it then 
> the coords are in the wrong order but without the error being shown.
> 
> -- 
> Dylan Parry
> 
> Blue Fox Technology Ltd
> Tel: 01492 532100
> Web: http://www.bluefoxtech.co.uk
> 
> Registered in England and Wales, Company No. 0508226.
> Registered office: Windsor House, 26 Mostyn Avenue, Craig-Y-Don,
> Llandudno, Conwy LL30 1YY
> 
> From: Bart van den Eijnden
> Sent: ‎Friday‎, ‎18‎ ‎October‎ ‎2013 ‎15‎:‎31
> To: Dylan Parry
> Cc: [email protected], [email protected]
> 
> What is the axis order of your CRS? yx or xy?
> 
> The default for WMS 1.3 is xy, yx is only used if your CRS uses yx as the 
> axis order.
> 
> It doesn't make any sense to set yx for a certain key to false, it is only 
> meant to store a list of CRSs that have yx as the axis order.
> 
> Best regards,
> Bart
> 
> On Oct 18, 2013, at 4:11 PM, Dylan Parry <[email protected]> 
> wrote:
> 
> Hi,
> 
> That’s similar to what I tried before, ie.
> 
> yx: { ‘EPSG:27700’: false }
> 
> 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?
> 
> -- 
> Dylan Parry
> 
> Blue Fox Technology Ltd
> Tel: 01492 532100
> Web: http://www.bluefoxtech.co.uk
> 
> Registered in England and Wales, Company No. 0508226.
> Registered office: Windsor House, 26 Mostyn Avenue, Craig-Y-Don,
> Llandudno, Conwy LL30 1YY
> 
> From: Jerome A. Wendell
> Sent: ‎Friday‎, ‎18‎ ‎October‎ ‎2013 ‎13‎:‎25
> To: Dylan Parry, [email protected]
> 
> Dylan,
>  
> I have added the following to the same section of code that you referred to 
> for some of my layers:
>  
> yx : {'EPSG:4326' : true}
>  
> See if adapting it to your projection makes any difference.
>  
> Jerome Wendell
>  
>  
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Dylan Parry
> Sent: Friday, October 18, 2013 8:06 AM
> To: [email protected]
> Subject: [OpenLayers-Users] Cannot read property 'yx' of undefined
>  
> Hi,
>  
> 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.
>  
> I am currently getting the following error:
>  
> Cannot read property ‘yx’ of undefined
>  
> 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.
>  
> My problem is that I have no idea where to add that property to.
>  
> Here’s the code I have so far:
>  
> <script src="~/Scripts/proj4js.js"></script>
> <script>
>     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";
> </script>
> <script src="/Scripts/openlayers/openlayers.js"></script>
> <script>
>     var map, opus;
>  
>     function init() {
>         OpenLayers.ImgPath = "/Scripts/openlayers/img/";
>  
>         var options = {
>             maxExtent: new OpenLayers.Bounds(0, 0, 700000, 1300000),
>             restrictedExtent: new OpenLayers.Bounds(0, 0, 700000, 1300000),
>             projection: new OpenLayers.Projection('EPSG:27700'),
>             units: 'm',
>             scales: [10000, 25000, 50000, 75000, 100000, 150000, 175000, 
> 200000],
>             controls: [
>                 new OpenLayers.Control.Navigation({ 'zoomWheelEnabled': false 
> }),
>                 new OpenLayers.Control.MousePosition(),
>                 new OpenLayers.Control.PanZoomBar(),
>                 new OpenLayers.Control.LayerSwitcher()
>             ]
>         };
>  
>         map = new OpenLayers.Map('map', options);
>  
>         opus = new OpenLayers.Layer.WMS(
>             'OpenStreetMap via Opus',
>             'http://server/wms',
>             {
>                 layers: 'OpenStreetMap',
>                 version: '1.3.0',
>                 crs: 'EPSG:27700',
>                 format: 'image/png',
>             },
>             {
>                 isBaseLayer: true,
>                 transitionEffect: 'resize'
>             }
>         );
>         map.addLayer(opus);
>  
>         map.zoomToMaxExtent();
>         map.zoomToScale(10000, true);
>         map.setCenter(new OpenLayers.LonLat(195775, 223755));
>     }
> </script>
>  
> I also have an onload event that calls the init() function to draw the map on 
> the page.
>  
> 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.
>  
> Thanks,
>  
> -- 
> Dylan Parry
> 
> Blue Fox Technology Ltd
> Tel: 01492 532100
> Web: http://www.bluefoxtech.co.uk
> 
> Registered in England and Wales, Company No. 0508226.
> Registered office: Windsor House, 26 Mostyn Avenue, Craig-Y-Don,
> Llandudno, Conwy LL30 1YY
>  
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
> 
> 
> 
> 

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to