Time for Action – setting up Proj4js.org
This step is similar to the way we set up OpenLayers.
Download Proj4js from http://trac.osgeo.org/proj4js/wiki/Download. At the time of writing, the latest version was proj4js-1.0.1.zip, so go ahead and download it (or whichever the latest version is).
Extract it and copy the proj4js folder to your root code directory (the folder where your
OpenLayers.js
file is located).Add the following line in the
<head>
section of your code after the OpenLayers library inclusion code.<script type='text/javascript' src="proj4js/lib/proj4js-combined.js"></script>
Now, open up the page and start Firebug. Type and run the following:
var test_proj = new Proj4js.Proj('EPSG:4325'); console.log(test_proj);
You should see output that looks like the following:
Object { srsCodeInput="EPSG:4325", more...}
What Just Happened?
We just included the Proj4js library and tested to see if it worked. If you received an error when you attempted to call new Proj4js.Proj...