Code Monkey home page Code Monkey logo

wind-js-leaflet's Introduction

wind-js-leaflet NPM version

A plugin for Leaflet to add visualisation overlay of wind direction, wind velocity, and temperature. To use this plugin, you will need to run your own wind-js-server instance. The data is 1 degree, 6 hourly data from NOAA.

leaflet-velocity released

Consider using leaflet-velocity instead of wind-js-leaflet, as it is more flexible and up to date.

v2 Breaking Changes

Now supports both leaflet version 0.7.7 and 1.0.3. However this update brings one breaking change - how you initialise the plugin.

v1 way to init:

WindJSLeaflet({ options: 'here' });

v2 way to init:

WindJSLeaflet.init({ options: 'here' });

Screenshot

Install

Basic

Download zip and include dist/wind-js-leaflet.js and dist/wind-js-leaflet.css files using resource tags.

npm

npm install wind-js-leaflet

Use

Demo use here: http://danwild.github.io/wind-js-leaflet/

Dependencies

Prior to loading wind-js-leaflet, you need to load:

Options

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:

License

MIT License (MIT)

wind-js-leaflet's People

Contributors

danwild avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wind-js-leaflet's Issues

where's the data

where's the data?can you give me a direct link?noaa has so many datasets

Change "data" on-the-fly

If I want to change the dataset being rendered, must I rebuild the object with object, or can I somehow just change the "data" element during runtime?

Disable zoom-out function after top-most zoom level

@danwild
I would like to disable the zoom-out after top-most zoom level like this: http://jsfiddle.net/gxzhc/3/

I'm unable to achieve this, look at the screenshot. I do not want to display "Map data not yet available", but instead I need to disable the zoom-out level, and of course no repetition of world map.

chrome_2017-03-03_13-42-57

I have done so far: demo.js
var Esri_WorldImagery = L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, ' +
'AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
noWrap: true
});

var map = L.map('map', {
layers: [ Esri_WorldImagery ],
zoom: 0,
center: [49.009952, 2.548635],
maxBounds: [
[-85.0, -180.0],
[85.0, 180.0]
]
});

What code should I add to achieve the same as the jsfiddle I provided above?

How to make the wind layer open automatically

In your example, the wind layer needs to be opened by selecting the checkbox. Is there any way to open it automatically? I know this is a low-level question, but I really don't know how to implement this feature.

wind-js addto map on load

@danwild

I'm trying to get the wind-js overlay to be active on page load... only i cannot find the solution.
I tried to add it with .addTo(map); at various locations/functions and failed :(

How do i load the wind-js on page load?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.