@kngai/leaflet.timezones

1.0.0 • Public • Published

Leaflet.timezones

Overlay timezones on a Leaflet Earth map.

This is an npm packaged version of https://dj0001.github.io/Leaflet.timezones/. Use the following command to add this package to your project.

npm install --save @kngai/leaflet.timezones

Demo

https://dj0001.github.io/Leaflet.timezones/

Usage

Leaflet.timezones extends the GeoJSON class. Adding the sunset to a leaflet popup is as easy as:

L.timezones.addTo(map);

with timezone popup:

L.timezones.bindPopup(function (layer) {
    return layer.feature.properties.time_zone;
}).addTo(map);

with worldclock popup:

L.timezones.bindPopup(function (layer) {
    return new Date().toLocaleString("en-GB", {timeZone:layer.feature.properties.tz_name1st, timeZoneName:"short"})
}).addTo(map);

License

This project is licensed under the terms of the MIT license.

Package Sidebar

Install

npm i @kngai/leaflet.timezones

Weekly Downloads

33

Version

1.0.0

License

ISC

Unpacked Size

476 kB

Total Files

4

Last publish

Collaborators

  • kngai