npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@almamigratoria/leaflet-openmeteo

v0.3.1

Published

Weather control for Leaflet v2

Downloads

7

Readme

Leaflet.OpenMeteo

A leaflet plugin to display weather using the Open-Meteo API. It was inspired by the Leaflet.Weather plugin.
Primary differences are that Leaflet.OpenMeteo has no dependancies (no JQuery), the Open-Meteo api doesn't require an API key (for non- commerial use), and (hopefully) will be Leaflet version 2 compatible.

Live Demo

Example

    // Create a map in the "map" div, set the view to Berlin
     map = new L.Map('map').setView([52.5, 13.4], 13);

    // add an OpenStreetMap tile layer
    new L.TileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(map);

    // add the weather control that displays the weather at the center of the map
    new L.Control.OpenMeteo().addTo(map);

    // You can add multiple instances.
    // Add a control for London
    new L.Control.OpenMeteo({
        title: "London",
        center: [51.5, -0.1],
    }).addTo(map);

Installation

Just include the JS in your HTML. The CSS is in the javascript file. The method used to inject the CSS might (or might not) work on non-evergreen browsers.

    <script src="Leaflet.OpenMeteo.min.js"></script>

Options

  • position - Leaflet position option for Controls.
  • title - Title for control. Defaults to "OpenMeteo". Useful when creating multiple instances.
  • autoTitle - Looks up a place name using OSM.
  • location - Not to be confused with position, this is the lat/lng from where you want the weather. Defaults to the center of the map. Useful when creating multiple instances.
  • wind_directions - options are:
    • if undefined or ommitted, wind direction displayed in degrees
    • an array of strings representing evenly spaced directions (starting at north, rotating clockwise). You can use this to get directons like "NNE", or things like ["Βορέας", "Εὖρος", "Νότος", "Ζέφυρος"] if you're an ancient Greek sailor.
    • default - a pre-defined array [ "N", "NE", "E", "SE", "S", "SW", "W", "NW" ]

Weird design choices

  • The cool kids these days say "don't use webfonts, use SVG's". I'm not sure I agree, but I'm trying it out in this project. Turns out I've got a lot to learn about how to use SVG's, but I'll get there. Feel free to tweak it.
  • Putting the CSS right in the javascript file and using adoptedStyleSheets. Only one file to load or customize, and Leaflet version 2 doesn't plan to support broken browsers, so this seemed like the way to go.

License

The Leaflet.OpenMeteo plugin is released under the MIT License The Open-Meteo API has a tiered license, which you should check out if you plan on deploying this plugin in a commerical setting.