Richard
Richard

Reputation: 65600

Disable mouse wheel zoom in Mapbox maps?

How can I disable mouse wheel zoom on Mapbox maps?

I am trying to create a simple map, as per the simple example:

mapbox.auto('map', 'examples.map-vyofok3q');

The Mapbox docs say that you can supply an extra eventhandler argument when you create the map, including the MM.MouseWheelHandler() event, but they do not example how to actually provide a handler:

eventHandlers can be an array of event handlers, including any of the following:
.... MM.MouseWheelHandler()

Please could someone give an example of how to use this handler to disable mouse wheel zoom?

Upvotes: 2

Views: 3133

Answers (2)

skg
skg

Reputation: 141

For Mapbox GL JS maps

map.scrollZoom.disable();

Upvotes: 1

tmcw
tmcw

Reputation: 11882

(this is a double with a support forum question, but I'll write it here as well)-> http://bl.ocks.org/4404508

Upvotes: 0

Related Questions