Leaflet plugin to add WindJS data visualisation overlay
npm install wind-js-leafletwind-js-leaflet, as it is more flexible and up to date.0.7.7 and 1.0.3.v1 way to init:
``javascript`
WindJSLeaflet({ options: 'here' });`
v2 way to init: javascript`
WindJSLeaflet.init({ options: 'here' });
and dist/wind-js-leaflet.css files using resource tags.$3
npm install wind-js-leafletUse
Demo use here: http://danwild.github.io/wind-js-leaflet/Dependencies
Prior to loading wind-js-leaflet, you need to load:
- Leaflet
- jQueryOptions
`javascript
localMode: true // use a local data file to test before hitting a real wind-js-server
map: map, // ref to your leaflet Map
layerControl: layerControl, // ref to your leaflet layer control
useNearest: false, // get nearest data to your ISO time string
timeISO: null, // your ISO time string, falls back to current time (can also use WindJsLeaflet.setTime(time))
nearestDaysLimit: 7, // the maximum range (±) to look for data
displayValues: true, // whether or not to add a mouseover control to display values
displayOptions: {
displayPosition: 'bottomleft', // leaflet control position
displayEmptyString: 'No wind data' // what to display in mouseover control when no data
},
overlayName: 'wind', // string to display for the overlay in your layer control
pingUrl: 'http://localhost:7000/alive', // url to check service availability
latestUrl: 'http://localhost:7000/latest', // url to get latest data with no required params
nearestUrl: 'http://localhost:7000/nearest', // url to get data nearest a specified time ISO
errorCallback: handleError // callback function to get called on error
`Reference
wind-js-leaflet` is possible because of things like:[npm-image]: https://badge.fury.io/js/wind-js-leaflet.svg
[npm-url]: https://www.npmjs.com/package/wind-js-leaflet