Book Image

OpenLayers 2.10 Beginner's Guide

Book Image

OpenLayers 2.10 Beginner's Guide

Overview of this book

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

Transforming projections


Transforming a point means you take a coordinate in one projection and turn it into a coordinate of another projection. Apart from transforming EPSG:4326 to EPSG:900913 and vice-versa, OpenLayers does not provide support for transforming other projections out of the box—to do transforms of other projections, you'll need to include Proj4js (which can be found at http://proj4js.org/).

In most scenarios, it is the job of the backend map server to handle projection transformations, but often it's useful or faster to do it on the client side (such as in the case of vector layer coordinate transformations). Let's take a look at how to transform EPSG:4326 to EPSG:900913 with OpenLayers.