Friday, November 23, 2007

GeoRSS Support

AWX has GeoRSS support. So given for example the following feed (on my local machine I can access it as http://ccccmac/~mansour/geofeed.xml):

<?xml version="1.0"?>
<rss xmlns:georss="" version="2.0">
  <title>GeoRSS-Simple Example</title>
  <description>Example GeoRSS-Simple Feed</description>
   <title>GeoRSS-Simple Polygon</title>
   <description>A polygon describes an arbitrary geographic shape. The 
  format is a series of ordered latitude, longitude pairs. The last pair 
  must be the same as the first pair, closing the polygon.</description>
   <author>georss supporter</author>
   <pubDate>Mon, 09 Jul 2007 10:49:00 PDT</pubDate>
  45.256 -110.45 46.46 -109.48 43.84 -109.86 45.256 -110.45

You can create a GeoRSS layer as follows:

<?xml version="1.0" encoding="utf-8"?>
   private function onChildAdd( event : ChildExistenceChangedEvent ) : void
    var overlayObject : OverlayObject = event.relatedObject as OverlayObject;
    overlayObject.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0.0, true);
   private function onMouseDown( event : MouseEvent ) : void
    var overlayObject : OverlayObject = as OverlayObject;
    navigateToURL( new URLRequest(, "_blank");
   private function onFeedLoad() : void
    map.extent = geoRSSLayer.extent.createBuffer(0.2);
 <awx:Map id="map" createDefaultLayers="false">
    <awx:PolygonStyle color="0xFFFF00" outlineColor="0x000000" outlineThickness="2"/>    

In this example, I'm setting the GeoRSSLayer feed URL, and I have the option to set the style of the polygon, in this case a yellow filling with a 2 pixel wide black outline. On each added overlay, I'm adding a mouse down event listener, such that when I click on the overlay, I navigate to the associated URL. When the feed is fully loaded, I'm setting the map extent to the layer extent plus a 2 percent buffer.

Remember, if you want to access a remote GeoRSS feed, make sure that it has a crossdomain.xml file or you can always use a proxy server.

1 comment:

cp said...

Any tips on using a proxyserver?