Google Map API key on multisites

dunx's picture

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

Login to post comments

I think the keys API will help

drew reece - Sat, 2009-08-22 21:08

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

dunx's picture
dunx - Mon, 2009-08-24 21:01

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.