esm7 / obsidian-map-view

Interactive map view for Obsidian.md

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Default map provider doesn't show nature reserves and custom map provider default not remembered

VorpalBlade opened this issue · comments

I thought this plugin looked interesting to use for recording notes on nature reserve and national parks that I have visited. However, unlike openstreetmap.org the map view in this plugin is incredibly sparse in what it shows. Things that are missing include:

  • Borders of national parks and nature reserves (at least in Sweden, which is what I care about)
  • Hiking trails
  • Minor roads, tracks, etc.

This makes the map view largely useless to me.

I figured out how to add another tile source (using openstreetmap.org itself), but I cannot figure out how to make that the default when opening the map view. I don't see an option for that.

I eventually found where to change the default. It wasn't very obvious, you need to expand "Presets" in the map view and save a new default. Hopefully this is useful to someone else in the future.

Unfortunately it doesn't seem to remember the default map provider across obsidian restarts, so I'm reopening this.

commented

To make sure I understand, you do the following:

  1. Set your view with a custom map provider (chosen in the View dropdown),
  2. Click "Save as Default"

And then when you close & reopen Map View, or restart Obsidian, it shows you the default again?
When you reopen Map View and the original default is shown, does it say "Default" in the preset dropdown?
If you manage to capture a video of the process it may help me recreate it.

To make sure I understand, you do the following

Exactly.

And then when you close & reopen Map View, or restart Obsidian, it shows you the default again?

It happens when restarting Obsidian. Just reopening the map view keeps the previous state.

When you reopen Map View and the original default is shown, does it say "Default" in the preset dropdown?

Nope!

If you manage to capture a video of the process it may help me recreate it.

Here it is: obsidian_map_view_behaviour.mkv.tar.gz

I'm using Arch Linux (rolling release distro) with KDE in case it matters for reproducing this. I'm using the AppImage for obsidian.

commented

You are incidentally using a configuration quite similar to mine.
One thing that's unclear from the video, is whether the 'Default' preset is actually saved when you click "save as default". Would you mind after clicking it, to move the map a little so the preset name would be cleared, and then choose 'Default' again from the dropdown, and see what happens?
Also, I'm happy to know that you're a very technical user, because now I can ask you for the most important detail. Would you mind checking the plugin's data file VAULT_PATH/.obsidian/plugins/obsidian-map-view/data.json and copy the value of the defaultState key?

One thing that's unclear from the video, is whether the 'Default' preset is actually saved when you click "save as default". Would you mind after clicking it, to move the map a little so the preset name would be cleared, and then choose 'Default' again from the dropdown, and see what happens?

The preset is cleared. When I select default, it moves back but always chooses CartoDB. I tried saving a separate preset (named OSM). There the choice of tile provider seems to stick (I selected "Include chosen map source" in the save dialog box). However I don't get that option for default, nor can I set to use my custom preset as default from what I can tell.

commented

I would appreciate if you could check plugin's data file VAULT_PATH/.obsidian/plugins/obsidian-map-view/data.json and copy the value of the defaultState key. It's likely that this will provide all I need to understand the issue.

data.json.txt is the data file. One immediate strange thing I notice is that there still seem to be references to the default #trip, #trip-water etc in there. The only rule I thought I had (and I can see in the settings) is for #natur.

commented

Thank you for this. That's a much more serious bug than the simple symptom may suggest, and is very important to fix ASAP since it messes up users' settings. Will give it the highest priority.

commented

So indeed, there was a major issue with the way presets are handled and saved, and it required a thorough fix.
I made the required changes in the just-released version 4.0.0 and tested them to the best of my ability, hoping it didn't break anything unexpected.