相关疑难解决方法(0)

"您已在Google地图中超出了此API的请求配额"

我目前正在使用react-google-mapGoogle Map在我的React项目中运行,这是我的Map组件:

import React from 'react'
import { compose, withProps, lifecycle } from 'recompose'
import { withScriptjs, withGoogleMap, GoogleMap } from 'react-google-maps'

import MapStyle from  '../../../api/mapStyle'

const Map = ({ children }) => {

  return (

    <GoogleMap
      defaultZoom={15}
      defaultCenter={{ lat: 35.6840299, lng: 51.3861187 }}
    >
      {children}
    </GoogleMap>
  )
}

export default compose(
  withProps({
    googleMapURL: "https://maps.googleapis.com/maps/api/js?key=MY_KEY_HERE",
    loadingElement: <div style={{ height: `100%` }} />,
    containerElement: <div className='map' style={{ height: `100vh` }} />,
    mapElement: <div style={{ height: `100%` }} />
  }), …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps google-maps-api-3 reactjs

38
推荐指数
2
解决办法
9万
查看次数