I wanted to be able to do offline work with Obsidian when I’m out and about on my Windows Surface Go tablet, and I recently discovered the Map View plugin which I’ve started incorporating into many of my notes. Since the default map tile server for Map View requires Internet access (CartoDB) I decided to set up an offline option, and here’s what I came up with (requires Java runtime to be installed on your system):
- Download mapsforgesrv (mapsforgesrv/mapsforgesrv/bin/jars_ready2use at master · telemaxx/mapsforgesrv · GitHub) into a folder on your system
- Download whatever maps (*.map files) you want to have access to from Index of /pub/Mirrors/download.mapsforge.org/maps/v5 into the same folder as mapsforgesrv
- Open a Windows command prompt and move to the folder you downloaded everything into
- Run mapsforgesrv with the command 'java -jar mapsforgesrv-fatjar.jar -p 8080 -m “map1.map, map2.map, map3.map”, replacing ‘map1.map, map2.map, map3.map’ with a comma-separated list of the maps you downloaded, or just the ones you want to use for now
- In Obsidian go the settings for the Map View plugin
- Under ‘Map Sources’ click on ‘New map source’, enter whatever name you want (I used MyTileServer’), and for the URL enter ‘http://localhost:8080/{z}/{x}/{y}.png’
- Now when you open any map view in Obsidian, under the ‘View’ option select the pull-down list that currently shows ‘CartoDB’ and select the name you used when entering the map source in Map View settings (MyTileServer for me)
Some notes:
- You’ll only see maps for the areas you’re serving with .map files in mapsforgesrv - everything else will be blank white squares
- There’s a very slight but noticeable lag on my system, but it’s still very usable
- You can easily create a batch file to run this if you want to use it regularly
Hope this is useful for someone.
John