O'Reilly logo

OpenLayers 3 : Beginner's Guide by Erik Hazzard, Paul Spencer, Thomas Gratier

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 the now usual template for OpenLayers 3.

  1. Download Proj4js from https://github.com/proj4js/proj4js/releases. At the time of writing, the latest version was proj4js 2.3.3; so, go ahead and download it by clicking on the proj4.js green button for 2.3.3 (or whichever the latest version is).
  2. Copy the proj4.js file into a new assets/proj4js directory at the root code directory.
  3. Add the following line in the <head> section of your code before the OpenLayers 3 library inclusion code:
    <script src="../assets/proj4js/proj4.js">
    </script>
  4. You can also use the online source, http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.3/proj4.js, for production purposes. In this case, do not ...

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