简体   繁体   English

在PhoneGap iOS应用中使用Google Maps JavaScript API v3

[英]Use of Google Maps JavaScript API v3 in PhoneGap iOS App

I'm experiencing a problem in using the Google Maps JavaScript API v3 for a Cordova PhoneGap based iOS App which, up until a few days ago, was working fine. 我在将Google Maps JavaScript API v3用于基于Cordova PhoneGap的iOS应用程序时遇到问题,该应用程序直到几天前仍能正常工作。

As I'm not an Objective-C developer I've purposely picked the Google Maps JavaScript API v3 over the iOS Maps SDK and have, in the Google Developers console, created a project and associated a browser key (set to enable all referrers) with that project. 由于我不是Objective-C开发人员,因此我故意在iOS Maps SDK上选择了Google Maps JavaScript API v3,并在Google Developers控制台中创建了一个项目并关联了一个浏览器密钥(设置为启用所有引荐来源)与那个项目。

In the head of the HTML page in my PhoneGap App I have called the Google Map API like so: https://maps.googleapis.com/maps/api/js?key=MY_APPLICATION_KEY_IS_PASTED_HERE&sensor=false 在PhoneGap应用程序的HTML页面的开头,我已经这样调用Google Map API: https ://maps.googleapis.com/maps/api/js?key=MY_APPLICATION_KEY_IS_PASTED_HERE&sensor =false

But when I run the App, despite this having worked without a key in previous versions and now having created a browser key and associating that as part of the call to the Google Maps API, I get the following error message: 但是,当我运行该应用程序时,尽管此方法在以前的版本中没有密钥,但现在已经创建了浏览器密钥并将其与对Google Maps API的调用相关联,但仍收到以下错误消息:

Google has disabled use of the MAPS API for this application. Google已禁止对此应用程序使用MAPS API。 The key provided is not a valid Google API key or it is not authorised for the Google Maps JavaScript API v3 on this site. 提供的密钥不是有效的Google API密钥,或者未经此站点上的Google Maps JavaScript API v3的授权。

Can anyone provide any suggestions on what I might be missing/doing wrong and what I could possibly do to resolve this as I need to get the App running again. 任何人都可以就我可能丢失/做错的事情以及为解决此问题而可能做的事情提供任何建议,因为我需要重新启动该应用程序。 I've looked through the Google Maps and Developer documentation but can't see anything that would alert me to what I might be doing wrong. 我查看了Google Maps and Developer文档,但看不到任何可能使我警惕的错误提示。

Thanks in advance for any help that anyone out there might be able to provide with this query. 在此先感谢您的帮助,那里的任何人都可以提供此查询。

I had the same problem. 我有同样的问题。 Solved it by setting up a key as per instruction here: 通过按照以下说明设置密钥来解决此问题:

https://developers.google.com/maps/documentation/javascript/tutorial#api_key https://developers.google.com/maps/documentation/javascript/tutorial#api_key

BUT setting the "Referrers" to [NOTHING]. 但是将“推荐人”设置为[无]。

KEY NOTE: I had set it explicitly to "*" and this did NOT work and then edited it beck to be empty. 关键说明:我已将其显式设置为“ *”,但此方法不起作用,然后将其编辑为空白。 I can't believe the edit back to nothing is necessary but...the default was already blank so and did not initially work so ... maybe try the explicit "edit" to blank if all else fails. 我不认为需要进行任何编辑,但是...默认值已经为空,因此最初没有用,所以...如果所有其他操作都失败,则可以尝试将显式“ edit”更改为空。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM