【问题标题】:"You have exceeded your request quota for this API" react-google-maps Javascript API“您已超出此 API 的请求配额” react-google-maps Javascript API
【发布时间】:2019-08-21 10:38:22
【问题描述】:

我正在尝试使用 react-google-maps 绘制路径。我可以毫无问题地显示地图,但是当我添加折线组件时,地图就像我已经达到配额一样。我还没有接近配额。

是的,这个问题以前被问过。不,启用计费不是解决此问题的方法。

以下是相关代码:

按预期工作(无多图):

<div classname="Maps" style={{ height: '55vh', width: '44.3%', float:  'right'}}>

      <GoogleMapReact
        defaultCenter={center}
        defaultZoom={zoom}
        bootstrapURLKeys={{ key:'MY_API_KEY'}}


      </GoogleMapReact>
    </div>

抛出错误:

<div classname="Maps" style={{ height: '55vh', width: '44.3%', float: 'right'}}>

      <GoogleMapReact
        defaultCenter={center}
        defaultZoom={zoom}
        bootstrapURLKeys={{ key:'MY_API_KEY'}}

      >
        <Polyline 
          path={path} 
          options={{ 
            strokeColor: '#00ffff',
            strokeOpacity: 1,
            strokeWeight: 2,
            icons: [{ 
              icon: "hello",
              offset: '0',
              repeat: '10px'
            }],
          }}
        />

      </GoogleMapReact>
    </div>

控制台中显示的错误是:“您已超出此 API 的请求配额。请参阅https://developers.google.com/maps/documentation/javascript/error-messages?utm_source=maps_js&utm_medium=degraded&utm_campaign=billing#api-key-and-billing-errors

【问题讨论】:

    标签: google-cloud-platform polyline google-maps-react


    【解决方案1】:

    解决方案:改用 react-leaflet。

    如果我真的需要帮助,我应该听从这个建议:https://meta.wikimedia.org/wiki/Cunningham%27s_Law

    【讨论】:

      猜你喜欢
      • 2019-02-23
      • 2016-11-08
      • 2019-01-12
      • 1970-01-01
      • 1970-01-01
      • 2019-02-03
      • 2016-10-30
      • 1970-01-01
      相关资源
      最近更新 更多