Skip to content

fuzhenn/maptalks.windylayer

gh-pages
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 20 commits ahead, 16 commits behind Esri:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

maptalks.windylayer

NPM Version

An experiment layer plugin to draw animation of wind, this is a fork of Esri's wind-js. Most of the codes is ported from original great works.

screenshot

Examples

Install

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

Usage

As a plugin, maptalks.windylayer must be loaded after maptalks.js in browsers.

<script type="text/javascript" src="https://unpkg.com/maptalks/dist/maptalks.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/maptalks.windylayer/dist/maptalks.windylayer.min.js"></script>
<script>
var windyLayer = new maptalks.WindyLayer('wind', data, { 'opacity' : 0.3 }).addTo(map);
</script>

Supported Browsers

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

API Reference

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

Constructor

new maptalks.WindyLayer(id, data, options)
  • id String layer id
  • data Marker[] layer data, an array of maptalks.Marker
  • options Object options

getData

get layer's data

Returns Object

setData(data)

set new data

  • data Object data to set

Returns this

toJSON()

export the layer's JSON.

var json = windyLayer.toJSON();

Returns Object

Contributing

We welcome any kind of contributions including issue reportings, pull requests, documentation corrections, feature requests and any other helps.

Develop

The only source file is index.js.

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

Scripts

  • Install dependencies
$ npm install
  • Watch source changes and generate runnable bundle repeatedly
$ gulp watch
  • Tests
$ npm test
  • Watch source changes and run tests repeatedly
$ gulp tdd
  • Package and generate minified bundles to dist directory
$ gulp minify
  • Lint
$ npm run lint

About

An demo animation of wind on a Canvas layer in the JSAPI

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%