Skip to content

Build your personal knowledge base with Trilium Notes

docs(geomap): correct the location privacy claim; fix comment style

Elian Doranbbc0673e4274
diff --git a/apps/client/src/widgets/collections/geomap/MapToolbar.css b/apps/client/src/widgets/collections/geomap/MapToolbar.css
index 1d4bee7969..9c38e6620d 100644
--- a/apps/client/src/widgets/collections/geomap/MapToolbar.css
+++ b/apps/client/src/widgets/collections/geomap/MapToolbar.css
@@ -5,8 +5,8 @@
width: 32px;
}
-/* The glyph breathes while the device is being asked where it is: the one state of the button that
- is a wait rather than a choice. Boxicons draws the glyph in the button's ::before. */
+/* Animates only while waiting for the device's position, the one state that is a wait rather than a
+ choice. Boxicons draws the glyph in the button's ::before. */
.geo-map-container .geo-map-toolbar .geo-map-locate-button.locating::before {
animation: geo-map-locating 1.2s ease-in-out infinite alternate;
}
@@ -21,9 +21,9 @@
}
}
-/* The pulse around the device's dot is a pseudo-element scaled to three times the dot, and a
- pseudo-element is hit-tested whatever its opacity: a click on the fading ring would otherwise
- count as a click on the dot (see isLocationDot in MapToolbar.tsx). */
+/* MapLibre's pulse is a ::before scaled to three times the dot. A pseudo-element is hit-tested
+ regardless of opacity, so without this the fading ring would count as the dot in isLocationDot
+ (MapToolbar.tsx). */
.geo-map-container .maplibregl-user-location-dot::before {
pointer-events: none;
}
diff --git a/apps/client/src/widgets/collections/geomap/MapToolbar.spec.tsx b/apps/client/src/widgets/collections/geomap/MapToolbar.spec.tsx
index cf79f714a8..3e2717ae00 100644
--- a/apps/client/src/widgets/collections/geomap/MapToolbar.spec.tsx
+++ b/apps/client/src/widgets/collections/geomap/MapToolbar.spec.tsx
@@ -16,8 +16,8 @@ import MapToolbar from "./MapToolbar";
const { showError } = vi.hoisted(() => ({ showError: vi.fn() }));
vi.mock("../../../services/toast", () => ({ default: { showError } }));
-// t() returns the key, so the assertions below are on which title the button wears rather than on
-// its English wording.
+// t() returns its key, so assertions below check the button's title key rather than its English
+// text.
vi.mock("../../../services/i18n", () => ({ t: (key: string) => key }));
/** The order the group lays its buttons out in — the image viewer's, with the tilt leading and the
@@ -48,16 +48,16 @@ function fakeMap({ zoom = 5, minZoom = 2, maxZoom = 22, pitch = 0 } = {}) {
pitch = value;
fire("pitch");
};
- /** The controls the map holds, which a map being removed lets go of on its own. */
+ /** Controls added via addControl; map.remove() clears them, as MapLibre's own teardown does. */
const controls = new Set<unknown>();
return {
addControl: vi.fn((control: unknown) => { controls.add(control); }),
removeControl: vi.fn((control: unknown) => { controls.delete(control); }),
hasControl: (control: unknown) => controls.has(control),
- /** The map being torn down, as `map.remove()` does before any cleanup around it runs. */
remove: () => controls.clear(),
- /** A click on the map, landing on the element given — as MapLibre reports one on a marker. */
+ /** Fires a map click event with `originalEvent.target` set to the given element, as MapLibre
+ * does for a click on a marker. */
click: (target: Element | null) => fire("click", { originalEvent: { target }, point: { x: 0, y: 0 } }),
getZoom: () => zoom,
getMinZoom: () => minZoom,
@@ -94,11 +94,11 @@ function setFullscreenElement(element: Element | null) {
beforeEach(() => {
Object.defineProperty(document, "fullscreenElement", { value: null, configurable: true });
document.exitFullscreen = vi.fn(async () => {});
- // What a browser offers on a secure origin, which is the only place the locate button is
- // offered: happy-dom leaves the first undefined and the second null.
+ // happy-dom leaves isSecureContext undefined and navigator.geolocation null; canLocate needs
+ // both truthy, as a secure origin provides.
Object.defineProperty(window, "isSecureContext", { value: true, configurable: true });
Object.defineProperty(navigator, "geolocation", { value: {}, configurable: true });
- // The control's own press, which would otherwise reach for the browser's geolocation.
+ // Mocked so a press does not call the real Geolocation API.
vi.spyOn(GeolocateControl.prototype, "trigger").mockReturnValue(true);
showError.mockClear();
});
@@ -129,7 +129,8 @@ function press(container: HTMLElement, index: number) {
act(() => buttons(container)[index].click());
}
-/** The locate control the toolbar stood on the map, which the tests speak for as the browser would. */
+/** Returns the GeolocateControl instance MapToolbar added, so a test can fire its events as MapLibre
+ * would. */
function controlOn(map: ReturnType<typeof fakeMap>) {
const control: unknown = map.addControl.mock.calls[0]?.[0];
if (!(control instanceof GeolocateControl)) throw new Error("no locate control was added");
@@ -183,8 +184,8 @@ describe("geo map MapToolbar", () => {
try {
const container = renderToolbar(fakeMap());
- // The tilt, the device's position and the screen remain — see the mobile note in
- // MapToolbar.tsx.
+ // The zoom steps are hidden on mobile; the tilt, locate and fullscreen buttons remain
+ // (see the mobile note in MapToolbar.tsx).
expect(buttons(container).map((button) => button.className)).toEqual([
expect.stringContaining("geo-map-tilt-button"),
expect.stringContaining("bx-current-location"),
@@ -207,12 +208,14 @@ describe("geo map MapToolbar", () => {
expect(map.addControl).toHaveBeenCalledTimes(1);
const control = controlOn(map);
- // A toggle that follows the device rather than a button that flies there once.
+ // trackUserLocation: true keeps following the device rather than jumping there once.
expect(control.options.trackUserLocation).toBe(true);
- // GPS where the device has it; MapLibre's default settles for a coarse fix.
+ // enableHighAccuracy requests GPS; MapLibre's default position options settle for a coarser
+ // fix.
expect(control.options.positionOptions?.enableHighAccuracy).toBe(true);
- // MapLibre builds the control's white box; the toolbar wears the button instead.
+ // GeolocateControl's own button is hidden by HiddenGeolocateControl; MapToolbar's
+ // OverlayControlButton is used instead.
const box = document.createElement("div");
vi.spyOn(GeolocateControl.prototype, "onAdd").mockReturnValue(box);
expect(control.onAdd(map as unknown as MapLibreGLMap)).toBe(box);
@@ -221,8 +224,8 @@ describe("geo map MapToolbar", () => {
act(() => { render(null, container); });
expect(map.removeControl).toHaveBeenCalledWith(control);
- // A map torn down first has let go of the control already, and is not asked to again —
- // MapLibre throws for a control it no longer holds.
+ // If the map was torn down first, its controls are already gone; removeControl must not be
+ // called again, since MapLibre throws for a control the map no longer holds.
const torn = fakeMap();
const second = renderToolbar(torn);
torn.remove();
@@ -242,7 +245,7 @@ describe("geo map MapToolbar", () => {
press(container, LOCATE);
expect(control.trigger).toHaveBeenCalledTimes(1);
- // The press as the control reports it: waiting on the browser, then following the fix.
+ // trackuserlocationstart sets "waiting"; the first geolocate event sets "following".
act(() => { control.fire("trackuserlocationstart"); });
expect(button().getAttribute("aria-label")).toBe("geo-map.locate-waiting");
expect(button().classList.contains("active")).toBe(true);
@@ -253,8 +256,8 @@ describe("geo map MapToolbar", () => {
expect(button().classList.contains("active")).toBe(true);
expect(button().classList.contains("locating")).toBe(false);
- // A drag frees the camera. The control says the tracking ended and, in the same breath,
- // that the dot merely lost the camera; the second word is the one that counts.
+ // A drag fires trackuserlocationend and userlocationlostfocus together; the state ends at
+ // "background", not "off", since userlocationlostfocus is handled after.
act(() => {
control.fire("trackuserlocationend");
control.fire("userlocationlostfocus");
@@ -262,7 +265,7 @@ describe("geo map MapToolbar", () => {
expect(button().getAttribute("aria-label")).toBe("geo-map.locate-return");
expect(button().classList.contains("active")).toBe(false);
- // Pressed again, the camera returns to the dot.
+ // A press with the camera free fires trackuserlocationstart, then userlocationfocus.
act(() => {
control.fire("trackuserlocationstart");
control.fire("userlocationfocus");
@@ -270,7 +273,7 @@ describe("geo map MapToolbar", () => {
expect(button().getAttribute("aria-label")).toBe("geo-map.locate-following");
expect(button().classList.contains("active")).toBe(true);
- // Pressed while following, the watch stops: the drag's first word with no second one.
+ // A press while following fires only trackuserlocationend, so the state goes to "off".
act(() => { control.fire("trackuserlocationend"); });
expect(button().getAttribute("aria-label")).toBe("geo-map.locate");
expect(button().classList.contains("active")).toBe(false);
@@ -288,15 +291,15 @@ describe("geo map MapToolbar", () => {
expect(showError).toHaveBeenCalledTimes(1);
expect(showError).toHaveBeenLastCalledWith("geo-map.location-unavailable");
- // The watch goes on reporting the same failure; the reader was told the first time.
+ // The watch keeps firing the same error; showError must not be called again for it.
act(() => { control.fire("error", { code: 2, message: "unavailable" }); });
expect(showError).toHaveBeenCalledTimes(1);
- // A fix arriving after all takes the word back.
+ // A later successful fix clears the error state.
act(() => { control.fire("geolocate", { coords: {}, timestamp: 0 }); });
expect(button().getAttribute("aria-label")).toBe("geo-map.locate-following");
- // Denied is the end of it: the control clears its watch, and the button stands down.
+ // A denied permission is terminal: the button is disabled and its title reflects that.
act(() => { control.fire("error", { code: 1, message: "denied" }); });
expect(button().disabled).toBe(true);
expect(button().getAttribute("aria-label")).toBe("geo-map.locate-unavailable");
@@ -308,13 +311,13 @@ describe("geo map MapToolbar", () => {
const onLocationClick = vi.fn();
renderToolbar(map, { onLocationClick });
const control = controlOn(map);
- // The two markers the control draws, as MapLibre's stylesheet names them.
+ // Class names match MapLibre's own dot and accuracy-circle markers.
const dot = document.createElement("div");
dot.className = "maplibregl-marker maplibregl-user-location-dot";
const circle = document.createElement("div");
circle.className = "maplibregl-marker maplibregl-user-location-accuracy-circle";
- // No fix yet, so nothing stands where a click could land on it.
+ // No geolocate event yet, so lastFix is null and the click is ignored.
act(() => { map.click(dot); });
expect(onLocationClick).not.toHaveBeenCalled();
@@ -323,14 +326,15 @@ describe("geo map MapToolbar", () => {
act(() => { map.click(null); });
expect(onLocationClick).not.toHaveBeenCalled();
- // Where the dot stands rather than where on it the click fell.
+ // onLocationClick receives lastFix, not the click's own coordinates on the dot.
act(() => { map.click(dot); });
expect(onLocationClick).toHaveBeenCalledTimes(1);
expect(onLocationClick).toHaveBeenCalledWith({ lat: 45.9432, lng: 24.9668 });
});
it("keeps the locate button off a map that cannot ask where the device is", () => {
- // What a browser says of a page served over plain HTTP, where the Geolocation API refuses.
+ // isSecureContext is false for a page served over plain HTTP; canLocate requires a secure
+ // origin.
Object.defineProperty(window, "isSecureContext", { value: false, configurable: true });
const map = fakeMap();
const container = renderToolbar(map);
@@ -401,7 +405,7 @@ describe("geo map MapToolbar", () => {
it("stops listening to a map it is taken off", () => {
const map = fakeMap();
const container = renderToolbar(map);
- // One listener for the zoom, one for the pitch, one for a click on the device's dot.
+ // One map.on listener each for zoom, pitch, and the dot-click handler.
expect(map.listenerCount).toBe(3);
// A map torn down under controls that stayed behind would go on being reported to.
diff --git a/apps/client/src/widgets/collections/geomap/MapToolbar.tsx b/apps/client/src/widgets/collections/geomap/MapToolbar.tsx
index f61e49b63d..e785e69fb7 100644
--- a/apps/client/src/widgets/collections/geomap/MapToolbar.tsx
+++ b/apps/client/src/widgets/collections/geomap/MapToolbar.tsx
@@ -33,9 +33,9 @@ import { ParentMap, useMapPitch } from "./map";
* remembered from the last press — MapLibre tilts for Ctrl and a drag as well, and a button that
* only watched itself would go on offering a 3D the reader is already in.
*
- * Between the steps and the screen stands the locate button. It asks the device where it is, frames
- * the map there and follows the position until the map is dragged or the button pressed again. The
- * work is MapLibre's own GeolocateControl with its button hidden (see useGeolocate).
+ * The locate button sits between the zoom steps and the fullscreen button. It requests the device's
+ * position, frames the map on it, and keeps following it until the map is dragged or the button is
+ * pressed again. GeolocateControl does the work, with its own button hidden (see useGeolocate).
*
* On mobile the two steps stay home, as the image viewer's do: the fingers already zoom, and the
* foot of a narrow map is spoken for. The tilt is kept — the two-finger drag that leans the view
@@ -49,8 +49,8 @@ const TILTED_PITCH = 45;
interface MapToolbarProps {
/**
- * A click on the dot the locate button draws for the device, handed the position the dot stands
- * at rather than where the click landed on it (see {@link useGeolocate}).
+ * Called when the device's location dot is clicked, with the dot's position rather than the
+ * click's own coordinates on it (see {@link useGeolocate}).
*/
onLocationClick?: (location: LngLat) => void;
}
@@ -159,10 +159,8 @@ interface Locate {
/** The Geolocation API's code for a permission the user or the browser refused. */
const PERMISSION_DENIED = 1;
-/**
- * MapLibre's GeolocateControl with its button hidden. The map keeps the control's behaviour and the
- * toolbar wears the button (see {@link useGeolocate}).
- */
+/** GeolocateControl with its own button hidden; MapToolbar's OverlayControlButton drives it instead
+ * (see {@link useGeolocate}). */
class HiddenGeolocateControl extends GeolocateControl {
onAdd(map: MapLibreGLMap) {
const container = super.onAdd(map);
@@ -172,26 +170,27 @@ class HiddenGeolocateControl extends GeolocateControl {
}
/**
- * Drives MapLibre's locate control from the toolbar's own button.
+ * Drives GeolocateControl from MapToolbar's own button instead of the control's hidden one.
*
- * The control keeps its behaviour: the first press starts a watch on the device's position, frames
- * the first fix to its accuracy and follows the later ones; dragging the map keeps the dot and frees
- * the camera; a press while following stops the watch and removes the dot, and a press while the
- * camera is free returns it to the dot. The dot and its accuracy circle are DOM markers, so they need
- * no carrying across a style switch (see `keepAdditions` in map.tsx). What the control's hidden button
- * would show is read off its events instead.
+ * GeolocateControl's own behavior is unchanged: the first press starts a watch on the device's
+ * position, frames the first fix to its accuracy and follows later fixes; dragging the map keeps the
+ * dot and frees the camera; a press while following stops the watch and removes the dot; a press while
+ * the camera is free re-centers on the dot. The dot and its accuracy circle are DOM markers, so they
+ * need no handling across a style switch (see `keepAdditions` in map.tsx). Button state comes from the
+ * control's events instead of its own DOM.
*
* `trackuserlocationend` fires both when the watch stops and when a drag frees the camera; only the
- * drag follows it, synchronously, with `userlocationlostfocus`, so the state is set to off and then
- * corrected. A denied permission is terminal: the control clears its watch and disables its button,
- * and so does this.
+ * drag also fires `userlocationlostfocus`, synchronously right after. `setState` is called with "off"
+ * and then corrected to "background" — Preact batches both calls into one render, so the button never
+ * flashes off. A denied permission is terminal: the control clears its watch and disables its button,
+ * and so does this hook.
*
- * A click on the dot is reported through `onLocationClick` with the last fix, which is where the dot
- * stands; the click itself lands somewhere on the dot's few pixels. The accuracy circle is a marker
- * of its own and a click on it is a click on the map (see {@link isLocationDot}).
+ * `onLocationClick` receives the last fix from the "geolocate" event, not the click's own coordinates
+ * on the dot (see {@link isLocationDot}, which tells a click on the dot from one on the accuracy
+ * circle marker).
*
- * Returns `null` where the button cannot work: no Geolocation API, or an insecure origin, where
- * browsers refuse the call outright.
+ * Returns `null` when the Geolocation API is unavailable or the origin is insecure, since browsers
+ * refuse the call in both cases.
*/
function useGeolocate(map: MapLibreGLMap | null, onLocationClick?: (location: LngLat) => void): Locate | null {
const available = canLocate();
@@ -201,8 +200,9 @@ function useGeolocate(map: MapLibreGLMap | null, onLocationClick?: (location: Ln
// Whether the reader has been told of the failure the watch is in; a watch reports the same
// failure over and over, and one toast is enough for it.
const toldOfError = useRef(false);
- // Where the dot stands, as the last fix put it. The click handler below reads the callback
- // through a ref as well, so a caller passing a new function does not rebuild the control.
+ // lastFix holds the position from the most recent "geolocate" event, read by onMapClick below.
+ // onLocationClickRef holds the callback so a new function from the caller does not rebuild the
+ // control.
const lastFix = useRef<LngLat | null>(null);
const onLocationClickRef = useRef(onLocationClick);
onLocationClickRef.current = onLocationClick;
@@ -218,8 +218,8 @@ function useGeolocate(map: MapLibreGLMap | null, onLocationClick?: (location: Ln
control.current = geolocate;
map.addControl(geolocate);
- // A press from off waits on the browser; a press with the camera free returns to the dot,
- // which userlocationfocus says as well.
+ // trackuserlocationstart moves to "following" if the state was "background", else "waiting";
+ // userlocationfocus also sets "following".
geolocate.on("trackuserlocationstart", () => {
setState((current) => current === "background" ? "following" : "waiting");
});
@@ -287,12 +287,12 @@ function canLocate() {
}
/**
- * Whether a click landed on the dot the locate control draws for the device's position.
+ * Whether a click landed on GeolocateControl's user-location dot.
*
- * The dot is a DOM marker rather than a layer, so it is told by the click's target instead of by
- * hit-testing the map; the accuracy circle around it is a marker of its own and does not count. The
- * class is MapLibre's, from its stylesheet. Its pulse is a pseudo-element scaled to three times the
- * dot and is kept out of the hit test by MapToolbar.css.
+ * The dot is a DOM marker, not a layer, so this checks the click's target instead of hit-testing the
+ * map; the accuracy circle is a separate marker and does not match. The class name is MapLibre's own,
+ * from its stylesheet. MapToolbar.css sets `pointer-events: none` on the dot's pulse pseudo-element so
+ * it does not enlarge the hit area.
*/
export function isLocationDot(target: EventTarget | null): boolean {
return target instanceof Element && target.closest(".maplibregl-user-location-dot") !== null;
diff --git a/apps/client/src/widgets/collections/geomap/Pois.spec.tsx b/apps/client/src/widgets/collections/geomap/Pois.spec.tsx
index 9285111bd3..1241a103b9 100644
--- a/apps/client/src/widgets/collections/geomap/Pois.spec.tsx
+++ b/apps/client/src/widgets/collections/geomap/Pois.spec.tsx
@@ -43,7 +43,8 @@ const { FakePopup } = vi.hoisted(() => {
return { FakePopup };
});
-// GeolocateControl is extended at module load by MapToolbar, which the click guard is imported from.
+// isLocationDot is imported from MapToolbar, which extends GeolocateControl at module load
+// (HiddenGeolocateControl); the mock must define it too.
vi.mock("maplibre-gl", () => ({ GeolocateControl: class {}, Popup: FakePopup, setWorkerUrl: vi.fn() }));
/** What the tooltip currently reads, or `null` where none is up. */
@@ -93,7 +94,8 @@ function fakeMap({
onPoi = poi;
onOwn = own;
},
- /** A click on the map, landing on the element given — as MapLibre reports one on a marker. */
+ /** Fires a map click event with `originalEvent.target` set to the given element, as MapLibre
+ * does for a click on a marker. */
click(target: Element | null = null) {
for (const fn of listeners.get("click") ?? []) fn({ point: { x: 0, y: 0 }, originalEvent: { target } });
},
@@ -260,8 +262,8 @@ describe("geo map Pois", () => {
const { picked } = await renderPois(map);
map.setUnderPointer({ poi: [ poiFeature({ name: "Café Kranzler", amenity: "cafe" }) ] });
- // The dot is a DOM marker over the canvas rather than a layer, so the hit test cannot see it;
- // the click's target can.
+ // isLocationDot checks the click's target directly, since the dot is a DOM marker over the
+ // canvas rather than a layer the POI hit test below can see.
const dot = document.createElement("div");
dot.className = "maplibregl-marker maplibregl-user-location-dot";
await act(async () => { map.click(dot); });
diff --git a/apps/client/src/widgets/collections/geomap/Pois.tsx b/apps/client/src/widgets/collections/geomap/Pois.tsx
index 526c91643a..422b6bef19 100644
--- a/apps/client/src/widgets/collections/geomap/Pois.tsx
+++ b/apps/client/src/widgets/collections/geomap/Pois.tsx
@@ -87,8 +87,8 @@ export default function Pois({ placing, onPick }: PoisProps) {
const onClick = (e: MapMouseEvent) => {
if (map.getZoom() < MIN_POI_ZOOM || isOwnUnderPointer(map, e.point)) return;
- // The device's dot stands above the base map too, but as a DOM marker the hit test
- // cannot see; a click on it is the dot's (see useGeolocate in MapToolbar).
+ // The location dot is a DOM marker, not a layer, so poiLayers below cannot see it;
+ // isLocationDot checks the click's target directly (see useGeolocate in MapToolbar).
if (isLocationDot(e.originalEvent.target)) return;
const layers = poiLayers(map);
diff --git a/apps/client/src/widgets/collections/geomap/coordinates.ts b/apps/client/src/widgets/collections/geomap/coordinates.ts
index 47c43d4dc0..84b62032dd 100644
--- a/apps/client/src/widgets/collections/geomap/coordinates.ts
+++ b/apps/client/src/widgets/collections/geomap/coordinates.ts
@@ -79,11 +79,11 @@ export function formatCoordinates([ lng, lat ]: [number, number]) {
export const POINT_ZOOM = 16;
/**
- * A bare point as a place, like any the geocoder answers with, so that standing the map on it pins
- * it and offers it for keeping exactly as a searched place is (see PlacePanel). It has no name of
- * its own, which is why it is named by its coordinates and marked `unnamed`.
+ * Builds a `GeoSearchResult` for a bare coordinate, shaped like any geocoder result so `pickPlace`
+ * can pin it and offer it for keeping as a marker (see PlacePanel). It has no name, so it is named by
+ * its own coordinates and marked `unnamed`.
*
- * Serves the point typed into the search bar and the dot the locate button draws for the device.
+ * Used for a coordinate typed into the search bar and for the device's location fix.
*/
export function pointPlace(center: [number, number]): GeoSearchResult {
const [ lng, lat ] = center;
diff --git a/apps/client/src/widgets/collections/geomap/index.tsx b/apps/client/src/widgets/collections/geomap/index.tsx
index e47074be7d..527ba89a6c 100644
--- a/apps/client/src/widgets/collections/geomap/index.tsx
+++ b/apps/client/src/widgets/collections/geomap/index.tsx
@@ -195,9 +195,9 @@ export default function GeoView({ note, noteIds, viewConfig, saveConfig }: ViewM
}, []);
/**
- * Stands the map on the device's own position, as it stands on a point typed into the search bar:
- * the coordinates under a pin, offered for keeping as a marker (see PlacePanel). Not while a click
- * is armed to place a note, when the click means that instead.
+ * Points the map at the device's position the same way it points at a typed coordinate: pickPlace
+ * opens it as a place, offered for keeping as a marker (see PlacePanel). Does nothing while a click
+ * is armed to place a note instead.
*/
const showLocation = useCallback((location: { lat: number; lng: number }) => {
if (placement) return;
@@ -446,8 +446,8 @@ export default function GeoView({ note, noteIds, viewConfig, saveConfig }: ViewM
}
/**
- * A coordinate to the six decimals a place is named and stored to, which name a spot to within a
- * stride (see `formatLocation` in Markers). A fix carries digits far beyond that.
+ * Rounds a coordinate to six decimals, the precision a place is named and stored at (see
+ * `formatLocation` in Markers). A geolocation fix reports far more digits than that.
*/
function roundCoordinate(value: number) {
return Number(value.toFixed(6));
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Geo Map.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Geo Map.html
index 0c5dd13924..f5c95e035b 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Geo Map.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Geo Map.html
@@ -88,9 +88,12 @@
button is disabled until the map is opened again. To allow it after all,
change the permission for Trilium in the browser or in the system's location
settings.</p>
-<p>Your position is not stored in the note and is not sent anywhere. The map
- does remember where you left it, as it does after any other movement, so
- a map you have taken to your location opens there the next time.</p>
+<p>Your position is not stored in the note, and Trilium does not send it
+ anywhere on its own. Moving the map there does what any other pan or zoom
+ does: the tile provider behind the map's style sees the coordinates of the
+ area now on screen. The map does remember where you left it, as it does
+ after any other movement, so a map you have taken to your location opens
+ there the next time.</p>
<h2>Searching the map</h2>
<p>The search bar at the top-left of the map searches in two places. It always
searches the notes that are already on the map. It can also search for
diff --git a/docs/User Guide/User Guide/Collections/Geo Map.md b/docs/User Guide/User Guide/Collections/Geo Map.md
index 0bfd1ab823..daf223a900 100644
--- a/docs/User Guide/User Guide/Collections/Geo Map.md
+++ b/docs/User Guide/User Guide/Collections/Geo Map.md
@@ -60,7 +60,7 @@ Click the dot to see its coordinates in the panel a searched place is shown in.
If the position cannot be found, a message says so and the button keeps waiting for one; press it again to stop. If you refuse the permission, the button is disabled until the map is opened again. To allow it after all, change the permission for Trilium in the browser or in the system's location settings.
-Your position is not stored in the note and is not sent anywhere. The map does remember where you left it, as it does after any other movement, so a map you have taken to your location opens there the next time.
+Your position is not stored in the note, and Trilium does not send it anywhere on its own. Moving the map there does what any other pan or zoom does: the tile provider behind the map's style sees the coordinates of the area now on screen. The map does remember where you left it, as it does after any other movement, so a map you have taken to your location opens there the next time.
## Searching the map