2.0.0 • Published 2 years ago

leaflet-auto-graticule v2.0.0

Weekly downloads
121
License
BSD-2-Clause
Repository
github
Last release
2 years ago

Leaflet.AutoGraticule

A graticule for maps showing Latitude and Longitude, with automatic adjustment to the zoom level.

Based on Leaflet.SimpleGraticule.

Demo\ Demo on FacilMap

Usage

If you are using a module bundler, you can install Leaflet.AutoGraticule using npm install -S leaflet-auto-graticule and use it in your code like so:

import AutoGraticule from "leaflet-auto-graticule";

new AutoGraticule().addTo(map);

TypeScript is supported. Note that when including Leaflet.AutoGraticule like this, L.AutoGraticule is not available on the global L leaflet object.

If you want to use Leaflet.AutoGraticule in a static HTML page, load it after Leaflet:

<script src="https://unpkg.com/leaflet"></script>
<script src="https://unpkg.com/leaflet-auto-graticule"></script>
<script>
    new L.AutoGraticule().addTo(map);
</script>

Options

var options = {
    /** Leaflet map event on which to redraw the graticule. */
    redraw: 'moveend',

    /** Minimum distance in pixels between two graticule lines. */
    minDistance: 100
};

new L.AutoGraticule(options).addTo(map);
2.0.0

2 years ago

1.1.2

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago