Hi !
Is it possible the disable the inverse mouse movement in map, when i zooming on that ? I didn't find anything about that in the API documents.
Thank you in advance !
Code: Select all
(function(H) {
const { defined } = H;
let totalWheelDelta = 0,
totalWheelDeltaTimer;
H.wrap(H.Pointer.prototype, 'onContainerMouseWheel', function(proceed, e) {
var chart = this.chart;
e = this.normalize(e);
var delta = (defined(e.wheelDelta) && -e.wheelDelta / 120) ||
e.deltaY || e.detail;
if (Math.abs(delta) >= 1) {
totalWheelDelta += Math.abs(delta);
if (totalWheelDeltaTimer) {
clearTimeout(totalWheelDeltaTimer);
}
totalWheelDeltaTimer = setTimeout(function() {
totalWheelDelta = 0;
}, 50);
}
if (totalWheelDelta < 10 && chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop) && chart.mapView) {
// ADD -1
chart.mapView.zoomBy((-1 * (chart.options.mapNavigation.mouseWheelSensitivity -
1)) * -delta, void 0, [e.chartX, e.chartY],
Math.abs(delta) < 1 ? false : void 0);
}
});
}(Highcharts));