Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/dj0001/Leaflet.timezones
- Owner: dj0001
- Created: 2018-01-10T15:41:36.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-12-10T07:28:23.000Z (almost 5 years ago)
- Last Synced: 2024-07-27T19:43:12.369Z (4 months ago)
- Language: HTML
- Size: 79.1 KB
- Stars: 16
- Watchers: 2
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
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.