Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • OpenLayers 2.10 Beginner's Guide
  • Toc
  • feedback
OpenLayers 2.10 Beginner's Guide

OpenLayers 2.10 Beginner's Guide

4.2 (9)
close
OpenLayers 2.10 Beginner's Guide

OpenLayers 2.10 Beginner's Guide

4.2 (9)

Overview of this book

Table of Contents (18 chapters)
close
OpenLayers 2.10
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 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...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete