Google Map API Key annoyance

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

googlemaperror
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.

Advertisements

4 thoughts on “Google Map API Key annoyance

  1. For windows users, windows/system32/drivers/etc hosts file
    or use a Unix system 😉 and safe yourself the hassle of it not working
    cheers Tim

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s