If you tried to get a key for your localhost, you might get the following error when you tried to load the map:

In order for a key to work on your localhost, you need to register an unique host name. So, go back to the registration page and pick a really unique name. Pick anything you know will be unique. Then edit your /etc/hosts file and add your unique name to localhost. For example:
127.0.0.1 localhost myrealuniquehostname
Assuming you did everything else correctly, you should be able to see the map display without the pop up error above.

ventureskills said
For windows users, windows/system32/drivers/etc hosts file
and safe yourself the hassle of it not working
or use a Unix system
cheers Tim
Quick Tip: Working with Google API « Venture Skills Blog said
[...] When working with any of Google’s API’s you are asked to specify a directory that a key will be generated for, if you work with a site on a local testing server you probably have come across the “this key is in use” when you specify localhost as explained in this post the key is to specify a unique host name. [...]
zencin said
Thanks for pointing out the equivalent file on Windows .
Stimpfl Daniel webblog » Api di Google Map : Ricevere una Key valida con server locali said
[...] Google non permetteva l’utilizzo della chiave. Leggendo un pò in giro ho trovato questo post dove spiega come ricevere una chiave di Api GoogleMap anche per i server locali. Praticamente, se [...]