cloudybay / leaflet.latlng-graticule

Lat/Lon Graticule for Leaflet map
MIT License
56 stars 40 forks source link

leaflet.latlng-graticule

Create a Canvas as ImageOverlay to draw the Lat/Lon Graticule,

and show the grid tick label at the edges of the map.

Check out the demo.

Usage example

L.latlngGraticule({
    showLabel: true,
    dashArray: [5, 5],
    zoomInterval: [
        {start: 2, end: 3, interval: 30},
        {start: 4, end: 4, interval: 10},
        {start: 5, end: 7, interval: 5},
        {start: 8, end: 10, interval: 1}
    ]
}).addTo(map);

Options

Special Options

Some of the projections (like Lambert) is no straight line, set those options to draw a polyline graticule.

Check out the Lambert projection example.