I'm trying to disable all the buttons on the map:
<GoogleMap mapTypeControl={false} panControl={false} streetViewControl={false} zoomControl={false}/>
None of those props seem to have any affect.
Oops, nevermind. Looks like those needs to go into the options props.
Yes, options are the right place. Thanks!
The react-google-maps documentation does not explain exactly how to do this.
Here is how you need to code the component:
<GoogleMap
defaultZoom={12}
defaultCenter={{ lat: 48.855924, lng: 2.34532 }}
defaultOptions={{
styles: mapStyle,
// these following 7 options turn certain controls off see link below
streetViewControl: false,
scaleControl: false,
mapTypeControl: false,
panControl: false,
zoomControl: false,
rotateControl: false,
fullscreenControl: false
}}
disableDefaultUI />
A list of all available control options you can turn on/off are here: https://developers.google.com/maps/documentation/javascript/controls#Adding_Controls_to_the_Map
Most helpful comment
The react-google-maps documentation does not explain exactly how to do this.
Here is how you need to code the component:
A list of all available control options you can turn on/off are here: https://developers.google.com/maps/documentation/javascript/controls#Adding_Controls_to_the_Map