diff --git a/src/ui/map.js b/src/ui/map.js index a70a51b..cfaed93 100644 --- a/src/ui/map.js +++ b/src/ui/map.js @@ -27,7 +27,7 @@ const STYLE = ` .leonida-map-note { top: 16px; left: 50%; transform: translateX(-50%); } .leonida-map-here { top: 16px; left: 16px; } .leonida-map-readout { bottom: 16px; right: 16px; font-variant-numeric: tabular-nums; } -.leonida-map-note:empty, .leonida-map-readout:empty { display: none; } +.leonida-map-note:empty, .leonida-map-readout:empty, .leonida-map-here:empty { display: none; } `; const NOTE_MISSING = "Kartenbild fehlt — cd tools/extract && uv run python overview.py ausführen"; diff --git a/src/ui/mapMath.js b/src/ui/mapMath.js index 2d95c8c..dda61b9 100644 --- a/src/ui/mapMath.js +++ b/src/ui/mapMath.js @@ -96,7 +96,7 @@ export function chunkNameAtMap(info, px, py) { return chunkName(i, j); } -/** Anzeige für die Stelle unter dem Mauszeiger, etwa "C10 · x 412 / y 1830". */ +/** Anzeige für die Stelle unter dem Mauszeiger, etwa "F3 · x 412 / y 1830". */ export function hoverLabel(info, px, py) { const name = chunkNameAtMap(info, px, py); if (!name) return null; diff --git a/tests/coords.test.js b/tests/coords.test.js index 6ab07c0..7841f5e 100644 --- a/tests/coords.test.js +++ b/tests/coords.test.js @@ -61,9 +61,13 @@ describe("Chunk-Namen", () => { } }); - it("verbindet den Namen mit der Lage: der Downtown-Kern liegt in B9", () => { + it("verbindet den Namen mit der Lage: Downtown-Bezugspunkt in B9, höchster Turm in C12", () => { + // (−511, 254) ist der Bezugspunkt "Downtown" aus tools/extract/data/districts.json, der Mittelpunkt + // der westlichen Hochhäuser. Die Türme selbst stehen nördlich und südlich davon. const { i, j } = chunkForWorld(-511, 254); expect({ i, j }).toEqual({ i: 1, j: 8 }); expect(chunkName(i, j)).toBe("B9"); + const tower = chunkForWorld(-461.31, -460.1); // Southeast Financial Center, 248 m + expect(chunkName(tower.i, tower.j)).toBe("C12"); }); }); diff --git a/tests/mapMath.test.js b/tests/mapMath.test.js index 1850746..4c5fbf6 100644 --- a/tests/mapMath.test.js +++ b/tests/mapMath.test.js @@ -114,8 +114,9 @@ describe("Landeplatz", () => { }); describe("Chunk-Namen und Anzeige", () => { - it("nennt am Kartenpunkt des Downtown-Kerns B9", () => { + it("nennt am Downtown-Bezugspunkt B9 und am Southeast Financial Center C12", () => { expect(chunkNameAtMap(INFO, 489, 2246)).toBe("B9"); + expect(chunkNameAtMap(INFO, 538.69, 2960.1)).toBe("C12"); }); it("liefert am östlichen Kartenrand keinen Namen mehr", () => {