Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

maptalks.autogradual

0.1.1 • Public • Published

maptalks.autogradual

A tool to update geometries symbol with gradual change color.

Examples

DEMO

Install

  • 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

Usage

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)

API Reference

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

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
  • Package and generate minified bundles to dist directory
$ gulp minify
  • Lint
$ npm run lint

More Things

Install

npm i maptalks.autogradual

DownloadsWeekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

210 kB

Total Files

15

Last publish

Collaborators

  • avatar