0

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.

1 Answers1

0

Yes, I think it's safe to assume that. I also encountered this behaviour. Same behaviour is also when loading a tile region for offline use and this is included in the documentation:

If there is already a pending loading operation for the tile region with the given id, the pending loading operation will fail with an error of Canceled type.

Please check loadTileRegion(forId:loadOptions:progress:completion:) method from TileStore.

I can only assume that it's the same handling based on the above mentioned.

I'm using iOS SDK 10.10.0, not sure about Android or other iOS SDK versions.

Vlad Preda
  • 26
  • 1
  • 4