This step is similar to the way we set up the now usual template for OpenLayers 3.
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).
Copy the
proj4.js
file into a newassets/proj4js
directory at the root code directory.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>
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 forget to use a fallback to the local file if the CDN fails for any reason.
Now, open up the page and start Chrome Developer Tools. Type and run the following code:
var test_proj = proj4('EPSG:4326'); console.log(test_proj);
You should...