This status is used to determine whether a layer is displaying in a in a MapView or SceneView or whether it is still loading, not visible, out of scale, or has encountered an error or warning. Each layer can have multiple states at the same time. For example, a layer could be both Enums.LayerViewStatusNotVisible and Enums.LayerViewStatusOutOfScale, or it could be Enums.LayerViewStatusNotVisible and Enums.LayerViewStatusLoading. These multiple states are represented using a flag enumeration.
A status of Enums.LayerViewStatusActive indicates that the layer is being displayed in the view. Note, that some of the layer view states are not possible together. For example, a layer cannot be both Enums.LayerViewStatusActive and Enums.LayerViewStatusNotVisible at the same time.
If you implement a layer list in a table of contents (TOCs), you can use the layer view status to manage the TOC user interface. For example, you could gray out the layer if it is Enums.LayerViewStatusOutOfScale, or you could show a spinning icon if the layer is Enums.LayerViewStatusLoading. If the layer list contains a GroupLayer that is Enums.LayerViewStatusNotVisible, then its child layers will be Enums.LayerViewStatusNotVisible. If the GroupLayer is visible then each child layer can be either visible or Enums.LayerViewStatusNotVisible.
If the layer completely fails to load or render, you will encounter a Enums.LayerViewStatusError. If the layer fails to render some of its content, then you will encounter a Enums.LayerViewStatusWarning. This could be due to the temporary loss of a network connection, failing layer requests or exceeding the max feature count. In both cases you will find more details about the problem in the LayerViewState::loadError.
The LayerViewStatus can be one of:
The LayerViewState::loadError property will provide more details about the specific problem which was encountered. Depending on the type of problem, you could: - call Layer::retryLoad - remove the layer from the Map or Scene - inspect the data.
A warning status indicates that the layer has encountered a problem but may still be usable. For example, some tiles or features may be failing to load due to network failure or server error.
Be aware that when a Enums.LayerViewStatusWarning is received, the layer may not be showing all data or it may be showing data which is not up-to-date.
The LayerViewState::loadError property will provide more details about the specific problem which was encountered. Depending on the type of problem, you could: - check your network connection - check whether an online service is experiencing problems.