14

Since a few days our users can only zoom when they hit the "ctrl" key while scrolling which doesn't make sense in our applications.

Is there a way to allow zooming only with scrolling (as it was before) in Google Maps?

I've seen that this "ctrl + scroll" force now also is in the google maps api reference (screenshot).

Screenshot from the Google Maps Javascript API reference which shows the new message

5
  • 3
    Have you tried the gestureHandling: 'greedy' property when instantiating your map? Commented Aug 15, 2017 at 14:04
  • Hi G.Hunt, thank you for the answer, it worked with gestureHandling: 'greedy'! Commented Aug 15, 2017 at 14:17
  • This was happening to some users of an app that I built as well, was this changed within the google maps JavaScript API recently? I looked all over the google maps docs and couldn't find anything noting this change so it was a bit difficult to figure out what happened and how it could be reverted back to the previous functionality. Commented Aug 17, 2017 at 14:15
  • 1
    @morris295 You can find the release notes here, which details the release on 16th August. Commented Aug 17, 2017 at 15:18
  • Ah, cool. The first report I got about it was on 8/15. I guess it went out ahead of the date they specified or we might be accepting new versions rather greedily. Thanks for digging that up, subscribing to the release notes RSS now to catch future changes. Commented Aug 17, 2017 at 17:53

2 Answers 2

19

Add gestureHandling: 'greedy' to your map options during instantiation.

E.g:

var map = new google.maps.Map(document.getElementById('map'), {
    center: {0, 0},
    zoom: 8,
    gestureHandling: 'greedy'
  });
}
Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, I removed my previous comment because it was not relevant after you edited, :).
0
gestureHandling: "cooperative",

This the updated version from google maps.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.