ArcGIS Runtime SDK for WPF - Library Reference
HydrographicS57Layer Class
Members  Example  See Also 
ESRI.ArcGIS.Client.AdvancedSymbology Namespace : HydrographicS57Layer Class

A layer that reads S-57 files and displays them following the S-52 specification.

Object Model

HydrographicS57Layer ClassEnvelope ClassSpatialReference ClassTimeExtent Class

Syntax

Visual Basic (Declaration) 
Public Class HydrographicS57Layer 
   Inherits ESRI.ArcGIS.Client.Layer
C# 
public class HydrographicS57Layer : ESRI.ArcGIS.Client.Layer 

Remarks

An HydrographicS57Layer is a layer that comprises one or more S-57 files (*.000) conforming to the International Hydrographic Organization (IHO) Transfer Standard for Digital Hydrographic Data, and displayed following the S-52 Specifications for Chart Content and Display Aspects of ECDIS.

S-57 files are added and removed from an HydrographicS57Layer using the Cells property which comprises an ObservableCollection of S-57 files. To add a cell you create a new instance of a S57Cell and set the S57Cell.Path property (or use the S57Cell.S57Cell Constructor(String) overloaded constructor). Then call the Add or Remove methods on the Cells collection, passing in the Cell to be added/removed. Before adding the first Cell it is recommended that an event handler be defined for the CellLoaded event. The CellLoaded event always occurs regardless of whether the Cell loaded successfully. To confirm the status of the Cell you should check the S57Cell.Status property. If an error was encountered during the Cell loading, the HydrographicS57Layer.S57CellLoadedEventArgs.Error can be checked for additional information and you should call the Remove method on the Cells collection to remove the affected Cell.

Example

The following example shows how to add Cells to a HydrographicS57Layer and respond to the CellLoaded event.
C#Copy Code
/*
 * Add using statements:
 * using ESRI.ArcGIS.Client.AdvancedSymbology;
 * using ESRI.ArcGIS.Client;
 */
 
// Create a new S-57 layer instance
HydrographicS57Layer hydrographicS57Layer = new HydrographicS57Layer();
             
// Register an inline event handler for the CellLoaded event. You can also use named event handlers if required.
hydrographicS57Layer.CellLoaded += (s, s57CellLoadedEventArgs) =>
{
    if (s57CellLoadedEventArgs.Cell.Status == S57CellStatus.Loaded)
    {
        // Cell properties will be populated with values
        // e.g. _map.ZoomTo(s57CellLoadedEventArgs.Cell.Extent);
    }
    else if (s57CellLoadedEventArgs.Cell.Status == S57CellStatus.Error)
    {
        MessageBox.Show("Error: " + s57CellLoadedEventArgs.Error.Message);
        hydrographicS57Layer.Cells.Remove(s57CellLoadedEventArgs.Cell);
    }
};
             
// Register Inline event handler for the Layer Initialized event.
hydrographicS57Layer.Initialized += (s, eventArgs) =>
{
    S57Cell cell = new S57Cell("{Path to .000 file}");
    hydrographicS57Layer.Cells.Add(cell);
};
             
// Add the new s-57 layer to the map (will raise the Layer.Initialized event above).
_map.Layers.Add(hydrographicS57Layer);
VB.NETCopy Code
'
' * Add using statements:
' * Imports ESRI.ArcGIS.Client.AdvancedSymbology
' * Imports ESRI.ArcGIS.Client
'             
' Create a new S-57 layer instance
Dim hydrographicS57Layer As New HydrographicS57Layer()
             
' Inline event handler for the CellLoaded event. You can also use named event handlers if required.
AddHandler hydrographicS57Layer.CellLoaded, _
    Sub(s, s57CellLoadedEventArgs)
        If s57CellLoadedEventArgs.Cell.Status = S57CellStatus.Loaded Then
            ' Cell properties will be populated with values
            ' e.g. _map.ZoomTo(s57CellLoadedEventArgs.Cell.Extent)
        ElseIf s57CellLoadedEventArgs.Cell.Status = S57CellStatus.[Error] Then
            MessageBox.Show(Convert.ToString(s57CellLoadedEventArgs.[Error].Message))
            hydrographicS57Layer.Cells.Remove(s57CellLoadedEventArgs.Cell)
        End If
    End Sub
            
' Inline event handler for the Layer Initialized event.
AddHandler hydrographicS57Layer.Initialized, _
    Sub(s, eventArgs)
        Dim cell As New S57Cell("{Path to .000 file}")
        hydrographicS57Layer.Cells.Add(cell)
    End Sub
            
' Add the new s-57 layer to the map (will raise the Layer.Initialized event above).
_map.Layers.Add(hydrographicS57Layer)

Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         ESRI.ArcGIS.Client.Layer
            ESRI.ArcGIS.Client.AdvancedSymbology.HydrographicS57Layer

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8

See Also

© ESRI, Inc. All Rights Reserved.