The Google Maps JS Api version 3.27 (published on the 15.11.2016, see https://developers.google.com/maps/documentation/javascript/releases?hl=de) introduces a new map option called gestureHandling to define how touch events on mobile should be handled. It would be really nice to see support for it in this library, especially since the update changed the default behavior of the map.
For anyone following: you just have to pass an options object to any of the provided react elements to set their respective google maps js options. For example, for the map itself and this example you would add a prop to the <GoogleMap> like this: options={{gestureHandling: "greedy"}} as specified in the API doc.
What's the difference between options and defaultOptions? Does options just override defaultOptions?
When i pass options={{
gestureHandling: 'cooperative'
}} it didn't worked.defaultOptions={{
gestureHandling: 'cooperative'
}} also didn't worked
@SuryaAcube @DanPen
The repo of this project is unmaintained more than a year, and we had build new version https://www.npmjs.com/package/@react-google-maps/api
We had rewrite it to TypeScript, and updating it frequently: https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api
You can enjoy autocomplete.
You can see our docs: https://react-google-maps-api-docs.netlify.app
Also a lot of examples: https://react-google-maps-api-gatsby-demo.netlify.app/ https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api-gatsby-example/src/examples
The bundle size is much smaller: https://bundlephobia.com/result?p=@react-google-maps/api
Our Spectrum community: https://spectrum.chat/react-google-maps鈥∣ur Slack channel: https://join.slack.com/t/react-google-maps-api/shared_invite/enQtODc5ODU1NTY5MzQ4LTBiNTYzZmY1YmVjYzJhZThkMGU0YzUwZjJkNGJmYjk4YjQyYjZhMDk2YThlZGEzNDc0M2RhNjBmMWE4ZTJiMjQ
Enjoy!
Most helpful comment
For anyone following: you just have to pass an
optionsobject to any of the provided react elements to set their respective google maps js options. For example, for the map itself and this example you would add a prop to the<GoogleMap>like this:options={{gestureHandling: "greedy"}}as specified in the API doc.