Skip to content

dj0001/Leaflet.timezones

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

Overlay timezones on a Leaflet Earth map

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages