Overlay timezones on a Leaflet Earth map
Switch branches/tags
Nothing to show
Clone or download
Latest commit 02aadad Sep 14, 2018
Permalink
Failed to load latest commit information.
L.timezones.js Add files via upload Jan 10, 2018
README.md Update README.md Sep 14, 2018
index.html Add files via upload Jan 10, 2018

README.md

Leaflet.timezones

Overlay timezones on a Leaflet Earth map.

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);

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