ubilabs / google-maps-react-hooks

The JavaScript library to easily implement a Google Maps map into your react application. It comes with a collection of React hooks to access the map instance or different Maps JavaScript Services.
MIT License
77 stars 13 forks source link

Update README.md #140

Closed Yrll21 closed 1 year ago

Yrll21 commented 1 year ago

Change the height from 100% to 100vh. Since no map is showing when using such. Especially for those who are trying this out for the first time.

yfr commented 1 year ago

While 100vh certainly works as well, the 100% example is just what google provides via the official examples. https://developers.google.com/maps/documentation/javascript/examples/map-simple#maps_map_simple-css

I think your case where height: 100% did not work might have something to do with the parent container.

https://developer.mozilla.org/en-US/docs/Web/CSS/height

Defines the height as a percentage of the containing block's height.