ghettovoice / vuelayers

Web map Vue components with the power of OpenLayers
https://vuelayers.github.io/
MIT License
681 stars 230 forks source link

Bug: Animation get cancelled in 0.12.0-rc.21 #413

Closed Soren-Knudsen closed 3 years ago

Soren-Knudsen commented 3 years ago

Discovery: The animation seems to get canceled if you e.g. double click (using DoubleClickZoom) or utilize View.fit.

Example: I created a small example below. If you double click on the map you can see the animation gets canceled or is not executed correctly which results in a small flicker.

https://jsfiddle.net/spf27ur0/

Expected behavior: The expected behavior is the animation should be executed fully and not interrupted or canceled by any means.

Infomation: Version: 0.12.0-rc.21

silvester-pari commented 3 years ago

Not sure if this helps, but I noticed this only happens with center animation, not with zoom animation:

https://jsfiddle.net/8hwbzpdq/5/

Try clicking the button, the map moves only very tiny amounts. Try commenting out center: [0, 0], (line 14) to only use zoom, works fine.

silvester-pari commented 3 years ago

The same issue can be seen when using mouse wheel zoom on any map.

Somehow this seems to have been introduced with the last commit on master regarding projections, as when reverting the COORD_PRECISION back to -1 (see https://github.com/ghettovoice/vuelayers/commit/6724fda0aef8be8465e4d8817773da4c37c581dd#diff-b844598619b183240559d9ee9b9f008ebebaddc88322ac93a6f7831d29c0987dR4) the mouse scroll works fine again.

Using precision of -1 (and thus returning the number in round() function instead of rounded number) in https://github.com/ghettovoice/vuelayers/blob/master/src/ol-ext/coord.js#L12 also fixes the problem.

These observations are probably only symptoms, but not the cause of the problem (maybe connected with something new in OL6?).

ghettovoice commented 3 years ago

Thanks guys for report. This was a something like an experiment that I occasionally forget rollback before prev release

Soren-Knudsen commented 3 years ago

@ghettovoice Just tested 0.12.0-rc.23 and the map doesn't render anymore :(

image

ghettovoice commented 3 years ago

Interesting, I don't see any errors in my test app. Can you make a breakpoint inside setTarget method of the VlMap component to check what actually passed to it?

Soren-Knudsen commented 3 years ago

@ghettovoice Here u go. Give me a ping if you need more info :)

image

ghettovoice commented 3 years ago

I guess the reason is somehow related with latest rollup-plugin-vue. For a while rollback it to the previous and rebuild new release. Should work now

Soren-Knudsen commented 3 years ago

That seems to have solved the issue 👍