Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 在react中呈现Google地图时,Google未定义_Reactjs_Google Maps React - Fatal编程技术网

Reactjs 在react中呈现Google地图时,Google未定义

Reactjs 在react中呈现Google地图时,Google未定义,reactjs,google-maps-react,Reactjs,Google Maps React,目前我正在尝试在react中渲染简单贴图。我尝试过的一切,但都是血脉。现在我已经使用谷歌地图反应渲染谷歌地图,包括其库,但我仍然得到谷歌是未定义的,我不知道为什么。这是我的密码 // External Dependencies import React, { Component } from 'react'; import { withGoogleMap, GoogleMap , GoogleMapLoader,Marker} from 'react-google-maps'; // Inte

目前我正在尝试在react中渲染简单贴图。我尝试过的一切,但都是血脉。现在我已经使用谷歌地图反应渲染谷歌地图,包括其库,但我仍然得到谷歌是未定义的,我不知道为什么。这是我的密码

// External Dependencies
import React, { Component } from 'react';
import { withGoogleMap, GoogleMap , GoogleMapLoader,Marker} from 'react-google-maps';

// Internal Dependencies
import './style.css';


class HelloWorld extends Component {

  static slug = 'nel_hello_world';

  render() {
    var google = window.google;
    const GoogleMapExample = withGoogleMap(props => (
       <GoogleMap
         defaultCenter = { { lat: 40.756795, lng: -73.954298 } }
         defaultZoom = { 13 }
       >
       </GoogleMap>
    ));

    // const Content = this.props.content;
    return (
      <div>
        <GoogleMapExample
          containerElement={<div style={{ height: `500px`, width: '500px' }} /> }
          mapElement={ <div style={{ height: `100%` }} /> }
        />
       </div>
    );
  }
}

export default HelloWorld;
//外部依赖项
从“React”导入React,{Component};
从“react GoogleMaps”导入{withGoogleMap、GoogleMap、GoogleMapLoader、Marker};
//内部依赖关系
导入“/style.css”;
类HelloWorld扩展组件{
静态slug='nel_hello_world';
render(){
var google=window.google;
const GoogleMapExample=withGoogleMap(道具=>(
));
//const Content=this.props.Content;
返回(
);
}
}
导出默认HelloWorld;
有什么建议吗