Reputation: 43
I am new to google map api. I copied the Hello_World.html from google maps javascript v3 getting started. But I always get the error message: the provided key is not a valid google api key
.
I tried a few things but none of them worked. The following is what I did:
mysite.com/*
and localhost/*
. But the error message is still there.src="https://maps.googleapis.com/maps/api/js?key={XXX....X}&sensor=true"
to src="https://maps.googleapis.com/maps/api/js?v=3.6key={XXX....X}&sensor=true"
, even so, the error message is still there.Can someone give me any suggestions?
Upvotes: 3
Views: 3803
Reputation: 760
I had this problem. The solution is:
The example says to enter *.example.com/*
but it doesn't work for me. I had to enter (one per line):
example.com
*.example.com
*.example.com/*
example.com/*
Hope this helps
Upvotes: 1
Reputation: 161324
You don't need a key, it should work without it. If you provided the key you are using (it isn't secret and can't be used on domains that you don't allow), we could tell if it is at least the correct format.
This
src="https://maps.googleapis.com/maps/api/js?v=3.6key={XXX....X}&sensor=true
is incorrect.
Upvotes: 2
Reputation: 59435
You do not need a key for Google Maps API v3, see the documentation. Your API v2 key will not work. You will only need key for API v3 in case you want some additional features (very high traffic site, additional statistics etc.). But this is a very rare case.
Upvotes: 2