IITC-CE / Leaflet.Canvas-Markers

Leaflet plugin for displaying icons on canvas instead of DOM
MIT License
2 stars 4 forks source link

'zoom' event should be 'zoomend' #11

Closed johnd0e closed 5 years ago

johnd0e commented 5 years ago

https://github.com/IITC-CE/Leaflet.Canvas-Markers/blob/153525e045e1c4ec22a0ecb02d965366e99852a0/src/plugin/leaflet.canvas-markers.js#L43

I suppose here meant 'zoomend', as for 'zoom' documentation says:

Fired repeatedly during any change in zoom level, including zoom and fly animations.

modos189 commented 5 years ago

yes

johnd0e commented 5 years ago

yes

But zoomend seems excessive too, as with every zoom we also get moveend event. 3 times! dragend also come 3 times in row.

So we have a bunch of unneeded redraws now.

Edit We have 3 layers, so it's normal.

johnd0e commented 5 years ago

I wonder if we really need to redraw on every move.

Well, here in IITC I am pretty sure that we don't. But it may be still useful for other uses.

johnd0e commented 5 years ago

I was wrong. That fix should be reverted. We need 'zoom' at least for pinch zoom.