Plotting World Wide WebCams on Google Maps

April 29th, 2008

Google Maps provides a rather wonderful API that allows you to add details to a Google Maps window of your own design. There have been all kinds of things implemented using the MashUp approach, and since I was home all day I decided to look at doing something I have wanted to do for white a while – a world map of webcams using the familiar Google Maps interface.

Initially I set up a simple full-screen Google Map DIV. My first problem was to get around the lack of “height:100%;” functionality in FireFox (and possibly IE – I didn’t check) so I knocked together some Window Size Detection code and resized the DIV using onLoad and onResize. Throw in the relevent Google code to produce a map, and you’re off.

For my example cams, I chose a couple of simple refreshing images in Scotland, a WMV stream from London and an mJPEG cam from some Sushi restaurant in Tokyo. Each presented their own problems: JPEG cams need to be refreshed using JavaScript; WMV streams use and EMBED command; mJPEG has to be actively stopped to avoid run-on and so on. My first approach was to simply produce working code for each of these types.

With these working I took a break from technical stuff to add some header and footer bars. I initially decided I would have the centre map in an IFRAME or something similar, but changed my mind because, well, IFRAMEs. Yuck. I added a 50-high DIV to the top and a 30-high one to the bottom and just resized my map to WindowHeight-80 – nice and simple.

Lastly – for today at least – I moved the whole thing over to a database to allow me to add and delete WebCams more easily. I’ve gone for a two table approach for this:

  • camlist
    This table contains the list of cameras and everything specific to them: Title; Url; Width; Height; Lattitude; Longtitude and so on. Everything that is unique to a camera goes in this table, and it provides the basic listing of available WebCams.
  • camtype
    This uses a lookup from the camlist table to provide standard information on how to handle this particular type of webcam. If it’s an mJPEG stream for example, there’s no function to start the updates, but there’s one to stop it once the window is closed. These use a template approach with [VAR] fields to mark the position of data which is inserted when required.

Lastly I use a cross-table SQL query to produce a list of all active WebCams in the database with tailored usage information tagged on the end. Everything I need, from the title of the webcam to the HTML containing the unique URLs and JavaScript, comes out in one big fat array, making it easier – with a few conditions – to produce a list of Google Maps API calls that will draw my camera markers.

Today’s effort can be seen at:

It’s the front page only for the time being, but I will allow people to suggest webcams for including on the map at some point.

Wednesday 1st May, 11:41pm
I’ve added new WebCam types for Flash and Quicktime, plus added a few new cameras (mostly places where there’s a bit of daylight, heh)

One of those Days

April 25th, 2008

On the weekend I went off to Scotland to climb Ben Nevis my router decided to pack in on me. No amount of resetting, prodding, poking or power starvation would fix it – the power LED would glow, flickering slightly, and that was that.

A whole month later I finally get time to sit down and contact Netgear about it. The process is fairly straightforward and we arrange for A NOVO to come and collect the duff unit, with CityLink due to drop a new one in sometime in the week.

Except yesterday, while I was packing up the unit ready for collection, the Cable Modem decided to quit. It’s worth mentioning that this is the original Motorola Surfboard modem that can back in the day when Diamond Cable was my provider and NTL was nothing but a distant rumour. I think it had been on for roughly seven years straight.

Calling the 25p/min support number got me straight through to a helpful customer service rep who arranged for a new modem to be delivered in 5-7 days, so for the time being I am completely without internets at home.

Sigh… what next?

Download YouTube Videos with YouChoob

April 15th, 2008

The planets have completed their alignment and as according to the prophecy Bootblock has emerged from the seedy underworld of Scunthorpe to shower us with virtual goodness.

YouChoob is a tiny wee application that takes a YouTube page URL and downloads the video to your harddrive. It is entirely clientside and not dependent on any external website (except for YouTube, obv) and does exactly what it says on the tin, though v1.00 has a few quirks:

  • Links must be for http://www.youtube.com and not http://youtube.com
  • Only one video stream can be downloaded at any time (*)
  • No default filename is generated for your video file

Despite that, it’s a quick, reliable and easy way to download YouTube videos.

UPDATE: v1.01 available. Download it here:
http://software.bootblock.co.uk/?id=youchoob

(* – not actually a quirk, BB says)

Playa del Ingles, Gran Canaria

April 13th, 2008
Gran Canaria - Sunny!

Gran Canaria - Sunny!

After the hard work and pain involved in climbing Ben Nevis a while ago it was nice to jet off to Gran Canaria for two weeks of beer and sunshine. We stayed at the Green Seas resort in Playa del Ingles – a so-so ‘all inclusive’ resort – and basically tanned and chilled.

The TV lost all the decent channels so we were stuck with Sky News and its unending coverage of the unfolding Shannon Matthews drama, while missing TV presenter Mark Speight barely got a look in. The Olympic Torch protests took up a fair bit of airtime as well – all in all it made me realise just how crap Sky News is, and I was glad to sit down to BBC News 24 over breakfast this morning.

While I was up Ben Nevis my Netgear router died on me (not up the mountain, no), and after a discussion with eBuyer I need to get that sent off for repair.

I also need to get a laptop reformatted, money paid in and ease myself back into the joy that is work. To top it all off it’s cold and wet and I had the sniffles less than 8 hours after landing. Welcome back to Blighty I guess!