Search code examples
openlayers-5

Using projection EPSG:4322 in openlayers view is not working even after defining in proj4js


I'm trying to use WGS 72 "EPSG:4322" in my openlayers project. However, using this projection does not work. When trying this projection all layers disappear. I have found an example in the latest openlayers examples showing reprojection from EPSG.io, and it is not working as well.

The linke to the example is: https://openlayers.org/en/latest/examples/reprojection-by-code.html


Solution

  • It seems like a proj4.js problem. Use the WKT format in the def as a workaround:

    proj4.defs('EPSG:4322', 'GEOGCS["WGS 72",DATUM["D_WGS_1972",SPHEROID["WGS_1972",6378135,298.26]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]');