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

"Add geolocation (front matter)..." barfs when property exists with any value or no value. #248

Open
jordanmills opened this issue Jun 4, 2024 · 1 comment
Labels
p1 High

Comments

@jordanmills
Copy link

If there is a value it does not recognize as a geocode:

Unknown front matter location format:  Location {ancestorOrigins: DOMStringList, href: 'app://obsidian.md/index.html', origin: 'app://obsidian.md', protocol: 'app:', host: 'obsidian.md', …}

If the property exists with no value/null value:

Error converting location in file note.md: TypeError: Cannot read properties of null (reading 'match')
    at getFrontMatterLocation (plugin:obsidian-map-view:41324:56)
    at eval (plugin:obsidian-map-view:41170:34)
    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 buildAndAppendFileMarkers (plugin:obsidian-map-view:41164:12)
    at eval (plugin:obsidian-map-view:41199:19)
    at Generator.next (<anonymous>)
    at fulfilled (plugin:obsidian-map-view:67:58)

If the property exists and the location is recognized as a valid geolocation it silently fails.

It's more of an FR than a bug, but it would also be nice if the plugin could work with or even better output human-readable place names with the geocoding results. Such as, if I search for "new york", and the suggestion I accept is "New York, U.S." it will output

40.7127281,-74.0060152

but it would be great if the output were

New York, U.S. [40.7127281,-74.0060152]
@esm7 esm7 added the p1 High label Jun 8, 2024
@esm7
Copy link
Owner

esm7 commented Jun 8, 2024

Thank you, will fix.

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