openlayers/ol3 — pull request #2167 by elemoine (2014-06-04 13:48:56+00:00)
Title: Add a Graticule component

This PR adds a graticule component to the library.

The graticule component uses the immediate API to draw meridian and parallel lines on the map.

The creation of the meridian and parallel line strings uses an adaptive subdivision algorithm (the code is based on code from @twpayne in #1884).

The graticule component works with the Spherical Mercator projection, as well as other projections. The patch includes two examples, [one](http://erilem.net/ol3/graticule/examples/graticule.html) that use the Spherical Mercator projection, and [one](http://erilem.net/ol3/graticule/examples/sphere-mollweide.html) that uses the [Sphere Mollweide](http://en.wikipedia.org/wiki/Mollweide_projection) projection.

The patch also adds maxLat, maxLon, minLat, and minLon properties/options to ol.proj.Projection, which are required values for the graticule component. I'd like to make sure that adding these properties makes sense to others.

Also, the graticule component doesn't draw labels at this point. I have a [graticule2 branch](https://github.com/elemoine/ol3/blob/graticule2) whose [graticule example](https://github.com/elemoine/ol3/blob/graticule2/examples/graticule.js) includes code that adds labels at the intersections between the meridian/parallel lines and the map viewport. I removed that code from this PR's branch, to make the example simpler. My graticule2 branch also includes [code](https://github.com/elemoine/ol3/blob/graticule2/src/ol/geom/flat/intersectionflatgeom.js) for calculating the intersection between a line string and a segment. This is used in the example for the label placement.

Please review.