node.js - 电子地理定位网络位置提供商
问题描述
所以我有这个代码:
navigator.geolocation.getCurrentPosition(console.log, console.error, {timeout:5000});
并返回以下错误:
GeolocationPositionError {code: 2, message: "Network location provider at
'https://www.googleapis.com/' : No response received."}
code: 2 message: "Network location provider at 'https://www.googleapis.com/' : No response received."
我似乎没有找到任何解决方案。我已经尝试设置process.env.GOOGLE_API_KEY = config.GoogleAPIKeys.GeolocationAPI;
(配置部分是正确的,我仔细检查了它)
而且我还切换到 ssl (https) 并添加了这个以便电子显示它 app.commandLine.appendSwitch('ignore-certificate-errors', 'true');
提前致谢!
解决方案
推荐阅读
- arrays - 如何在数组中移动项目的索引/位置并相应地打乱其他项目?
- javascript - 使用自定义复选框实现 ag-Grid 行选择
- laravel - 有没有办法对 Vue 前端进行版本化,并检查后端是否是最新版本?
- python - 为什么我的素数筛返回相同的结果比在 Python 2.7 中寻找素数的蛮力方法慢?
- html - 100% 高度取决于兄弟元素的高度
- symfony - 如果使用查询生成器获取数据,则 postLoad 不起作用
- doctrine-orm - Doctrine ORM“通过给定的关联图找到了多个非持久化的新实体:”
- c# - C# 从泛型获取 Linq 表
- ruby-on-rails - 如何为应该在 Pundit 授权机制后面失败的请求编写请求 RSpec?
- angular - Div 元素上的 ngModel