javalent / obsidian-leaflet

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

Markers with "Display Tooltip: Always" can't be deleted if note field is empty #239

Closed JesseBuck closed 3 years ago

JesseBuck commented 3 years ago

When a marker is set to always display its tooltip, and its "Note to Open" field is left blank, an error is thrown when deleting the marker. The marker will reappear next time the map is loaded. This makes accidentally created markers difficult to delete when the default tooltip behavior is set to always display.

This is the error thrown:

Uncaught TypeError: Cannot read property 'remove' of undefined
    at Ba.remove (eval at <anonymous> (app.js:1), <anonymous>:2:1357579)
    at kn.removeMarker (eval at <anonymous> (app.js:1), <anonymous>:2:1463639)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:2:1353288)
    at e.handleEvent (app.js:1)
remove @ VM179:2
removeMarker @ VM179:2
eval @ VM179:2
e.handleEvent @ app.js:1

This is occurring with version 4.1.3. I can attach an example if needed.