Skip To Content ArcGIS for Developers Sign In Dashboard

GeoRSS Layer

Download Samples Repository

Description

Creates a GeoRssLayer based on the United States Geological Survey earthquake feed and assigned a SimpleRenderer.

"Desktop" "Store" "Phone" Available for Desktop, Store, Phone

Sample Code

<UserControl x:Class="ArcGISRuntime.Samples.Desktop.GeoRssLayerSample"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
        Tag="GeoRSSLayerWindow">
    <Grid>
        <Grid.Resources>
            <esri:SimpleRenderer x:Key="TriangleRenderer">
                <esri:SimpleMarkerSymbol Color="#FF0A57FC" Size="12" Style="Triangle" />
            </esri:SimpleRenderer>
        </Grid.Resources>
        <esri:MapView WrapAround="True">
            <esri:Map>
                <esri:ArcGISTiledMapServiceLayer
                    ServiceUri="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" />

                <esri:GeoRssLayer x:Name="rssLayer"
                    ServiceUri="http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_week.atom" 
                    Renderer="{StaticResource TriangleRenderer}" />
            </esri:Map>
        </esri:MapView>

		<Border Background="White" BorderBrush="Black" BorderThickness="1"
			HorizontalAlignment="Right" VerticalAlignment="Top"
			Margin="30" Padding="20">
			<Border.Effect>
				<DropShadowEffect/>
			</Border.Effect>
            <Button Content="Update GeoRSS Layer" Click="OnLayerUpdateButtonClick"/>
        </Border>
    </Grid>
</UserControl>
using System;
using System.Windows;
using System.Windows.Controls;

namespace ArcGISRuntime.Samples.Desktop
{
    /// <summary>
    /// Creates a GeoRssLayer based on the United States Geological Survey earthquake feed and assigned a SimpleRenderer.
    /// </summary>
    /// <title>GeoRSS Layer</title>
	/// <category>Layers</category>
	/// <subcategory>Graphics Layers</subcategory>
	public partial class GeoRssLayerSample : UserControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="GeoRssLayerSample"/> class.
        /// </summary>
        public GeoRssLayerSample()
        {
            InitializeComponent();
        }

        private async void OnLayerUpdateButtonClick(object sender, RoutedEventArgs e)
        {
            try
            {
                await rssLayer.UpdateAsync();
                MessageBox.Show("Layer updated successfully", "GeoRSS Layer Sample");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "GeoRSS Layer Sample");
            }
        }
    }
}
Feedback on this topic?