Skip to content

Adding 'leaflet-dragging' class causes drag start slow down #2164

@danzel

Description

@danzel

tl;dr: #2164 (comment).


https://github.com/Leaflet/Leaflet/blob/master/src/dom/Draggable.js#L95

When you start a map drag we add this class so that you get the grabbing hand.
In larger apps, this causes a bit of a slow down as the browser recalculates styles
image
(We have 1000 markers with leaflet.labels attached)

If you comment out this line the drag start is super smooth and there are no big lumps in the timeline during a drag.
If anyone has any ideas that still give us the dragging hand without the performance hit that'd be awesome :)
I'll fiddle around a bit later today.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions