Multiple Google Maps APIs?

12 years 3 weeks ago #607 by jasondean78@gmail.com
Multiple Google Maps APIs? was created by jasondean78@gmail.com
I have the Store Locator module loaded on my PC site and my mobile site (driven by Mobile Joomla) but the mobile site is under a different domain name. This of course means that the Google Maps API that I have loaded (due to it being for the domain name the PC site is running from) will not work for the mobile site.

Is it possible to load more than one API?

Please Log in to join the conversation.

  • jasondean78@gmail.com
  • Topic Author
  • Offline
More
12 years 2 weeks ago #608 by jasondean78@gmail.com
Replied by jasondean78@gmail.com on topic Multiple Google Maps APIs?
The other thing I was wondering, I've turned off the map on my mobile site, I only have the search module and the side bar, can I turn something else off that means I don't even have to have an API key for the mobile site? Or is the search module still querying Google Maps even though an actual map isn't being displayed?

Please Log in to join the conversation.

  • jasondean78@gmail.com
  • Topic Author
  • Offline
More
12 years 2 weeks ago - 12 years 2 weeks ago #609 by sysgenmedia
Replied by sysgenmedia on topic Multiple Google Maps APIs?
This is a two part question.. First ill answer your second question. The query system still uses google maps, so it would require the api key.

In regards to your first question, by default it does not support two api keys, byt you could edit the code to do something like this:

In components/com_storelocator/views/map/view.html.php on line 45, you can add the following like so:
$googleKey = $params->get( 'google_maps_api_key' ); // Originally in code, add the following under it...
 
If ( $_SERVER['HTTP_HOST'] == 'www.domain1.com')
    $googleKey = 'SOMEOTHERKEY';
 
If ( $_SERVER['HTTP_HOST'] == 'domain2.com')
    $googleKey = 'SOMEOTHERKEY';

Also, in our next release (before the end of 2011), we will be migrating to use google maps v3 api, which does away with keys all together.

Jared

Please Log in to join the conversation.

More
12 years 2 weeks ago #619 by jasondean78@gmail.com
Replied by jasondean78@gmail.com on topic Multiple Google Maps APIs?
For the time being, I have the mobile domain name forwarding to the pc domain name with code to send the browser to the mobile template on device detect. Looking forward to no more keys though!

Please Log in to join the conversation.

  • jasondean78@gmail.com
  • Topic Author
  • Offline
More