Google Maps API for Work and phonegap / cordova - google-maps

I bought an API key for Google Map. I tried to implement the client key in a PhoneGap application.
<script src="http://maps.googleapis.com/maps/api/js?client=YOUR_CLIENT_ID&v=3.17"></script>
However, it doesn't work. I have an alert with the message: "your domain is not permitted."
I can't put a domain in the admin console, because it's a phonegap app and the file protocol doesn't work well too.
How can I use the client key with a phonegap app ?
Many thanks

I think Google Maps Javascript API v3 for work does not work on PhoneGap/Cordova, because the API refers the domain of the page.
You can still use Google Maps Web APIs (direction APIs, geocoding APIs ... etc) with your key.
Ask your Google Maps reseller (or directly Google support team).

Related

a commercial API key did not work: This page can't load google maps correctly

I used a new key and got:
"This page can't load google maps correctly"
What does it really mean?
<script src="https://maps.googleapis.com/maps/api/js?key=MY_API_KEY&libraries=places" async defer"></script>
This is a key from a commercial account.
For anyone who runs into this "This page can't load google maps correctly" error and has added the Places library in the JavaScript API script, i.e.:
<script src="https://maps.googleapis.com/maps/api/js?key=KEY&libraries=places"></script>
You must enable the Places API. It's not enough to enable the JavaScript API only. Refer to Google's documentation:
Before using the Places library in the Maps JavaScript API, first
ensure that the Places API is enabled in the Google Cloud Platform
Console, in the same project you set up for the Maps JavaScript API.
Hope this helps.

Google Static Map Authorisation with Key not working

I have the following Google Developer Console APIs with ON status:
Google Maps Embed API
Google Maps Javascript API v3
Static Maps API
BigQuery AP
Google Cloud SQL
Google Cloud Storage
Google Cloud Storage JSON API
I have the following link in an HTML email:
<img src='http://maps.google.com/staticmap?center=-15,-47&zoom=11&size=600x200&key=myKey'/>
But I never get an image. The key works OK for an embedded map using an iframe.
What am I doing wrong?
If you are using Google static Map API, you should use this URL:
http://maps.googleapis.com/maps/api/staticmap?center=-15,-47&zoom=11&size=600x200&key=myKey
Of course, replace 'myKey' to your valid key.
It won't work because you're trying to put it in an email, browsers work differently to email clients. Email clients block iframes for security purposes, see:
Is there no way to embed a Google Map into an HTML email?
You can check if your api key is working using the Google Maps API console https://code.google.com/apis/console/?pli=1
Update
also you might want to update the bit of the string 'myKey' with your api key :)

How to use google maps simple api on localhost

I have requested a link for embedding google maps on my website on
https://developers.google.com/maps/documentation/embed/start
and have authorized everyone with the link to use it
Referers: Any referer allowed
https://code.google.com/apis/console/
but I still receive a
The Google Maps API server rejected your request. This API project is not authorized
to use this API. Please ensure that this API is activated in the APIs Console:
Learn more: https://code.google.com/apis/console
Is there some other way to test my website locally with embedded google maps?
EDIT:
They say:
Easy embedding
Google Maps Embed API maps are easy to add to your webpage—just set the URL
you build as the value of an iframe's src attribute. Control the size of the
map with the iframe's height and width attributes. No JavaScript required.
but I still can't access the link.
The problem was that they have their "quick start" out of date.
https://developers.google.com/maps/documentation/embed/start
It says you should only provide them with your API key but the thing is that there is a new version of the same website which they don't have links to from their guide but which you get a link to elsewhere( I got offered when in "billing" )
The new service is called Cloud Console and I found the API on/off buttons there.
https://console.developers.google.com/project/...
You have to enable the "Static Maps API", "Google Maps API" and "Google Maps Embed API" and make sure to have your link in an iframe div
As Dominik said, go here:
https://console.developers.google.com/project/%your-project-name%/apiui/apis/library?q=google%20maps
Enable both APIs:
Google Maps Embed API
Static Maps API
Then go here:
https://console.developers.google.com/project/%your-project-name%/apiui/credential
Create New Key
Browser Key
And you're done.
I also had to enable the Google Maps JavaScript API.

Google does not permit the use of the Maps API for this application

Good day.
Now i create api Key for browser apps (with referers).
Referers: *.invait.ru/*
But on site i get error:
Google does not permit the use of the Maps API for this application.
API Google key provided is invalid or do not have permission to use it
with Google Maps JavaScript API v3 on this site.
Screenshot:
Tell me please why i get it error and how remove error and use google map api v3?
For domain use Referers: invait.ru/*

Google Maps API v3 over HTTPS?

Is there a https version of the google maps api v3? I have a site that uses https and am getting annoying mixed secure and non-secure content errors in IE. I read that in v2 you had to pay to get this, but haven't seen anything for v3.
Yesterday Google announced that sites may use the v3 API for free over https:
http://googlegeodevelopers.blogspot.com/2011/03/maps-apis-over-ssl-now-available-to-all.html
Try replacing
http://maps.google.com/maps
with
https://maps-api-ssl.google.com/maps
Update
As of March 2011
The Maps API v3, Static Maps API, and Maps API Web Services are now
available to all developers over https:
This is one of my big problems with Google Maps. If you want to access Google Maps javascript via https you have to sign up as a Google Maps Premier customer.
There is a Google Maps API issue on the topic with lots of mutinous comments, but the final word from Google is that they will not be supporting this functionality in the free API.
This particular problem is close to my heart as I have spent the last few days porting one of our projects over to Bing Maps (it does support https).
Google does allows https access for Maps API v3, Static Maps API, and Maps API Web Services.
But with one condition:
If your site uses SSL because you charge for access to your
application, or because your application is not publicly accessible to
all users, you must still purchase a Maps API Premier license.