How to use cancellationToken in ImageTiledLayer.GetTileDataAsync(int level, int row, int column, CancellationToken cancellationToken)?

588
2
05-11-2021 01:01 AM
AntonSukhanov
New Contributor

I implemented a subclass of ImageTiledLayer.
if I check cancellationToken.IsCancellationRequested == true and throw OperationCanceledException or TaskCanceledException with loading operation cancel, the method GetTileDataAsync will never be called with same level, row and column parameters. I guess that wrong result is cached.

How is the right way to use cancellationToken?

0 Kudos
2 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

Can you share your code for your ImageTiledLayer subclass and the code that calls it?

Thanks 

0 Kudos
AntonSukhanov
New Contributor

Hi,

Thank you for your reply. My subclass has a lot of code which reading and some processing of geotiff files. I can make a simple project with this problem but only later, maybe after a couple of weeks

Thanks

0 Kudos