React Google Maps Unable to set scroll zoom off

Viewed 4332
3 Answers

The best solution here is to set
<GoogleMap options={{ gestureHandling: 'none'}}>

If you also want to hide the +/- zoom buttons you can add an additional option <GoogleMap options={{ gestureHandling: 'none', disableDefaultUI: true}}>

Documentation for scrollwheel option: 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"

https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions.scrollwheel

To hide "use ctrl + scroll to zoom map" in React js put options={{ gestureHandling: "greedy" }}> in

<GoogleMap
        defaultZoom={15}
        defaultCenter={{ lat: 44.814346, lng: 20.458047 }}
        options={{ gestureHandling: "greedy" }}>
        <Marker position={{ lat: 44.814346, lng: 20.458047 }} />
</GoogleMap>
Related