Hello,
It seems that somehow the AGSLayerViewState is set to 6.
We already handle active/notVisible/outOfScale/loading/error/warning (0 to 5).
I've checked the documentation https://developers.arcgis.com/ios/api-reference/_a_g_s_layer_view_state_8h.html#ae64e23b127ffb327986163f4b522cdfe and there are no other options.
Do you have any ideas what would that mean?
Thank you
We already handle active/notVisible/outOfScale/loading/error/warning (0 to 5)
Actually they are not 0 to 5, but 1, 2, 4, 8, 16 and 32 (1 << 0 to 1 << 5).
The raw values of AGSLayerViewState are NS_OPTIONS, or OptionSet, which allows multiple options/states to be returned at the same time.
Consider this snippet
let states: [AGSLayerViewStatus] = [.active, .notVisible, .outOfScale, .loading, .error, .warning] states.forEach { state in print(state.rawValue) } // 1, 2, 4, 8, 16, 32 print(AGSLayerViewStatus.notVisible.rawValue | AGSLayerViewStatus.outOfScale.rawValue) // 6
When there are multiple states involved, you'll see a combination of values.
Here is a related snippet that may help: https://github.com/Esri/arcgis-runtime-samples-ios/blob/main/arcgis-ios-sdk-samples/Maps/Display%20layer%20view%20state/LayerStatusViewController.swift#L72
Thanks for clarifying that. I've handled them as "switch:", hence the error.
I'll convert it to the example code.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.