You can see an example of some javascript that will do this at:
http://www.healthypetmobilevet.com/area.shtml

Here is the relevant part:

<script type="text/javascript">
                document.write(
                '<script src="http://maps.google.com/maps?
file=api&amp;v=2&amp;sensor=false&amp;key=' +
                  ({
                  'www.healthypetmobilevet.com':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRQ7EqE0mOyfVG40L6fNq7Un8buj8hQTV6eQ_fNtisF9PNXuKtCC-
_2uug',
                  'www.healthypetmobilevet.net':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRTT5nT7mmUboUV6vFITvKVSE86WjBTs3oH3H2BTBOBAzOYLFbvT49Gmhg',
                  'www.healthypetsmobilevet.com':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRQAb7A2k6llMjrlfZxpWKtqTAYuIRQ4vMl3gWTn69w6B8Bj-
Mt0TQYPRw',
                  'www.healthypetsmobilevet.net':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRSqBBNKHnueDMwRMKZAV9_6Da27iBT6Av6VDcSwotyMoKrk5Uf7YvCegw',
                  'healthypetmobilevet.com':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRQjCe8R_zz67cVP9fK3JICqhKPGhxQjnUIMvULceH4pi3kluMyJsrc_yg',
                  'healthypetmobilevet.net':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRTSYZgRQ5dBplpJNYmYjT89Hrv5gxTWOcVpoNxQG7nj4V5sapNWKJJTSg',
                  'healthypetsmobilevet.com':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRQx0MeLAPr3QMS-
p6PgiWPiKUde2hTEnnXi8ymwpVdpNQVIUgbLovdUCg',
                  'healthypetsmobilevet.net':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRQSua4aPdgE8oMwuPybsuaP0LIbaBSTFw09g5XHDrsRY6klPYIQhEFKOA'
                  }[location.host] ||
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRQ7EqE0mOyfVG40L6fNq7Un8buj8hQTV6eQ_fNtisF9PNXuKtCC-
_2uug') +
                  '" type="text/javascript"><\/script>' );
            document.write(
            '<script src="http://www.google.com/uds/api?
file=uds.js&amp;v=1&amp;key=' +
              ({
              'www.healthypetmobilevet.com':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRQ7EqE0mOyfVG40L6fNq7Un8buj8hQTV6eQ_fNtisF9PNXuKtCC-
_2uug',
              'www.healthypetmobilevet.net':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRTT5nT7mmUboUV6vFITvKVSE86WjBTs3oH3H2BTBOBAzOYLFbvT49Gmhg',
              'www.healthypetsmobilevet.com':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRQAb7A2k6llMjrlfZxpWKtqTAYuIRQ4vMl3gWTn69w6B8Bj-
Mt0TQYPRw',
              'www.healthypetsmobilevet.net':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRSqBBNKHnueDMwRMKZAV9_6Da27iBT6Av6VDcSwotyMoKrk5Uf7YvCegw',
              'healthypetmobilevet.com':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRQjCe8R_zz67cVP9fK3JICqhKPGhxQjnUIMvULceH4pi3kluMyJsrc_yg',
              'healthypetmobilevet.net':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRTSYZgRQ5dBplpJNYmYjT89Hrv5gxTWOcVpoNxQG7nj4V5sapNWKJJTSg',
              'healthypetsmobilevet.com':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRQx0MeLAPr3QMS-
p6PgiWPiKUde2hTEnnXi8ymwpVdpNQVIUgbLovdUCg',
              'healthypetsmobilevet.net':
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRQSua4aPdgE8oMwuPybsuaP0LIbaBSTFw09g5XHDrsRY6klPYIQhEFKOA'
              }[location.host] ||
'ABQIAAAAkzMwfHDLTrxt8VNR0yq9FRQ7EqE0mOyfVG40L6fNq7Un8buj8hQTV6eQ_fNtisF9PNXuKtCC-
_2uug') +
              '" type="text/javascript"><\/script>' );
        </script>

-Brian

On Dec 22, 3:51 am, Mike Williams <[email protected]> wrote:
> That's not a redirected domain, it's an aliased domain. The Google code
> has no way of knowing that its an alias and requires the API key to
> match the domain name that it sees in window.location.host.
>
> You need to check window.location.host yourself and switch keys as
> appropriate.
>
> --
> Mike Williamshttp://econym.org.uk/gmap

--

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


Reply via email to