Tuesday, January 18, 2011

[Google Maps API v2] Re: two api keys

Thank you so much for your response

Now I do have 2 api working using the code below but I am not certain
on how to add 3rd I tried by

adding

var key 3+
|| window.location.host == 'www.amf100.org
and
else {
var myKey = key2;
}

it did not work is there something I missed?

Here is the segment that did work

<script type="text/javascript">
var key1='ABQIAAAAcP3ZEqiBawylee3CjwAcjBTtxh3TA__nYYyMJ-
DNyxIdGZTqyRSSjPgKsuut2V4e2K3krRgiw8wehA';
var
key2='ABQIAAAAcP3ZEqiBawylee3CjwAcjBQskypt3MiyQ6Cz2ESSLzv0W_w7ARSX1_BqRvAdF2qstkYdb6fCCBdH7g';
if (window.location.host == 'www.americanmilitaryfamily.org' ||
window.location.host == 'www.amf100.org') {
var myKey = key1;
}

else {
var myKey = key2;
}

var scriptTag = '<' + 'script src="http://maps.google.com/maps?
file=api&amp;v=2&amp;key=
' + myKey + '">'+'<'+'/script>';
document.write(scriptTag);
</script>

On Jan 18, 1:30 am, ProbablyMike <mike.be...@stroud.gov.uk> wrote:
> This is asked frequently, a quick search finds lots of answers, try
> the third result "Using two domains/keys in one site"
>
> http://groups.google.com/group/google-maps-api/search?group=google-ma...

--
You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate