-
|
hi, i've been playing around with the mapsforge samples, which in general work great. However, generating tiles while zooming, panning or rotating shows a lot of white blocks instead. For instance, when I zoom in, I see no map, when I zoom out to the previous zoom level, the map there again. Sometimes when zooming in again, the tiles are generated, but most of the time the tiles never appear. When rotating it is even worse. Happens on emulators and recent android phones. Am I missing something, maybe there are possibilities to improve this behavior? thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 3 replies
-
|
@git-bone Thanks for the report. Do you see this with the Mapsforge Android samples? What sample exactly? Can you post a video to see what you mean? When scroll / zoom / rotate, the new map areas appear empty until their map tiles are rendered on screen. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
If you use the map rotation gesture or API, you must adapt your code according to the samples that use map rotation:
|
Beta Was this translation helpful? Give feedback.
-
|
Ok, implemented that, but it really makes no difference. After rotation, there are lots of missing tiles during panning the map. |
Beta Was this translation helpful? Give feedback.
-
|
LabelLayerUsingLabelCacheMapViewer sample works, better check its code. Just need to set a larger |
Beta Was this translation helpful? Give feedback.
-
|
hm. I set the screenratio to 2, that seems to help a lot. however, after a minute of panning and zooming an exception occurs: `2025-02-08 16:40:10.691 1936-2836 AndroidRuntime com.example.mapsforgesample E FATAL EXCEPTION: pool-6-thread-4 (Ask Gemini) 2025-02-08 16:40:10.691 1936-2836 AndroidRuntime com.example.mapsforgesample E FATAL EXCEPTION: pool-6-thread-4 (Ask Gemini) |
Beta Was this translation helpful? Give feedback.
-
|
@git-bone Does it happens with Mapsforge samples? |
Beta Was this translation helpful? Give feedback.
-
|
Out of mem happens a lot after a couple of minutes zooming, panning and rotating. It happens less when I dont add the labellayer. Code is from above in my previous reply, which is a combo some of the mapsforge examples. I create the labelstore and labellayer like this:
and add it after the tilerenderlayer. |
Beta Was this translation helpful? Give feedback.
-
|
@git-bone Try also with another large map to see if having the same result. Netherlands has complex water polygons, leading to some heavy rendering. |
Beta Was this translation helpful? Give feedback.
-
|
this indeed seems to help a bit for the out of mem error: I also tested Germany NRW map. Also same issue there with map rotation and missing tiles. What also seems to happen, is that the map gesture for rotation becomes kind of unresponsive after the first rotation? about the missing tiles, what I just noticed, is that a lot of missing tiles have on-off effect. Just slightly move the map where you keep the missing tile within the screen boundaries, then the missing tile appears for a second to disappear again: |
Beta Was this translation helpful? Give feedback.
-
|
So I followed your advice, cloned the latest master and installed the samples app on my phone with the Berlin map. During the example of MapsforgeMapViewer it crashed with this error (i'll only copy the first few lines as the complete error is very long: Not sure how to reproduce, as it only happened once till now... But after that, I tried a different implementation of the tilecache and this seems to work a bit better:
|
Beta Was this translation helpful? Give feedback.




@git-bone But Mapsforge samples work correctly with map rotation.
Perhaps there is a problem in your implementation?
Follow the code in LabelLayerUsingLabelCacheMapViewer or RotationMapViewer without changes and see how it works.