Maps app && local tiles

The app Maps fetches tiles from the OSM servers on demand. Where can I change the URL to a local HTTP server and have the tiles already localy stored?

3 Likes

I don’t know any answer to this, but I’m also interested in getting it to work. Here are some things I found that seem related:

Back in 2015 someone was doing this:

The OpenStreetMap wiki talks about ways to use maps offline:

https://wiki.openstreetmap.org/wiki/Using_OpenStreetMap_offline

Found two open issues related to offline maps:

Do you mean that you already know how to setup such a local server, so that all you need is to ask GNOME Maps to fetch data from a different URL? (In that case I’m sure we can find where the URL is in the source code and change it there in case there is no configuration option for it.)

2 Likes

Yes. In my UBports (Ubuntu) mobile I have the tiles tree for some places of interest (Munich, Havana, …) and run a modified app uNav. The change is simple the URL:

diff index.html index.html.orig
210c210
<               source: new ol.source.OSM({url: 'http://localhost:8888/osm/{z}/{x}/{y}.png'}),
---
>               source: new ol.source.OSM({url: 'http://{a-c}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png'}),

On the phone runs on port 8888 a simple Python HTTP server offering on demand the tiles from the SD card:

cd /media/phablet/9CC0-D6CE/Maps
python3 -m http.server 8888 &
1 Like

The HTTP server is available as well on the L5:

purism@pureos:~$ python3 -m http.server 8888 
Serving HTTP on 0.0.0.0 port 8888 (http://0.0.0.0:8888/) ...

I can’t answer your question but a different question that might still solve the problem is: How can I force (configure) an HTTP client to use an HTTP proxy server?

Then the HTTP proxy server can do all sorts of different things. At simplest, you could rely on an HTTP proxy server’s cache.

You would ideally bind the HTTP server to localhost though (rather than 0.0.0.0) - unless you want to be serving the same content to other devices (or you are using a firewall to protect the HTTP server).

The internet says:

python3 -m http.server --bind 127.0.0.1 8888

To the original question, if you’d use Pure maps, there would be handy instructions for that https://rinigus.github.io/osmscout-server/en/ (from: https://forums.puri.sm/t/alternative-to-google-maps/9915/9)