Skip to content

ablakey/Leaflet.SimpleGraticule

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

Leaflet.SimpleGraticule

A graticule for maps in Leaflet's L.CRS.Simple coordinate system. Code inspiration came from Jan Pieter Waagmeester's fantastic Leaflet.Grid for world projections. It is very similar in nature but assumes an infinite flat plane.

Usage

Adding L.SimpleGraticule:

var options = {interval: 20,
               showOriginLabel: true,
               redraw: 'move',
               zoomIntervals: [
                {start: 0, end: 3, interval: 50},
                {start: 4, end: 5, interval: 5},
                {start: 6, end: 20, interval: 1}
            ]};

L.simpleGraticule(options).addTo(map);

####Options:####

  • interval: The spacing in map units between horizontal and vertical lines.
  • showOriginLabel: true Whether or not to show '(0,0)' at the origin.
  • redraw: on which map event to redraw the graticule. On move is default but moveend can be smoother.
  • zoomIntervals: use different intervals in different zoom levels. If not specified, all zoom levels use value in interval option.

Notes

  • This is my first open source contribution. I appreciate feedback on any topics!

About

A graticule for Leaflet maps in the L.CRS.Simple coordinate system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published