NALayerClass Class

Product Availability

Extended Error Information

Use the ISupportErrorInfo method InterfaceSupportsErrorInfo to determine if the object supports extended error information. If the object supports extended error info, VC++ developers should use the OLE/COM IErrorInfo interface to access the ErrorInfo object. Visual Basic developers should use the global error object Err to retrieve this extended error information.

Remarks

NALayer is a composite layer that holds a reference to the NAContext and exposes the NAClasses within the NAContext as feature layers.

The NALayer behaves like any other composite layer within ArcGIS. Use ICompositeLayer and ICompositeLayer2 to access these properties.

It is possible to find an NALayer in ArcMap by enumerating through the layers in the table of contents and checking to see which ones implement the interface INALayer. You can also determine the NALayer currently selected in the network analyst window by asking the NAWindow for its ActiveAnalysis.

The entire NAContext, including the contents of the NAClasses, is persisted within the NALayer. If there are a lot of NALocationFeatures in the NAContext, the size of the NALayer saved in a map document and in a layer file could be large. The NATraversalResult is not persisted within the NALayer.

In ArcGIS for Server, starting a MapServer with multiple pooled objects that contain NALayers may cause some NALayers to not bind to their internal network dataset due to contention opening the network dataset. By default, the NALayer tries reconnecting to the network dataset for 60 seconds before returning a failure. If 60 seconds is not the appropriate amount of time for your server, create a registry key named "HKEY_LOCAL_MACHINE\Software\ESRI\ArcServer\NetworkAnalyst\OpenTimeout" of type DWORD with a decimal value between 0 and 600 that specifies the amount of time you want to try re-opening the network dataset before failing. A value of 600 means to keep trying to open the network analysis layer's network dataset for 10 minutes before failing. Setting it to 0 would indicate to fail immediately if it could not connect to the network dataset on its first attempt. This is only applicable to ArcGIS for Server MapServer objects containing NALayers.

[C#]

This C# example illustrates how you can get the active NALayer (as shown in the Network Analyst Window) programatically.