Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to have “AutoZoom” (or “Fit”) enabled for embedded codeblocks? #171

Closed
ces3001 opened this issue Jul 2, 2023 · 3 comments
Labels
p1 High

Comments

@ces3001
Copy link

ces3001 commented Jul 2, 2023

The use case is probably the same as most people’s, if not all, use case for the embedded codeblock, which is to display the current note’s locations.

I am generating a note of my locations automatically from a tracking app. Most of the time a Zoomlevel of 13-15 works fine if I’m not travelling. If I’m travelling or flying there is no way to know the proper zoom level apriori without a lot of guess-work and programming on my end. Wondering if there is an easy “Auto” or “Fit” setting for the “mapZoom” key, as this is already a feature in the plug-in for the right-pane map.

If not, maybe you can give me the algorithm to determine zoom from the range in lat and lon?

@ces3001 ces3001 changed the title Is there a way to have “AutoZoom” enabled for embedded codeblocks? Is there a way to have “AutoZoom” (or “Fit”) enabled for embedded codeblocks? Jul 2, 2023
@esm7
Copy link
Owner

esm7 commented Jul 15, 2023

Sounds super useful and I'd like to add this soon. However, I'm also seeing some potential for confusion and trouble here, as the "fit" setting will somehow need to work intuitively when users move and zoom the embedded map, then click 'Save'. How would you define such a case to behave -- should "fit" turn off when a user makes manual changes to the map?

@esm7 esm7 added the p1 High label Jul 15, 2023
@ces3001
Copy link
Author

ces3001 commented Jul 15, 2023 via email

@esm7
Copy link
Owner

esm7 commented Jul 28, 2023

This proved to be considerably more complicated than I expected. I added the basic feature in 4.0.0, so you can set autoFit in the code block, but there is not yet a UI for it and the user experience isn't perfect. See here: https://github.com/esm7/obsidian-map-view#advanced-additional-options

@esm7 esm7 closed this as completed Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1 High
Projects
None yet
Development

No branches or pull requests

2 participants