Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allow zooming only with scroll in google maps

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

like image 424
bidosa Avatar asked Aug 15 '17 13:08

bidosa


People also ask

How do I control zoom on Google Maps?

Users can zoom the map by clicking the zoom controls. They can also zoom and pan by using two-finger movements on the map for touchscreen devices.

How do I change the default zoom on Google Maps?

You can change the zoom level of the map using simple steps. Step 1 Go to Add or Edit Map page . Step 2 Select 'Default zoom level' in the 'Map Information section'. Step 3 click save map and see the changes.

How do I zoom in with one finger on Google Maps?

Want a quicker, more precise way to browse Google Maps? If you double tap and hold with one finger, you can scroll up and down to zoom in or out! This feature also works with other Google apps, including Chrome on both Android and iOS.

Can you use Google Maps and zoom at the same time?

Google Maps - cannot zoom and move at the same time with animateCamera, but can with moveCamera. Bookmark this question. Show activity on this post. I am using Google Maps for Android.


1 Answers

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'
  });
}
like image 92
G.Hunt Avatar answered Oct 17 '22 07:10

G.Hunt