cyberhobo / wordpress-geo-mashup

Official repository for Geo Mashup, the plugin that makes WordPress into a GeoCMS. Documentation:
https://github.com/cyberhobo/wordpress-geo-mashup/wiki/Getting-Started
63 stars 15 forks source link

Need option to disable scroll wheel zoom in location-editor.js #730

Closed jerclarke closed 8 years ago

jerclarke commented 8 years ago

For my editors the most frustrating thing about GM is that their mouse gets "trapped" in the map while scrolling down the post editor, where they have several other metadata tasks and Edit Flow below the map (but I keep the map high to make sure people use it).

IMHO this is such a common annoyance that having scroll disabled by default seems like the better choice for usability, but I also keep scroll wheel zooming disabled on the frontend, so I am biased.

Either way I need an option to disable the scroll-zooming in the admin map for my users who don't find it helpful.

I tracked the relevant map down to location-editor.js, where you do a custom map setup (not using the helper functions from the shortcode etc.)

In there you have the scroll wheel (and dragging) option hardcoded (line 415):

map.setOptions( {enableDragging: true, enableScrollWheelZoom: true} );

For a temporary hack/fix I've just changed the hardcoding in my copy:

//map.setOptions( {enableDragging: true, enableScrollWheelZoom: true} ); map.setOptions( {enableDragging: true, enableScrollWheelZoom: false} );

Ultimately I hope you can add some kind of option that lets us change the behavior without editing the plugin file for obvious reasons. Either an option in the admin, or some kind of filter I could use from within another plugin to alter the behavior (I see there's a javascript filter API in some of your code, but don't know how to use it yet).

Thanks!

cyberhobo commented 8 years ago

Let's turn it off by default. It would still be possible to turn using the API if needed.

jerclarke commented 8 years ago

Thanks!