Good evening Ludwig,
1) Yes, you are right. A too small capacity effectively renders the
InMemoryTileCache useless. The minimum capacity can be calculated:
(width / TileSize + 1) * (height / TileSize + 1)
where TileSize is 256 pixel. Width and height are the dimensions of the
frame buffer - which is usually larger than the actual MapView. The
current default width and height is 1.5 times the size of the MapView.
I propose to add some utility method which calculates this minimum
capacity so that developers can easily adhere to this lower bound.
2) If you - for whatever reason - don't want a file system based tile
cache then you should simply not use one. The TwoLevelTileCache doesn't
have to be used, just a simple InMemoryTileCache will work fine. Or do
you have an idea how we can solve this problem in the tile cache code?
Greetings,
Thilo
On 01/05/13 15:40, Ludwig wrote:
> Playing with the Samples app, I noticed two things related to the tile
> caches.
>
> 1. A fixed (small) number of tiles is, at least for the
> InMemoryTileCache, not right as it does not take account of the
> screen size. In the Samples app the InMemoryTileCache has a capacity
> of 32 which leads to thrashing on devices where the screen shows
> more than 32 tiles at a time (tablets). The effect is that tiles are
> copied from the FileSystemTileCache into the InMemoryTileCache, only
> to be ejected again by one of the later tiles before it is ever
> retrieved from the cache. So the InMemoryCache is never read, but
> written on every tile access.
> Some sort of technique is needed to determine the number of tiles a
> screen requires as a minimum. That cannot be too difficult.
> 2. Setting the capacity of the FileSystemCache (second level cache) to
> 0 results in nothing being drawn at all. That does not seem right.
> Plus, there is actually a surprising number of devices out there
> that do not have any available storage (I think mostly the /sdcard/
> is full), so not having a secondary storage must be an option.
>
> Ludwig
>
> --
> You received this message because you are subscribed to the Google
> Groups "mapsforge-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
mapsforge-de...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>