francoisromain / leaflet-markers-canvas

A Leaflet plugin to render many markers in a canvas instead of the DOM
GNU Affero General Public License v3.0
42 stars 15 forks source link

Zoom Icons Synchronously #4

Open LukePrior opened 3 years ago

LukePrior commented 3 years ago

This rewrite appears to exhibit the same issues as the original plugin in terms of zooming. The icons seem to follow if you pan and zoom at the same time on mobile.

LukePrior commented 3 years ago

See the video for an example:

https://user-images.githubusercontent.com/22492406/123587613-dee8f580-d829-11eb-91c9-4309186695c9.mp4

ShadowZone commented 3 years ago

I think that has something to do with the implemented moveEnd event listener. So the tile layer updates on move event, but the canvas layer only updates if you release the finger/mouse. If you look closer, you can see that the map underneath is moving. The markers stay in the same position related to the absolute screen position.

I really don't know if this is fixable, as updating the canvas on move instead of moveEnd would result in a really bad overall performance. But maybe the author of this plugin has an approach to this.