From 41b0f27420060892b35c33da651e4080c06547ed Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 1 Jun 2025 15:45:15 +0300 Subject: [PATCH] fix(geo_map): icons for GPX waypoints --- apps/client/src/types-lib.d.ts | 6 +++--- apps/client/src/widgets/type_widgets/geo_map.ts | 5 ++++- docs/Release Notes/Release Notes/v0.94.0.md | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/client/src/types-lib.d.ts b/apps/client/src/types-lib.d.ts index c72a6216c..0c4474e94 100644 --- a/apps/client/src/types-lib.d.ts +++ b/apps/client/src/types-lib.d.ts @@ -39,12 +39,12 @@ declare module "leaflet" { startIcon?: DivIcon | Icon | string | undefined; endIcon?: DivIcon | Icon | string | undefined; wptIcons?: { - [key: string]: Icon | string; + [key: string]: DivIcon | Icon | string; }; wptTypeIcons?: { - [key: string]: Icon | string; + [key: string]: DivIcon | Icon | string; }; - pointMatchers?: Array<{ regex: RegExp; icon: Icon | string}>; + pointMatchers?: Array<{ regex: RegExp; icon: DivIcon | Icon | string}>; } interface GPXOptions { diff --git a/apps/client/src/widgets/type_widgets/geo_map.ts b/apps/client/src/widgets/type_widgets/geo_map.ts index bdedcc52e..81e1712a0 100644 --- a/apps/client/src/widgets/type_widgets/geo_map.ts +++ b/apps/client/src/widgets/type_widgets/geo_map.ts @@ -235,7 +235,10 @@ export default class GeoMapTypeWidget extends TypeWidget { const track = new this.L.GPX(stringResponse, { markers: { startIcon: this.#buildIcon(note.getIcon(), note.getColorClass(), note.title), - endIcon: this.#buildIcon("bxs-flag-checkered") + endIcon: this.#buildIcon("bxs-flag-checkered"), + wptIcons: { + "": this.#buildIcon("bx bx-pin") + } } }); track.addTo(this.geoMapWidget.map); diff --git a/docs/Release Notes/Release Notes/v0.94.0.md b/docs/Release Notes/Release Notes/v0.94.0.md index 67652f9eb..ebefb5954 100644 --- a/docs/Release Notes/Release Notes/v0.94.0.md +++ b/docs/Release Notes/Release Notes/v0.94.0.md @@ -28,6 +28,7 @@ * [Unable to handle multi line mathematical formulas when importing markdown](https://github.com/TriliumNext/Notes/pull/1984) by @SiriusXT * Calendar: became invisible if resizing while not visible * [GPX track not rendering on geomap note](https://github.com/TriliumNext/Notes/issues/2085) +* [GPX icons not working](https://github.com/TriliumNext/Notes/issues/1772) ## ✨ Improvements