添加了第一个常数
const GettingStartedGoogleMap = withGoogleMap(props => ( <GoogleMap ref={props.onMapLoad} zoom={13} center={{ lat: 21.178574, lng: 72.814149 }} onClick={props.onMapClick} > {props.markers.map(marker => ( <Marker {...marker} onRightClick={() => props.onMarkerRightClick(marker)} /> ))} </GoogleMap>将containerElement大小和mapElement大小更改为像素,而不是百分比
containerElement={ <div style={{ height: `150px` }} /> } mapElement={ <div style={{ height: `150px` }} /> }只需在被调用的函数中添加标记
markers={this.state.markers}


