Google Map API key on multisites

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by dunx on August 22, 2009 at 8:02pm

Greetings,

I'm developing locally (with my /etc/hosts tweaked to point 3 domains at localhost), which are configured using the Domain module to all use the same code and database (as opposed to a true multi-site).

I have installed gmap and location. I've also generated a Google Map API key for domain1.com and that works fine. As each domain1 through 3 will use the same code, how do I go about having a valid API key for them all? Would I have to generate a key for each domain and then tweak the theme templates to select the appropriate key for each domain or is there some other magic way of achieving this?

Cheers
Dunx

Comments

I think the keys API will help

Posted by drew reece on August 22, 2009 at 9:08pm

Try the keys API (now called keys) http://drupal.org/project/keys

You still need a key for each hostname, but at least the maps work locally.

That did the job

Posted by dunx on August 24, 2009 at 9:01pm

Many thanks!

Just to confirm, /project/keys did exactly what I was after. Install and enable. You can then generate a Google Maps API key for each domain and add it to the /keys config screen by entering the key, the associated domain and the service - in this case GMap. GMap is integrated with keys, so does everything straight out of the box.

I'm using locally spoofed domains as noted, but this would work equally well on your live domains, so a great helper module for anybody using shared content under any form of multi-sites.

Location and Mapping

Group organizers

Group categories

Wiki type

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /