Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/459.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.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
Javascript dburles流星谷歌地图API错误:MissingKeyMapError_Javascript_Google Maps_Meteor_Meteor React - Fatal编程技术网

Javascript dburles流星谷歌地图API错误:MissingKeyMapError

Javascript dburles流星谷歌地图API错误:MissingKeyMapError,javascript,google-maps,meteor,meteor-react,Javascript,Google Maps,Meteor,Meteor React,我用的是Meteor软件包 在解决了我加载谷歌地图的问题后, 我遇到了一个新的错误, 谷歌地图API错误:MissingKeyMapError 我怎样才能解决这个问题?什么时候可以放置API凭据?我正在使用 然后创建一个谷歌地图组件 import React, {PropTypes} from 'react'; import Map, {GoogleApiWrapper, Marker} from 'google-maps-react'; export class Container ext

我用的是Meteor软件包

在解决了我加载谷歌地图的问题后,

我遇到了一个新的错误, 谷歌地图API错误:MissingKeyMapError

我怎样才能解决这个问题?什么时候可以放置API凭据?

我正在使用

然后创建一个谷歌地图组件

import React, {PropTypes} from 'react';
import Map, {GoogleApiWrapper, Marker} from 'google-maps-react';

export class Container extends React.Component {
  render() {
    if (!this.props.loaded) {
      return <div>Loading...</div>
    }

    return (
        <Map google={this.props.google}
          zoom={12}
          initialCenter={{lat: this.props.lat, lng: this.props.lng}}
          style={{width: '100%', height: '100%', position: 'relative'}}>
        </Map>
    )
  }
}
export default GoogleApiWrapper({
  apiKey: <YOUR_KEY_HERE>
})(Container)
import React,{PropTypes}来自'React';
从“google maps react”导入地图,{GoogleApiWrapper,Marker};
导出类容器扩展了React.Component{
render(){
如果(!this.props.loaded){
返回加载。。。
}
返回(
)
}
}
导出默认GoogleApprapper({
apiKey:
})(集装箱)
创建上述Container.jsx文件后,将其作为组件导入,然后将其用作:

 import Container from './Container.jsx';
  ...
 <Container lat={YOUR_LAT} lng={YOUR_LNG} />
从“/Container.jsx”导入容器;
...
这是使用库的基本方式,可以添加标记、标签等。有关详细信息,请访问我正在使用的

然后创建一个谷歌地图组件

import React, {PropTypes} from 'react';
import Map, {GoogleApiWrapper, Marker} from 'google-maps-react';

export class Container extends React.Component {
  render() {
    if (!this.props.loaded) {
      return <div>Loading...</div>
    }

    return (
        <Map google={this.props.google}
          zoom={12}
          initialCenter={{lat: this.props.lat, lng: this.props.lng}}
          style={{width: '100%', height: '100%', position: 'relative'}}>
        </Map>
    )
  }
}
export default GoogleApiWrapper({
  apiKey: <YOUR_KEY_HERE>
})(Container)
import React,{PropTypes}来自'React';
从“google maps react”导入地图,{GoogleApiWrapper,Marker};
导出类容器扩展了React.Component{
render(){
如果(!this.props.loaded){
返回加载。。。
}
返回(
)
}
}
导出默认GoogleApprapper({
apiKey:
})(集装箱)
创建上述Container.jsx文件后,将其作为组件导入,然后将其用作:

 import Container from './Container.jsx';
  ...
 <Container lat={YOUR_LAT} lng={YOUR_LNG} />
从“/Container.jsx”导入容器;
...

这是使用库的基本方式,可以添加标记、标签等。有关详细信息,请访问

您是否已解决此问题?是否仍需要Meteor react谷歌地图的帮助?我自己刚刚成功地实现了一个。请注意,它不是用dburles实现的,我放弃了它。您能提供您使用的包吗?答案呢?谢谢这对我有帮助。你解决问题了吗?你还需要Meteor react谷歌地图的帮助吗?我自己刚刚成功地实现了一个。请注意,它不是用dburles实现的,我放弃了它。您能提供您使用的包吗?答案呢?谢谢这对我有帮助。