0

I'm trying to transform coordinates from EPSG:3857 to EPSG:32633 using Proj4js. I added this script and the code is as follows:

        <script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.3/proj4.js"></script>

        Proj4js.defs["EPSG:3857"] = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs";
        Proj4js.defs["EPSG:32633"] = "+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs";
        var source = new Proj4js.Proj('EPSG:3857');    
        var dest = new Proj4js.Proj('EPSG:32633');

        var coorXNew = new Proj4js.Point( minX, maxX );   
        var coorYNew = new Proj4js.Point( minY, maxY ); 

        var transXCoords = Proj4js.transform(source, dest, coorXNew);      
        var transYCoords = Proj4js.transform(source, dest, coorYNew); 

I keep getting this error: Uncaught ReferenceError: Proj4js is not defined.

What am I doing wrong? Thanks for answers!

1 Answers1

0

A quick look at the docs and at the proj4.js file shows that Proj4js object doesn't exist. It's proj4. Make sure to have a look at the doc next time before asking!

Jean-Baptiste Martin
  • 1,399
  • 1
  • 10
  • 19