Skip to content

Build your personal knowledge base with Trilium Notes

feat(geomap): choose the map background in one place

Elian Doran7c81e95b2bfd
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index a4f087a68a..f6717998da 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -3150,8 +3150,6 @@
"properties": "Geo map properties...",
"properties-title": "Geo map properties",
"general": "General",
- "image": "Image",
- "image-description": "Draw the map over an image of your own instead of a world map, such as a floor plan or a fantasy map. Markers and shapes are then placed on the image.",
"image-note": "Image note",
"image-note-description": "A PNG, JPEG, WebP or GIF image. SVG images can't be used.",
"image-note-placeholder": "Search for an image note",
@@ -3164,7 +3162,13 @@
"bottom-right-corner": "Bottom-right corner",
"coordinates-invalid": "The two corners must differ in both x and y, so this change wasn't saved.",
"dark-image": "Dark image",
- "dark-image-description": "Draws the marker titles in a light color, so that they can be read over a dark image."
+ "dark-image-description": "Draws the marker titles in a light color, so that they can be read over a dark image.",
+ "background": "Background",
+ "background-type": "Type",
+ "background-map": "Vector & Raster",
+ "background-image": "Custom image",
+ "background-map-description": "A world map in one of the vector or raster styles.",
+ "background-image-description": "An image of your own, such as a floor plan or a fantasy map, with markers and shapes placed on it."
},
"embedded_note": {
"open-note": "Open note",
diff --git a/apps/client/src/widgets/collections/geomap/GeoMapProperties.spec.tsx b/apps/client/src/widgets/collections/geomap/GeoMapProperties.spec.tsx
index 086cde5c54..589b48ec1c 100644
--- a/apps/client/src/widgets/collections/geomap/GeoMapProperties.spec.tsx
+++ b/apps/client/src/widgets/collections/geomap/GeoMapProperties.spec.tsx
@@ -19,6 +19,7 @@ vi.mock("i18next", async (importOriginal) => ({
const mocks = vi.hoisted(() => ({
setLabel: vi.fn(async () => {}),
removeOwnedLabelByName: vi.fn(async () => {}),
+ removeOwnedRelationByName: vi.fn(async () => {}),
setAttribute: vi.fn(async () => {})
}));
@@ -26,6 +27,7 @@ vi.mock("../../../services/attributes", () => ({
default: {
setLabel: mocks.setLabel,
removeOwnedLabelByName: mocks.removeOwnedLabelByName,
+ removeOwnedRelationByName: mocks.removeOwnedRelationByName,
setAttribute: mocks.setAttribute,
isAffecting: () => true
}
@@ -72,6 +74,28 @@ describe("GeoMapProperties", () => {
".geo-map-properties-dialog .geo-map-corner input") ];
}
+ /** The background type the dropdown shows as chosen. */
+ function backgroundType() {
+ return query(".geo-map-background-type .dropdown > button")?.textContent?.trim();
+ }
+
+ /** Opens the background type dropdown, unless it is open, and returns its items. */
+ function openBackgroundTypes() {
+ const toggle = query(".geo-map-background-type .dropdown > button");
+ if (!toggle) throw new Error("no background type dropdown");
+ if (toggle.getAttribute("aria-expanded") !== "true") {
+ act(() => toggle.click());
+ }
+ return [ ...document.querySelectorAll<HTMLElement>(".dropdown-item") ];
+ }
+
+ function choose(label: string) {
+ const item = openBackgroundTypes()
+ .find((candidate) => candidate.textContent?.trim().startsWith(label));
+ if (!item) throw new Error(`no ${label} item`);
+ act(() => item.click());
+ }
+
/** Types `value` into `input` and leaves it, which is when a number box commits. */
function commit(input: HTMLInputElement | undefined, value: string) {
if (!input) throw new Error("no such input");
@@ -102,38 +126,58 @@ describe("GeoMapProperties", () => {
document.body.classList.remove("modal-open");
});
- it("repeats the settings dropdown in a General card, minus the style of an image map", () => {
+ it("repeats the settings dropdown in a General card, except the map style", () => {
draw({});
expect(document.querySelector(".geo-map-properties-dialog .modal-title")?.textContent)
.toContain("geo-map.properties-title");
expect(optionTitles(".geo-map-properties-general")).toEqual([
- "book_properties_config.map-style",
"book_properties_config.show-scale",
"book_properties_config.show-labels",
"book_properties_config.cluster-markers",
"book_properties_config.max-nesting-depth",
"book_properties.include_archived_notes"
]);
-
- render(null, container);
- draw({ "~map:image": "image1" }, LOADED_IMAGE);
- expect(optionTitles(".geo-map-properties-general"))
- .not.toContain("book_properties_config.map-style");
});
- it("offers only the image picker until the map has an image, and stores the one picked", () => {
+ it("draws a world map with a style, until a custom image is chosen and picked", () => {
const note = draw({});
- expect(optionTitles(".geo-map-properties-image")).toEqual([ "geo-map.image-note" ]);
+ expect(backgroundType()).toBe("geo-map.background-map");
+ expect(openBackgroundTypes().map((item) => item.textContent?.trim())).toEqual([
+ "geo-map.background-mapgeo-map.background-map-description",
+ "geo-map.background-imagegeo-map.background-image-description"
+ ]);
+ expect(optionTitles(".geo-map-properties-background")).toEqual([
+ "geo-map.background-type", "book_properties_config.map-style"
+ ]);
+
+ // Choosing the image writes nothing: the map stays a world map until an image is picked.
+ choose("geo-map.background-image");
+ expect(optionTitles(".geo-map-properties-background")).toEqual([
+ "geo-map.background-type", "geo-map.image-note"
+ ]);
+ expect(mocks.setAttribute).not.toHaveBeenCalled();
act(() => query(".autocomplete-stub")?.click());
expect(mocks.setAttribute).toHaveBeenCalledWith(note, "relation", "map:image", "image2");
});
+ it("goes back to a world map by removing the image", () => {
+ const note = draw({ "~map:image": "image1" }, LOADED_IMAGE);
+ expect(backgroundType()).toBe("geo-map.background-image");
+
+ choose("geo-map.background-map");
+ expect(mocks.removeOwnedRelationByName).toHaveBeenCalledWith(note, "map:image");
+ expect(optionTitles(".geo-map-properties-background")).toEqual([
+ "geo-map.background-type", "book_properties_config.map-style"
+ ]);
+ });
+
it("measures in pixels until custom corners are chosen, starting them at the size", () => {
const note = draw({ "~map:image": "image1" }, LOADED_IMAGE);
expect(query(".autocomplete-stub")?.dataset.noteId).toBe("image1");
- expect(optionTitles(".geo-map-properties-image")).toEqual([
- "geo-map.image-note", "geo-map.coordinates", "geo-map.dark-image"
+ expect(optionTitles(".geo-map-properties-background")).toEqual([
+ "geo-map.background-type", "geo-map.image-note",
+ "geo-map.coordinates", "geo-map.dark-image"
]);
expect(cornerInputs()).toHaveLength(0);
diff --git a/apps/client/src/widgets/collections/geomap/GeoMapProperties.tsx b/apps/client/src/widgets/collections/geomap/GeoMapProperties.tsx
index 1ed4fe89d8..39c51ee63e 100644
--- a/apps/client/src/widgets/collections/geomap/GeoMapProperties.tsx
+++ b/apps/client/src/widgets/collections/geomap/GeoMapProperties.tsx
@@ -3,6 +3,7 @@ import "./GeoMapProperties.css";
import { useEffect, useState } from "preact/hooks";
import type FNote from "../../../entities/fnote";
+import attributes from "../../../services/attributes";
import { t } from "../../../services/i18n";
import {
CollectionPropertiesDialog, INCLUDE_ARCHIVED_PROPERTY
@@ -10,12 +11,13 @@ import {
import { bookPropertiesConfig } from "../../note_bars/collection-properties-config";
import Admonition from "../../react/Admonition";
import { Card, CardSection, OptionCardSection } from "../../react/Card";
+import FormDropdownList from "../../react/FormDropdownList";
import FormSelect from "../../react/FormSelect";
import FormTextBox from "../../react/FormTextBox";
import FormToggle from "../../react/FormToggle";
import { useNoteLabel, useNoteLabelBoolean, useNoteRelation } from "../../react/hooks";
import NoteAutocomplete from "../../react/NoteAutocomplete";
-import { isPropertyVisible, ViewPropertySection } from "../../react/NotePropertyMenu";
+import { type BookProperty, ViewPropertySection } from "../../react/NotePropertyMenu";
import { formatImageExtent, type ImageSize, parseImageExtent } from "./space";
/** What the map knows of its image: none, loading, unusable, or loaded at its natural size. */
@@ -24,21 +26,28 @@ export type GeoMapImageState =
| { status: "error"; reason: "unloadable" | "svg" }
| { status: "image"; size: ImageSize };
+/** What a geo map is drawn over: a world map in one of its styles, or an image note. */
+type BackgroundKind = "map" | "image";
+
+interface BackgroundOption {
+ value: BackgroundKind;
+ title: string;
+ description: string;
+ icon: string;
+}
+
/** The longest side, in pixels, that practically every graphics card can draw an image at. */
const SAFE_IMAGE_SIDE = 4096;
/**
- * The geo map's settings: those of the collection's settings dropdown, and the image an image map
- * is drawn over, which only this dialog holds.
+ * The geo map's settings: those of the collection's settings dropdown, and what the map is drawn
+ * over, which this dialog sets up in full.
*/
export default function GeoMapProperties({ note, image, onClose }: {
note: FNote;
image: GeoMapImageState;
onClose: () => void;
}) {
- // Read here so that the General card hides the map style as soon as an image is picked.
- useNoteRelation(note, "map:image");
-
return (
<CollectionPropertiesDialog
className="geo-map-properties-dialog"
@@ -47,71 +56,142 @@ export default function GeoMapProperties({ note, image, onClose }: {
onHidden={onClose}
>
<Card className="geo-map-properties-general" heading={t("geo-map.general")}>
- {GENERAL_PROPERTIES
- .filter((property) => isPropertyVisible(property, note))
- .map((property, index) => (
- <ViewPropertySection key={index} note={note} property={property} />
- ))}
+ {GENERAL_PROPERTIES.map((property, index) => (
+ <ViewPropertySection key={index} note={note} property={property} />
+ ))}
</Card>
- <ImageCard note={note} image={image} />
+ <BackgroundCard note={note} image={image} />
</CollectionPropertiesDialog>
);
}
+/** The settings dropdown's map style, which the Background card holds instead of General. */
+const MAP_STYLE_PROPERTY = bookPropertiesConfig.geoMap.properties.find(isMapStyle);
+
/** What the settings dropdown offers for a geo map, which the General card repeats. */
const GENERAL_PROPERTIES = [
- ...bookPropertiesConfig.geoMap.properties, INCLUDE_ARCHIVED_PROPERTY
+ ...bookPropertiesConfig.geoMap.properties.filter((property) => !isMapStyle(property)),
+ INCLUDE_ARCHIVED_PROPERTY
];
-function ImageCard({ note, image }: { note: FNote; image: GeoMapImageState }) {
+function isMapStyle(property: BookProperty) {
+ return "bindToLabel" in property && property.bindToLabel === "map:style";
+}
+
+/**
+ * A world map with its style, or an image with its coordinates. Choosing the image writes nothing
+ * until an image note is picked, so the map stays drawn as it was until then.
+ */
+function BackgroundCard({ note, image }: { note: FNote; image: GeoMapImageState }) {
const [ imageNoteId, setImageNoteId ] = useNoteRelation(note, "map:image");
- const [ isDarkImage, setDarkImage ] = useNoteLabelBoolean(note, "map:darkStyle");
- const notice = imageNotice(image);
+ const [ kind, setKind ] = useState<BackgroundKind>(imageNoteId ? "image" : "map");
+
+ useEffect(() => {
+ if (imageNoteId) setKind("image");
+ }, [ imageNoteId ]);
+
+ function changeKind(newKind: BackgroundKind) {
+ setKind(newKind);
+ if (newKind === "map") {
+ void attributes.removeOwnedRelationByName(note, "map:image");
+ }
+ }
return (
- <Card
- className="geo-map-properties-image"
- heading={t("geo-map.image")}
- description={t("geo-map.image-description")}
- >
+ <Card className="geo-map-properties-background" heading={t("geo-map.background")}>
<OptionCardSection
- label={t("geo-map.image-note")}
- description={t("geo-map.image-note-description")}
- stacked
+ className="geo-map-background-type"
+ label={t("geo-map.background-type")}
>
- <NoteAutocomplete
- noteId={imageNoteId ?? undefined}
- placeholder={t("geo-map.image-note-placeholder")}
- noteIdChanged={setImageNoteId}
+ <FormDropdownList
+ values={BACKGROUND_OPTIONS}
+ keyProperty="value"
+ titleProperty="title"
+ descriptionProperty="description"
+ iconProperty="icon"
+ currentValue={kind}
+ onChange={(value) => changeKind(value as BackgroundKind)}
/>
</OptionCardSection>
- {imageNoteId && notice && (
- <CardSection>
- <Admonition type={notice.type} className="geo-map-image-notice">
- {notice.text}
- </Admonition>
- </CardSection>
+ {kind === "map" && MAP_STYLE_PROPERTY && (
+ <ViewPropertySection note={note} property={MAP_STYLE_PROPERTY} />
)}
- {imageNoteId && <>
- <ImageCoordinates
+ {kind === "image" && (
+ <ImageSettings
note={note}
- size={image.status === "image" ? image.size : undefined}
+ image={image}
+ imageNoteId={imageNoteId}
+ onPickImage={setImageNoteId}
/>
- <OptionCardSection
- name="geo-map-dark-image"
- label={t("geo-map.dark-image")}
- description={t("geo-map.dark-image-description")}
- >
- <FormToggle currentValue={isDarkImage} onChange={setDarkImage} />
- </OptionCardSection>
- </>}
+ )}
</Card>
);
}
+const BACKGROUND_OPTIONS: BackgroundOption[] = [
+ {
+ value: "map",
+ title: t("geo-map.background-map"),
+ description: t("geo-map.background-map-description"),
+ icon: "bx bx-world"
+ },
+ {
+ value: "image",
+ title: t("geo-map.background-image"),
+ description: t("geo-map.background-image-description"),
+ icon: "bx bx-image"
+ }
+];
+
+function ImageSettings({ note, image, imageNoteId, onPickImage }: {
+ note: FNote;
+ image: GeoMapImageState;
+ imageNoteId: string | null | undefined;
+ onPickImage: (noteId: string) => void;
+}) {
+ const [ isDarkImage, setDarkImage ] = useNoteLabelBoolean(note, "map:darkStyle");
+ const notice = imageNotice(image);
+
+ return <>
+ <OptionCardSection
+ label={t("geo-map.image-note")}
+ description={t("geo-map.image-note-description")}
+ stacked
+ >
+ <NoteAutocomplete
+ noteId={imageNoteId ?? undefined}
+ placeholder={t("geo-map.image-note-placeholder")}
+ noteIdChanged={onPickImage}
+ />
+ </OptionCardSection>
+
+ {imageNoteId && notice && (
+ <CardSection>
+ <Admonition type={notice.type} className="geo-map-image-notice">
+ {notice.text}
+ </Admonition>
+ </CardSection>
+ )}
+
+ {imageNoteId && <>
+ <ImageCoordinates
+ note={note}
+ size={image.status === "image" ? image.size : undefined}
+ />
+ <OptionCardSection
+ name="geo-map-dark-image"
+ label={t("geo-map.dark-image")}
+ description={t("geo-map.dark-image-description")}
+ >
+ <FormToggle currentValue={isDarkImage} onChange={setDarkImage} />
+ </OptionCardSection>
+ </>}
+ </>;
+}
+
/**
* Whether positions are measured in the image's pixels or in coordinates of the map's own, and the
* corners those coordinates give the image (`#map:imageBounds`).
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 72d9f5ad1e..45c6bbf751 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
@@ -501,8 +501,8 @@ class="admonition note">
<h2>Configuration</h2>
<h3>Map Style</h3>
<p>The styling of the map can be adjusted in the&nbsp;<a class="reference-link"
- href="#root/_help_CssoWBu8I7jF">Collection Properties</a>&nbsp;or manually
- via the <code>#map:style</code> attribute.</p>
+ href="#root/_help_CssoWBu8I7jF">Collection Properties</a>, under <em>Background</em> in
+ the <em>Geo map properties</em> dialog, or manually via the <code>#map:style</code> attribute.</p>
<p>The geo map comes with two different types of styles:</p>
<ul>
<li>Raster styles
@@ -592,8 +592,9 @@ class="admonition note">
their children, and so on. Without a value, every level is shown.</li>
</ul>
<p>The same options, together with whether archived notes are shown, are
- also listed under <em>General</em> in the <span class="tn-icon bx bx-cog"></span><em>Geo map properties</em> dialog,
+ also listed in the <span class="tn-icon bx bx-cog"></span><em>Geo map properties</em> dialog,
opened from the&nbsp;<a class="reference-link" href="#root/_help_8YBEPzcpUgxw">Note menu</a> or
from the settings menu of the&nbsp;<a class="reference-link" href="#root/_help_CssoWBu8I7jF">Collection Properties</a>.
- Its <em>Image</em> section draws the map over an image of your own instead,
+ Its <em>Background</em> section holds the map style, or, with <em>Type</em> set
+ to <em>Custom image</em>, draws the map over an image of your own instead,
as described in&nbsp;<a class="reference-link" href="#root/_help_ZRDXGc0nAIh4">Image maps</a>.</p>
\ No newline at end of file
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Geo Map/Image maps.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Geo Map/Image maps.html
index c93c92a349..9347ca2d52 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Geo Map/Image maps.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Geo Map/Image maps.html
@@ -13,10 +13,12 @@
<li>Open the <span class="tn-icon bx bx-cog"></span><em>Geo map properties</em> dialog
from the&nbsp;<a class="reference-link" href="#root/_help_8YBEPzcpUgxw">Note menu</a> or
from the settings menu of the&nbsp;<a class="reference-link" href="#root/_help_CssoWBu8I7jF">Collection Properties</a>.</li>
- <li>Under <em>Image</em>, choose the image note in <em>Image note</em>.</li>
+ <li>Under <em>Background</em>, set <em>Type</em> to <em>Custom image</em>, then
+ choose the image note in <em>Image note</em>.</li>
</ol>
<p>The map then shows the image instead of the world map and opens with the
- whole image in view. To go back to a world map, clear <em>Image note</em>.</p>
+ whole image in view. To go back to a world map, set <em>Type</em> back to <em>Vector &amp; Raster</em>,
+ which removes the image.</p>
<p>The image note is stored in a <code>~map:image</code> <a href="#root/_help_Cq5X6iKQop6R">relation</a> of
the geo map, which can also be added by hand.</p>
<h2>Image size</h2>
@@ -54,16 +56,16 @@
<li>Opening a location in an external map application.</li>
</ul>
<p>The look of the marker titles follows the image: if the image is dark,
- turn on <em>Dark image</em> under <em>Image</em> in the <em>Geo map properties</em> dialog,
+ turn on <em>Dark image</em> under <em>Background</em> in the <em>Geo map properties</em> dialog,
so that the titles are drawn in a light color. This sets the <code>#map:darkStyle</code> label.</p>
<p>The <em>Map style</em> setting doesn't apply to an image map, so it's hidden
- while the map has an image.</p>
+ from the settings menu of the collection while the map has an image.</p>
<h2>Choosing the coordinate system</h2>
<p>By default, positions are measured in pixels of the image at its original
size, from its top-left corner, with <code>x</code> growing to the right
and <code>y</code> growing downwards.</p>
<p>To use coordinates of your own instead, open the <em>Geo map properties</em> dialog,
- set <em>Coordinates</em> under <em>Image</em> to <em>Custom</em>, and enter
+ set <em>Coordinates</em> under <em>Background</em> to <em>Custom</em>, and enter
the coordinates of the image's <em>Top-left corner</em> and <em>Bottom-right corner</em>.
Switching to <em>Custom</em> starts from the image's size in pixels, so the
markers stay where they are until the corners are changed. All positions
diff --git a/docs/User Guide/User Guide/Collections/Geo Map.md b/docs/User Guide/User Guide/Collections/Geo Map.md
index 37e9c58b22..b8995bf8b4 100644
--- a/docs/User Guide/User Guide/Collections/Geo Map.md
+++ b/docs/User Guide/User Guide/Collections/Geo Map.md
@@ -340,7 +340,7 @@ To set a map as read-only, go to <a class="reference-link" href="../Basic%20Con
### Map Style
-The styling of the map can be adjusted in the <a class="reference-link" href="Collection%20Properties.md">Collection Properties</a> or manually via the `#map:style` attribute.
+The styling of the map can be adjusted in the <a class="reference-link" href="Collection%20Properties.md">Collection Properties</a>, under _Background_ in the _Geo map properties_ dialog, or manually via the `#map:style` attribute.
The geo map comes with two different types of styles:
@@ -396,4 +396,4 @@ The following options can be configured either via the <a class="reference-link
* Clicking on a cluster will automatically zoom in so that the individual markers that make up the cluster are now visible.
* The map shows the notes of its whole subtree, not only its children. _Max nesting depth_ (`#maxNestingDepth`) limits how deep below the map it looks: `0` shows only the children, `1` adds their children, and so on. Without a value, every level is shown.
-The same options, together with whether archived notes are shown, are also listed under _General_ in the <span class="tn-icon bx bx-cog"></span>_Geo map properties_ dialog, opened from the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20menu.md">Note menu</a> or from the settings menu of the <a class="reference-link" href="Collection%20Properties.md">Collection Properties</a>. Its _Image_ section draws the map over an image of your own instead, as described in <a class="reference-link" href="Geo%20Map/Image%20maps.md">Image maps</a>.
\ No newline at end of file
+The same options, together with whether archived notes are shown, are also listed in the <span class="tn-icon bx bx-cog"></span>_Geo map properties_ dialog, opened from the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20menu.md">Note menu</a> or from the settings menu of the <a class="reference-link" href="Collection%20Properties.md">Collection Properties</a>. Its _Background_ section holds the map style, or, with _Type_ set to _Custom image_, draws the map over an image of your own instead, as described in <a class="reference-link" href="Geo%20Map/Image%20maps.md">Image maps</a>.
\ No newline at end of file
diff --git a/docs/User Guide/User Guide/Collections/Geo Map/Image maps.md b/docs/User Guide/User Guide/Collections/Geo Map/Image maps.md
index 7a2ad31306..e48ed2f040 100644
--- a/docs/User Guide/User Guide/Collections/Geo Map/Image maps.md
+++ b/docs/User Guide/User Guide/Collections/Geo Map/Image maps.md
@@ -6,9 +6,9 @@ An image map is a geo map drawn over an image of your own instead of a world map
1. Upload the image as a note of its own, for example by dragging the file into the note tree. PNG, JPEG, WebP and GIF images are supported; SVG images are not.
2. Create a geo map, or open an existing one.
3. Open the <span class="tn-icon bx bx-cog"></span>_Geo map properties_ dialog from the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20menu.md">Note menu</a> or from the settings menu of the <a class="reference-link" href="../Collection%20Properties.md">Collection Properties</a>.
-4. Under _Image_, choose the image note in _Image note_.
+4. Under _Background_, set _Type_ to _Custom image_, then choose the image note in _Image note_.
-The map then shows the image instead of the world map and opens with the whole image in view. To go back to a world map, clear _Image note_.
+The map then shows the image instead of the world map and opens with the whole image in view. To go back to a world map, set _Type_ back to _Vector & Raster_, which removes the image.
The image note is stored in a `~map:image` [relation](../../Advanced%20Usage/Attributes/Relations.md) of the geo map, which can also be added by hand.
@@ -36,15 +36,15 @@ The features that only make sense on a real map are not available on an image ma
* The 3D buildings.
* Opening a location in an external map application.
-The look of the marker titles follows the image: if the image is dark, turn on _Dark image_ under _Image_ in the _Geo map properties_ dialog, so that the titles are drawn in a light color. This sets the `#map:darkStyle` label.
+The look of the marker titles follows the image: if the image is dark, turn on _Dark image_ under _Background_ in the _Geo map properties_ dialog, so that the titles are drawn in a light color. This sets the `#map:darkStyle` label.
-The _Map style_ setting doesn't apply to an image map, so it's hidden while the map has an image.
+The _Map style_ setting doesn't apply to an image map, so it's hidden from the settings menu of the collection while the map has an image.
## Choosing the coordinate system
By default, positions are measured in pixels of the image at its original size, from its top-left corner, with `x` growing to the right and `y` growing downwards.
-To use coordinates of your own instead, open the _Geo map properties_ dialog, set _Coordinates_ under _Image_ to _Custom_, and enter the coordinates of the image's _Top-left corner_ and _Bottom-right corner_. Switching to _Custom_ starts from the image's size in pixels, so the markers stay where they are until the corners are changed. All positions are then read and written in those coordinates, including the ones shown in the contextual menu and in the popup view. To go back to pixels, set _Coordinates_ to _Image pixels_.
+To use coordinates of your own instead, open the _Geo map properties_ dialog, set _Coordinates_ under _Background_ to _Custom_, and enter the coordinates of the image's _Top-left corner_ and _Bottom-right corner_. Switching to _Custom_ starts from the image's size in pixels, so the markers stay where they are until the corners are changed. All positions are then read and written in those coordinates, including the ones shown in the contextual menu and in the popup view. To go back to pixels, set _Coordinates_ to _Image pixels_.
The corners are stored in the `#map:imageBounds` label of the geo map as `x,y x,y`, with a space between the two corners, which can also be set by hand. For example: