All the layers in my application are EPSG:31466. However, if I retrieve the capabilites:

        var wms = new OpenLayers.Format.WMSCapabilities();

            url: myUrl,
            success: function(e){

                var response = wms.read(e.responseText);
                var layerObj = response.capability.layers[0];  


The BoundingBox' Coordinates are given in a totally different format.

In EPSG:31466 I would expect them to be similar to new OpenLayers.Bounds(363060,5770362,363496,5771118), but in fact they are like this: [-23.015284514192917, 48.276782941782315, -22.953739137948624, 48.29765968309495].

Looks like a different format, but why and how do I change this?

    var my_extent=new OpenLayers.Bounds(layerObj.llbbox).transform(new OpenLayers.Projection("EPSG:4326"),map.displayProjection);

Console Output:

 [-23.015284514192917, 48.276782941782315, -22.953739137948624, 48.29765968309495]

Object { left=-23.015284514193, bottom=48.276782941782, right=-22.953739137949, more...}

1 Answer 1


It's EPSG 4326. llbox means latlon-boundingbox. Every layer has to be published in 4326 but can often be requested in different crs's, so you get the llbbox always in 4326. just reproject them with

.transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:31466"));

for example

var my_extent=new OpenLayers.Bounds(-23.015284514192917, 48.276782941782315, -22.953739137948624, 48.29765968309495).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:31466"));

If transforming fails one reason can also be that you have not included proj4.js for this projection.

    var neu=new OpenLayers.Bounds.fromArray([35.76180874190184, 7.0599674899119, 
36.38799280563133, 7.559116178088183]);

    console.log(neu.transform(new OpenLayers.Projection("EPSG:4326"),
new OpenLayers.Projection("EPSG:31466")));

Reprojecting should work if proj4.js is included. see console.log in this example: enter image description here


You can get the BBOX of your Layer also with


instead of

  • looks like the transformation fails (look above).
    – Lokomotywa
    Commented Feb 13, 2015 at 11:03
  • 1
    have you already tried console.log(layerObj.bbox["EPSG:31466"]); instead of console.log(layerObj.llbbox); ?
    – Thomas B
    Commented Feb 13, 2015 at 11:08
  • 1
    nice. just added one more option in my answer to get the extent in 31466 by including proj4.js... (and merged my last comment also in the answer)
    – Thomas B
    Commented Feb 13, 2015 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.