Skip to content

Build your personal knowledge base with Trilium Notes

feat(geomap): offer the device's dot as a place when it is clicked

Elian Doran31cc8a825b66
diff --git a/apps/client/src/widgets/collections/geomap/MapToolbar.css b/apps/client/src/widgets/collections/geomap/MapToolbar.css
index 230560fb99..4454471157 100644
--- a/apps/client/src/widgets/collections/geomap/MapToolbar.css
+++ b/apps/client/src/widgets/collections/geomap/MapToolbar.css
@@ -21,3 +21,10 @@
}
}
+/* 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). */
+.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 9428f1f066..cf79f714a8 100644
--- a/apps/client/src/widgets/collections/geomap/MapToolbar.spec.tsx
+++ b/apps/client/src/widgets/collections/geomap/MapToolbar.spec.tsx
@@ -6,7 +6,7 @@
* back.
*/
import { GeolocateControl, type Map as MapLibreGLMap } from "maplibre-gl";
-import { render } from "preact";
+import { type ComponentProps, render } from "preact";
import { act } from "preact/test-utils";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
@@ -29,10 +29,12 @@ const LOCATE = 3;
const FULLSCREEN = 4;
/** A map that zooms and tilts, says so, and stands somewhere — all these controls ask of one. */
+type Listener = (payload?: unknown) => void;
+
function fakeMap({ zoom = 5, minZoom = 2, maxZoom = 22, pitch = 0 } = {}) {
- const listeners = new Map<string, Set<() => void>>();
- const fire = (event: string) => {
- for (const listener of listeners.get(event) ?? []) listener();
+ const listeners = new Map<string, Set<Listener>>();
+ const fire = (event: string, payload?: unknown) => {
+ for (const listener of listeners.get(event) ?? []) listener(payload);
};
const container = document.createElement("div");
container.requestFullscreen = vi.fn(async () => {});
@@ -55,6 +57,8 @@ function fakeMap({ zoom = 5, minZoom = 2, maxZoom = 22, pitch = 0 } = {}) {
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. */
+ click: (target: Element | null) => fire("click", { originalEvent: { target }, point: { x: 0, y: 0 } }),
getZoom: () => zoom,
getMinZoom: () => minZoom,
getMaxZoom: () => maxZoom,
@@ -69,10 +73,10 @@ function fakeMap({ zoom = 5, minZoom = 2, maxZoom = 22, pitch = 0 } = {}) {
easeTo: vi.fn(({ pitch: leanedTo }: { pitch?: number }) => {
if (leanedTo !== undefined) setPitch(leanedTo);
}),
- on: (event: string, listener: () => void) => {
+ on: (event: string, listener: Listener) => {
listeners.set(event, (listeners.get(event) ?? new Set()).add(listener));
},
- off: (event: string, listener: () => void) => { listeners.get(event)?.delete(listener); },
+ off: (event: string, listener: Listener) => { listeners.get(event)?.delete(listener); },
get listenerCount() {
let count = 0;
for (const held of listeners.values()) count += held.size;
@@ -104,12 +108,12 @@ afterEach(() => {
});
/** Builds the controls over a map and settles them, so they are listening before being spoken to. */
-function renderToolbar(map: ReturnType<typeof fakeMap> | null) {
+function renderToolbar(map: ReturnType<typeof fakeMap> | null, props: ComponentProps<typeof MapToolbar> = {}) {
let container: HTMLElement | undefined;
act(() => {
container = renderInto(
<ParentMap.Provider value={map as unknown as MapLibreGLMap}>
- <MapToolbar />
+ <MapToolbar {...props} />
</ParentMap.Provider>
);
});
@@ -299,6 +303,32 @@ describe("geo map MapToolbar", () => {
expect(showError).toHaveBeenLastCalledWith("geo-map.location-denied");
});
+ it("tells a click on the device's dot from one on its accuracy circle, and hands over the fix", () => {
+ const map = fakeMap();
+ const onLocationClick = vi.fn();
+ renderToolbar(map, { onLocationClick });
+ const control = controlOn(map);
+ // The two markers the control draws, as MapLibre's stylesheet names them.
+ 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.
+ act(() => { map.click(dot); });
+ expect(onLocationClick).not.toHaveBeenCalled();
+
+ act(() => { control.fire("geolocate", { coords: { latitude: 45.9432, longitude: 24.9668 }, timestamp: 0 }); });
+ act(() => { map.click(circle); });
+ act(() => { map.click(null); });
+ expect(onLocationClick).not.toHaveBeenCalled();
+
+ // Where the dot stands rather than where on it the click fell.
+ 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.
Object.defineProperty(window, "isSecureContext", { value: false, configurable: true });
@@ -371,8 +401,8 @@ 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.
- expect(map.listenerCount).toBe(2);
+ // One listener for the zoom, one for the pitch, one for a click on the device's dot.
+ expect(map.listenerCount).toBe(3);
// A map torn down under controls that stayed behind would go on being reported to.
act(() => { render(null, container); });
diff --git a/apps/client/src/widgets/collections/geomap/MapToolbar.tsx b/apps/client/src/widgets/collections/geomap/MapToolbar.tsx
index 14f2ed6e06..f61e49b63d 100644
--- a/apps/client/src/widgets/collections/geomap/MapToolbar.tsx
+++ b/apps/client/src/widgets/collections/geomap/MapToolbar.tsx
@@ -1,7 +1,7 @@
import "./MapToolbar.css";
import clsx from "clsx";
-import { GeolocateControl, type Map as MapLibreGLMap } from "maplibre-gl";
+import { GeolocateControl, type Map as MapLibreGLMap, type MapMouseEvent } from "maplibre-gl";
import { useCallback, useContext, useEffect, useRef, useState } from "preact/hooks";
import { t } from "../../../services/i18n";
@@ -46,7 +46,22 @@ import { ParentMap, useMapPitch } from "./map";
/** How far the button leans the view over — a lean rather than the horizon, as Google Maps takes
* it. Ctrl and a drag go further, all the way to MapLibre's own limit. */
const TILTED_PITCH = 45;
-export default function MapToolbar() {
+
+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}).
+ */
+ onLocationClick?: (location: LngLat) => void;
+}
+
+/** A position as the Geolocation API reports one and `#geolocation` stores it. */
+interface LngLat {
+ lat: number;
+ lng: number;
+}
+
+export default function MapToolbar({ onLocationClick }: MapToolbarProps) {
const map = useContext(ParentMap);
// The zoom is only read for the steps' disabled state, so where the steps stay home the map is
// not listened to for it either.
@@ -55,7 +70,7 @@ export default function MapToolbar() {
// The map itself rather than the whole view: what is around it is the note's own chrome, and
// everything the bar above the map offers is on the map's right-click menu as well.
const [ isFullscreen, toggleFullscreen ] = useFullscreen(map?.getContainer());
- const locate = useGeolocate(map);
+ const locate = useGeolocate(map, onLocationClick);
if (!map) return null;
@@ -171,10 +186,14 @@ class HiddenGeolocateControl extends GeolocateControl {
* corrected. A denied permission is terminal: the control clears its watch and disables its button,
* and so does this.
*
+ * 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}).
+ *
* Returns `null` where the button cannot work: no Geolocation API, or an insecure origin, where
* browsers refuse the call outright.
*/
-function useGeolocate(map: MapLibreGLMap | null): Locate | null {
+function useGeolocate(map: MapLibreGLMap | null, onLocationClick?: (location: LngLat) => void): Locate | null {
const available = canLocate();
const control = useRef<GeolocateControl | null>(null);
const [ state, setState ] = useState<LocateState>("off");
@@ -182,6 +201,11 @@ function useGeolocate(map: MapLibreGLMap | null): Locate | null {
// 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.
+ const lastFix = useRef<LngLat | null>(null);
+ const onLocationClickRef = useRef(onLocationClick);
+ onLocationClickRef.current = onLocationClick;
useEffect(() => {
if (!map || !available) return;
@@ -206,7 +230,8 @@ function useGeolocate(map: MapLibreGLMap | null): Locate | null {
toldOfError.current = false;
});
geolocate.on("userlocationlostfocus", () => setState("background"));
- geolocate.on("geolocate", () => {
+ geolocate.on("geolocate", ({ coords }) => {
+ lastFix.current = { lat: coords.latitude, lng: coords.longitude };
setHasError(false);
toldOfError.current = false;
setState((current) => current === "waiting" ? "following" : current);
@@ -224,8 +249,20 @@ function useGeolocate(map: MapLibreGLMap | null): Locate | null {
}
});
+ // The dot is a DOM marker in the canvas container, so a click on it reaches the map's own
+ // click event with the dot as its target.
+ const onMapClick = (e: MapMouseEvent) => {
+ const fix = lastFix.current;
+ if (fix && isLocationDot(e.originalEvent.target)) {
+ onLocationClickRef.current?.(fix);
+ }
+ };
+ map.on("click", onMapClick);
+
return () => {
+ map.off("click", onMapClick);
control.current = null;
+ lastFix.current = null;
setState("off");
setHasError(false);
toldOfError.current = false;
@@ -249,6 +286,18 @@ function canLocate() {
return window.isSecureContext === true && !!navigator.geolocation;
}
+/**
+ * Whether a click landed on the dot the locate control draws for the device's position.
+ *
+ * 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.
+ */
+export function isLocationDot(target: EventTarget | null): boolean {
+ return target instanceof Element && target.closest(".maplibregl-user-location-dot") !== null;
+}
+
function locateTitle({ state, hasError }: Locate) {
switch (state) {
case "denied": return t("geo-map.locate-unavailable");
diff --git a/apps/client/src/widgets/collections/geomap/Pois.spec.tsx b/apps/client/src/widgets/collections/geomap/Pois.spec.tsx
index d4d4eef393..9285111bd3 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 };
});
-vi.mock("maplibre-gl", () => ({ Popup: FakePopup, setWorkerUrl: vi.fn() }));
+// GeolocateControl is extended at module load by MapToolbar, which the click guard is imported from.
+vi.mock("maplibre-gl", () => ({ GeolocateControl: class {}, Popup: FakePopup, setWorkerUrl: vi.fn() }));
/** What the tooltip currently reads, or `null` where none is up. */
function tooltipText() {
@@ -92,8 +93,9 @@ function fakeMap({
onPoi = poi;
onOwn = own;
},
- click() {
- for (const fn of listeners.get("click") ?? []) fn({ point: { x: 0, y: 0 } });
+ /** A click on the map, landing on the element given — as MapLibre reports one on a marker. */
+ click(target: Element | null = null) {
+ for (const fn of listeners.get("click") ?? []) fn({ point: { x: 0, y: 0 }, originalEvent: { target } });
},
/** The pointer coming to rest on a place of the base map, as MapLibre reports it. */
hover(feature: unknown) {
@@ -253,6 +255,20 @@ describe("geo map Pois", () => {
expect(picked).toEqual([]);
});
+ it("leaves a click that landed on the device's own dot to the dot", async () => {
+ const map = fakeMap();
+ 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.
+ const dot = document.createElement("div");
+ dot.className = "maplibregl-marker maplibregl-user-location-dot";
+ await act(async () => { map.click(dot); });
+
+ expect(picked).toEqual([]);
+ });
+
it("leaves the click alone while one is armed to place a marker", async () => {
const map = fakeMap();
const { picked } = await renderPois(map, { placing: true });
diff --git a/apps/client/src/widgets/collections/geomap/Pois.tsx b/apps/client/src/widgets/collections/geomap/Pois.tsx
index d9edb45bc1..526c91643a 100644
--- a/apps/client/src/widgets/collections/geomap/Pois.tsx
+++ b/apps/client/src/widgets/collections/geomap/Pois.tsx
@@ -7,6 +7,7 @@ import { CLUSTER_LAYERS } from "./clusters";
import type { GeoSearchResult } from "./geocoding";
import { trackHitLayers } from "./GpxTrack";
import { MapStyleLoaded, ParentMap } from "./map";
+import { isLocationDot } from "./MapToolbar";
import { MARKER_LAYER } from "./Markers";
import { placeIcon } from "./osm_icons";
import { PLACE_LAYER, PLACE_MARKER_COLOR } from "./PlaceMarker";
@@ -86,6 +87,9 @@ 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).
+ if (isLocationDot(e.originalEvent.target)) return;
const layers = poiLayers(map);
if (!layers.length) return;
diff --git a/apps/client/src/widgets/collections/geomap/SearchBox.tsx b/apps/client/src/widgets/collections/geomap/SearchBox.tsx
index 1bd8573f6a..7c33245d65 100644
--- a/apps/client/src/widgets/collections/geomap/SearchBox.tsx
+++ b/apps/client/src/widgets/collections/geomap/SearchBox.tsx
@@ -14,7 +14,7 @@ import { filterTokens, matchesFilter } from "../../react/filter";
import FormAutocomplete from "../../react/FormAutocomplete";
import Icon from "../../react/Icon";
import OverlayToolbar, { OverlayToolbarButton } from "../../react/OverlayToolbar";
-import { formatCoordinates, parseCoordinates } from "./coordinates";
+import { parseCoordinates, pointPlace } from "./coordinates";
import { DEFAULT_GEOCODING_PROVIDER_NAME, DEFAULT_PLACE_ICON, type GeoBounds, GEOCODING_PROVIDERS, type GeoSearchResult, SEARCH_RADIUS_M } from "./geocoding";
import { GPX_MIME } from "./GpxTrack";
import { ParentMap } from "./map";
@@ -49,12 +49,6 @@ const EARTH_RADIUS_M = 6_371_008.8;
*/
const RESULT_LIST_WIDTH = 500;
-/**
- * How close a point named by its coordinates is shown. Nearer than the level a place of unsaid
- * extent is given: coordinates are typed to reach one spot rather than the town around it.
- */
-const POINT_ZOOM = 16;
-
/** Caps how many of the map's own notes the list offers. */
const MAX_MARKER_RESULTS = 8;
@@ -477,11 +471,8 @@ function headingEntry(key: string, label: string): SearchEntry {
}
/**
- * The row for a point the query names outright, or `null` where it names none.
- *
- * A place like any the geocoder answers with, so that taking it pins it, offers it for keeping and
- * steps among the rest exactly as a searched place does — one without a name, which is why it is
- * named by its own coordinates.
+ * The row for a point the query names outright, or `null` where it names none. The point is offered
+ * as a place (see `pointPlace`), so taking it pins it and steps among the rest as a searched place does.
*/
function pointEntry(query: string): SearchEntry | null {
const center = parseCoordinates(query);
@@ -489,24 +480,15 @@ function pointEntry(query: string): SearchEntry | null {
return null;
}
- const [ lng, lat ] = center;
- const coordinates = formatCoordinates(center);
+ const result = pointPlace(center);
return {
kind: "point",
- key: `place:point:${lng},${lat}`,
- label: t("geo-map.go-to-coordinates", { coordinates }),
+ key: `place:${result.id}`,
+ label: t("geo-map.go-to-coordinates", { coordinates: result.name }),
icon: "bx bx-crosshair",
center,
- result: {
- id: `point:${lng},${lat}`,
- name: coordinates,
- label: coordinates,
- lat,
- lng,
- zoom: POINT_ZOOM,
- unnamed: true
- }
+ result
};
}
diff --git a/apps/client/src/widgets/collections/geomap/coordinates.spec.ts b/apps/client/src/widgets/collections/geomap/coordinates.spec.ts
index 21659d3d5d..06ad99103a 100644
--- a/apps/client/src/widgets/collections/geomap/coordinates.spec.ts
+++ b/apps/client/src/widgets/collections/geomap/coordinates.spec.ts
@@ -4,7 +4,7 @@
*/
import { describe, expect, it } from "vitest";
-import { boundsOf, formatCoordinates, parseCoordinates } from "./coordinates";
+import { boundsOf, formatCoordinates, parseCoordinates, POINT_ZOOM, pointPlace } from "./coordinates";
/** Sibiu, as each form writes it. Held as `[lng, lat]`, which is how the map holds a point. */
const SIBIU: [number, number] = [ 24.9668, 45.9432 ];
@@ -70,6 +70,18 @@ describe("reading a point out of the search bar", () => {
expect(formatCoordinates(SIBIU)).toBe("45.9432, 24.9668");
expect(formatCoordinates([ 0, 0 ])).toBe("0, 0");
});
+
+ it("makes a place of a point, named by its coordinates and shown close in", () => {
+ expect(pointPlace(SIBIU)).toEqual({
+ id: "point:24.9668,45.9432",
+ name: "45.9432, 24.9668",
+ label: "45.9432, 24.9668",
+ lat: 45.9432,
+ lng: 24.9668,
+ zoom: POINT_ZOOM,
+ unnamed: true
+ });
+ });
});
describe("boxing a set of points", () => {
diff --git a/apps/client/src/widgets/collections/geomap/coordinates.ts b/apps/client/src/widgets/collections/geomap/coordinates.ts
index aee79a24d6..47c43d4dc0 100644
--- a/apps/client/src/widgets/collections/geomap/coordinates.ts
+++ b/apps/client/src/widgets/collections/geomap/coordinates.ts
@@ -9,6 +9,8 @@
* not gone looking for the coordinates at all.
*/
+import type { GeoSearchResult } from "./geocoding";
+
/** How far north or south a point can stand, and how far east or west. */
const MAX_LATITUDE = 90;
const MAX_LONGITUDE = 180;
@@ -70,6 +72,34 @@ export function formatCoordinates([ lng, lat ]: [number, number]) {
return `${lat}, ${lng}`;
}
+/**
+ * How close a point named by its coordinates is shown. Nearer than the level a place of unsaid
+ * extent is given: coordinates name one spot rather than the town around it.
+ */
+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`.
+ *
+ * Serves the point typed into the search bar and the dot the locate button draws for the device.
+ */
+export function pointPlace(center: [number, number]): GeoSearchResult {
+ const [ lng, lat ] = center;
+ const coordinates = formatCoordinates(center);
+
+ return {
+ id: `point:${lng},${lat}`,
+ name: coordinates,
+ label: coordinates,
+ lat,
+ lng,
+ zoom: POINT_ZOOM,
+ unnamed: true
+ };
+}
+
/** The corners of a box, as `fitBounds` wants them: south-west first, north-east second. */
export type Bounds = [[number, number], [number, number]];
diff --git a/apps/client/src/widgets/collections/geomap/index.tsx b/apps/client/src/widgets/collections/geomap/index.tsx
index c242601c16..e47074be7d 100644
--- a/apps/client/src/widgets/collections/geomap/index.tsx
+++ b/apps/client/src/widgets/collections/geomap/index.tsx
@@ -16,6 +16,7 @@ import { ViewModeProps } from "../interface";
import { createNewNote, createNoteForPlace, importGpxTrack, moveMarker } from "./api";
import Buildings from "./Buildings";
import ContextMenus from "./ContextMenus";
+import { pointPlace } from "./coordinates";
import DetailPane, { PaneSelection } from "./DetailPane";
import EditToolbar from "./EditToolbar";
import GhostPin from "./GhostPin";
@@ -193,6 +194,16 @@ export default function GeoView({ note, noteIds, viewConfig, saveConfig }: ViewM
}, OUTLINE_DELAY_MS);
}, []);
+ /**
+ * 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.
+ */
+ const showLocation = useCallback((location: { lat: number; lng: number }) => {
+ if (placement) return;
+ pickPlace(pointPlace([ roundCoordinate(location.lng), roundCoordinate(location.lat) ]));
+ }, [ placement, pickPlace ]);
+
/**
* Stands the map on one of a search's results: a place under a pin of its own, or a note of the
* map's own in the detail pane. Where the map is pointed is the caller's, which is the one thing
@@ -394,7 +405,7 @@ export default function GeoView({ note, noteIds, viewConfig, saveConfig }: ViewM
onAddMarker={keepPlaceAsMarker} onClose={() => pickPlace(null)}
/>
</>}
- <MapToolbar />
+ <MapToolbar onLocationClick={showLocation} />
<EditToolbar
isReadOnly={isReadOnly}
placing={placement?.mode === "new"}
@@ -434,6 +445,14 @@ 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.
+ */
+function roundCoordinate(value: number) {
+ return Number(value.toFixed(6));
+}
+
/**
* Asks the user for a GPX file, resolving to none where the dialog is dismissed.
*
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 6895982d85..0c5dd13924 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
@@ -80,6 +80,9 @@
<p>Dragging the map stops it from following. The dot stays and keeps moving,
and pressing the button again brings the map back to it. Pressing the button
while the map is following turns the dot off.</p>
+<p>Click the dot to see its coordinates in the panel a searched place is shown
+ in. From there the position can be kept as a marker (see <em>Keeping a place as a marker</em>).
+ Clicking the lighter circle around the dot is a click on the map.</p>
<p>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,
diff --git a/docs/User Guide/User Guide/Collections/Geo Map.md b/docs/User Guide/User Guide/Collections/Geo Map.md
index 108b9c01ea..0bfd1ab823 100644
--- a/docs/User Guide/User Guide/Collections/Geo Map.md
+++ b/docs/User Guide/User Guide/Collections/Geo Map.md
@@ -56,6 +56,8 @@ The map then moves to where the device is and marks it with a blue dot. A lighte
Dragging the map stops it from following. The dot stays and keeps moving, and pressing the button again brings the map back to it. Pressing the button while the map is following turns the dot off.
+Click the dot to see its coordinates in the panel a searched place is shown in. From there the position can be kept as a marker (see _Keeping a place as a marker_). Clicking the lighter circle around the dot is a click on the map.
+
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.