obsidian-map-view icon indicating copy to clipboard operation
obsidian-map-view copied to clipboard

Have geo location links not blindly parsed

Open mayurankv opened this issue 3 years ago • 2 comments

Currently, the geo location links [](geo:lat,lon) are parsed blindly within the markdown note as far as I can tell. I was attempting to create a dynamic map location using dataview and generating the exact same link in the preview pane using dataview doesn't show the note in the map whereas if I have a commented out location, the location still shows up in the map. It would be good to allow dataview blocks giving the required format to be read or dynamic templater commands.

As an example if I wanted a dynamic location given by the commands <%+ tp.user.latlon %> or \=this.latlon`` where both give the string "Ex", then I would expect both commands to be parsed into the map view.

I'm not 100% sure how this change would need to be implemented, I also saw previous discussion regarding the dataview api so this may go hand in hand?

Thank you

mayurankv avatar Sep 06 '22 15:09 mayurankv

It basically means that Map View would need to communicate with the Dataview API when it sees an inline data query. This should be possible, but I think it requires a caching solution, because Map View can't ask the Dataview API about every embedded location every time it wants to build its markers (it would make everything way too slow). So this is possible, but requires some meaningful investment, that I'm not sure I can personally find the time for (especially given the vast amount of improvements and ideas I have for Map View). If that's a feature that many users find helpful, I hope someone can step in and work on it before I do!

esm7 avatar Sep 07 '22 11:09 esm7

Thanks for explaining. I wish I was well versed enough to do it myself, maybe sometime in the future! Hopefully someone else finds this useful as well but appreciate the thorough reply.

mayurankv avatar Sep 27 '22 11:09 mayurankv

Managed to get round this with dataview and metaedit fyi.

mayurankv avatar Nov 22 '22 13:11 mayurankv

Thanks, that's good to know! Would you mind elaborating a bit what you did in case others want to accomplish the same thing?

esm7 avatar Nov 24 '22 15:11 esm7

Just essentially using metaedits api in a dataviewjs block in order to change the location: parameter in metadata directly.

mayurankv avatar Nov 28 '22 15:11 mayurankv