maptalks.marker.animateto
v0.1.0-beta.2
Published
MAPTALKS Marker animateTo
Downloads
3
Maintainers
Readme
maptalks.marker.animateto
Examples
DEMO
Install
- Install with npm:
npm install maptalks.marker.animateto
. - Install with yarn:
yarn add maptalks.marker.animateto
. - Download from dist directory.
- Use unpkg CDN:
https://cdn.jsdelivr.net/npm/maptalks.marker.animateto/dist/maptalks.marker.animateto.min.js
Usage
As a plugin, maptalks.marker.animateto
must be loaded after maptalks.js
in browsers.
<!-- ... -->
<script src="https://cdn.jsdelivr.net/npm/maptalks/dist/maptalks.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/maptalks.marker.animateto/dist/maptalks.marker.animateto.min.js"></script>
<!-- ... -->
marker.animateTo([121.443, 31.2166])
API Reference
marker.animateTo(path, options)
path number[] | number[][] | Coordinate[] | Coordinate[][]
options Object options
- pathSymbol Object reference to the symbol of LineString.
- showPath Boolean whether to show path LineString, false by default.
- easing String animation easing, 'out' by default.
- duration Number animation duration.
- speed Number animation speed, unit is m/s, 1.2 by default, work if no duration.
- maxDuration Number animation max duration, work for both duration and speed.
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