Closed (fixed)
Project:
Location
Version:
7.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Mar 2014 at 15:38 UTC
Updated:
28 Jun 2014 at 21:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
onelittleant commentedComment #2
onelittleant commentedComment #4
jkingsnorth commentedI can confirm this bug. Even though the module grabs our API key from the GMAP module, it doesn't actually USE it in the request!
Comment #5
jkingsnorth commentedI can confirm that the patch in #1 does work, but I'm not sure it is the right approach.
Surely the API key should be set into the variable
location_geocode_google_apikeyregardless of whether it comes from GMAP or is set in the location module. It looks like the admin settings form options is supposed to do this:But it doesn't work. My API key is set via GMAP, and the
location_geocode_google_apikeyvariable is empty. It is not empty if there is an API key set on the location module though, ie when the second form is active. But obviously the first part is not working properly. I think we should try to fix that and kill two birds with one stone.Comment #6
jkingsnorth commentedOK, so that first bit of the form, that is suppoed to detect the GMAP API key and set it to the variable is doing nothing useful:
Issue 1 - The 'item' type can't have a value, so nothing is being set here.
Issue 2 - Even if we change this to a 'textfield' with the value from the GMAP module's API key, the value isn't set to the
location_geocode_google_apikeyvariable until an admin goes to one of these configuration pages (Location > Geocoding options > Next to a country - Configure parameters) and hits 'Save configuration'.So we need to somehow get this variable to be set by default if the GMAP module's API key is set? I guess this would have to hook in to the install process, and hook in to the form in the GMAP module where the API key is saved? Or we abandon trying to use the GMAP module's API key altogether, and just set it again in Location.
Comment #7
onelittleant commentedWith Google Maps API 3.x an API key is not needed. Also, the API key needed for geocoding should now be different than any browser api key. It should be a server key generated through the Google developers console. This is tied to limits and billing.
I would think the best approach to preserve backward compatibility would be to always show the API key field on the Location settings and in the code use the gmap API key if nothing is set in the Location geocoder API key.
Comment #8
onelittleant commentedThis patch includes some updates based on suggestion from John https://drupal.org/comment/8611387#comment-8611387 and an API key for test bot.
Comment #9
podarok#8 commited
thanks!
Comment #12
gpvdo commentedIt sounds like location is getting the API key from 'gmap' module.
Since Location module will do geo-coding without the 'gmap' module, should it not have its own entry for the Google Maps API?