Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 669 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 669 Bytes

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.