I'm struggling to display my Google Maps on the screen. Even after referring to this question, I still can't solve my issue.
Here is what I have:
import React from 'react'
import GoogleMap from 'google-map-react';
import withStyles from 'isomorphic-style-loader/lib/withStyles'
import s from './CarMap.css'
class MoobieMap extends React.Component {
constructor(props){
super(props)
}
render() {
return (
<div className={s.map}>
<GoogleMap apiKey={API_KEY} center={{lat: -23.5925282, long: -46.6891377}} zoom={3}/>
</div>
)
}
}
export default withStyles(s)(MoobieMap)
Additionally:
import React from 'react'
import Layout from '../../components/Layout'
import MoobieMap from './CarMap'
const title = 'Mapa de carros'
export default {
path: '/car-map',
async action() {
return {
title,
chunk: 'component',
component: <Layout title={title}><MoobieMap /></Layout>,
}
},
}
As for the CSS:
.map {
width: 100%;
height: 400px;
}
In addition to using the React starter kit, my DOM structure resembles this:https://i.sstatic.net/bYOcL.png
No JavaScript errors appear in my console either.
What could I be overlooking here? Thanks!!!
UPDATE: https://i.sstatic.net/a9TBm.png