I have a map in OpenLayers that has a number of layers with Markers. Each time the user zooms the map I call a function that groups overlapping markers. This works just fine when zooming using the normal zoom buttons, but I also want to call this function when a user zooms using the mouse wheel.
I guess I have to use the OpenLayers.Handler.MouseWheel to capture this event, but I don’t know how. Does anyone have an example for this?
You should use map’s
zoomendevent that fires every time user zooms in or out no matter how user did it (buttons, double click or mouse scroll).The code should look like this: