Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#221 - add cache support for map tiles #229

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

mikolaj-jalocha
Copy link
Member

I've added cachce support for map tiles.

  • I've been wondering if flushing map's cache should be possible from an API. I've decided not to implement that feature for now (maps don't change that often I guess,at least ones that we use). If you think differently, I can change it of course
  • in the Hive implementation you can see null passed in place of directory path. Documentation says that if we use Hive already in the project, there's no need to provide it again. I guess that's correct in our situation.
  • do you know any ways to change if caching actually works (some logging or sth)?

@mikolaj-jalocha mikolaj-jalocha added the enhancement New feature or request label Sep 25, 2024
@mikolaj-jalocha mikolaj-jalocha added this to the v1.0.0 milestone Sep 25, 2024
@mikolaj-jalocha mikolaj-jalocha self-assigned this Sep 25, 2024
@mikolaj-jalocha mikolaj-jalocha linked an issue Sep 25, 2024 that may be closed by this pull request
Copy link
Member

@simon-the-shark simon-the-shark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

  1. TTL of map cache is def enough
  2. yeah we use it indirectly with graphql package
  3. so just install app, enter it and then exit app, enter flight mode (no internet) and if map has still tiles on new offline enter then the caching works. -imo simpelst testing method

@@ -38,7 +39,13 @@ class MapWidget<T extends GoogleNavigable> extends ConsumerWidget {
TileLayer(
urlTemplate: OpenStreetMapConfig.tileUrl,
userAgentPackageName: OpenStreetMapConfig.userAgent,
tileProvider: CancellableNetworkTileProvider(),
tileProvider: CachedTileProvider(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

future note, on web we may want to use CancellableNetworkTileProvider instead of cached one - but only a future note

@simon-the-shark simon-the-shark merged commit bb1755d into main Sep 25, 2024
2 checks passed
@simon-the-shark simon-the-shark deleted the feat/#221-add-cache-support-for-map-tiles branch September 25, 2024 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Map tile's caching with hive
2 participants