I've recently been doing development upgrading our maps to v3 and during development I was using my own personal key. Everything was working fine. When it was time to go to production I had someone generate a key through the company's google account and now it doesn't work. I've sat next to them making sure they were generating a browser key, and I'm pretty sure the domains are correct under the "Referrer's" section matching both: .mydomain.com/ mydomain.com/*
I've verified that we are using Key for browser apps.
I've verified that the Google Maps API v3 is turned ON via the services panel. Everything is identical to the way I was doing it with my key. I think the only difference is that they've enabled Billing on the company account where as my key doesn't. We'd like to get this moved off of my key seeing as how it's receiving more than the 25k views/day limit on my account.
When using the company API key the map loads and then very quickly I get an alert box which reads: "Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key, or it is not authorized for the Google Maps Javascript API v3 on this site. If you are the owner of this application, you can learn about obtaining a valid key here: https://developers.google.com/maps/documentation/javascript/tutorial#api_key"
If I then replace the key with my own key, with the same referrers settings, it works..
Any help would be greatly appreciated.
If you are testing locally, make sure to add your local ip to the server key:
if you want the maps api to be available across the whole domain add this to the browser key:
Hope this helps.
I had a number of reports from clients about problems with Google maps on their sites. I checked and got "Invalid key" errors.
Strangely, Google used to give out keys with a space before and after the API key. In the past, when I left the spaces off, the key broke. It was frustrating to remember to leave those spaces.
Now, I
trim()
my current API Key (with or without spaces) before submitting it to Google Maps and it works.You are missing the
v=3
before yourkey={yourkey}
Like this:
Actually you want the
Google Maps JavaScript API
to be enabled instead ofGoogle Maps API v3
because the former is what you are actually using here. The latter is now divided into iOS and Android BTW.Also you need to add your reference into your server key.
If it is local, it should be something like:
localhost/*
Add
v=3;
before your key.