Browse files

Documenting the functionality included in Projection.js.

This adds documentation for projection methods and includes detail in the release notes about build configuration related changes.
  • Loading branch information...
tschaub committed Jan 17, 2012
1 parent bfa6f06 commit 9a6827f6b3e166e6f762a323f08cd1108836f06c
Showing with 21 additions and 4 deletions.
  1. +15 −4 lib/OpenLayers/Projection.js
  2. +6 −0 notes/
@@ -9,10 +9,21 @@
- * Class: OpenLayers.Projection
- * Class for coordinate transforms between coordinate systems.
- * Depends on the proj4js library. If proj4js is not available,
- * then this is just an empty stub.
+ * Namespace: OpenLayers.Projection
+ * Methods for coordinate transforms between coordinate systems. By default,
+ * OpenLayers ships with the ability to transform coordinates between
+ * geographic (EPSG:4326) and web or spherical mercator (EPSG:900913 et al.)
+ * coordinate reference systems. See the <transform> method for details
+ * on usage.
+ *
+ * Additional transforms may be added by using the <proj4js at>
+ * library. If the proj4js library is included, the <transform> method
+ * will work between any two coordinate reference systems with proj4js
+ * definitions.
+ *
+ * If the proj4js library is not included, or if you wish to allow transforms
+ * between arbitrary coordinate reference systems, use the <addTransform>
+ * method to register a custom transform method.
OpenLayers.Projection = OpenLayers.Class({
@@ -54,6 +54,12 @@ Without the WKT format included (by default), the `OpenLayers.Geometry::toString
`Layer.OSM` is now defined in its own script file, namely `OpenLayers/Layer/OSM.js`. So people using `Layer.OSM` should now include `OpenLayers/Layer/OSM.js`, as opposed to `OpenLayers/Layer/XYZ.js`, in their OpenLayers builds. (See
+## Projection & SphericalMercator
+In previous releases, coordinate transforms between EPSG:4326 and EPSG:900913 were defined in the SphericalMercator.js script. In 2.12, these default transforms are included in the Projection.js script. The Projection.js script is included as a dependency in builds with any layer types, so no special build configuration is necessary to get the web mercator transforms.
+If you were previously using the `OpenLayers.Layer.SphericalMercator.forwardMercator` or `inverseMercator` methods, you may have to explicitly include the SphericalMercator.js script in your build. The Google layer is the only layer that depends on the SphericalMercator mixin. If you are not using the Google layer but want to use the SphericalMercator methods listed above, you have to explicitly include the SphericalMercator.js script in your build.
## QueryStringFilter
`OpenLayers.Protocol.HTTP` no longer requires `OpenLayers.Format.QueryStringFilter`. It you need this, make sure it is included in your build config file.

0 comments on commit 9a6827f

Please sign in to comment.