My Google Maps options are like
{ center: userLatLng, zoom: 13, mapTypeId: 'roadmap', scrollwheel: false, navigationControl: false, mapTypeControl: false, scaleControl: false, draggable: true, mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: true, disableDoubleClickZoom: false, zoomControl: false, styles: styles['hide'], componentRestrictions: {country: "in"}, }
On mobile, this message is displayed:
Use two fingers to move the map
If I use two fingers, I can move the map and also zoom it.
How to make that a single finger can move the map, but not zoom the map?
You can use the setOptions() method on the map object: map. setOptions({draggable: false, zoomControl: false, scrollwheel: false, disableDoubleClickZoom: true});
The Maps API provides built-in zoom controls that appear in the bottom right hand corner of the map. These are disabled by default, but can be enabled by calling UiSettings. setZoomControlsEnabled(true) .
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.
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.
Add gestureHandling: "greedy"
to your map options.
Here is the documentation about this option: gestureHandling
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With