tomchentw / react-google-maps

React.js Google Maps integration component
https://tomchentw.github.io/react-google-maps/
MIT License
4.63k stars 935 forks source link

do not pass default styles to google maps #1074

Closed jfarris587 closed 3 years ago

jfarris587 commented 3 years ago

When passing mapId via options prop, google maps Javascript API complains with the following warning:

react_devtools_backend.js:2560 Google Maps JavaScript API: A Map's styles property cannot be set when a mapId is 

present. When a mapId is present Map styles are controlled via the cloud console. Please see documentation at 

https://developers.google.com/maps/documentation/javascript/styling#cloud_tooling

It seems as though because react-google-maps is passing it a styles object, which is not permitted when a cloud mapid is being used

https://codesandbox.io/s/quirky-moser-7ylxu?file=/src/App.js