Click or drag to resize
CsvLayer Class
CsvLayer is used to load points contained in a CSV file hosted on the web.
Inheritance Hierarchy

Namespace: Esri.ArcGISRuntime.Layers
Assembly: Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 10.2.7.0 (10.2.7.1234)
Syntax
public sealed class CsvLayer : GraphicsLayer

The CsvLayer type exposes the following members.

Constructors
  NameDescription
Public methodCsvLayer
Initializes and instance of CsvLayer.
Public methodCsvLayer(Uri)
Creates a new instance of the CsvLayer class.
Top
Methods
  NameDescription
Public methodCheckAccess
Determines whether the calling thread has access to this DispatcherObject.
(Inherited from DispatcherObject.)
Public methodClearSelection
Unselects all graphics in the layer
(Inherited from GraphicsLayer.)
Public methodClearValue(DependencyProperty)
Clears the local value of a property. The property to be cleared is specified by a DependencyProperty identifier.
(Inherited from DependencyObject.)
Public methodClearValue(DependencyPropertyKey)
Clears the local value of a read-only property. The property to be cleared is specified by a DependencyPropertyKey.
(Inherited from DependencyObject.)
Public methodCoerceValue
Coerces the value of the specified dependency property. This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject.
(Inherited from DependencyObject.)
Public methodEquals
Determines whether a provided DependencyObject is equivalent to the current DependencyObject.
(Inherited from DependencyObject.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Gets a hash code for this DependencyObject.
(Inherited from DependencyObject.)
Public methodGetLocalValueEnumerator
Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject.
(Inherited from DependencyObject.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetValue
Returns the current effective value of a dependency property on this instance of a DependencyObject.
(Inherited from DependencyObject.)
Public methodHitTestAsync(ViewBase, Point)
Performs a Hit Test against the GraphicsLayer at the given screen point, relative to the upper left of the map.
(Inherited from GraphicsLayer.)
Public methodHitTestAsync(ViewBase, Point, Int32)
Performs a Hit Test against the GraphicsLayer at the given screen point, relative to the upper left of the map.
(Inherited from GraphicsLayer.)
Public methodHitTestAsync(ViewBase, Point, CancellationToken)
Performs a Hit Test against the GraphicsLayer at the given screen point, relative to the upper left of the map.
(Inherited from GraphicsLayer.)
Public methodHitTestAsync(ViewBase, Rect, Int32)
Performs a Hit Test against the GraphicsLayer at the given the intersecting rectangle relative to the upper left of the map.
(Inherited from GraphicsLayer.)
Public methodHitTestAsync(ViewBase, Point, Int32, CancellationToken)
Performs a Hit Test against the GraphicsLayer at the given screen point, relative to the upper left of the map.
(Inherited from GraphicsLayer.)
Public methodHitTestAsync(ViewBase, Rect, Int32, CancellationToken)
Performs a Hit Test against the GraphicsLayer at the given the intersecting rectangle relative to the upper left of the map.
(Inherited from GraphicsLayer.)
Public methodCode exampleInitializeAsync
Loads the metadata for this layer based on the current configuration.
(Inherited from Layer.)
Public methodInvalidateProperty
Re-evaluates the effective value for the specified dependency property
(Inherited from DependencyObject.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnGraphicItemsChanged
Called when graphics are added to or removed from the layer
(Inherited from GraphicsLayer.)
Protected methodOnInitializeGraphicsLayerRequestedAsync
Override this method to initialize any properties and settings prior to using the map.
(Overrides GraphicsLayerOnInitializeGraphicsLayerRequestedAsync.)
Protected methodOnPropertyChanged(DependencyPropertyChangedEventArgs)
Invoked whenever the effective value of any dependency property on this DependencyObject has been updated. The specific dependency property that changed is reported in the event data.
(Inherited from DependencyObject.)
Protected methodOnPropertyChanged(String)
Notifies listeners that a property value has changed.
(Inherited from Layer.)
Public methodReadLocalValue
Returns the local value of a dependency property, if it exists.
(Inherited from DependencyObject.)
Public methodSetCurrentValue
Sets the value of a dependency property without changing its value source.
(Inherited from DependencyObject.)
Protected methodSetLayerInitializationFailed
status must be failed - if not throw
(Inherited from Layer.)
Protected methodSetLayerStatus
Status cannot be failed or it will throw. To set Status to LayerStatus.Failed, call SetLayerInitializationFailed.
(Inherited from Layer.)
Public methodSetSourceAsync
Set stream is used to add graphics to the layer from a stream that contains CSV data.
Public methodSetValue(DependencyProperty, Object)
Sets the local value of a dependency property, specified by its dependency property identifier.
(Inherited from DependencyObject.)
Public methodSetValue(DependencyPropertyKey, Object)
Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property.
(Inherited from DependencyObject.)
Protected methodShouldSerializeProperty
Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property.
(Inherited from DependencyObject.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodVerifyAccess
Enforces that the calling thread has access to this DispatcherObject.
(Inherited from DispatcherObject.)
Top
Fields
  NameDescription
Public fieldStatic memberColumnDelimiterProperty
Identifies the ColumnDelimiter Dependency Property
Public fieldStatic memberServiceUriProperty
Identifies the ServiceUri dependency property.
Public fieldStatic memberSourceSpatialReferenceProperty
Identifies the SourceSpatialReference dependency property.
Public fieldStatic memberXFieldNameProperty
Identifies the XFieldName Dependency Property
Public fieldStatic memberYFieldNameProperty
Identifies the YFieldName Dependency Property
Top
Properties
  NameDescription
Public propertyColumnDelimiter
The column delimiter used to split the columns of the CSV file. The default value is comma.
Public propertyDefaultSpatialReference
Gets the default spatial reference.
(Inherited from Layer.)
Public propertyDependencyObjectType
Gets the DependencyObjectType that wraps the CLR type of this instance. 
(Inherited from DependencyObject.)
Public propertyDispatcher
Gets the Dispatcher this DispatcherObject is associated with.
(Inherited from DispatcherObject.)
Public propertyDisplayName
Gets or sets the display name.
(Inherited from Layer.)
Public propertyFullExtent
Gets the full extent of the layer in it's default spatial reference.
(Inherited from Layer.)
Public propertyGraphics
Gets or sets the graphics collection.
(Inherited from GraphicsLayer.)
Public propertyGraphicsSource
Gets or sets a collection used to contain the graphics of the GraphicsLayer.
(Inherited from GraphicsLayer.)
Public propertyID
Gets or sets an ID associated with this layer.
(Inherited from Layer.)
Public propertyInitializationException
Gets the initialization exception.
(Inherited from Layer.)
Public propertyIsSealed
Gets a value that indicates whether this instance is currently sealed (read-only).
(Inherited from DependencyObject.)
Public propertyIsVisible
Gets or sets the layer visibility.
(Inherited from Layer.)
Public propertyCode exampleLabeling
Gets or sets the LabelProperties which is used to enable labeling of a GraphicsLayer.
(Inherited from GraphicsLayer.)
Public propertyMaxScale
Gets or sets the maximum scale to display this layer at. A small number allows the map to display the layer when zooming further in.
(Inherited from Layer.)
Public propertyMinScale
Gets or sets the minimum scale to render this layer at. A large number allows the map to display the layer when zooming further out.
(Inherited from Layer.)
Public propertyOpacity
Gets or sets the opacity.
(Inherited from Layer.)
Public propertyRenderer
Gets or sets the renderer used for generating symbols.
(Inherited from GraphicsLayer.)
Public propertyCode exampleRenderingMode
Gets or sets a value indicating which rendering mode to use.
(Inherited from GraphicsLayer.)
Public propertySceneProperties
Gets or sets the scene properties.
(Inherited from GraphicsLayer.)
Public propertySelectedGraphics
Gets the selected graphics.
(Inherited from GraphicsLayer.)
Public propertySelectionColor
Gets or sets the color for selected graphics.
(Inherited from GraphicsLayer.)
Public propertyCode exampleServiceUri
ServiceUri is the location to the CSV file.
Public propertyShowLegend
Gets or sets a value indicating whether this layer should show in a legend
(Inherited from Layer.)
Public propertySourceFields
The fields that will be added as attribute of the graphic. The FieldName should match the header name contained inside the CSV file. The FieldType will be used to convert column into that specific data type. If FieldSource is empty or null then all fields will be returned as attributes. If FieldType is not provided field type will default to string.
Public propertySourceSpatialReference
The spatial reference of the CSV data.
Public propertyStatus
The Layer's Status, indicating whether it is being/has been initialized, or initialization failed.
(Inherited from Layer.)
Public propertyXFieldName
The name of the column header in the CSV file that contains the data used for the X coordinate.
Public propertyYFieldName
The name of the column header in the CSV file that contains the data used for the Y coordinate.
Top
Events
  NameDescription
Public eventLegendChanged
Occurs when the legend of the layer changed.
(Inherited from GraphicsLayer.)
Public eventPropertyChanged
Occurs when a property value changes.
(Inherited from Layer.)
Top
Examples

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

Code example using the CSVLayer Class via XAML.

XAML
<Window x:Class="CSVLayerXaml.MainWindow"
        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"
        Height="600" Width="800">

    <Grid x:Name="LayoutRoot">

        <Grid.Resources>

            <!-- Create a set of custom SimpleMarkerSymbol objects to denote the magnitude of 
            the earthquake being represented. -->
            <esri:SimpleMarkerSymbol x:Key="mag2to3" Color="#FF0A57FC" Size="12" Style="X" />
            <esri:SimpleMarkerSymbol x:Key="mag3to4" Color="#FF1CA2A3" Size="14" Style="X"/>
            <esri:SimpleMarkerSymbol x:Key="mag4to5" Color="#FF60AD12" Size="16" Style="Diamond" />
            <esri:SimpleMarkerSymbol x:Key="mag5to6" Color="#FFFFFE0A" Size="18" Style="Diamond" />
            <esri:SimpleMarkerSymbol x:Key="mag6to7" Color="#FFFDA208" Size="20" Style="Triangle" />
            <esri:SimpleMarkerSymbol x:Key="mag7to8" Color="#FFFB5107" Size="22" Style="Triangle" />

            <!-- Create a ClassBreaksRenderer that will consume the custom SimpleMarkerSymbol objects
            just defined. The Field property is set that matches the field header in the dataset being 
            served by the web service. -->
            <esri:ClassBreaksRenderer x:Key="MyClassBreaksRenderer" Field="Magnitude" >
                <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>

        <!-- Add a MapView Control and turn on the ability to have the layers scroll within the control (i.e WrapAround=True). -->
        <esri:MapView x:Name="MapView1" WrapAround="True" >

            <!-- Add a Map. -->
            <esri:Map x:Name="MyMap">

                <!-- Add a backdrop ArcGISTiledMapServiceLayer. -->
                <esri:ArcGISTiledMapServiceLayer ID="WorldTopoMap" 
                    ServiceUri="http://services.arcgisonline.com/arcgis/rest/services/world_topo_map/MapServer" />

                <!-- Add a CSVLayer. The XFieldName and YFieldName are specified for the spatial location coordinate 
                field headers that match the dataset provided by the ServiceUri. A custom ClassBreaksRenderer is 
                applied based the settings earlier in the XAML file in the Grid.Resoruces section. -->
                <esri:CsvLayer XFieldName="Lon" YFieldName="Lat" Renderer="{StaticResource MyClassBreaksRenderer}"
                    ServiceUri="http://earthquake.usgs.gov/earthquakes/catalogs/eqs7day-M2.5.txt" >
                </esri:CsvLayer>
            </esri:Map>
        </esri:MapView>

    </Grid>
</Window>

SPECIAL NOTE: The XAML displayed above comes from a C# project. If you are a VB.NET developer, you will need to modify the text for the x:Class namespace from "CSVLayerXaml.MainWindow" to be just "MainWindow".

See Also
Supported Platforms
This type is supported on the following ArcGIS Runtime .NET SDK platforms:
Windows Desktop
Windows Phone
Windows Store
Additional Examples
Hyperlink to ExampleDescription
CSVLayerXamlDemonstrates defining a CsvLayer in XAML and setting the serviceUri property to a text file hosted online by the United States Geological Survey (USGS).
GraphicsLayerWindowDemonstrates various Graphics and GraphicsLayer related actions.
MapView_DragDropEventsDemonstrates creating a CsvLayer by performing a Drag-and-Drop from a file on the local disk in File Explorer to the MapView.