Leaflet: [Violation] Added non-passive event listener to a scroll-blocking 'wheel' event.

Created on 8 Dec 2017  路  5Comments  路  Source: Leaflet/Leaflet

I have 10,000 markers on my map and each one generates an error message in my browser console:

[Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

Because of this, it takes a few minutes for the page to load. Is there a way to avoid generating these messages?

  • Leaflet version I'm using: 1.2.0
  • Browser (with version) I'm using: 63.0.3239.84
  • OS/Platform (with version) I'm using: macOS 10.13.1

Most helpful comment

@queeniema would you mind adding a quick comment showing why you closed this?

All 5 comments

@queeniema would you mind adding a quick comment showing why you closed this?

@queeniema Got the same problem here, how did you solve the problem ?

Same here

Hi @Itemshopp and @bobmoff,

If you need help on using Leaflet, you should rather ask on Stack Overflow or GIS Stack Exchange.

If you are _really_ sure that this is a bug in Leaflet, please open a new issue (and provide all requested information) rather than commenting an old closed thread.

Given OP's description "_I have 10,000 markers on my map_", I suspect the issue is not related to Chrome's warning, but rather to the browser struggling with the 10k DOM elements from the Markers.
This is a known limitation of Leaflet, see e.g. https://github.com/Leaflet/Leaflet/issues/6346#issuecomment-424242337 or this post on SO: https://stackoverflow.com/questions/43015854/large-dataset-of-markers-or-dots-in-leaflet/43019740#43019740

If you are in a different situation than OP's, then either ask on SO or open a new ticket if you are sure there is a bug in Leaflet.

Thanks for your answer, this isn't related to 10 0000 markers you're right.
I'll create a new issue about it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JonnyBGod picture JonnyBGod  路  4Comments

jblarsen picture jblarsen  路  3Comments

viswaug picture viswaug  路  4Comments

gdbd picture gdbd  路  3Comments

prbaron picture prbaron  路  3Comments