I am trying to implement a functionality using openlayers with Angular in which I have to add one interaction using MouseWheelZoom.
Interaction gets added but control does not come inside the event listener for this when I move my mouse wheel in map.
ngOnInit() {
this.createMap();
const mapInteraction = new MouseWheelZoom();
this.map.addInteraction(mapInteraction);
mapInteraction.on('change', (event) => {
console.log('event', event);
});
}
createMap() {
this.map = new Map({
target: 'map',
layers: [
new TileLayer({
source: new OSM(),
}),
],
view: new View({
center: [0, 0],
zoom: 2,
}),
});
}
}
Please find a simple stackblitz for this here