Disable Apple mouse/trackpad scrolling in 4.0?

3642
2
Jump to solution
06-01-2016 04:51 PM
JonCrane
New Contributor


Hi all,

I'm working on a pretty nifty project using the ArcGIS API, and am having a quite a bit of success so far. Awesome stuff!

My need is to disable Apple mouse/trackpad scrolling. Some users are reporting when they scroll over the map, it zooms very quickly and would prefer to disable it. I'm using ArcGIS 4.0 on a 2D map. I saw some API things for the 3.x versions that disable smartNavigation and things, but that is not working in 4.0.

Any tips on how I can disable all apple mouse trackpad and scrolling in 4.0? Thanks!

0 Kudos
1 Solution

Accepted Solutions
YannCabon
Esri Contributor

Hi,

We don't have a proper API for gestures at the moment but you can intercept and stop the event like this:

view.surface.addEventListener("wheel", function(event) { 
  event.stopImmediatePropagation();
}, true);

View solution in original post

2 Replies
YannCabon
Esri Contributor

Hi,

We don't have a proper API for gestures at the moment but you can intercept and stop the event like this:

view.surface.addEventListener("wheel", function(event) { 
  event.stopImmediatePropagation();
}, true);
JonCrane
New Contributor

Beautiful. Thanks!!

0 Kudos