Can you listen for the moveend event?
Yes but it would be nice/clearer to do it within flyTo
I think it's better to rely on map.once('moveend', fn) here. To add a reliable callback to flyTo directly, we need to add some ugly hacks, otherwise e.g. it won't be fired when stopped externally before it finishes.
:+1: this is a good solution. Closing.
I use this solution:
map.on('moveend', ({ originalEvent }) => {
if (originalEvent) {
map.fire('usermoveend');
} else {
map.fire('flyend');
}
});
You can do the same for movestart.
Most helpful comment
I think it's better to rely on
map.once('moveend', fn)here. To add a reliable callback toflyTodirectly, we need to add some ugly hacks, otherwise e.g. it won't be fired when stopped externally before it finishes.