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 🙏

© 2025 – Pkg Stats / Ryan Hefner

maptalks.wind

v0.1.5

Published

A maptalks Layer to render gltf

Readme

maptalks.wind

NPM Version

Usage

maptalks.wind is a maptalks layer used to rendering the globle wind data which get from the US National Weather Service publishes weather data for the whole globe, known as GFS. This project is heavily inspired by the work of https://github.com/mapbox/webgl-wind.

screenshot

Examples

Install

  • Install with npm: npm install maptalks.wind.
  • Download from dist directory.
  • Use unpkg CDN: https://unpkg.com/maptalks.wind/dist/maptalks.wind.js

Vanilla Javascript

<script type="text/javascript" src="../maptalks.wind.js"></script>
<script>
var map = new maptalks.Map({});

var windData = {
    date: "2016-11-20T00:00Z",
    height: 180,
    image: '2016112000.png',
    source: "http://nomads.ncep.noaa.gov",
    uMax: 26.8,
    uMin: -21.32,
    vMax: 21.42,
    vMin: -21.57,
    width: 360
};
var windlayer = new maptalks.WindLayer('wind', {
    data : windData
}).addTo(map);
</script>

ES6

import { WindLayer } from 'maptalks.wind';

const windData = {
    date: "2016-11-20T00:00Z",
    height: 180,
    image: '2016112000.png',
    source: "http://nomads.ncep.noaa.gov",
    uMax: 26.8,
    uMin: -21.32,
    vMax: 21.42,
    vMin: -21.57,
    width: 360
};
const windlayer = new WindLayer('wind', {
    data : windData
});

support for GFS data

import { WindLayer } from 'maptalks.wind';

const windlayer = new WindLayer('wind', {
    data : '../path/gfs.json'
});

OR

const windData = {...};
const windlayer = new WindLayer('wind', {
    data : windData
});

Supported Browsers

IE 9-11, Chrome, Firefox, other modern and mobile browsers.

API Reference

Constructor

WindLayer is a subclass of maptalks.Layer and inherits all the methods of its parent.

new maptalks.WindLayer(id, options)
  • id String layer id
  • options Object options
    • count Number count of the particles (256 * 256 by default)
    • fadeOpacity Number how fast the particle trails fade on each frame(0.996 by default)
    • speedFactor Number how fast the particles move(0.25 by default)
    • dropRate Number how often the particles move to a random place(0.003 by default)
    • dropRateBump Number drop rate increase relative to individual particle speed (0.01 by default)
    • colors Object the color of the particles, it's usually a ramp color
    • data Object if your wind data is a lookup table image, it should includ lookup image, max wind velocity and min wind velocity, and if you wind data is a GFS json, it should be a json file path.

setWind(data)

set the wind data for windlayer

windlayer.setWind(data);
  • data Object. It's an object like this:
   {
        height: 180,
        image: '2016112000.png',
        uMax: 26.8,
        uMin: -21.32,
        vMax: 21.42,
        vMin: -21.57,
        width: 360
    }

setParticlesCount(count)

set the count for particles

windlayer.setParticlesCount(count);
  • count Number the count of the particles in layer

getParticlesCount()

get the count of particles for windlayer

windlayer.getParticlesCount();

Returns Number

  • The count of particles.

setRampColors(colors)

set the ramp color for rendering particles

windlayer.setRampColors(colors);
  • colors Object a ramp color object, the structure like this:
    {
        0.0: '#3288bd',
        0.1: '#66c2a5',
        0.2: '#abdda4',
        0.3: '#e6f598',
        0.4: '#fee08b',
        0.5: '#fdae61',
        0.6: '#f46d43',
        1.0: '#d53e4f'
    }

getWindSpeed(coordinate)

get the wind speed on specified location

windlayer.getWindSpeed(coordinate);
  • coordinate maptalks.Coordinate

Returns Array

  • The return value is a length of 2 Array which contains horizontal speed and vertical speed. The negative and positive of the value represent the direction of wind.

Develop

It is written in ES6, transpiled by babel and tested with mocha and expect.js.

  • Install dependencies
$ npm install
  • dev
$ npm run dev
  • build
$ npm run build
  • test
$ npm run test