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

Support for PDF export of embedded maps

Open sbungartz opened this issue 1 year ago • 3 comments

Hi, I just found this amazing plugin and am really impressed! I set up an embedded map in my note and it shows up fine in Obsidian. When I use the PDF export though, it only shows an image of the map background and the lock icon. All the markers are missing. Is this a known issue / limitation or is it just a problem for me maybe?

sbungartz avatar Oct 03 '24 13:10 sbungartz

That's not the case for me, as far as I know PDF export works, and I just tested it to make sure. Is it possible you might have an active theme, CSS snippet (especially ones with @media selectors) or another plugin that's messing it up?

esm7 avatar Oct 03 '24 16:10 esm7

Hi, thanks for the quick reply. Good to know that it should work. I tried again and looked more closely this time: The problem is not really that the markes are hidden but actually the viewport shifted to the west (in my case) so that there simply were no markers to be displayed in that area.

I created a new note and added an embedded map view with the built in command and just selected "London" as an example. The generated code looks like this:

```mapview
{"name":"Default","mapZoom":8,"centerLat":51.4893335,"centerLng":-0.14405508452768728,"query":"","chosenMapSource":0,"showLinks":false,"linkColor":"red"}
```

In Obsidian it renders as expected (note: there are no markers to be expected there, since I have none):

grafik

When I export it to PDF however it looks like this:

grafik

I'm using the Default theme in Obsidian 1.6.7 on macOS Sonoma 14.6.1. I disabled all other Community Plugins just to make sure.

In my actual use case with markers I also checked what happens when I shift the viewport to the east so that the Lng i want to be at the right edge of the viewport in the PDF is shown in the center in Obsidian. Then it actually works and I see all the markers with labels. So that's at least a workaround for me.

Very strange bug though. Let me know if there is other stuff I can check. Also: Do you know if there is a way to attach a debugger to the PDF export?

sbungartz avatar Oct 06 '24 08:10 sbungartz

I confirm that in my case too, PDF export displays a different portion of the map -- haven't noticed this! I'll investigate, thanks!

esm7 avatar Oct 06 '24 08:10 esm7