O'Reilly logo

OpenLayers 2.10 by Erik Hazzard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for Action – setting up Proj4js.org

This step is similar to the way we set up OpenLayers.

  1. 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).
  2. Extract it and copy the proj4js folder to your root code directory (the folder where your OpenLayers.js file is located).
  3. 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>
  4. 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);
  5. You should see output ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required