I am trying to download multiple style packs for offline use by following the example in the Maps SDK for iOS documentation.
In the documentation example, the completion handler handles cancellation errors differently than all other types of errors, like so:
if case StylePackError.canceled = error {
handleCancelation()
} else {
handleFailure()
}
When I call loadStylePack()
multiple times simultaneously with the same styleURI
, the completion handler is called with a canceled
StylePackError
.
Is it safe to assume that a cancellation error will occur when attempting to download a styleURI
that is already being downloaded? I was unable to find documentation indicating under what conditions a cancellation error can occur.
In other words, should I call loadStylePack()
again if it's error type is canceled
, or can I assume the data is already loaded?
My question applies to both the iOS and Android SDKs.