leaflet-openweathermap

From OpenStreetMap Wiki
Jump to navigation Jump to search
Example screenshot with several active layers

leaflet-openweathermap is a JavaScript library providing easy access to OpenWeatherMap's features for Leaflet-based maps.

OpenWeatherMap (OWM) is a service providing weather related data, visualizing it using an OpenLayers based map. A Leaflet library is available but is it is very limited and uses an old API.

Source

Get it from Github: leaflet-openweathermap

Features

The main features are:

  • Licensed under CC0
  • Simple access to all tile layers
    • The tile layers are* Clouds, Clouds Classic, Precipitation, Precipitation Classic, Rain, Rain Classic, Snow, Pressure, Pressure Contour, Temperature, Wind
    • a legend for each layer can be displayed, too, but only a few are available out of the box
    • you can provide your own legend image
  • Simple access to current weather data (cities and stations)
    • support for OWM's API key (everything works without a key but it is recommended to get a free one at OWM/appid
    • set a minimal zoom for fetching data
    • show a progress indicator when loading data from OWM (can be custumized or just disabled)
    • caching of current weather items
    • automated refresh of current weather data every n minutes
    • simple client side clustering of current weather items
    • prepared for different languages (en is default, de/ru/fr are still incomplete - please help if you know the correct terms)
  • A lot of configuration options for builtin popups
    • configurable temperature units (K, °C, F)
    • configurable speed units (m/s, km/h, mph, Beaufort scala)
    • show or hide some values in popup
    • number of decimal places used for speed or temperature
    • include your own set of weather icons if you have one
    • keep an open popup open if map is moved and the popup's marker is still visible
  • If you don't like the builtin markers or popups
    • provide your own function for generating current weather markers
    • switch off all popups or
    • provide your own function for generating current weather popups

Example

Read the documentation (README.md) with examples at GitHub or just look at the working example at OpenWeatherMap for Leaflet

Screenshots

Leaflet-OpenWeatherMap
Wind direction with Leaflet-OpenWeatherMap
Stormy Monday / Leaflet-OpenWeatherMap