obsidian-map-view
obsidian-map-view copied to clipboard
Obsidian freezes for 10-15 seconds when pressing map view
thx for the fix!
I updated to the latest version
unfortunately it seems now on my system pressing the map view freezes obsidian for a good 10-15 seconds :)
plus it seems that didn't fix the world view
as always happy to help debug!
best
Z
Originally posted by @zeltak in https://github.com/esm7/obsidian-map-view/issues/14#issuecomment-890802338
see above comments
- Are you sure you upgraded the plugin version to 0.0.9?
- Can you post your configuration again?
- Is there something showing in the development console (Ctrl+Shift+I) when you open the plugin or work with it?
Hi again
Are you sure you upgraded the plugin version to 0.0.9?
Can you post your configuration again? sure attached data.json.zip
Is there something showing in the development console (Ctrl+Shift+I) when you open the plugin or work with it?
this time obsidian frooze completely :) here is the dev view

thx again
itai
Sorry I should have been more detailed :) Under the dev view there's a "console" tab (it's at the bottom of your screenshot). Can you check if it shows anything?
No worries , happy to debug:)
here it is (this time obsidian froze for around 15 seconds):

We're not as lucky this time, I'm unable to recreate it. A few more things if you don't mind...
- Can you try to disable all community plugins except Map View, restart Obsidian and see if this makes a difference? If so, it would be great if you can locate which plugin is interfering.
- After that initial freeze, if you click on a note then go back to the map, does it freeze again?
- You mentioned you still have the "world view" issue. Do you mean that when you click a note, then click "show on map", you get the world view rather than a zoom on the location? Does it happen with all locations?
- Can you try to disable all community plugins except Map View, restart Obsidian and see if this makes a difference? If so, it would be great if you can locate which plugin is interfering.
did that and still get eh freeze :D
- After that initial freeze, if you click on a note then go back to the map, does it freeze again?
i cant even click on a note obsidian is completely frozen
- You mentioned you still have the "world view" issue. Do you mean that when you click a note, then click "show on map", you get the world view rather than a zoom on the location? Does it happen with all locations?
yes exactly and yes it happens in all locations (tried 7-8 different notes and locations )
thx so much !
Z
I just released a 0.1.0 version and added a Debug Logs toggle in the settings. Can you update, turn that on, reload the plugin, let it sit until it's done whatever it is doing, and then send me the same console output like above?
As another point of reference, I have the same problem, it freezes for about 10 seconds after it prints out the updateMapToState:

I just released a 0.1.0 version and added a Debug Logs toggle in the settings. Can you update, turn that on, reload the plugin, let it sit until it's done whatever it is doing, and then send me the same console output like above?
sure :) updated , turned in the advanced debug and"
- first time obsidian the map didn't show up and i got this error

- second time obsidian just completely froze up:

am i doing something wrong :D
best
Z
Thanks for the help so far! I have a suspicion of what might be going on and added more debug logs to catch it. @HEmile, @zeltak, do you mind -
- Unzipping the attached debug build of the plugin into VAULT/.obsidian/plugins/obsidian-map-view (make sure there's already a main.js file there before unzipping so you'll be sure you're in the right place),
- Doing the same thing, again with debug logs turned on? main.zip
Looks like the setState phase is very expensive:

Ok I think I got it! I'm guessing from the log that Obsidian on your system doesn't like plugins to await while setting a state, regardless of the actual action (updateMapToState) not being very long.
Can you try the attached fix and let me know if it solves the issue?
main.zip
It's now giving this, but it's still freezing actually after updateMapToState.

Hi again
i also tried it and its still freezing for me :)

happy to further debug
Z
For both of you guys the performance counters are fundamentally different than mine. I made an optimization that might help and added some more specific printouts. Would appreciate another run. main.zip
sure
here is the output with the latest version you sent
Still took about 2 minutes to load and again the map is zoomed out

thx for looking into this!
Z
I'm sorry for disappearing, I didn't have any time to work on this project for more than a week. This bug is my top priority, and I'll devote the little time I have in the next couple of days to getting it sorted. I suspect the freeze started in version 0.0.9, so I inspected the diff between the versions and came up with another attempt. Can you try the attached? main.zip
thx!
no worries @esm7 :)
i tried the latest it dosent see to give any errors but still the same super slow response :)

best
Z
You seem to have over 1400 location markers, is this correct or the result of some parsing error?
That's very possibly the key for why it doesn't recreate for me. How do these markers look like, are they mostly in separate notes or is it a few notes with many inline markers?
Also, is my understanding correct that the problem started in version 0.0.9 of the plugin?
If your inline locations are still backwards-compatible (you didn't convert them to the geo:... syntax), can you check if in version 0.0.8 (attached) the freeze is not there?
main.zip
Hi again
1400 seems to much but i may have a few hundreds across my notes
its always in the yaml part such as
---
tags: [ nyc]
status: 5
rating: 3
location: [40.784240722656,-73.948684692383]
counter:
---
# Pata Market
each note has a location entry (i have a few hundreds)
i don't think i ever had 0.0.8, im a neweb in obsidian :)
thx again
Z
@HEmile was there a version upgrade that seems to have worsened the situation or was it always like that with your amount of markers? It could be "just" the inherent issue that it takes a long time to parse thousands of files and build markers for them, and caching is needed, as I'm planning anyway to do for this and this. Either way, I wrote a script that generates 1000 notes with location data and the problem now recreates, so I can investigate is there is a bottleneck that can be tackled before I'm done with caching and clusters.
After further investigation seems like parsing and creating markers for thousands of notes is actually very fast, and all the time goes to add these markers to Leaflet.js. I'll investigate if there is a faster way to batch-add markers, but it's possible that only clusters can handle these quantities.
@HEmile was there a version upgrade that seems to have worsened the situation or was it always like that with your amount of markers?
I don't think there was an earlier version that was quicker, no. Like you mention, it's more likely related to needing to either cache or with creating the markers. Like mentioned, clusters would be ideal for this! (In fact, that's a feature I'm quite missing in terms of usability too. It can look quite cluttered! I hope it's not too hard to implement...)
It doesn't look hard at all, after fixing a few small bugs this is definitely the next thing to do. It will also greatly help make the plugin more usable on mobile.
It's finally here, marker clusters are now available on version 0.2.1, and I'm curious to know how this works for you guys with many markers!
Oh wow this is excellent! So smooth and quick :) Very amazing work!!

@esm7 awesome update thx so much!!
the new version dosent freeze obsidian and in general is very smooth!
the only issue still (and maybe that's not a bug) is that if you stand on a note with coordinates its still opens the globe view and not the zoomed location of the actual note, is that by design?
thx so much!
Z
That's not supposed to happen, unless you have "Default zoom for show on map action" configured very low. What value do you have set for that setting? If that's not the issue, do you mind explaining in more detail what you're doing? What kind of location (inline / frontmatter), which "Show on map" option are you using (from the note's context menu? Right-click?) etc?
Hi i played with "Default zoom for show on map action" in both high and low and middle configuration and that didn't seem to change anything

the issue is that whenever i open a note with coordinates i get the global map with all pins:

i was under the impression that it should zoom to the actually location of the current note (ie NYC, London etc)
i will say it opens now lightning fast which is so awesome :D
happy to debug
best
Z
