1

I'm trying to get the extent of a map using OpenLayers 3, so that I can use it in a CQL filter to limit the area of the WMS request to the area currently shown in the map extent. To do this, I have to transform the extent into the source layer's SRID coordinates, but I am getting an error when I try this. The code I'm using is:

var currentExtent = map.getView().calculateExtent(map.getSize());
transformedExtent = ol.proj.transformExtent(currentExtent,'EPSG:3857','EPSG:8155');

I get the following error bubbling up in Firebug, which points to line 68 in http://openlayers.org/en/v3.11.1/build/ol.js:

TypeError: c is undefined function Je(b,c){var d=b.a,e=c.a,f;d in Ke&&e in Ke[d]&&(f=Ke[d][e]);void 0===f&...

If I transform from 3857 to 4326 using the same syntax, otherwise, it works as expected, giving me coordinates that make sense for 4326:

transformedExtent = ol.proj.transformExtent(currentExtent,'EPSG:3857','EPSG:4326');

8155 is the WYLAM SRID, and was added somewhat recently. It looks like some of the formatting information is missing on spatialreference.org.

Any ideas as to whether this is a problem that needs to be addressed in OpenLayers, Spatial Reference, or elsewhere?

1
  • The EPSG web service does not know code 8155 epsg-registry.org so it is probably not included in the newest official EPSG database version 8.8.1.
    – user30184
    Jan 27, 2016 at 18:30

0

Your Answer

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

Browse other questions tagged or ask your own question.