javalent / obsidian-leaflet

Adds interactive maps to Obsidian.md using Leaflet.js
508 stars 30 forks source link

Save UI Features to Code Block #279

Closed Servinjesus1 closed 1 year ago

Servinjesus1 commented 2 years ago

Right now, UI features don't save to the code block, namely the "view parameters" and shapes. It would be nice if these did, so that we could more reliably adjust, copy, and paste those parameters as necessary.

For example, the "Save Parameters to View" button might modify the defaultZoom, lat, and long parameters, which control the default view location anyway (and are clobbered by that save button now). The current button also has a tendency to become corrupt so that hitting it again no longer updates the view parameters, and this is a difficult thing to circumnavigate.

For the shapes, I could see them saving to the code block when the user hits the check box. They'll become immutable at that point, but then upon reopening the Shapes toolbar, they might repopulate whatever UI space makes them mutable.

Honestly, it would be ideal to have the marker and overlays also have their own UI tool with the same mutability/immutability so that maps are perused in "preview" mode by default and only modified when intentionally pulling out your cartographer's tools. This would definitely save me some headache of deleting many accidentally placed markers 😅