Grid of latitude and longitude lines.
JavaScript
Latest commit e9146fb Jan 28, 2014 @turban Merge pull request #1 from tmcw/trailing-whitespace
Remove trailing whitespace
Permalink
Failed to load latest commit information.
examples Minor fix Jul 4, 2013
L.Graticule.js Remove trailing whitespace Jan 23, 2014
README.md Improve readme Jan 23, 2014

README.md

Leaflet.Graticule

Generate a graticule grid of latitude and longitude lines.

API

L.graticule(options)

Create a new Graticule layer which inherits from L.GeoJSON. Options is an optional options object with the following properties:

  • interval: the gap between each graticule line, in degrees
  • style: path options for the generated lines

Example

// Add a basic graticule with divisions every 20 degrees
// as a layer on a map
L.graticule().addTo(map);

// Specify divisions every 10 degrees
L.graticule({ interval: 10 }).addTo(map);

// Specify bold red lines instead of thin grey lines
L.graticule({
    style: {
        color: '#f00',
        weight: 10
    }
}).addTo(map);

More information