When your developing your googleMaps feature, it's not on the production site with the final url. (At least... I hope it's not so ;)
And you may code some google feature for several sites, and all these sites, you often code it on your computer with a local Apache/Php or Tomcat server.
So in you html (jsp, php, asp whatever) page you'll include the following code to have access to the google maps feature.
<!-- google map -->
A simple trick, is to request a key for a fake domain here : http://code.google.com/apis/maps/signup.html
Let's say, for "http://toms-projects"
Get the key, put it in your html code, and then edit your etc/hosts file.
(/etc/hosts on linux, c:\windows\system32\drivers\etc\hosts)
and edit the 127.0.0.1 line to
127.0.0.1 localhost toms-projects
As all system, by default, query the /etc/hosts file before making a DNS query,
toms-projects will be located at 127.0.0.1 by the machine dns client, and thus point to your local website.
And google sees the api key used for the toms-projects domain.
And everything works.
you may register directly the final domain key, let's say http://mysupersite.com
and edit you /etc/hosts in the same way :
127.0.0.1 localhost mysupersite.com
It will work as well, but beware, as long as you /etc/hosts file will be configured that way, mysupersite.com will be your computer !