views:

122

answers:

1

Hi there, I am trying to create a google maps for mutiple domain the php script is below:

$my_google_map_keys = array('host1' => 'key1', 'host2' => 'key2');

$conf = array(
  'google_maps_key' => $my_google_map_keys[$_SERVER['HTTP_HOST']]
);

but I can't make it work after put on my heading. any one can help please?

sorry,

originally, I use the script below for the API keys which is working fine:

Now I want to use it for multiple domain, and replace by the php script, but it doesn't work. any idea what else should I do, or could you give me some idea how to update to V3.

Many thanks!!

+1  A: 

You might want to upgrade to V3 of the Google Maps API - API Keys are no longer required.

The Google Maps Javascript API V3 - Basics

Lucanos
Hi Lucanos, could you give me some example that for the javascript API V3, I have found one which is working: http://www.xuanyinwen.com/test8.html
xuanyinwen
could you let me know how can I use the physical address replace the LatLng(-41.251290,174.803638). I couldn't find any example for using the address. Help please
xuanyinwen
@xuanyinwen: Regarding examples of V3 code, refer to the Google site. They tend to have good examples. The text8.html page you have seems to be working fine though, so you should be able to migrate most of your existing code over without a problem. For turning physical addresses into LatLng sets, you can either search in Google Maps for the street address and then dissect the resulting URL to get the LatLng, or you could possibly batch the jobs through the Google Geocode API (search for it - there should be plenty of guides out there).
Lucanos
Hi Lucanos, Thanks again. I have searching for days and couldn't find the right answer, and try to use php but fail. I know I am dumn.
xuanyinwen
would you mind help me have a quick search, and tell me the link or example? what I want just use street address to replace the LatLng number. how can I edited my test8.html with address please? many thanks!!
xuanyinwen