maptalks.windylayer

0.1.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i maptalks.windylayer

Weekly Downloads

2

Version

0.1.2

License

MIT

Last publish

Collaborators

  • fuzhenn