| Project: | GMap Module |
| Version: | 7.x-2.x-dev |
| Component: | Documentation |
| Category: | task |
| Priority: | major |
| Assigned: | podarok |
| Status: | active |
Issue Summary
I installed the gmap module thought I had everything configured properly but kept getting this error...
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 v2 on this site. If you are the owner of this application, you can learn about obtaining a valid key here: http://code.google.com/apis/maps/documentation/javascript/v2/introduction.html#Obtaining_Key
I finally realized that I was using a 'Google Maps API Server Key' when I needed to be using a 'Google Maps API Browser Key'! Perhaps some of the Google Map API Key instructions could be updated on the gmap homepage and README file. How about this...
===
In order to use 7.x-1.x and earlier versions of this module, you need a (free) Google Maps API Browser key. Here is how to get one:
1. Login at https://code.google.com/apis/console
2. Create project
3. Go to 'Services' and turn on 'Google Maps API v2'
4. Go to 'API Access' and 'Create New Browser Key' specifying your domain url(s)
5. Paste the Google API Browser Key here ./admin/settings/gmap
Hope that helps someone.
Jeff
Comments
#1
This is not working for me any more from today. The Google warning pops up after 5 seconds or so and the map disappears. I've generated new keys but same problem.
#2
@rectangle, make sure you have "Google Maps API v2" turned on under Services. If you have only v3 turned on, you will get errors.
#3
Yes. I do have Google Maps API v2 turned on. I still get the error.
EDIT: http://drupal.org/node/818638#comment-5925902 solved my problem.
#4
Instructions rolled into diff.
Should apply cleanly.
#5
Google API Console >> All Services
Make sure you have Google Maps API v2 marked as on under Services.
If only v3 turned on then it will give Javascript popup error.
Google API Console >>API Access
Now 'Create New Browser Key' for your url (localhost or domain)
Use Google API Browser Key in drupal module at ./admin/settings/gmap
#6
deepakjoshi: Are you commenting on my patch?
I really don't understand you post at all.
#7
I've seen others say that you need to include both 'yourdomain.com' and 'yourdomain.com/*' for the domain key to work. Maybe that is what he is saying. However, that is not my experience, nor is that what the google docs say here https://developers.google.com/console/help/#restrictingusage. Seems to me that my initial proposal to revise the docs still stands as simple and concise, plus there are links to the google docs right in their api console.
It may be that some installations need 'yourdomain.com/*' because of DNS or .htaccess complications. Dunno, but I don't need it for my install to work.
#8
webservant316:
I agree with you that the issues of *.example.com/*, *.example.com are laid out in the Google.com control panel.
Not having them here seems to me to make maintaining the documentation easier, as when google makes a change to the requirements we don't have to go through the patching process to update the documentation.
#9
yep
#10
#11
I can confirm the instructions from OP worked. My site is now showing maps correctly.
Thanx!
#12
I had this issue just moments ago. For whatever reason, I had to turn off the v3 service as well. It seems that having both services on was causing an issue.
#13
OK. I think I finally solved my problem with this by Creating a new project (I was trying to use an old project while just generating a new key) and then allowing all referrers. We'll see...
#14
Creating a new "Project" in the Google APIs Console was needed for me too.
#15
HI, this is what worked for me. It's the same as the first post, almost:
1. Login at https://code.google.com/apis/console
2. Create project
3. Go to 'Services' and turn on 'Google Maps API v2'
4. Go to 'API Access' and copied the API key under "Key for browser apps (with referers)"
5. Paste the Google API Browser Key here ./admin/settings/gmap
thanks
#16
This works...
http://www.websitename.com/http://websitename.com/
www.websitename.com
websitename.com
www.websitename.com/*
websitename.com/*
*.websitename.com/*
#17
Hi,
For me the only thing what helped is to set the referrer to: "Any referer allowed".
With any other combination I got:
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 v2 on this site. If you are the owner of this application, you can learn about obtaining a valid key here: http://code.google.com/apis/maps/documentation/javascript/v2/introduction.html#Obtaining_KeyGreetings, Martijn
#18
5. Paste the Google API Browser Key here ./admin/settings/gmap
Hey I'm just missing that step, I can't find that in the google api console. Can you tell me where it is?
#19
deepakjoshi does have a point...
I'm using 7.x, but the underlying issue shouldn't be any different from the 6.x versions of this module.
Recently, I had to migrate a Drupal site to a new Web host, and although there were no changes to the site itself, besides its location, I would be getting the Google Map API key issues related to above this post.
First thought it may have to do with the SSL, but disabled forcing redirects to it, and ruled that out...
I generated a new key, careful to make sure v.2 was selected, but still the same issues. Putting the URL in the key in a variety of different formats (e.g. sitename.com
sitename.com/*) did the trick.
#20
Try adding
&sensor=false
to the end of the script src= line as so:
script src="http://maps.google.com/maps?file=api&v=2&key=YOURKEY&sensor=false"
#21
Thanks Jeff, your instruction to update about google api key (https://code.google.com/apis/console) is working fine for me.
But please update this api link in the module also.
Again thanks for this good work.
#22
Thanks!
updated README.txt for 7.x-2.x and 7.x-1.x branches with this instruction
will be tagged in next minor release update
#23
Drupal Community is so helpful !! I wish that someday I will also help in Drupal community. Currently learning Drupal and PHP.
Bravo ! Bravo ! Drupal Community.
#24
updated project
http://drupal.org/project/gmap
page also
#25
Sorry to re-open the issue..
Mentioned at project page...
1. Login at https://code.google.com/apis/console
2. Create project
3. Go to 'Services' and turn on 'Google Maps API v2'
4. Go to 'API Access' and 'Create New Browser Key' specifying your domain url(s)
5. Paste the Google API Browser Key here /admin/settings/gmap
All done but I get a promt message: "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..."
Don't know what could possible be wrong? (I'm using GMap 6.x-2.0 beta2)
Further, someone told that Google has sent out emails reminding that the formal deprecation period for v2 of the API ends in May, 2013, after which they suggest that v2 won't work at all.
If at Google console 'Services' turning on both 'Google Maps API v2' and 'Google Maps API v3' and at 'API Access' choosing "Referers: Any referer allowed" seems to solve it and no error promt showing.
Has anything changed recently?
#26
Same issue. No matter what I do I can't get this to work on D7. I've followed all the steps countless times