You can subscribe to events raised at runtime by the plugin to be notified of changes in status of the layers, elevation sources, the layer view, and the renderer view. These events can help you determine when there is a problem with your GIS scene.
To subscribe to the event and print layer view status messages to the Console:
You can attach the ArcGIS View State Logging to the ArcGISMap by taking the following steps.
- Click the ArcGISMap in the Hierarchy window.
- In the Inspector window, click the Add Component button.
- Search for ArcGIS View State Logging and select it to attach the component.
For more information about the Console window, refer to the Unity's documentation: Console Window.
You can attach the ArcGIS View State Logging to the ArcGIS Map game object by taking the following steps.
- Click the ArcGIS Map game object in the Hierarchy window.
- In the Inspector window, click the Add Component button.
- Search for ArcGIS View State Logging and select it to attach the component.
Use the ArcGISElevation
, ArcGISLayer
, and ArcGISView
to subscribe to changes in the state of elevation sources, layers, and the view. The view state events will return the current state of the content in the view through ArcGISElevation
, ArcGISLayer
, and ArcGISView
objects. The view state objects contain combined status with a bitwise mask to indicate, for example, that a specific layer may be visible and have a warning. If the status is an error or a warning, you can call get
and obtain more information.
You can find the sample code to subscribe to the event and log the state to the Console in the ArcGISViewStateLoggingComponent.cs file. The sample script file is in:
Assets/Samples/ArcGIS Maps SDK for Unity/[version]/Sample Content/Components
If you don't have the folder in your project, import sample assets.