This patch allows the use of Keys to manage the site's Google API Key. Keys provides an API for managing keys for other API's also allowing for sites that are developed on different servers than the live to have unique keys and allow modules to use the proper key based on the server host name.

This patch still allows for the Google Map API key to be entered in on the Gmap settings page, but can also be managed from Keys settings page. From the Keys settings page you can also add additional host name's and their appointed keys, or delete any key.

There are two patches, the first one included in this message and the second one to follow. Also, I did not patch the gmap.info file but 'dependencies = keys_api' needs to be added to it.

Comments

greenskin’s picture

StatusFileSize
new904 bytes

Here is the second patch. I hope that this can find its way into the module in some form. Thanks.

Carlos Miranda Levy’s picture

I can confirm this works like a charm...

This is greatly needed by many of us pointing more than one URL to the same Drupal installation.

I can now start integrating my separate files and communities into one large Drupal powered / gmap enhanced happy family.
:)

Plsssss, pretty please, with a cherry on top, add this to the module's core code...

bdragon’s picture

I refuse to make gmap dependent on keys api, however, I am open to supporting it when available, either by telling keys api about our variable, or doing module_exists() calls where appropriate.

bdragon’s picture

Status: Needs review » Needs work

Looking at the keys code, it seems the module_exists route will work the best. Give me a few.

bdragon’s picture

Status: Needs work » Fixed

Added support for keys api when available.
http://drupal.org/cvs?commit=87022

Please test the next snapshot.

greenskin’s picture

This is a great idea not to require it but to have it has an option which is something I should have thought of when I wrote the patch. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

jcnventura’s picture

Status: Closed (fixed) » Active

This is actually a followup to another issue here (http://drupal.org/node/69465).

Correct me if I am wrong, but doesn't the Google maps API require a different key depending on the location of the page? So a page residing in www.example.com/print will require a different key than a page in www.example.com/content?

If so, the fact that this patch only supports getting a key per host, where it could be easy to associate the key to a complete host+path string, is somewhat a middle solution.

I am closing the other issue down.

bdragon’s picture

Status: Active » Closed (fixed)

No. You are most likely generating your key wrong. You should be generating it against your Drupal root folder.