close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

using two API's for .net & .com domains

Thread began 4/10/2010 3:51 pm by Sally | Last modified 4/12/2010 11:42 am by Jason Byrnes | 679 views | 1 replies |

Sally

using two API's for .net & .com domains

I am trying to use two API for both the .net and .com version of a domain. I don't see any way within Pro Maps for Google to do this.

Google's FAQ says it can be done by inserting:
document.write([
'<script src="http://maps.google.com/maps?file=api&v=2&key=', {
'domain1.com': 'apikey1',
'domain2.com': 'apikey2',
'domain3.com': 'apikey3',
'domainN.com': 'apikeyN'
}[window.location.host],
'" type="text/javascript"><\/script>'
].join(''));

but I haven't had any luck with that.

Any suggestions would be appreciated. Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

your page will have a line similar to this that sends the api keyL
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAvZMU4-DFRYtw1UlTj_zc6hT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQcT1h-VA8wQL5JBdsM5JWeJpukvw">/*wagmp*/</script>



change that to:

php:
<?php

switch ((isset($_SERVER["SERVER_NAME"]))?$_SERVER["SERVER_NAME"]:"") {
    case 
"domain1.com":
        
$key "key1";
        break;
    case 
"domain2.com":
        
$key "key2";
        break;
   case 
"domain3.com":
        
$key "key3";
        break;
   default:
        
$key "key1";
        break;   
}
?>
<script type="text/javascript"  src="http://maps.google.com/maps?file=api&v=2&key=<?php echo $key?>">/*wagmp*/</script>
Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...