Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit e3d1ecc

Browse files
committed
Merge branch 'develop' of https://github.com/TriliumNext/Notes into develop
2 parents 8b2c978 + 68d094d commit e3d1ecc

File tree

5 files changed

+36
-20
lines changed

5 files changed

+36
-20
lines changed

apps/client/src/types-lib.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ declare module "leaflet" {
3939
startIcon?: DivIcon | Icon | string | undefined;
4040
endIcon?: DivIcon | Icon | string | undefined;
4141
wptIcons?: {
42-
[key: string]: Icon | string;
42+
[key: string]: DivIcon | Icon | string;
4343
};
4444
wptTypeIcons?: {
45-
[key: string]: Icon | string;
45+
[key: string]: DivIcon | Icon | string;
4646
};
47-
pointMatchers?: Array<{ regex: RegExp; icon: Icon | string}>;
47+
pointMatchers?: Array<{ regex: RegExp; icon: DivIcon | Icon | string}>;
4848
}
4949

5050
interface GPXOptions {

apps/client/src/widgets/type_widgets/geo_map.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,10 @@ export default class GeoMapTypeWidget extends TypeWidget {
235235
const track = new this.L.GPX(stringResponse, {
236236
markers: {
237237
startIcon: this.#buildIcon(note.getIcon(), note.getColorClass(), note.title),
238-
endIcon: this.#buildIcon("bxs-flag-checkered")
238+
endIcon: this.#buildIcon("bxs-flag-checkered"),
239+
wptIcons: {
240+
"": this.#buildIcon("bx bx-pin")
241+
}
239242
}
240243
});
241244
track.addTo(this.geoMapWidget.map);

apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Geo Map.html

Lines changed: 18 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/Release Notes/Release Notes/v0.94.0.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* [Unable to handle multi line mathematical formulas when importing markdown](https://github.com/TriliumNext/Notes/pull/1984) by @SiriusXT
2929
* Calendar: became invisible if resizing while not visible
3030
* [GPX track not rendering on geomap note](https://github.com/TriliumNext/Notes/issues/2085)
31+
* [GPX icons not working](https://github.com/TriliumNext/Notes/issues/1772)
3132

3233
## ✨ Improvements
3334

@@ -61,6 +62,9 @@
6162
* [improve tab scroll UX by switching from instant to smooth behavior](https://github.com/TriliumNext/Notes/pull/2030) by @SiriusXT
6263
* Calendar view: display calendar view if `#viewType=calendar` is set.
6364
* [Mind map: add search support](https://github.com/TriliumNext/Notes/pull/2055) by @SiriusXT
65+
* Geo map:
66+
* The name, icon and color of the track note are displayed as the starting point.
67+
* Added a distinct icon for the end marker.
6468

6569
## 📖 Documentation
6670

docs/User Guide/User Guide/Note Types/Geo Map.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This note type displays the children notes on a geographical map, based on an at
55

66
## Creating a new geo map
77

8-
<figure class="table"><table><thead><tr><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td>1</td><td><figure class="image image_resized image-style-align-center" style="width:51.25%;"><img style="aspect-ratio:1256/1044;" src="7_Geo Map_image.png" width="1256" height="1044"></figure></td><td>Right click on any note on the note tree and select <em>Insert child note</em> → <em>Geo Map (beta)</em>.</td></tr><tr><td>2</td><td><figure class="image image_resized image-style-align-center" style="width:53.44%;"><img style="aspect-ratio:1720/1396;" src="9_Geo Map_image.png" width="1720" height="1396"></figure></td><td>By default the map will be empty and will show the entire world.</td></tr></tbody></table></figure>
8+
<figure class="table"><table><thead><tr><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td>1</td><td><figure class="image image-style-align-center image_resized" style="width:51.25%;"><img style="aspect-ratio:1256/1044;" src="7_Geo Map_image.png" width="1256" height="1044"></figure></td><td>Right click on any note on the note tree and select <em>Insert child note</em> → <em>Geo Map (beta)</em>.</td></tr><tr><td>2</td><td><figure class="image image-style-align-center image_resized" style="width:53.44%;"><img style="aspect-ratio:1720/1396;" src="9_Geo Map_image.png" width="1720" height="1396"></figure></td><td>By default the map will be empty and will show the entire world.</td></tr></tbody></table></figure>
99

1010
## Repositioning the map
1111

@@ -60,7 +60,7 @@ The value of the attribute is made up of the latitude and longitude separated by
6060

6161
### Adding from Google Maps
6262

63-
<figure class="table" style="width:100%;"><table class="ck-table-resized"><colgroup><col style="width:2.77%;"><col style="width:33.24%;"><col style="width:63.99%;"></colgroup><thead><tr><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td>1</td><td><figure class="image image_resized image-style-align-center" style="width:56.84%;"><img style="aspect-ratio:732/918;" src="13_Geo Map_image.png" width="732" height="918"></figure></td><td>Go to Google Maps on the web and look for a desired location, right click on it and a context menu will show up.&nbsp;&nbsp;&nbsp;&nbsp;<br><br>Simply click on the first item displaying the coordinates and they will be copied to clipboard.&nbsp;&nbsp;&nbsp;&nbsp;<br><br>Then paste the value inside the text box into the <code>#geolocation</code> attribute of a child note of the map (don't forget to surround the value with a <code>"</code> character).</td></tr><tr><td>2</td><td><figure class="image image_resized image-style-align-center" style="width:100%;"><img style="aspect-ratio:518/84;" src="4_Geo Map_image.png" width="518" height="84"></figure></td><td>In Trilium, create a child note under the map.</td></tr><tr><td>3</td><td><figure class="image image_resized image-style-align-center" style="width:100%;"><img style="aspect-ratio:1074/276;" src="12_Geo Map_image.png" width="1074" height="276"></figure></td><td>And then go to Owned Attributes and type <code>#geolocation="</code>, then paste from the clipboard as-is and then add the ending <code>"</code> character. Press Enter to confirm and the map should now be updated to contain the new note.</td></tr></tbody></table></figure>
63+
<figure class="table" style="width:100%;"><table class="ck-table-resized"><colgroup><col style="width:2.77%;"><col style="width:33.24%;"><col style="width:63.99%;"></colgroup><thead><tr><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td>1</td><td><figure class="image image-style-align-center image_resized" style="width:56.84%;"><img style="aspect-ratio:732/918;" src="13_Geo Map_image.png" width="732" height="918"></figure></td><td>Go to Google Maps on the web and look for a desired location, right click on it and a context menu will show up.&nbsp;&nbsp;&nbsp;&nbsp;<br><br>Simply click on the first item displaying the coordinates and they will be copied to clipboard.&nbsp;&nbsp;&nbsp;&nbsp;<br><br>Then paste the value inside the text box into the <code>#geolocation</code> attribute of a child note of the map (don't forget to surround the value with a <code>"</code> character).</td></tr><tr><td>2</td><td><figure class="image image-style-align-center image_resized" style="width:100%;"><img style="aspect-ratio:518/84;" src="4_Geo Map_image.png" width="518" height="84"></figure></td><td>In Trilium, create a child note under the map.</td></tr><tr><td>3</td><td><figure class="image image-style-align-center image_resized" style="width:100%;"><img style="aspect-ratio:1074/276;" src="12_Geo Map_image.png" width="1074" height="276"></figure></td><td>And then go to Owned Attributes and type <code>#geolocation="</code>, then paste from the clipboard as-is and then add the ending <code>"</code> character. Press Enter to confirm and the map should now be updated to contain the new note.</td></tr></tbody></table></figure>
6464

6565
### Adding from OpenStreetMap
6666

@@ -74,6 +74,11 @@ Trilium has basic support for displaying GPS tracks on the geo map.
7474

7575
<figure class="table" style="width:100%;"><table class="ck-table-resized"><colgroup><col style="width:2.77%;"><col style="width:30.22%;"><col style="width:67.01%;"></colgroup><thead><tr><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th></tr></thead><tbody><tr><td>1</td><td><figure class="image image-style-align-center"><img style="aspect-ratio:226/74;" src="3_Geo Map_image.png" width="226" height="74"></figure></td><td>To add a track, simply drag &amp; drop a .gpx file inside the geo map in the note tree.</td></tr><tr><td>2</td><td><figure class="image image-style-align-center"><img style="aspect-ratio:322/222;" src="15_Geo Map_image.png" width="322" height="222"></figure></td><td>In order for the file to be recognized as a GPS track, it needs to show up as <code>application/gpx+xml</code> in the <em>File type</em> field.</td></tr><tr><td>3</td><td><figure class="image image-style-align-center"><img style="aspect-ratio:620/530;" src="6_Geo Map_image.png" width="620" height="530"></figure></td><td>When going back to the map, the track should now be visible.&nbsp;&nbsp;&nbsp;&nbsp;<br><br>The start and end points of the track are indicated by the two blue markers.</td></tr></tbody></table></figure>
7676

77+
> [!NOTE]
78+
> The starting point of the track will be displayed as a marker, with the name of the note underneath. The start marker will also respect the icon and the `color` of the note. The end marker is displayed with a distinct icon.
79+
>
80+
> If the GPX contains waypoints, they will also be displayed. If they have a name, it is displayed when hovering over it with the mouse.
81+
7782
## Troubleshooting
7883

7984
<figure class="image image-style-align-right image_resized" style="width:34.06%;"><img style="aspect-ratio:678/499;" src="14_Geo Map_image.png" width="678" height="499"></figure>

0 commit comments

Comments
 (0)