Reputation: 873
How to enable message ctrl + Scroll zoom message in google map? Map option define below.
var mapOptions = {
mapTypeId: 'roadmap', center: new google.maps.LatLng(countryLat, countryLon), zoom: countryZoom, gestureHandling: 'cooperative'
};
I need output like this when mouse scroll :
Upvotes: 2
Views: 6475
Reputation: 73
Use the following option to control this behavior:
gestureHandling: 'cooperative'
As per the instructions mentioned here: Controlling Zoom and Pan (developers.google.com)
Upvotes: 7
Reputation: 65
This function seems to only work in the experimental version of the API. So just change the version in the URL to 3.exp or to 3.30 (which is the current experminatal version) so your URL in the script would look something like this:
"https://maps.googleapis.com/maps/api/js?v=3.30&sensor=false&key=" + your_api_key
You can also remove the version tag so it will always use the latest version of the API.
Hope this fix your issue.
Upvotes: 0
Reputation: 487
If you want to enable the ctrl + scroll to zoom on map have to pass the gestureHandling: 'greedy' this option in the javascript of google map object. you just passed the
Ref.: Click here to look at reference
and as per i seen there are any issue worth your css because here is the link which is exactly as you want please refer this link
Upvotes: 0