fullstackreact / google-maps-react

Companion code to the "How to Write a Google Maps React Component" Tutorial
https://www.fullstackreact.com/articles/how-to-write-a-google-maps-react-component/
MIT License
1.64k stars 819 forks source link

MapControlOptions #428

Open vidyaramachandran56 opened 4 years ago

vidyaramachandran56 commented 4 years ago

<Map

google={this.props.google}
mapTypeControlOption= {{ style: this.props.google.maps.MapTypeControlStyle.DROPDOWN_MENU, position: this.props.google.maps.ControlPosition.TOP_RIGHT } }/>

The satellite tab is neither moving to right nor taking dropdown.

DieterVanmoortel commented 4 years ago

Key : mapTypeControlOptions ( add the s )

There is an issue with the mapTypeControlOptions type though.

Code below actually moves the mapTypeControls, but you get an invalid type error.

<Map google={this.props.google}
                                ...
                mapTypeControlOptions={{
                 style: window.google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
                 position: window.google.maps.ControlPosition.RIGHT_TOP
                }}
            >

Failed prop type: Invalid prop mapTypeControlOptions of type object supplied to Map, expected boolean

Shouldn't type of mapTypeControlOptions be object instead of boolean ( same as streetviewControlOptions )

DieterVanmoortel commented 4 years ago

duplicates https://github.com/fullstackreact/google-maps-react/issues/435