Logicify / jquery-locationpicker-plugin

JQuery Location Picker plugin
MIT License
389 stars 260 forks source link

scrollWheel: true default option is "not recommended" and causes compatibility behavior to trigger #135

Open kolen opened 6 years ago

kolen commented 6 years ago

In current Google Maps API 3.31 scrollWheel option is marked as "not recommended"

scrollwheel

Type: boolean

If false, disables zooming on the map using a mouse scroll wheel. The scrollwheel is enabled by default.

Note: This property is not recommended. To disable zooming using scrollwheel, you can use the gestureHandling property, and set it to either "cooperative" or "none".

Despite looking like scrollwheel is true by default in Google Maps, setting it to true explicitly turns on "legacy compatibility behavior": gestureHandling is completely ignored.

By default, in current versions of Google Maps, mouse wheel zooms only if ctrl/cmd is pressed, if it detects that page is scrollable. Setting scrollwheel to true when constructing Map disables this, which makes scrolling of page more painful (locationpicker is often used for editors such as in admin UIs where there are lots of fields in addition to location editor).

It's set here:

https://github.com/Logicify/jquery-locationpicker-plugin/blob/fac8658119043e830e0cbccd14b8b22bde08436b/src/locationpicker.jquery.js#L442

https://github.com/Logicify/jquery-locationpicker-plugin/blob/fac8658119043e830e0cbccd14b8b22bde08436b/src/locationpicker.jquery.js#L386