将 Google Map JavaScript 库与 cordova 一起使用
Using Google Map JavaScript library with cordova
我正在尝试将Google map JavaScript API与Cordova项目一起使用,
我正在获得地图,几秒钟后,我得到了RefererNotAllowedMapError file:///android_asset/www/index.html
我也尝试在开发人员控制台上提供此URL,但没有运气。
我尝试提供通配符星号符号
有没有其他方法可以设置自定义引荐来源网址或如何解决此问题?
---编辑---
我正在使用浏览器 API 密钥,我更改为 Android API 密钥,现在它可以正常工作。
科尔多瓦的错误值:https://maps.googleapis.com/maps/api/js?key=<浏览器 api=" 密钥=">浏览器>
科尔多瓦的正确值:https://maps.googleapis.com/maps/api/js?key=
浏览器 API 密钥似乎仅在 http 网址上执行 html 页面时才允许
截至 2017 年 5 月,该问题已由 Google 解决。现在您可以使用文件:/带有 API 密钥的引荐来源网址。您可以在文档中看到以下文本
file:// referers need a special representation to be added to the Key restriction. The "file:/" part should be replaced with "__file_url__" before being added to the Key restriction. For example, "file://path/to/" should be formatted as "__file_url__/path/to/*". After enabling file:// referers, it is recommended you regularly check your usage, to make sure it matches your expectations
https://developers.google.com/maps/documentation/javascript/get-api-key#key-restrictions
- 转义符不能与innerHTML一起使用
- 高亮显示与数组字符串一起使用时文本插件中断
- setTimeout可以与闭包内的函数一起使用吗
- 将依赖外部库的UMD模块与browserfy捆绑在一起
- cordova-2.0.0.js不适用于使用phonegap的android
- ReferenceError: cordova is not defined @ng-cordova.min.js:7
- Highcharts colorsByPoint与系列中的线性渐变一起使用时不起作用
- cordova:例外:财产'requestFileSystem'的[对象全局]不是函数
- 如何将js库与typescript一起使用
- 将webpack和babel与父项目目录中的文件一起使用
- 在cordova android应用程序中连接数据库
- Javascript无法与Onsen一起在Cordova工作
- 在普通桌面浏览器中测试时,如何将sqlite与cordova一起使用
- Parsererror 当将 AJAX 和 JSONP 与 Cordova 一起使用时
- 应该在Cordova应用程序中将哪些RederictUrl与ADAL一起使用
- 将 Google Map JavaScript 库与 cordova 一起使用
- 将Cordova插件与Meteor.js一起使用
- 如何将 Parse Push 与 Cordova、Appcelerator 等一起使用
- 我可以将python或php与Framework7/cordova一起使用吗
- 让SoundJS与Cordova/Phonegap一起工作