Skip to content

A Leaflet plugin to create wind arrows with direction and velocity (wind barbs)

License

Notifications You must be signed in to change notification settings

rickyars/Leaflet.windbarb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaflet.windbarb

A small Leaflet plugin to generate wind barbs / wind arrows

Leaflet.idw generates wind barbs according to the wind barb standard shown [here] (https://commons.wikimedia.org/wiki/Wind_speed).

Requirements

This plugin needs Leaflet version v1.0.0beta2 or above.

Demos

  • Example (Mobile: Working on Samsung Galaxy s4)

Examples

Image of wind barbs

Basic Usage

var icon = L.WindBarb.icon({deg: 90, speed: 20, pointRadius: 5, strokeLength: 20});
var marker = L.marker([lat,long], {icon: icon}).addTo(map);

To include the plugin, just use leaflet-windbarb.js from the src folder:

<script src="leaflet-windbarb.js"></script>

Options

Generates a wind barb / wind arrow icon with the following options:

pointRadius - Radius of point in the middle; Default = 8
strokeWidth - Stroke width; Default = 2
strokeLength - Length of the main stroke, to which the barbs are connected; Default = 15
barbSpaceing - Spacing between the barbs; Default = 5
barbHeight - Height of 10kn adn 50kn barbs, 5kn barbs will be 50%; Default = 15
forceDir - if set to "true" the direction will always be shown, even if speed < 2.5kn; Default = false

Changelog

0.0.3 - January 30, 2017

Updated to current Leaflet version (1.0.3). Fixed marker offset issue.

0.0.1 — May 28, 2016

Initial release.

About

A Leaflet plugin to create wind arrows with direction and velocity (wind barbs)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 83.9%
  • HTML 16.1%