import {Map, GoogleApiWrapper} from 'google-maps-react'
var React = require('react')
class GoogleMapContainer extends React.Component {
render() {
return(
<Map google={this.props.google}
style={{width: '100%', height: '100%', position: 'relative'}}
className={'map'}
zoom={14}>
<Marker
title={'The marker`s title will appear as a tooltip.'}
name={'SOMA'}
position={{lat: 37.778519, lng: -122.405640}} />
<Marker
name={'Dolores park'}
position={{lat: 37.759703, lng: -122.428093}} />
\\
</Map>
)
}
}
export default GoogleApiWrapper({
apiKey: 'AIzaSyDq-nhDEOWaOzLfFAr9Lx4dlvEBIpHMxCk'
})(GoogleMapContainer)
我有这段代码在浏览器控制台中给我一个错误
ReferenceError: Marker is not defined
但在包的文档中,他们从不导入 Marker https://github.com/fullstackreact/google-maps-react
我无法发现发生了什么