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

OpenLayers projection class

So far, we've been talking about the abstract idea of a projection. Let's dive into OpenLayer's Projection class, OpenLayers.Projection, which is what we use to actually handle projections. The Projection class relies on an external library called Proj4js, which can be found at http://proj4js.org. First, we'll talk about what we can do without the proj4js library, and then talk about what we can do with it.

Creating a projection object

To instantiate an object from the Projection class, the code would look like the following:

my_proj = new OpenLayers.Projection('EPSG:4326', {});

Parameters

Let's take a look at the parameters for the Projection class.

  • projectionCode: {String}: A string of identifying the Well Known Identifier ...

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