transform maptalksjs polygon by flubber
npm i maptalks.flubber
# or
yarn add maptalks.flubber
<script type="text/javascript" src="https://unpkg.com/maptalks/dist/maptalks.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/maptalks.flubber/dist/maptalks.flubber.js"></script>
polygon will auto mount transform
method
import * as maptalks from 'maptalks';
import 'maptalks.flubber';
- polygon.transform(polygon/coordinates/geojson, options, step)
It is similar to animate
const polygon1 = new Polygon();
const polygon2 = new Polygon();
//transfrom polygon shape to polygon2 shape
polygon1.transform(polygon2, {
duration: 2000
}, function(frame) {
//do somethings
});