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

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

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
}));