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

Bug: Embedded maps no longer appearing

Open masasin opened this issue 2 years ago • 4 comments

When I upgraded to v4.0.0, embedded maps disappeared. There's a blank space that's persistent across restarts of Obsidian. Regular maps work fine.

I'm on Obsidian v1.3.7, macOS Ventura 13.4.1 M2.

masasin avatar Aug 12 '23 09:08 masasin

Can you paste here the code block that has stopped working? Also, it would be helpful if you open the Obsidian Developer Console (Cmd+Shift+I in Mac I believe) and take a screenshot or copy any errors you may see there.

esm7 avatar Aug 12 '23 10:08 esm7

All of them, but they're all this format:

{"name":"Default","mapZoom":15,"centerLat":43.504322350467895,"centerLng":16.436598133295778,"chosenMapSource":0}

And from the dev console:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'replace')
    at formatEmbeddedWithTemplates (plugin:obsidian-map-view:14827:24)
    at MapViewPlugin.eval (plugin:obsidian-map-view:27574:35)
    at Generator.next (<anonymous>)
    at eval (plugin:obsidian-map-view:70:71)
    at new Promise (<anonymous>)
    at __awaiter (plugin:obsidian-map-view:66:12)
    at eval (plugin:obsidian-map-view:27562:85)
    at t.initDOM (app.js:1:1423792)
    at t.toDOM (app.js:1:1420070)
    at t.sync (app.js:1:389434)
plugin:obsidian-map-view:27734 Uncaught TypeError: Cannot read properties of null (reading 'close')
    at window.closeMapPopup (plugin:obsidian-map-view:27734:38)
    at HTMLAnchorElement.onmouseout (index.html:1:1)
2
plugin:obsidian-map-view:14827 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'replace')
    at formatEmbeddedWithTemplates (plugin:obsidian-map-view:14827:24)
    at MapViewPlugin.eval (plugin:obsidian-map-view:27574:35)
    at Generator.next (<anonymous>)
    at eval (plugin:obsidian-map-view:70:71)
    at new Promise (<anonymous>)
    at __awaiter (plugin:obsidian-map-view:66:12)
    at eval (plugin:obsidian-map-view:27562:85)
    at t.initDOM (app.js:1:1423792)
    at t.toDOM (app.js:1:1420070)
    at t.sync (app.js:1:389434)
DevTools failed to load source map: Could not load content for app://obsidian.md/styles.css.map: System error: net::ERR_FILE_NOT_FOUND

masasin avatar Aug 13 '23 18:08 masasin

That's very useful, thank you. I'll post a fix ASAP.

esm7 avatar Aug 13 '23 18:08 esm7

I found that adding a "query":"", to the embedding gets it to work, but inserting from the embedded map from the command pallette does not add the query field.

masasin avatar Aug 13 '23 19:08 masasin