White tiles on map

65 views
Skip to first unread message

Giorgio Battistoni

unread,
Apr 29, 2021, 11:38:38 AM4/29/21
to Mapsforge & VTM
I have implemented an app using offline mapsforge maps. It works  well on  many phones, but few users report the presence of white squares (tiles) as shown in the annex. I can't reproduce this because on phones I  can use this problem doesn't exist. Do you have any suggestion to solve or investigate this problem? Many thanks for your excellent work. 

snapshotWhiteTiles.jpg

Emux

unread,
Apr 29, 2021, 11:43:55 AM4/29/21
to mapsfo...@googlegroups.com
Without reproducing a report, it is difficult to understand what happens from an image.

I cannot debug your code, however you seem to use very small 256x256 tiles?
And do you use permanent tile cache?

Checking and comparing with getting started example may help you see how Mapsforge API can be used.

--
Emux

Giorgio Battistoni

unread,
Apr 30, 2021, 6:13:19 AM4/30/21
to Mapsforge & VTM
Tiles are 256x256. Cache is not persistent.

My code is very close to the getting started example.
 There are two points  that may be of some interest: 
 1)The app is adding several layers to the map layer and redrawing only at the end, when all the layers have been added.  
2) When a new  multi-map is to be shown then initialisation is done as:
     - all mapView layers cleared
     - cache purged
     - new tile renderer layer added
 
I guess this problem maybe related to the timing and synchronisation of concurrent threads that are rendering the tiles (and that can be very different on different devices) , but I have not been able to find where this is managed in the mapsforge code and how this is performed.  

Thanks again. 
Giorgio 

Emux

unread,
Apr 30, 2021, 6:40:49 AM4/30/21
to mapsfo...@googlegroups.com
It is not recommended to use the old 256x256 tiles for vector maps on modern large screens.
(this is an old tiling useful only in raster bitmap maps)

Memory tile cache must be large enough to cover all screen tiles.
(see AndroidUtil for more details)

You should follow Mapsforge guidelines which auto-calculates the tile size and cache.

Mapsforge samples work fine, so you can check and compare your code with them.

--
Emux

Giorgio Battistoni

unread,
Apr 30, 2021, 2:23:14 PM4/30/21
to Mapsforge & VTM
Cache definition is exactly the same of the example and in fact it is auto-calculated,  256x256 was on one old phone, and I checked 512 on a larger screen  i.e:
tileCache = AndroidUtil.createTileCache(mfContext, "mapcache", mfMapView.getModel().displayModel.getTileSize(), 1f,
mfMapView.getModel().frameBufferModel.getOverdrawFactor(),false);

Maybe  increasing screenRatio  will give benefits?

Emux

unread,
May 1, 2021, 1:37:49 AM5/1/21
to mapsfo...@googlegroups.com
As Mapsforge samples work correctly,
you just need to compare your code with the examples and use the same API calls.

--
Emux
Reply all
Reply to author
Forward
0 new messages