# leaflet-wind

> leaflet wind

Latest version **1.2.4** (published 2026-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install leaflet-wind
pnpm add leaflet-wind
yarn add leaflet-wind
bun add leaflet-wind
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2026-11-19 |
| First published | 2020-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 2.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 714 |
| Author | sakitam-fdd |
| Maintainers | sakitam-fdd |
| Keywords | leaflet, 2d, webgl, map, vis, gis |

## Links

- npm: https://www.npmjs.com/package/leaflet-wind
- Repository: https://github.com/sakitam-fdd/wind-layer
- Homepage: https://github.com/sakitam-fdd/wind-layer#readme
- Issues: https://github.com/sakitam-fdd/wind-layer/issues
- npm.io page: https://npm.io/package/leaflet-wind

## Dependencies (5)

- [gl-matrix](https://npm.io/package/gl-matrix.md) ^3.4.4
- [wind-core](https://npm.io/package/wind-core.md) 1.1.9
- [wind-gl-core](https://npm.io/package/wind-gl-core.md) 2.0.4
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) ^0.5.2
- [@sakitam-gis/vis-engine](https://npm.io/package/@sakitam-gis/vis-engine.md) ^1.5.3

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 1.2.4 (latest) — 2026-11-19
- 1.1.3-alpha.0 (alpha) — 2023-06-06
- 1.2.2 — 2024-04-29
- 1.2.1 — 2024-04-29
- 1.2.0 — 2024-04-28
- 1.1.6 — 2024-04-14
- 1.1.5 — 2024-03-21
- 1.1.4 — 2024-03-17
- 1.1.3 — 2024-02-29
- 1.1.2 — 2022-11-26
- 1.1.1 — 2022-11-22
- 1.1.1-alpha.2 — 2021-04-09
- 1.1.1-alpha.1 — 2021-03-30
- 1.1.1-alpha.0 — 2021-03-26
- 1.1.0-alpha.0 — 2021-03-26
- … 8 more at https://npm.io/package/leaflet-wind/versions

## README

# `leaflet-wind`

> [leaflet](https://leafletjs.com/) wind layer adapter

## Usage

### Install

```bash
pnpm i leaflet-wind -S
```

### Example

```vue
<template>
  <div class="demo-content">
    <div class="map-warp" ref="map"></div>
  </div>
</template>
<script setup>
import {ref, onMounted} from 'vue'

const map = ref(null)

const initMap = async (dom) => {
  const L = await import('leaflet');
  const { WindLayer } = await import('leaflet-wind');

  const map = new L.map(dom, {
    // center: [113.53450137499999, 34.44104525],
    zoom: 5,
    center: [113.53450137499999, 34.44104525].reverse(),
    // zoom: 4
  });

  const layer = L.tileLayer('//{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png', {
    subdomains: ['a', 'b', 'c', 'd'],
  });

  map.addLayer(layer);

  fetch('https://sakitam.oss-cn-beijing.aliyuncs.com/codepen/wind-layer/json/wind.json')
      .then(res => res.json())
      .then(res => {
        const velocityScale = [0.1, 0.2, 0.3, 0.4, 0.5];

        const windLayer = new WindLayer('wind', res, {
          windOptions: {
            // colorScale: (m) => {
            //   // console.log(m);
            //   return '#fff';
            // },
            colorScale: [
              "rgb(36,104, 180)",
              "rgb(60,157, 194)",
              "rgb(128,205,193 )",
              "rgb(151,218,168 )",
              "rgb(198,231,181)",
              "rgb(238,247,217)",
              "rgb(255,238,159)",
              "rgb(252,217,125)",
              "rgb(255,182,100)",
              "rgb(252,150,75)",
              "rgb(250,112,52)",
              "rgb(245,64,32)",
              "rgb(237,45,28)",
              "rgb(220,24,32)",
              "rgb(180,0,35)"
            ],
            // velocityScale: 1 / 20,
            // paths: 5000,
            frameRate: 16,
            maxAge: 60,
            globalAlpha: 0.9,
            velocityScale: () => {
              return velocityScale[map.getZoom() - 5] * 0.1 || 0.1;
            },
            // paths: 10000,
            paths: 1000,
          },
        });

        console.log(map, windLayer);

        map.addLayer(windLayer);
      });
}

onMounted(() => {
  initMap(map.value);
});
</script>

<style lang="less">
.demo-content {
  width: 100%;
  height: 100vh;
  position: relative;
  background-color: #cbe0ff;

  &-datgui {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    pointer-events: auto;
  }

  .map-warp {
    width: 100%;
    height: 100%;
  }
}
</style>

```

---
_Source: https://npm.io/package/leaflet-wind · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
