6

I've got a tabbed UI on my web page, the last tab is an arcgis javascript map built with their API. The problem I'm having is that just adding the map and all of the esri / dojo libraries to the page has caused the mouse scroll wheel to be entirely hijacked by the map. I can't scroll down on any other pages using the mousewheel, and disabling it in the map doesn't seem to do any good.

I've done a bit of work trying to figure out how to unbind the mousewheel events but have had no luck. Basically I want the mousewheel to work as expected if they aren't on the map tab, and zoom in and out if they are on the map tab.

Has anyone had this issue before?

1
  • are you able to link to a sample page to help us reproduce this issue? Commented Dec 11, 2014 at 3:25

1 Answer 1

1

You can turn off navigation via the mouse scroll wheel. The map has a boolean setting for it and functions to enable and disable it.

Your code would look something like this:

function openMapTab() {
    ...
    map.enableScrollWheelZoom();
}

function openNotTheMapTab() {
    ...
    map.disableScrollWheelZoom();
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.