From 74c1df9c105f5a350f94587278cdfcf708085e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Fri, 16 Jan 2026 16:35:46 +0700 Subject: [PATCH] Add geolinks --- app/components/places-sidebar.gjs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/app/components/places-sidebar.gjs b/app/components/places-sidebar.gjs index 3bcedd4..97ec8c0 100644 --- a/app/components/places-sidebar.gjs +++ b/app/components/places-sidebar.gjs @@ -30,6 +30,25 @@ export default class PlacesSidebar extends Component { } } + get geoLink() { + if (!this.args.selectedPlace) return '#'; + const p = this.args.selectedPlace; + // geo:lat,lon?q=lat,lon(Label) + const label = encodeURIComponent( + p.title || + p.tags?.name || + p.tags?.['name:en'] || + 'Location' + ); + return `geo:${p.lat},${p.lon}?q=${p.lat},${p.lon}(${label})`; + } + + get visibleGeoLink() { + if (!this.args.selectedPlace) return ''; + const p = this.args.selectedPlace; + return `geo:${p.lat},${p.lon}`; + } + @action async toggleSave(place) { if (!place) return; @@ -66,7 +85,7 @@ export default class PlacesSidebar extends Component { // Also fire onSelect if it exists (for list view) if (this.args.onSelect) { // Similar logic for select if needed, but we usually close. - this.args.onSelect(null); + this.args.onSelect(null); } // Close sidebar after delete @@ -187,6 +206,12 @@ export default class PlacesSidebar extends Component {
{{#if (or @selectedPlace.osmId @selectedPlace.id)}} +

+ {{this.visibleGeoLink}}

OSM ID: