2005-10-13

Google Maps Talk by Lars Elstrup Rasmussen

Yesterday, Lars Elstrup Rasmussen, the lead engineer of Google Maps, gave a talk at the University of Sydney, which I attended.

He started off by giving us an overview of the history of Google Maps – where it came from and how it got to be where it is now. Originally, Keyhole - which was later accquired by Google - was a desktop-based application written in C++. When they first became Google Maps, Lars and his team tried to convince Google that a desktop app was the way to go, citing the fact that it could have more features, and just generally be nicer than anything you could do in a web browser. Google, however, would have none of this and said basically, “We like the web, see what you can do to get this online.” So their C++ program which had taken months to write got converted into Javascript in a matter of weeks, and thus AJAX was born.

AJAX, for those of you who don't know, is a way of writing applications entirely in Javascript, so they can be run in a web browser. Google Maps was the pioneer of this technique, however it is now widespread across the internet. Lars explained to us that in fact a lot of the methodology of Google Maps originated as quick hacks to get something working in the limited time frame they had to port the original app to the web, and that in fact it continues, in his words, to be 'held together by chewing gum.' But it's chewing gum that appears to be holding up pretty well so far. :)

He went on to explain how the magic was done, including demos and code examples. The standard way to do maps and other related things online before Google Maps came about was to load each new image on a new page (and this is still employed at many websites). You click a button or link to zoom in, the page reloads, and you get a closer image. Or you click to go to the next map and again, the page reloads to give you the image you want. Google Maps doesn't do this.

This is achieved through the use of iframes. Essentially, an iframe is a page-inside-a-page: it allows you to embed one webpage inside another. You may have seem them in widespread use to implant advertising into webpages, for example. The thing about an iframe is that it is in fact a separate page. So the iframe can load, refresh, go back and forwards etc. without the main page changing. Moreover, if you follow links in an iframe, so that you load a number of pages inside the iframe in sequence, the pages will appear in your session history and you can switch between them with the 'Back' and 'Forward' buttons in your browser just as you would an ordinary page.

Next, with a bit of javascript, you can make the link in the iframe change content in the main page. Since it's javascript doing this, the main page does not need to reload in order for its content to change, even though the iframe will load a new page. Lastly, you use a bit more javascript to hide the iframe. So now what you have is pages loading in the iframe, entirely invisible to the user, but changing content on the main page. What this looks like to the user is a seamless changing of content on the page they are looking at. What it actually is is new pages being loaded, content being transferred to the main page, and all of this being done in the background where you can't see it.

If you've ever tried to look at a portion of Google Maps where images are not available, you'll notice the area where the map usually goes is divided into squares, each of which will bear the same message about the lack of images. This is another neat trick Google Maps uses to make the overall experience smoother for the user. All of Google's images for both their maps and satellite imagery are divided into tiles, each of which can be loaded individually. The bit of the page where the map goes is actually much bigger than it looks. You look through a 'window' onto a portion of the map, but the rest of the map is there, being loaded by your browser: you just don't see it. So, if you move the map around, as you approach new tiles that your browser hasn't rendered yet, they will be loaded, so that by the time they actually appear in your peephole onto the map, they are already there. This means the scrolling is smooth – it appears like it's just one big image that's already been loaded that you can move around freely in.

We were shown a graph of the usage of Google Maps. The service was originally launched in beta form through Google Labs. This, as you can imagine produced a spike in the graph, however then it seemed to go along at a fairly constant rate, with small increases which Lars informed us were due to various stories in newspapers and so on. However, after a while, the graph suddenly increased exponentially – actually it looked like it was going almost straight up. This, we were told, was when Google added satellite images. Which, as I'm sure you'll agree, are damn cool. Now, a great many people have heard of and use Google Maps – both the maps and the satellite images. So, people like maps, and, moreover, people want to be able to do things with them. They want to be able to put them on their own websites and map walking routes on them, or track approaching hurricanes, or check out possible places to live. So they did.

Within days of its release, Google Maps had been reverse engineered. According to Lars, there were blogs out there describing how they did it better than their design documents did. Within weeks people had worked out how to get Google Maps on their own websites and manipulate them in all sorts of cool and interesting ways. Google were getting hundreds of emails asking “Is this ok?”, “Can I use your maps for X?” etc. However, Google licences the maps from data providers and so were not at liberty to give such permission. After about three months of renegotiating their contract with the data providers to allow such use, Google released the Google Maps API.

To wrap up the talk, Lars talked about where Google Maps would be heading in the future. Firstly, Google Maps is based here in Sydney, though they have teams working in numerous locations around the globe. The Sydney office is currently expanding a great deal – in fact, if anyone's interested, they're hiring in a big way at the moment. This should allow them to work on a number of improvements to the service in the future. The main goal at present is to make the geographical information more organised and more searchable. This is, after all, what Google is all about – making information accessible. Other map services may have neat features in their interfaces and so on, but what Google wants its map service to be distinguished by is how easy it is to find things. Currently, businesses can be located quite well for places where maps are available, as Google has done a great deal of data mining on the web to find addresses and other information about these businesses. However, places like parks, for instance, are currently very difficult to find, since parks don't usually have websites to mine data from. So this is one area they are looking at improving.

Another is bringing some of the nice features available in Google Earth to Google Maps, such as 3D flyovers (which, if you haven't seen them in Google Earth, are exceedingly cool). This is being helped along by current trends in browser development – in fact, browser developers are starting to come to Google and ask them what sorts of things they'd like a browser to be able to do in order to make things like Google Maps easier to create. There are also new standards for browsers being developed by W3C to better allow a browser to act as a platform for web-based applications. This will naturally have an impact on Google Maps.

Lastly, the audience were given a chance to ask questions. Here are some of the answers:

- Google maps for Australia will be coming out probably early next year
- There is a Google Earth client for Linux in the works: it's being done by a different team to Lars', so no real idea when it will be here, but it's coming.
- No comment as to whether or not Google are making an office suite: the answer was basically 'Not as far as I know', and, later on as we were all having food and drinks 'Are you from the press?'.

Links:

http://local.google.com The google maps service itself, as of last week integrated with Google's local search service
http://earth.google.com Where to get Google Earth, the downloadable version of Google Maps, complete with lots of features not available online (needs Windows)