Integrating a GeoRSS Feed with Google Maps

by dbaldwin

This article will give a brief explanation of accessing a GeoRSS feed from your Foundation server and displaying a Google map on your website. This can prove valuable in situations where you want to publicize the location of mobile assets (e.g. campus bus, delivery van, pizza truck) on your own website. Since the Google Maps API has built-in support for both GeoRSS and KML this is a relatively simple task. Before we dig into the code let’s take a look at an example here. Be sure to view the source on the sample page. The most important part of this code consists of the following three lines:

var grss = new GGeoXml("http://demo.ublip.com/readings/public"); // Change to your server URL
map.addOverlay(grss);
grss.gotoDefaultViewport(map);

Be sure to apply for a Google map key that matches your server URL and change the reference in the GGeoXml constructor. That should be all there is to it.

While the GGeoXml object provides limited functionality, it’s a great starting place. We’ll be publishing a series of articles in the near future that demonstrate more advanced features. In the interim feel free to post any questions in the applications forum.