Simon Harriyott

Google Maps

I've been looking for an excuse to do something with Google maps for a little while. I had a little play about with the API last week, and it's really pleasing. Tonight I knocked up a quick map for the contact page of my church's website. Simple, I know, but it's better than the existing text links that launched mulletmap in a new window.

To use the Google maps API, one must register a root URL to obtain an API key, and pass this to Google's JavaScript handler. Any pages using that key must have a URL starting with the one registered. Sounds fine, but there was an irritating side-effect. I had to register http://localhost to test my map on my local machine while developing and testing it, and then change the key to the church's one just before uploading. I couldn't even register file://, so I had to have a web server running to even start. It would be really useful if the API would allow those two prefixes with any valid key, so using the target site's key wouldn't prevent the map running locally.
2 December 2005