I have a few thousand markers which are grouped in feature groups which i show depending on the zoom level. At the moment i run the the show/hide function for each feature group after the event zoom end. But when i'm going from a close zoom level to a smaller one, a few hundrets markers will be shown for a few milliseconds until my function hides them. That's because leaflet shows them before i can hide them with the zoomend event. This behaviour results in a lag for mobile devices.
What can I do to first run the "Hide/show function" before leaflet shows them all?