Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Overlay timezones on a Leaflet Earth map
https://github.com/dj0001/Leaflet.timezones

Last synced: 3 months ago
JSON representation

Overlay timezones on a Leaflet Earth map

Awesome Lists containing this project

README

        

# 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:

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

with worldclock popup:

```javascript
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.