Ontario Parks in KML

One of the things mentioned briefly in the book is the KML data format.

I really like KML. It’s an XML standard for representing groups of markers, contents of info bubbles, and geometric paths. It’s intriguing, because it’s all the data of a mashup without the mashup itself: You simply prepare the KML file, enter its URL into Google Maps, and the points are plotted for you. What could be easier?

It’s true, there’s no Ajax, and there are no fancy rollovers. In some cases, it’s important to have an on-site presentation, where the entire UI is under control. But that isn’t always the case—if your mashup is just a handful of points being plotted, it might be worth exposing that data as KML. This frees your visitors to view it in Google Maps or Google Earth, at their leisure, and it puts it in a common format for any future mashing.

As an example, I’ve put together a KML file of Ontario Parks. You can view this on Google Maps, or on Google Earth.

Ontario Parks KML on Google Earth    Ontario Parks KML on Google Maps

The data looks terrific in Google Earth, but unfortunately the Maps implementation is severely limited. In order to keep loading times under control, Maps truncates your KML before sending it to the user, apparently at about 10k. (Compare the link above with this one, which skips the descriptions, reducing file size from 340k down to about 12k, and results in almost the whole file being plotted.)

Hopefully, the Maps team will continue to expand Google Maps’ KML functionality. Any number of tricks could be used to bump up the total number of plottable markers, the most obvious of which would be to send them into chunks, and then not send infoWindow contents until the particular marker is actually clicked on.

Tomorrow I’ll post up the tutorial explaining how I generated this KML from the original Ontario Parks mashup.

Update: The tutorial is here.

One Response to “Ontario Parks in KML”  

  1. 1 A. Sagarwala

    Thank you thank you thank you!! You application is awesome compared to what Ontario Parks has going. KML is rediculously good for this type of application. The internet needs more geeks like you!

Buy Our Books!

(Here's Why) PHP book Rails book DOM book mashups book