View state report

You can subscribe to the plugin's events during runtime to see changes made to layers, elevation sources, the layer view, and the renderer view. These events will return a combined status with a bitwise mask and a message when there is an error. To subscribe to the event and log the state on the Output Log, you can add the following sample code in your C++ source code file together with the necessary header files:

Header files:

Use dark colors for code blocksCopy
     
1
2
3
4
5
#include "ArcGISMapsSDK/API/GameEngine/View/Event/ArcGISElevationSourceViewStateChangedEvent.h"
#include "ArcGISMapsSDK/API/GameEngine/View/Event/ArcGISLayerViewStateChangedEvent.h"
#include "ArcGISMapsSDK/API/GameEngine/View/Event/ArcGISRendererViewStateChangedEvent.h"
#include "ArcGISMapsSDK/API/GameEngine/View/State/ArcGISElevationSourceViewState.h"
#include "ArcGISMapsSDK/API/GameEngine/View/State/ArcGISLayerViewState.h"

Sample codes:

Use dark colors for code blocksCopy
                         
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
    // Adding callbacks to get state changes from view
    Esri::GameEngine::View::Event::ArcGISRendererViewStateChangedEvent arcGISRendererViewChanged =
        [](Esri::GameEngine::View::State::ArcGISRendererViewState& state) {
            UE_LOG(LogTemp, Warning, TEXT("ArcGISRendererView status changed : %d"), (int)state.GetStatus());
        };

    // Adding callbacks to get state changes from view of ArcGISLayer

    Esri::GameEngine::View::Event::ArcGISLayerViewStateChangedEvent arcGISLayerViewChanged =
        [](Esri::GameEngine::Layers::Base::ArcGISLayer& layer,
           Esri::GameEngine::View::State::ArcGISLayerViewState& state) {
            UE_LOG(LogTemp, Warning, TEXT("ArcGISLayer status changed : %s %d"), *layer.GetName(), (int)state.GetStatus());
        };

    // Adding callbacks to get state changes from view of ArcGISElevationSource

    Esri::GameEngine::View::Event::ArcGISElevationSourceViewStateChangedEvent arcGISElevationSourceViewChanged =
        [](Esri::GameEngine::Elevation::Base::ArcGISElevationSource& elevation,
           Esri::GameEngine::View::State::ArcGISElevationSourceViewState& state) {
            UE_LOG(LogTemp, Warning, TEXT("ArcGISElevationSource status changed : %s %d"), *elevation.GetName(), (int)state.GetStatus());
        };

    rendererView->SetArcGISRendererViewStateChanged(std::move(arcGISRendererViewChanged));
    rendererView->SetArcGISVisualLayerViewStateChanged(std::move(arcGISLayerViewChanged));
    rendererView->SetArcGISElevationSourceViewStateChanged(std::move(arcGISElevationSourceViewChanged));

If it's an error, you can call state.GetStatus() and obtain more information.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.