Closed lavenpillay closed 5 years ago
If you are getting a direct message that the "API key is invalid", you should start there. There have been changes within the Google ecosystem as far as API keys go in the past couple of months, which you obviously know (by describing the payment).
I would suggest contacting them, or reading this, which involves a different API service (javascript, but is still pertinent given the changes) and double checking your payment status.
Edit: Have you went to the link that you were given at the end of your post? http://g.co/dev/maps-no-account
Thanks for the quick response ! I confirmed all the obvious things in from the Google links, but I just spotted this :
In order to switch over to the new pay as you go pricing plan, you must create a new project, as your existing Premium project cannot be transferred. You must get new API keys, and use them to to replace your existing keys.
I'm not in control of billing (client is), so maybe I just need to re-create the project ? I'll try that. Thanks again for the response.
Keyless access to Google Maps Platform is deprecated.
This message is outputted when you use Google Maps JavaScript v3
without key.
It means your HTML includes <script src="https://maps.googleapis.com/maps/api/js"></script>
in anywhere.
This plugin inserts <script src="https://maps.googleapis.com/maps/api/js"></script>
automatically if your app does not it.
If your app already has <script src="https://maps.googleapis.com/maps/api/js"></script>
, this plugin skips it.
This is browser platform behavior.
If you see the message on Browser platform, but you don't include <script src="https://maps.googleapis.com/maps/api/js"></script>
, you probably forget to specify API key
in your code.
https://github.com/mapsplugin/cordova-plugin-googlemaps/blob/master/README.md#api-key
If you see the message even on Android platform, you must check your HTML files.
Because this plugin does not use Google Maps JavaScript v3
in Android platform.
in index.html
<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOURKEY" type="text/javascript"></script>
in app.component.ts
this.platform.ready().then(() => {
Environment.setEnv({
// api key for server
'API_KEY_FOR_BROWSER_RELEASE': 'YOURKEY',
// api key for local development
'API_KEY_FOR_BROWSER_DEBUG': 'YOURKEY'
});
this.statusBar.styleDefault();
this.splashScreen.hide();
});
Remove <script async defer src="https://maps.googleapis.com/maps/api/js?key=YOURKEY" type="text/javascript"></script>
Facing the same issue.
I just got my API key (with billing), but whenever i'm trying to test an maps.googleapis.com/maps/api/distancematrix/json?origins=origin&destinations=destination?key=myApiKey, i'm getting the bellow message:
{ "error_message" : "Keyless access to Google Maps Platform is deprecated. Please use an API key with all your API calls to avoid service interruption. For further details please refer to http://g.co/dev/maps-no-account", "routes" : [], "status" : "OVER_QUERY_LIMIT" }
I'm submitting a ... (check one with "x")
OS: (check one with "x")
cordova information: (run
$> cordova plugin list
)If you use
@ionic-native/google-maps
, please tell the package.json (only@ionic-native/core
and@ionic-native/google-maps
are fine mostly)Current behavior: Despite providing a valid API KEY, from an account with Billing Enabled, and a newly generated API KEY, I am getting this error when attempting to use the "locate place" function:
Expected behavior: API Call returns a valid response (and then the application re-centers on that location). Note : This did work when last tested, a few months ago, and with a different API KEY, so the functionality itself does work.
Related code, data or error log (please format your code or data):
Plugin was added like so, with the valid API Key
The code making the call to the GeoCoding api :
I have also tried using curl to make the call directly - and get the same error whether I provide a "key" parameter or not :
I have also tried various combinations of Remove/Add Plugin and Remove/Add Platform.
Please let me know if you require further information.