CSV Layer

Download Samples Repository

Description

Demonstrates defining a CsvLayer in XAML and setting the serviceUri property to a .csv file hosted online by the United States Geological Survey (USGS).

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

Sample Code

<UserControl x:Class="ArcGISRuntime.Samples.Desktop.CsvLayerSample"
             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">
    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <esri:SimpleMarkerSymbol x:Key="mag2to3" Color="#FF0A57FC" Size="12" Style="Triangle" />
            <esri:SimpleMarkerSymbol x:Key="mag3to4" Color="#FF1CA2A3" Size="12" Style="Triangle" />
            <esri:SimpleMarkerSymbol x:Key="mag4to5" Color="#FF60AD12" Size="12" Style="Triangle" />
            <esri:SimpleMarkerSymbol x:Key="mag5to6" Color="#FFFFFE0A" Size="12" Style="Triangle" />
            <esri:SimpleMarkerSymbol x:Key="mag6to7" Color="#FFFDA208" Size="12" Style="Triangle" />
            <esri:SimpleMarkerSymbol x:Key="mag7to8" Color="#FFFB5107" Size="12" Style="Triangle" />
            <esri:ClassBreaksRenderer x:Key="classBreaksRenderer1" Field="mag" >
                <esri:ClassBreaksRenderer.Infos>
                    <esri:ClassBreakInfo Minimum="2" Maximum="3" Symbol="{StaticResource mag2to3}" />
                    <esri:ClassBreakInfo Minimum="3" Maximum="4" Symbol="{StaticResource mag3to4}" />
                    <esri:ClassBreakInfo Minimum="4" Maximum="5" Symbol="{StaticResource mag4to5}" />
                    <esri:ClassBreakInfo Minimum="5" Maximum="6" Symbol="{StaticResource mag5to6}" />
                    <esri:ClassBreakInfo Minimum="6" Maximum="7" Symbol="{StaticResource mag6to7}" />
                    <esri:ClassBreakInfo Minimum="7" Maximum="8" Symbol="{StaticResource mag7to8}" />
                </esri:ClassBreaksRenderer.Infos>
            </esri:ClassBreaksRenderer>
        </Grid.Resources>
        
        <esri:MapView WrapAround="True">
            <esri:Map>
                <esri:ArcGISTiledMapServiceLayer 
                    ServiceUri="http://services.arcgisonline.com/arcgis/rest/services/world_topo_map/MapServer" />
                
                <esri:CsvLayer 
                    ServiceUri="http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.csv" 
                    XFieldName="longitude" YFieldName="latitude"
                    Renderer="{StaticResource classBreaksRenderer1}">
                </esri:CsvLayer>
            </esri:Map>
        </esri:MapView>
    </Grid>
</UserControl>
using System.Windows.Controls;

namespace ArcGISRuntime.Samples.Desktop
{
    /// <summary>
    /// Demonstrates defining a CsvLayer in XAML and setting the serviceUri property to a .csv file hosted online by the United States Geological Survey (USGS).
    /// </summary>
    /// <title>CSV Layer</title>
	/// <category>Layers</category>
	/// <subcategory>Graphics Layers</subcategory>
	public partial class CsvLayerSample : UserControl
    {
        /// <summary>Initializes a new instance of the <see cref="CsvLayerSample"/> class.</summary>
        public CsvLayerSample()
        {
            InitializeComponent();
        }
    }
}
Feedback on this topic?