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)

1 Like

Seconded. I’m currently on holidays in a country where I don’t have mobile internet AND frequently need maps, and installing OSM scout server was very easy (it’s in flathub; hardest was waiting for the maps to get downloaded in slow hotel wifis :slight_smile: ). Pure Maps works out of the box with OSMscout server (just select “offline” profile) and is IMO much better than Gnome Maps (much snappier, more features, etc).

I actually plan to keep using Pure Maps even after I’m back in my country and have mobile internet.

EDIT: oops I just noticed this was two years old… I got on the topic through a link… Anyway maybe it helps someone :slight_smile:

4 Likes

When I was abroad in December I used only GNOME Maps. It worked quite well when my phone was offline. Because when I had WiFi, I surfed around at the areas which I needed later. The tiles are then cached on-disk and are accessible without internet :slight_smile:

2 Likes

I tried this once, opening Gnome Maps at a restaurant (with wifi) to find the way back to the hotel, then started walking back. As soon as I got out of range of the restaurant’s network, the map got replaced by a full-screen “Maps needs network access to function” message.

2 Likes

Which version of GNOME Maps are you using? I’m running 45.2 from flatpak which doesn’t show this fullscreen message anymore. It showing the tiles which are cached…

2 Likes