Open jose2007kj opened 7 years ago
const style = { // MUST specify dimensions of the Google map or it will not work. Also works best when style is specified inside the render function and created as an object
width: '100vw', // 90vw basically means take up 90% of the width screen. px also works.
height: '280px' // 75vh similarly will take up roughly 75% of the height of the screen. px also works.
}
instead of % maybe try px or vw&vh maybe? I had similar issue and above styling solved it
I have the same issue here. I found out that the "Map" component renders a "div" element with the following style : {position:'absolute', width:'100%', height:'100%'}. I couldn't find a way to override it, using the "style" hook from the "Map" component doesn't work as it renders in another "div" element right below the previous one. It seems that the following lines (from 117 to 122) from the "index.js" file are responsible for this behaviour :
var mapStyles = {
container: {
position: 'absolute',
width: '100%',
height: '100%'
},
Could you provide a fix please? Thanks
I found out that the "Map" component renders a "div" element with the following style : {position:'absolute', width:'100%', height:'100%'}.
Commenting out lines 179-183 & 185 in dist > index.js removed the issue.
You can override container styles and fix this without commenting out the code.
<Map ... containerStyle={{ width: '100%', height: '300px', position: 'relative' }} ... </Map>
When I add the containerStyle={{ width: '100%', height: '300px', position: 'relative' }} to the
const style = { width: '50%', height: '100%', } ... <Map google={this.props.google} containerStyle={{ width: '100%', height: '400px', position: 'relative' }} style={style} zoom={11} initialCenter={this.state.location}
Same here. Adding containerStyle the map is not visible
My component page
My app.js
and i am using the map component in this page
sir,My Location page is scollable,even when no full content is available,.....when map component is removed its working fine.....where i might be going wrong