flutter_map_tile_caching
flutter_map_tile_caching copied to clipboard
[FEATURE] Prevent duplication of tiles between stores
What do you want implemented?
The ability to delete a downloaded region, either BaseRegion or DownloadableRegion, by name, and delete any of its contained tiles, assuming they do not also belong to another region.
- A region can be downloaded with a name
- A tile has multiple owning region names, plus a special region that signifies the tile has been browse cached
- Deleting a region by name will remove it's name from all it's tiles
- A tile with no owning regions (and one that is not browse cached) will be deleted
What other alternatives are available?
At the moment, users can use multiple Stores to achieve similar functionality. However, this means that tiles can be duplicated between regions, which is not ideal.
Can you provide any other information?
This is a formalised request for https://github.com/JaffaKetchup/flutter_map_tile_caching/issues/24.
Platforms Affected
Android, iOS, Windows, MacOS, Linux
Severity
Annoying: Currently have to use workarounds
Requirements
- [X] I agree to follow this project's Code of Conduct
- [X] I am using the latest stable version of this package
- [X] I have checked for similar feature requests which may be duplicates
@GaelleJoubert Unfortunatley, I've decided that this will not be part of the v7 update. I'm under some time pressure to get it published and I don't want to introduce potentially unstable features. I've tried an initial implementation, and whilst it works, it's less than perfect.
This will be delayed to v7.1.
Nice :) No rush 7.1 will be fine ! Thanks for the work !
Hi @JaffaKetchup ,
Really awesome work. May I know any possible timeline nearby that we could have these feature ?
- A region can be downloaded with a name
- Deleting a region by name will remove it's name from all it's tiles
Regards, Jack
Hi @ZeroToHero-StepByStep, Unfortunately, I am extremely busy at the moment. When I have spare time, my efforts must first be concentrated on bug fixes and other improvements to existing functionality. Therefore, there is no fixed ETA. But, it won't be within the next few weeks, and it could be as much as 4-5 months. Apologies for this!
Hi @JaffaKetchup ,
Thanks for that. Totally understand and no rush.
May I have a silly question, I know this plugin is for flutter_map specifically, but is it possible to use this plugin in (https://pub.dev/packages/syncfusion_flutter_maps) cause we may need some sophisticated labels that flutter_map may not support. https://github.com/fleaflet/flutter_map/discussions/1087
TileLayer(
urlTemplate: urlTemplate,
tileProvider: provider.currentStore != null
? FMTC.instance(provider.currentStore!).getTileProvider(
FMTCTileProviderSettings(
behavior: CacheBehavior.values
.byName(metadata.data!['behaviour']!),
cachedValidDuration: int.parse(
metadata.data!['validDuration']!,
) ==
0
? Duration.zero
: Duration(
days: int.parse(
metadata.data!['validDuration']!,
),
),
maxStoreLength: int.parse(
metadata.data!['maxLength']!,
),
),
)
: NetworkNoRetryTileProvider(),
maxZoom: 22,
cause if all downloaded maps/tiles conform to /z/x/y format, using other map libraries may do as well?
If I would like to integrate this plugin with syncfusion_flutter_maps, how difficult it could be and what do you think(doable)?
Regards, Jack
Hi @ZeroToHero-StepByStep,
Just to note, FM does now support labels in Polygons, with two different centering algorithms, and ability to counter rotate to the map.
If you still need to use an alternative mapping library, you'll need to implement your own tile provider equivalent, based on the one from FMTC - I'm not sure how it works elsewhere, but I'd imagine it would be similar. Then, if you link that up to FMTC's custom image provider (bypassing a few "import from 'src/'" lints along the way), it should function correctly. However, I cannot offer support with this.
Also, please note that FMTC is licensed under GPL-v3. If you're building a proprietary application, this affects your rights to distribution. For more information, see the docs landing page.
Hope this helps :)
Unfortunately I've decided that this feature will not be implemented at all in the foreseeable future. This is because there are essentially two/three possible implementations, and they are all either:
-
Not performant One possible implementation relies on keep track of what tiles are owned by what stores (many to many relationship). This requires at least one read and one write per tile save/update. A draft implementation caused noticeable and unacceptable stutter.
-
To convoluted to implement and maintain An alternative implementation relies on tiles referring their bytes (the largest part of the tile object) to the same tile URL in another store. So there may be more than one tile object per URL, but the idea is that only one contains the bytes. Handling what happens when a store that a tile refers to is renamed/deleted is very difficult, and wouldn't be clear to the developer or end-user.
Perhaps I can think of an alternative, but I'm putting this on indefinite hold for now. Apologies.
This should be part of v9 #123 with Isar v4.