Have you heard? Google Earth 5.0 is out and the information windows use webkit to render the description. This means you can insert javascript and iframe in your kml and it just work. We had to try it out. We added a new kml file to SeeYourHotel, showing the main site information windows.

Our site windows use Ajax for tabs and checking of availability for rooms, it also use an iframe to display a gadget from TripAdvisor. Now would it work. Yes, but not without some caveat.

The first thing that seems a bit strange is each description is it’s own HTML page. This makes sense, but it also force you to define all your common code in all the description tags, hopefully you just include the code. This could have been handled by global includes for the whole kml files, but it wouldn’t sit nicely with the kml standard. This also means your kml files could become pretty big even faster than before. Our solution to all this repetition and the size for now has been to use iframe. It is a bit slower, but the size of the kml to download stays small and our script includes are inside the iframe.

The cookies are not supported, so some of what we do for keeping track of dates of travel is not working. Someone at Google told us this was a security concern, maybe at a later date they will be supported. We haven’t done it yet, but we will do a session with some URL manipulation to keep track of the user preferences.

The last problem we encountered is the strange behavior of the post method. For all post we did from Google Earth, what we saw on the server was a get with no parameters. We changed our code to only use get, but this was acknowledged as a bug by Google. Normally it should be fixed soon and all the problems from not having post will vanish.

Our last concern is not technical but really about discover-ability, Ajax content is hard to get indexed. That’s the price you have to pay to make dynamic application. We will continue to enhance our kml and this is really an awesome addition by Google.