A tool to update geometries symbol with gradual change color.
- Install with npm:
npm install maptalks.autogradual
. - Install with yarn:
yarn add maptalks.autogradual
. - Download from dist directory.
- Use unpkg CDN:
https://cdn.jsdelivr.net/npm/maptalks.autogradual/dist/maptalks.autogradual.min.js
As a plugin, maptalks.autogradual
must be loaded after maptalks.js
in browsers. You can also use 'import { AutoGradual } from "maptalks.autogradual"
when developing with webpack.
<!-- ... -->
<script src="https://cdn.jsdelivr.net/npm/maptalks.autogradual/dist/maptalks.autogradual.min.js"></script>
<!-- ... -->
const autogradual = new maptalks.AutoGradual()
autogradual.change(layer)
// autogradual.change(geometryCollection)
// autogradual.change(geometries)
new maptalks.AutoGradual(options)
- options
- colors Array gradual color array
- direction String 'x' / 'y' / null
- includePolygonBorder Boolean false is default
change(attr)
attr can be a VectorLayer, GeometryCollection or geometries array
We welcome any kind of contributions including issue reportings, pull requests, documentation corrections, feature requests and any other helps.
The only source file is index.js
.
It is written in ES6, transpiled by babel and tested with mocha and expect.js.
- Install dependencies
$ npm install
- Watch source changes and generate runnable bundle repeatedly
$ gulp watch
- Package and generate minified bundles to dist directory
$ gulp minify
- Lint
$ npm run lint