josxha / flutter_map_plugins

The source code for all sorts of flutter_map plugins.
https://pub.dev/publishers/joscha-eckert.de/packages
29 stars 21 forks source link

Exception caught by image resource service #3

Closed ricardobarrospereira closed 1 year ago

ricardobarrospereira commented 1 year ago

Hi! I'm new to Flutter so I am probably missing something, but I am trying to use FileSystem cache exactly as it is showing on this example, and it is showing a lot of the exceptions below every time the map loads:

════════ Exception caught by image resource service ════════════════════════════ DioException [request cancelled]: The request was cancelled.

It doesn't show any other detail, only those lines repeating multiple times. This is happening both with File System and In Memory cache, for Android and iOS simulators.

What could be the cause of this? Thanks!

MaxiStefan commented 1 year ago

Hi, i've also just started using this caching plugin and I am using the hive storage. Also ran into this exception

josxha commented 1 year ago

Hi @ricardobarrospereira and @MaxiStefan. Thanks for the issue and sorry for my late response. I've had lots of things to do the last week.

Quick answer:

You can just ignore those exceptions in the console. The plugin still works as intended and I'm going to remove those console logs in the next version.

Longer answer:

flutter_map version 6 introduced an awesome new feature to cancel tile requests that aren't needed any more before they finished. This saves bandwidth, supports faster map loading times on the web and decreases costs on map providers.

Tile requests are cancelled for example if you zoom in or out quickly and "skip" some zoom levels. The tiles from the between zoom level will get cancelled. And end up in a thrown exception that doesn't get caught internally. This is no problem and everything should work fine but I agree that it's confusing to users. I will release an update as soon as I find the time. For now you can just ignore it.

I hope that helps and sorry for this. (:

josxha commented 1 year ago

I published version 1.3.1 to pub.dev that removes those exceptions from the console. 👍

maotou316 commented 1 year ago

I am using version 1.3.1, but the issue still persists.

DioException (DioException [request cancelled]: The request was cancelled.)

image

josxha commented 1 year ago

@maotou316 Thanks for the comment. I created https://github.com/josxha/flutter_map_cache/issues/5, since the problem you are mentioning has actually a different cause and is vs code specific. It's a bug in the vs code debugger and can be ignored.