https://github.com/bright/leaflet.weathericonslayer
Current weather icons layer for Leaflet, based on OpenWeatherMap API
https://github.com/bright/leaflet.weathericonslayer
Last synced: 9 months ago
JSON representation
Current weather icons layer for Leaflet, based on OpenWeatherMap API
- Host: GitHub
- URL: https://github.com/bright/leaflet.weathericonslayer
- Owner: bright
- Created: 2014-12-02T13:17:47.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-30T12:08:23.000Z (over 10 years ago)
- Last Synced: 2025-09-14T03:45:03.762Z (9 months ago)
- Language: JavaScript
- Size: 146 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Leaflet.WeatherIconsLayer
=========================
Current weather icons layer for Leaflet, based on [OpenWeatherMap API](http://openweathermap.org/current).
Partial rework of [outdated sample script](http://openweathermap.org/js/leaflet-layer.js) from OpenWeatherMap site.
As an OpenWeatherMap derivative work, licenced with [Creative Commons BY-SA 2.0](http://creativecommons.org/licenses/by-sa/2.0/). OpenWeatherMap [Terms of service](http://openweathermap.org/terms) apply.
See **[live example](http://bright.github.io/Leaflet.WeatherIconsLayer)**.
Installation
------------
* NPM: `npm install leaflet-weathericonslayer`
* Bower: `bower install leaflet-weathericonslayer`
Usage
-----
map.addLayer(new L.WeatherIconsLayer());
Also, several options available. Here are the defaults shown:
map.addLayer(new L.WeatherIconsLayer({
apiKey: undefined, // OpenWeatherMap API key
host: 'http://openweathermap.org/', // API host
i18n: {...}, // object with translation strings, see code
units: 'metric', // or 'imperial'; temperature scale
temperatureDigits: 0, // how many decimal digits in temperature
maxAgeSeconds: 24*60*60, // 24h; how long the weather data is considered worth showing
}));