Vit*_*ito 2 html javascript electron
当我尝试获取当前位置时
navigator.geolocation.getCurrentPosition(handleCoordinates, handleError, {timeout:10000})
Run Code Online (Sandbox Code Playgroud)
它返回
“' https://www.googleapis.com/ ' 上的网络位置提供程序:返回错误代码 400。”
有人可以建议任何可能的方法吗?
小智 6
您应该配置正确的 google api 密钥来请求 Chrome 中的 google 相关服务。
https://github.com/electron/electron/blob/master/docs/api/environment-variables.md#google_api_key
https://github.com/electron/electron/issues/9420