esm7 / obsidian-map-view

Interactive map view for Obsidian.md

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow inline `geo:` links to open in Map View by default

alexking opened this issue · comments

commented

It's currently possible to open inline links in Map View by right clicking and selecting "Open in Map View", but left clicking will attempt to open a geo: handler (which doesn't work on Windows, and several other platforms - #114, #115). I'd like to be able to choose the default left click action to open geo:, the Map View, or one of my Custom "Open In" actions. This seems to be a feature others are interested in as well.

Unsure how best to implement this while keeping the geo: url scheme in the markdown files (#18) - wondering if it would be possible to override the click event for inline geo links and either allow it to pass through, or preventDefault() based on plugin settings?

commented

I looked into this in the early days of the plugin and was unable to find a good way to do it with the Obsidian API (even after consulting in the plugin-dev Discord channel). However, it's great that you bring it up now, because I actually think it's very much possible nowadays!
I'll definitely look into it. The current behavior is less than satisfactory.

commented

Just wanted to update here that I spent a few hours on it in the past weeks with no luck yet (kidnapping Obsidian's link handling in Edit mode is overly complicated), but I won't give up until I get it to work!

commented

I finally managed to figure out how to utilize an editor extension to do this and it works 😎
In the upcoming days I'll test it out in desktop and mobile, add Reading Mode support (which is considerably easier), and possibly play around with some interesting new possibilities that opened up due to this :)

commented

I just released this in 3.1.0 and would love some feedback if it works for you as expected.
I also added a nice treat, off by default but very nice I think, of map preview popups.

commented

(rolled back the release because I made a mistake in the process, will hopefully re-release it tomorrow)

commented

(update: fixed and re-released now)