Canvas based layer redrawing causes map moveend eventΒ #1920
Description
Hello.
Right now (leaflet stable verstion 0.6.4) canvas based layers fire map moveend event to update canvas viewport.
It makes some troubles when I bind a handler to moveend event. This handler requests geo data placed in map's boundary from a server. And this handler is called on every layer redraw. Server response with data that is already cached on client side. Because no map moving was made actually.
To prevent unnecessary request I need to unbind handler from moveend event, then call layer.redraw, catch moment when Path._fireMapMoveEnd fires moveend event. And finally bind handler to moveend event again.
Maybe there is a simpler way?
Is it possible to call map._updateCanvasViewport directly as a callback of requestAnimFrame in Path._requestUpdate instead of firing map moveend event?