Assembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
Remarks
The layer classes are a subset of MapItems that reference geographic data. A GeoRssLayer enables a GeoRSS feed to be added to the map and displayed by the ArcGIS Explorer application.
Many sources of changing information use RSS as a means of syndicating their content and making it available to subscribers in what is known as a 'feed'. In the same way that news aggregators or other RSS-aware applications can keep up with and check a feed for changes and react to the changes in an appropriate way, you can use ArcGIS Explorer to subscribe to a service that provides content that is geographically tagged with encodings in one of the supported GeoRSS formats. At present ArcGIS Explorer supports geometries from the following feed types and in the following formats:
GeoRSS supported feed types | GeoRSS supported formats |
---|---|
Atom 1.0, RSS 2.0 | W3C Geo, GeoRSS simple, GML |
GeoRSS supplies vector data as a set of features which have a common geometry type, for example a set of points that represent Earthquake epicenters. When a connected GeoRssLayer is added to the map, the related data is draped over the basemap (and any existing layers in the map). The layer must be in a connected state before data can be displayed. There are two ways to connect a layer to data:
1. Instantiate a GeoRssLayer and connect explicitly.
- Create a new GeoRssLayer, populate the URL property and call GeoRssLayer.Connect()
- A constructor is also provided to allow you to specify the URL when you instantiate a layer. If the properties specified are incorrect the GeoRSS layer will remain disconnected but no exception will be thrown; use the ConnectionStatus property to diagnose why a layer could not be connected.
2. Instantiate and connect with a single method call.
- Use the static Open method to both instantiate a GeoRssLayer and connect to its underlying data source with a single method call.
- If successful the Open method will return a connected GeoRssLayer object. In contrast to the Connect method, an exception will be thrown if the URL specified for the GeoRSS feed is incorrect. Therefore it is a good idea to wrap a call to the Open method with a try... catch block if you are unsure of the data source to which you are connecting.
- The connection information you specify will be stored in the GeoRssLayer.Url property.
If a GeoRssLayer is added to the map in an unconnected state, no data will be displayed. The layer will still appear in the ArcGIS Explorer contents window with an exclamation mark to indicate the layer is not connected.
Once connected, you can access data dependent properties such as the geographical extent of the layer. It is also possible to retrieve the underlying data for the GeoRssLayer using the Table property. The symbol used to represent the geometries is not usually stored alongside the GeoRSS features, but rather specified at the layer level. GeoRssLayer.Symbol allows you to specify the type of symbol used to represent the vector data on the map.
Examples
{ //Example 1 - Instantiate a GeoRssLayer and connect explicitly. //************************************************************** //Create a new GeoRssLayer and set up symbology GeoRssLayer rssLayer1 = new GeoRssLayer(new Uri("http://www.bioneural.net/tag/geotag/feed/"), Symbol.Marker.Flag.Checkered); //Set the layer name rssLayer1.Name = "GeoRSS 1"; //Try to connect the layer to the service bool connected = rssLayer1.Connect(); //Check to see whether the connection was successful if (connected) { //Add the layer to the map. ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(rssLayer1); } else { //Investigate connection issue. ConnectionStatus status = rssLayer1.ConnectionStatus; if (status.HasError) { System.Diagnostics.Debug.Print(status.ErrorString); } } //Example 2 - Instantiate and connect GeoRssLayer with a single method call. //************************************************************************** try { //Create a new GeoRssLayer GeoRssLayer rssLayer2 = GeoRssLayer.Open(new Uri("http://www.bioneural.net/tag/geotag/feed/")); //Set the layer name rssLayer2.Name = "GeoRss 2"; //Set the symbology rssLayer2.Symbol = Symbol.Marker.PointsOfInterest.Information; //Add the layer to the map ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(rssLayer2); } catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message); } }
'Example 1 - Instantiate a GeoRssLayer and connect explicitly. '************************************************************* 'Create a new GeoRssLayer and set up symbology Dim rssLayer1 As GeoRssLayer = New GeoRssLayer(New Uri("http://www.bioneural.net/tag/geotag/feed/"), Symbol.Marker.Flag.Checkered) 'Set the layer name rssLayer1.Name = "GeoRSS 1" 'Try to connect the layer to the service Dim connected As Boolean = rssLayer1.Connect() 'Check to see whether the connection was successful If (connected) Then 'Add the layer to the map. ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(rssLayer1) Else 'Investigate connection issue. Dim status As ConnectionStatus = rssLayer1.ConnectionStatus If status.HasError Then System.Diagnostics.Debug.Print(status.ErrorString) End If End If 'Example 2 - Instantiate and connect GeoRssLayer with a single method call. '************************************************************************** Try 'Create a new GeoRssLayer Dim rssLayer2 As GeoRssLayer = GeoRssLayer.Open(New Uri("http://www.bioneural.net/tag/geotag/feed/")) 'Set the layer name rssLayer2.Name = "GeoRss 2" 'Set the symbology rssLayer2.Symbol = Symbol.Marker.PointsOfInterest.Information 'Add the layer to the map ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(rssLayer2) Catch ex As Exception System.Diagnostics.Debug.Print(ex.Message) End Try
Inheritance Hierarchy
ESRI.ArcGISExplorer.Mapping..::.MapItem
ESRI.ArcGISExplorer.Mapping..::.Layer
ESRI.ArcGISExplorer.Mapping..::.GeoRssLayer