Relative Content

Tag Archive for javascriptreactjsopenlayers

Too many OpenLayers moveend triggers when resizing the window

I’m using OpenLayers inside the React environment (background info). I want to control what the map shows with React – using context and other components. For example, zoom in to the map if something is selected in the react components. I am using the latest OpenLayers (10.1) and React(18.3.1), and the problem I have is that the moveEnd event triggers too many times. For a simple window resize, I’m getting 20+ move-end triggers:

Inverse MouseWheelZoom

There is a project that uses openlayers and react.
I came across the need to invert the direction of the mouse wheel when zooming. More precisely, even be able to switch from standard mode to inverted and back.