Mapbox offline maps: Webserver dies when Oruxmaps is put into the background

Started by Hauke, May 14, 2024, 01:08:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hauke

When I open a Mapbox format offline vector map (2D view) and move around, it works just fine - can scroll zoom - anywhere, no issues. If I then send Oruxmaps into the background and then pull it up again, all previously rendered areas are still there, and I can zoom, scroll etc. as before, but as soon as I move outside of the previously rendered parts (both in area as well as in zoom level), the map does not update and I usually only see the coarse renderings of the low zoom levels.

If I load another map (any kind) and then re-load the faulty map, it works again - until I put oruxmaps into background.

My assumption is, that the local webserver that serves the vector tiles dies (I mean the server listening on http://localhost:8998/). I have Oruxmaps configured so that it is exempt from power saving of Android, so I assume that it is not connected to that.

Attached is a screenshot with crashed situation.

Hauke

I've more evidence that the tile-server dies. I've now integrated some raster map via mbtiles into my mapbox offline map (and that is SO! COOL! that this is possible! It expands the possibilities for offline maps so much! Thanks for implementing this feature!). If I send Oruxmaps into background and pull it up again, no new tiles are served - see attached "Broken.jpg". If I restart Oruxmaps (or switch maps back and forth), all is working again - see attached "OK.jpg".

Any chance this gets fixed? My gut feeling is that this should be an easy fix - but I may be totally wrong here...

Hauke

...and some more evidence: I created a mixed mapsource, combining offline (local mbtiles) plus online (Web-URLs with pbf tile services). When I put Oruxmaps into the background, the offline-tiles "die", i.e. they miss in the rendering. The online sources continue to work. So the renderer obviously works, but data delivery through the local web server is not successful.

Since I had no reaction to this bug yet: What is the best way forward? How can I best provide input? How do I know if this bug caught the awareness of the developers? Don't get me wrong: I do not want to put pressure or so, I just would love to hear feedback. It takes as long as it takes of course!

Tronpo

Quote from: Hauke on May 21, 2024, 02:29:16 PM...and some more evidence: I created a mixed mapsource, combining offline (local mbtiles) plus online (Web-URLs with pbf tile services). When I put Oruxmaps into the background, the offline-tiles "die", i.e. they miss in the rendering. The online sources continue to work. So the renderer obviously works, but data delivery through the local web server is not successful.

Since I had no reaction to this bug yet: What is the best way forward? How can I best provide input? How do I know if this bug caught the awareness of the developers? Don't get me wrong: I do not want to put pressure or so, I just would love to hear feedback. It takes as long as it takes of course!
Hello, maybe the problem is not Oruxmaps or yours, I explained some time ago I was looking for information on how to create my offline mapbox, in the documentation I found
https://docs.mapbox.com/help/troubleshooting/mobile-offline/

The mapbox SDK offers the direct download of tiles from your online maps, to work in cache.
This is offered directly by Oruxmaps Gp
What I'm saying is that I think the mapbox sdk isn't developed to use the "homemade" maps you're developing.
At least the most modern versions of the mapbox sdk.
The Spain maps app uses an older sdk than Oruxmaps Gp, this version of the sdk does not have a 3D viewer but the offline maps of the IGN work better (not perfectly) with this sdk, than with the Oruxmaps Gp sdk
The potential of the mapbox sdk is in the online maps today, and in making it easier to download to use As a cac memory
Strava, fatmap, uses the same sdk as Oruxmaps Gp offering the
But in Oruxmaps we are offered the possibility to use our maps.


I add: try using lighter weight maps.
About the developers of Oruxmaps........ It's only one, surprising isn't it?




Hauke

Thanks for the explanation!

Indeed, the documentation saying "The cumulative amount of unique maps tile packs used in the offline regions cannot be greater than 750" hints on some potential problem here. And that's quite a bummer honestly. perhaps switching to Maplibre SDK might be a way forward?

That said, I seem to have indications that this is not my problem. I'll try to explain why:

The offline maps I create use as data source in the style "http://localhost:8998/MySelfmade.mbtiles/{z}/{x}/{y}.pbf" - which makes me assume that Oruxmaps starts a simple webserver that serves the content of the mbtiles DB. There are several lightweight servers out in the wild, and I personally for style creation serve my mbtiles via tilemaker-server. So from the viewpoint of Mapbox GL, it is effectively an online source, which happens to be served locally.

What I think supports my theory is the fact that my map very likely exceeds the 750 tile packs (I mean: whole Germany?), but it works just nicely and without any issues as long as I keep Oruxmaps in the foreground. I can move east, west, north, south, in and out as much as I like, and it just works. I've as a stresstest (and to enjoy my product :-) ) been browsing my map for several minutes, looking at various regions all over Germany. It just worked to my utter delight. But as soon as I send Oruxmaps in the background, and regardless if I did just load the map or did excessive map browsing before, reproducibly after that the map gets stuck. all that was rendered before is there, cached, but any region that needs new rendering fails.

To further verify my statement, I will perhaps prepare a lightweight, very small map and see if I can reproduce the problem even with that.

Writing this, it comes to my mind to look for an "external" mbtiles-server as Andoid app... If such a thing exists, I might have my workaround, even bypassing the mapbox limit...

Thanks again for discussing with me! And Kudos to Jose Vazquez for keeping Oruxmaps alive as a one man show! Impressive!

EDIT: Just found this: https://github.com/bojko108/mobile-tile-server - available in Google Play: https://play.google.com/store/apps/details?id=com.bojko108.mobiletileserver&hl=de&gl=US --> Will try this! My hopes are high!

EDIT EDIT: Not compatible with Android 13 - nooooooo!

Hauke