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#ae64e23b127ffb327986... and there are no other options.
Do you have any ideas what would that mean?
Thank you
Solved! Go to Solution.
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.
It seems that somehow the AGSLayerViewState is set to 6.
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%20l...
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.
It seems that somehow the AGSLayerViewState is set to 6.
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%20l...
Thanks for clarifying that. I've handled them as "switch:", hence the error.
I'll convert it to the example code.