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
TileLooper calculates wrong number of required tiles when map repetition is disabled #1955
Comments
I just tested and it doesnt' seems a bug. My example at zoom 1:
TileCache Capacity is NOT current cache Size but only "how much items it CAN handle before require a re-hashing of items". |
You are absolutely correct with your assessment. The bug doesn't cause loading more tiles than needed. |
Tiles are just retained in the minimum Cache size, so if at Zoom 1 only one is required the other cached tiles are just "there as they were". In fact in my test 11 tiles were of simple Water (because I come from an higher zoom) and only one is about the whole world. |
Issue Type
[x] Bug
Description and/or steps/code to reproduce the problem
TileLooper.loop
calculatesmTiles
, which represents which tiles are currently visible on the screen.TilesOverlay.OverlayTileLooper.initialiseLoop
uses thismTiles
to calculate the total numbers of tiles and callsmTileProvider.ensureCapacity
to ensure theMapTileCache
is big enough to hold all the tiles.This works fine for maps which have set
isHorizontalMapRepetitionEnabled
andisVerticalMapRepetitionEnabled
to true (horizontalWrapEnabled
andverticalWrapEnabled
set to true inTileLooper
).However, when
isHorizontalMapRepetitionEnabled
and/orisVerticalMapRepetitionEnabled
is set to falsemTiles
may be incorrect and thus resulting in a wrong cache-size inMapTileCache
.Example:
Set
isHorizontalMapRepetitionEnabled
andisVerticalMapRepetitionEnabled
to false.When zoomed out on zoom level 1 we get the following
mTiles = Rect(-1, -2 - 2, 3)
while we should getRect(0, 0 - 1, 1)
.Thus
MapTileCache
increases its cache-size to 24 instead of 4.Environment
If it's a bug, version(s) of android this affects:
All
Version of osmdroid the issue relates to:
6.1.17
The text was updated successfully, but these errors were encountered: