Merge branch 'develop' of https://github.com/TriliumNext/Notes into develop

This commit is contained in:
Adorian Doran 2025-06-01 16:15:03 +03:00
commit e3d1eccfd6
5 changed files with 36 additions and 20 deletions

View File

@ -39,12 +39,12 @@ declare module "leaflet" {
startIcon?: DivIcon | Icon | string | undefined; startIcon?: DivIcon | Icon | string | undefined;
endIcon?: DivIcon | Icon | string | undefined; endIcon?: DivIcon | Icon | string | undefined;
wptIcons?: { wptIcons?: {
[key: string]: Icon | string; [key: string]: DivIcon | Icon | string;
}; };
wptTypeIcons?: { 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 { interface GPXOptions {

View File

@ -235,7 +235,10 @@ export default class GeoMapTypeWidget extends TypeWidget {
const track = new this.L.GPX(stringResponse, { const track = new this.L.GPX(stringResponse, {
markers: { markers: {
startIcon: this.#buildIcon(note.getIcon(), note.getColorClass(), note.title), 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); track.addTo(this.geoMapWidget.map);

View File

@ -19,7 +19,7 @@
<tr> <tr>
<td>1</td> <td>1</td>
<td> <td>
<figure class="image image_resized image-style-align-center" style="width:51.25%;"> <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" <img style="aspect-ratio:1256/1044;" src="7_Geo Map_image.png" width="1256"
height="1044"> height="1044">
</figure> </figure>
@ -29,7 +29,7 @@
<tr> <tr>
<td>2</td> <td>2</td>
<td> <td>
<figure class="image image_resized image-style-align-center" style="width:53.44%;"> <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" <img style="aspect-ratio:1720/1396;" src="9_Geo Map_image.png" width="1720"
height="1396"> height="1396">
</figure> </figure>
@ -39,7 +39,6 @@
</tbody> </tbody>
</table> </table>
</figure> </figure>
<h2>Repositioning the map</h2> <h2>Repositioning the map</h2>
<ul> <ul>
<li>Click and drag the map in order to move across the map.</li> <li>Click and drag the map in order to move across the map.</li>
@ -103,11 +102,12 @@
</tbody> </tbody>
</table> </table>
</figure> </figure>
<h2>How the location of the markers is stored</h2> <h2>How the location of the markers is stored</h2>
<p>The location of a marker is stored in the <code>#geolocation</code> attribute <p>The location of a marker is stored in the <code>#geolocation</code> attribute
of the child notes:</p> of the child notes:</p>
<img src="18_Geo Map_image.png" width="1288" height="278"> <p>
<img src="18_Geo Map_image.png" width="1288" height="278">
</p>
<p>This value can be added manually if needed. The value of the attribute <p>This value can be added manually if needed. The value of the attribute
is made up of the latitude and longitude separated by a comma.</p> is made up of the latitude and longitude separated by a comma.</p>
<h2>Repositioning markers</h2> <h2>Repositioning markers</h2>
@ -170,7 +170,7 @@
<tr> <tr>
<td>1</td> <td>1</td>
<td> <td>
<figure class="image image_resized image-style-align-center" style="width:56.84%;"> <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" <img style="aspect-ratio:732/918;" src="13_Geo Map_image.png" width="732"
height="918"> height="918">
</figure> </figure>
@ -187,7 +187,7 @@
<tr> <tr>
<td>2</td> <td>2</td>
<td> <td>
<figure class="image image_resized image-style-align-center" style="width:100%;"> <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" <img style="aspect-ratio:518/84;" src="4_Geo Map_image.png" width="518"
height="84"> height="84">
</figure> </figure>
@ -197,7 +197,7 @@
<tr> <tr>
<td>3</td> <td>3</td>
<td> <td>
<figure class="image image_resized image-style-align-center" style="width:100%;"> <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" <img style="aspect-ratio:1074/276;" src="12_Geo Map_image.png" width="1074"
height="276"> height="276">
</figure> </figure>
@ -210,7 +210,6 @@
</tbody> </tbody>
</table> </table>
</figure> </figure>
<h3>Adding from OpenStreetMap</h3> <h3>Adding from OpenStreetMap</h3>
<p>Similarly to the Google Maps approach:</p> <p>Similarly to the Google Maps approach:</p>
<figure class="table" style="width:100%;"> <figure class="table" style="width:100%;">
@ -260,7 +259,6 @@
</tbody> </tbody>
</table> </table>
</figure> </figure>
<h2>Adding GPS tracks (.gpx)</h2> <h2>Adding GPS tracks (.gpx)</h2>
<p>Trilium has basic support for displaying GPS tracks on the geo map.</p> <p>Trilium has basic support for displaying GPS tracks on the geo map.</p>
<figure <figure
@ -316,14 +314,20 @@ class="table" style="width:100%;">
</tbody> </tbody>
</table> </table>
</figure> </figure>
<aside class="admonition note">
<h2>Troubleshooting</h2> <p>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 <code>color</code> of the note. The end marker is displayed with
a distinct icon.</p>
<p>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.</p>
</aside>
<h2>Troubleshooting</h2>
<figure class="image image-style-align-right image_resized" style="width:34.06%;"> <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" <img style="aspect-ratio:678/499;" src="14_Geo Map_image.png" width="678"
height="499"> height="499">
</figure> </figure>
<h3>Grid-like artifacts on the map</h3>
<h3>Grid-like artifacts on the map</h3>
<p>This occurs if the application is not at 100% zoom which causes the pixels <p>This occurs if the application is not at 100% zoom which causes the pixels
of the map to not render correctly due to fractional scaling. The only of the map to not render correctly due to fractional scaling. The only
possible solution is to set the UI zoom at 100% (default keyboard shortcut possible solution is to set the UI zoom at 100% (default keyboard shortcut

View File

@ -28,6 +28,7 @@
* [Unable to handle multi line mathematical formulas when importing markdown](https://github.com/TriliumNext/Notes/pull/1984) by @SiriusXT * [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 * Calendar: became invisible if resizing while not visible
* [GPX track not rendering on geomap note](https://github.com/TriliumNext/Notes/issues/2085) * [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 ## ✨ Improvements
@ -61,6 +62,9 @@
* [improve tab scroll UX by switching from instant to smooth behavior](https://github.com/TriliumNext/Notes/pull/2030) by @SiriusXT * [improve tab scroll UX by switching from instant to smooth behavior](https://github.com/TriliumNext/Notes/pull/2030) by @SiriusXT
* Calendar view: display calendar view if `#viewType=calendar` is set. * Calendar view: display calendar view if `#viewType=calendar` is set.
* [Mind map: add search support](https://github.com/TriliumNext/Notes/pull/2055) by @SiriusXT * [Mind map: add search support](https://github.com/TriliumNext/Notes/pull/2055) by @SiriusXT
* Geo map:
* The name, icon and color of the track note are displayed as the starting point.
* Added a distinct icon for the end marker.
## 📖 Documentation ## 📖 Documentation

View File

@ -5,7 +5,7 @@ This note type displays the children notes on a geographical map, based on an at
## Creating a new geo map ## Creating a new geo map
<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> <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>
## Repositioning the map ## Repositioning the map
@ -60,7 +60,7 @@ The value of the attribute is made up of the latitude and longitude separated by
### Adding from Google Maps ### Adding from Google Maps
<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> <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>
### Adding from OpenStreetMap ### Adding from OpenStreetMap
@ -74,6 +74,11 @@ Trilium has basic support for displaying GPS tracks on the geo map.
<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> <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>
> [!NOTE]
> 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.
>
> 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.
## Troubleshooting ## Troubleshooting
<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> <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>