Google Maps mash-ups are easy

A colleague from dare2, a youth development charity based in Woking, asked where the nearest IBM location to him was. I didn’t know.

The IBM UK website gives a list of UK locations. But there are two small problems. One – my geography is so bad that I don’t know where Woking actually is. Two – my geography is so bad that I don’t know where each of the IBM locations on the IBM list are. Okay, it’s really one reason, but it’s embarrassing enough that it’s worth mentioning twice 🙂

So, I thought this would be a good enough excuse to try creating my first Google Maps mash-up.

I’ve been meaning to try the Google Maps API for ages, but never realy got around to it. I’d heard that it was easy, but I didn’t realise just how easy. If you just want a map with a few points marked on it, it only takes a few minutes.

screenshotTo see my map of IBM UK locations, take a look here. I wont bother copying the source code here – it is short and simple enough that it doesn’t really need any explanation, and if you want to see it you can view the source for the webpage.

The only frustrating bit was when I tried adding some search capabilities to the map. See http://dalelane.co.uk/maps/search.html to see how far I got. What I wanted was a box that I could enter ‘Woking’ into, then hit Submit to get it added to the map – ideally in a different colour – so I could see where Woking is in relation to the IBM locations.

Unfortunately, the Google Maps Geocoder (the bit that should convert ‘Woking’ into map coordinates) doesn’t seem to like UK place names. Try it – enter UK place names and nothing. Enter a US place name, for example ‘New York’, and you get coordinates.

Apparently, this is intentional – some problem with Ordnance Survey and Royal Mail holding the copyright to the database needed to do the conversion. I could look into using another source for the conversion but this has already long since passed the point of being an over-engineered solution to a fairly trivial problem, so I think I might leave it there for tonight. 🙂

Oh – and if you’re curious what the answer was? It’s IBM Weybridge.

One Response to “Google Maps mash-ups are easy”