This document is archived and information here might be outdated.  Recommended version.


INALayer2 Interface (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (NetworkAnalyst)  

INALayer2 Interface

Provides access to the network analysis layer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Network Analyst Extension.

Members

Description
Method Add Add a new layer.
Method AttachContext Sets the NALayer to reference the NAContext and the sublayers to reference the NAClasses of the NAContext.
Method Clear Clear all analysis layers.
Read/write property Context The network analysis context.
Method CopyContext Returns a copy of the NAContext referenced by the NALayer.
Read-only property DataLayerByNAClassName The network analysis layer or standalone table by class name.
Method Delete Delete an existing layer.
Read/write property Expanded Indicates if the network analysis layer is expanded or collapsed in the TOC of the map.
Read-only property LayerByNAClassName The network analysis layer by class name.

Inherited Interfaces

Interfaces Description
INALayer Provides access to the network analysis layer.

CoClasses that implement INALayer2

CoClasses and Classes Description
NALayer The layer for defining, solving, and viewing network analysis results.

Remarks

The INALayer2 interface is used to access the NAContext, access individual sublayers by specifying the name of the NAClass, manage the sublayers within the NALayer, as well as manage the state of an NALayer's context within the server environment.

CopyContext makes a copy of the NALayer's NAContext that can be persisted within a user's session state.  AttachContext re-attaches an NAContext to the NALayer.

CopyContext, AttachContext, and DataLayerByNAClassName should not be used from within ArcMap because user interface components listening to events on the NAContext will not have an opportunity to switch to the new NAContext.

.NET Snippets

Get Active Analysis Layer | Statements - Get Active Analysis Layer