问题
I'm currently upgrading one of my websites from the old system to HTML5 and I have some problems with the Google Maps JavaScript API v3. To fetch data from their API, you must have an key - of course - but it's here I have the problem.
The problem is that even if I have an correct key that I have added on their Google APIs Console I'm getting "Permission Denied" all the time, followed by an alert window that say that I don't have an real API key or it's not approved to Google Maps JavaScript API v3.
I have turned on "Google Maps API v3" in "Services" on Google APIs Console and payed the "bill" but that didn't help at all as proved. I'm using this URL to their API: http://maps.googleapis.com/maps/api/js?key={MY_KEY}&sensor=false
and I have readed their documentions very carefully and I'm currently out of ideas.
Do you know what's wrong here? Have I missed something or what?
回答1:
In the absence of a link to check...
You can have more than one Project (dropdown, top left in the Console), and each key is tied to a project. Maps v3 must be enabled for the right project.
The seqence should be:
- Choose project from the dropdown (or create one)
- Choose the services required by that project
- Choose collaborators if any
- Set up the access keys for that project. You can have more than one key per project and specify the domains the keys can be used on.
- Set up billing if you need it.
The menu on the left is set out in a logical order.
来源:https://stackoverflow.com/questions/10066045/api-key-invalid-or-not-approved-by-google