maptalks / maptalks.routeplayer

The route player plugin for maptalks.js
MIT License
26 stars 10 forks source link

请问怎么监听播放结束? #33

Closed OnePunchManGhy closed 9 months ago

OnePunchManGhy commented 2 years ago

试了player.on('finish'),finished,animateend,playend都不行

BKx201 commented 1 year ago

playfinish,https://github.com/maptalks/maptalks.routeplayer/blob/gh-pages/dist/maptalks.routeplayer.js 文件下this.fire的参数都能监听

CharlesLeocc commented 1 year ago

routePlayer.on("playing", (param) => { console.log(param); map.setView({ center: [param.coordinate.x, param.coordinate.y], zoom: 20, pitch: 10 }); if (param.target.player.playState === 'finished') { routePlayer.cancel() } // map.setCameraPosition({ // position: [param.coordinate.x, param.coordinate.y, param.coordinate.z], // pitch: getPitch(map, param.pitch), // bearing: -param.bearing - 90, // }) }) 好像只能这样判断

deyihu commented 9 months ago

https://github.com/maptalks/maptalks.routeplayer/pull/46