diff --git a/client/src/components/AtlasGlobe/GlobeEngine.test.ts b/client/src/components/AtlasGlobe/GlobeEngine.test.ts index 536b211a9..81755681f 100644 --- a/client/src/components/AtlasGlobe/GlobeEngine.test.ts +++ b/client/src/components/AtlasGlobe/GlobeEngine.test.ts @@ -518,6 +518,29 @@ describe('GlobeEngine regions in view', () => { expect(s.worldKey).toBe('l2'); }); + it('FE-ATLAS2-ENGINE-114: pinned countries load and draw their coarse regions on the whole globe', async () => { + const ctx = await start({ initial: { lon: 2, lat: 46, zoom: 1 } }); + await boot(ctx); + ctx.engine.setPinnedRegions(['FR']); + frames(1); + await flush(); + expect(fetched(ctx, 'regions/FR.r0.json')).toBe(1); + expect(ctx.renderer.touchRegion.mock.calls.map(([k]) => k)).toContain('FR:r0'); + ctx.worker.answer(); + await flush(); + const inUse = ctx.renderer.setRegion.mock.calls[0][2]; + expect(inUse?.has('FR:r0')).toBe(true); + frames(1); + const pinned = lastDraw(ctx.renderer); + expect(pinned.regionAlpha).toBe(0); + expect(pinned.regionKeys).toEqual(['FR:r0']); + expect(pinned.pinnedRegions?.has('FR')).toBe(true); + + ctx.engine.setPinnedRegions([]); + frames(1); + expect(lastDraw(ctx.renderer).regionKeys).toEqual([]); + }); + it('FE-ATLAS2-ENGINE-021: the view is scanned at most every 0.2 s and a loaded region is not fetched twice', async () => { const ctx = await start({ initial: { lon: 2, lat: 46, zoom: 6 } }); await boot(ctx); diff --git a/client/src/components/AtlasGlobe/GlobeEngine.ts b/client/src/components/AtlasGlobe/GlobeEngine.ts index b40a550f4..5f9b205b9 100644 --- a/client/src/components/AtlasGlobe/GlobeEngine.ts +++ b/client/src/components/AtlasGlobe/GlobeEngine.ts @@ -150,6 +150,8 @@ export class GlobeEngine { private regionFailedAt = new Map(); private regionScanAt = -1; private inViewRegionKeys: ReadonlySet = new Set(); + /** Countries whose regions show at every zoom, not only once zoomed in (the regions view). */ + private pinned: ReadonlySet = new Set(); private prefetchQueue: string[] = []; private prefetchTimer = 0; private nextRegionId = FIRST_REGION_ID; @@ -252,6 +254,22 @@ export class GlobeEngine { } } + /** + * Shows these countries' regions at every zoom instead of only once zoomed + * in, so a country with a few visited regions reads as those regions rather + * than as a whole visited country. An empty list goes back to the usual fade. + */ + setPinnedRegions(a2s: readonly string[]): void { + this.pinned = new Set(a2s); + this.kick(); + } + + /** The region layers that must stay on the GPU: those in view and the pinned countries' coarse ones. */ + private regionsInUse(): ReadonlySet { + if (!this.pinned.size) return this.inViewRegionKeys; + return new Set([...this.inViewRegionKeys, ...[...this.pinned].map((a2) => `${a2}:r0`)]); + } + async loadRegionIndex(a2: string): Promise { const have = this.regionIndex.get(a2); if (have) return have; @@ -281,7 +299,7 @@ export class GlobeEngine { const topo = (await this.opts.fetchJson(idx.files[lod])) as Topology; const layer = await this.build(topo, 'regions', MAX_EDGE[lod], base); if (!this.alive) return; - this.renderer.setRegion(key, layer, this.inViewRegionKeys); + this.renderer.setRegion(key, layer, this.regionsInUse()); this.onRegionLoaded?.(a2); this.kick(); } catch { @@ -736,6 +754,12 @@ export class GlobeEngine { if (fine) void this.loadRegion(a2, 'r1'); } } + // The pinned countries' coarse regions, wherever the camera is. + for (const a2 of this.pinned) { + if (!this.manifest?.regions[a2]) continue; + this.renderer.touchRegion(`${a2}:r0`); + void this.loadRegion(a2, 'r0'); + } this.regionKeys = this.collectRegionKeys(); const time = this.now(); @@ -768,6 +792,7 @@ export class GlobeEngine { selected: this.selected, ink, regionAlpha: this.regionAlpha, + pinnedRegions: this.pinned, theme: this.theme, arcs: this.arcs, arcProgress, @@ -791,9 +816,13 @@ export class GlobeEngine { }; private collectRegionKeys(): string[] { - if (this.regionAlpha <= 0) return []; - const fine = this.cam.zoom >= REGION_FINE_ZOOM; const out: string[] = []; + // Pinned countries draw their regions before the zoom brings the rest in. + for (const a2 of this.pinned) { + if (this.regionAlpha <= 0 && this.renderer.hasRegion(`${a2}:r0`)) out.push(`${a2}:r0`); + } + if (this.regionAlpha <= 0) return out; + const fine = this.cam.zoom >= REGION_FINE_ZOOM; for (const a2 of this.regionIndex.keys()) { const k1 = `${a2}:r1`; const k0 = `${a2}:r0`; diff --git a/client/src/components/AtlasGlobe/GlobeRenderer.test.ts b/client/src/components/AtlasGlobe/GlobeRenderer.test.ts index 8e879b134..81fadb098 100644 --- a/client/src/components/AtlasGlobe/GlobeRenderer.test.ts +++ b/client/src/components/AtlasGlobe/GlobeRenderer.test.ts @@ -448,6 +448,17 @@ describe('GlobeRenderer region layers', () => { expect(DARK.regionBorder[3]).toBe(0.5); }); + it('FE-ATLAS2-RENDER-049: a pinned country draws its regions in full while zoomed out, with faint inner borders', () => { + const { fake, r } = setup(); + r.setRegion('DE:r0', layer(4, 1, 5)); + r.draw(state({ regionAlpha: 0, regionKeys: ['DE:r0'], pinnedRegions: new Set(['DE']) })); + const [region] = fillDraws(fake, 12); + expect(region.values.u_mode).toBe(2); + expect(region.values.u_layerAlpha).toBe(1); + const [borders] = lineDraws(fake, 5); + expect((borders.values.u_color as number[])[3]).toBeCloseTo(DARK.regionBorder[3] * 0.45); + }); + it('FE-ATLAS2-RENDER-029: does not draw regions faded out below the threshold', () => { const { fake, r } = setup(); r.setRegion('DE', layer(4, 1, 5)); diff --git a/client/src/components/AtlasGlobe/GlobeRenderer.ts b/client/src/components/AtlasGlobe/GlobeRenderer.ts index 1871081a1..d979735f7 100644 --- a/client/src/components/AtlasGlobe/GlobeRenderer.ts +++ b/client/src/components/AtlasGlobe/GlobeRenderer.ts @@ -49,6 +49,8 @@ export interface DrawState { selected: number; ink: { id: number; lon: number; lat: number; radius: number } | null; regionAlpha: number; + /** Countries whose regions show at full strength at every zoom (the regions view). */ + pinnedRegions?: ReadonlySet; theme: GlobeTheme; arcs: ArcLayer[]; arcProgress: number; @@ -199,7 +201,7 @@ export class GlobeRenderer { return vao; } - /** rgba: colour + fill strength. fx: hatch, reveal order (0..255), outline, spare. */ + /** rgba: colour + fill strength. fx: hatch, reveal order (0..255), regions loaded, visited regions. */ setStatus( id: number, rgba: [number, number, number, number], @@ -454,7 +456,10 @@ export class GlobeRenderer { gl.bindVertexArray(this.ocean.vao); gl.drawElements(gl.TRIANGLES, this.ocean.count, gl.UNSIGNED_INT, 0); } - const regionsOn = s.regionAlpha > 0.001 && s.regionKeys.some((k) => this.regions.has(k)); + // A pinned country's regions show whatever the zoom; the rest fade in with it. + const pinnedKey = (k: string) => !!s.pinnedRegions?.has(k.slice(0, k.indexOf(':'))); + const fillAlpha = (k: string) => (pinnedKey(k) ? 1 : s.regionAlpha); + const regionsOn = s.regionKeys.some((k) => this.regions.has(k) && fillAlpha(k) > 0.001); if (this.world) { gl.uniform1i(p.u.u_mode, 0); gl.uniform1f(p.u.u_dimBase, 1); @@ -464,10 +469,10 @@ export class GlobeRenderer { } if (regionsOn) { gl.uniform1i(p.u.u_mode, 2); - gl.uniform1f(p.u.u_layerAlpha, s.regionAlpha); for (const k of s.regionKeys) { const r = this.regions.get(k); if (!r) continue; + gl.uniform1f(p.u.u_layerAlpha, fillAlpha(k)); gl.bindVertexArray(r.fill.vao); gl.drawElements(gl.TRIANGLES, r.fill.count, gl.UNSIGNED_INT, 0); } @@ -490,11 +495,13 @@ export class GlobeRenderer { gl.drawArraysInstanced(gl.TRIANGLES, 0, 6, g.count); }; if (regionsOn) { - const c = [...th.regionBorder]; - c[3] *= s.regionAlpha; for (const k of s.regionKeys) { const r = this.regions.get(k); - if (r) lines(r.borders, c, 0.7); + if (!r) continue; + // Zoomed out, a pinned country's inner borders stay faint, so it does not turn into a web. + const c = [...th.regionBorder]; + c[3] *= pinnedKey(k) ? Math.max(s.regionAlpha, 0.45) : s.regionAlpha; + lines(r.borders, c, 0.7); } } if (this.world) { diff --git a/client/src/components/AtlasGlobe/globeShaders.ts b/client/src/components/AtlasGlobe/globeShaders.ts index 1b55769e6..49d033863 100644 --- a/client/src/components/AtlasGlobe/globeShaders.ts +++ b/client/src/components/AtlasGlobe/globeShaders.ts @@ -84,7 +84,7 @@ in float v_shade; in vec2 v_ll; flat in int v_fid; uniform sampler2D u_status; // rgb colour, a strength -uniform sampler2D u_fx; // r hatch, g reveal order, b outline flag +uniform sampler2D u_fx; // r hatch, g reveal order, b regions loaded, a visited regions uniform int u_mode; // 0 land, 1 ocean, 2 region layer uniform vec3 u_land; uniform vec3 u_ocean; @@ -136,8 +136,9 @@ void main() { float d = acos(clamp(dot(p1, p2), -1.0, 1.0)); a *= 1.0 - smoothstep(u_inkR - 0.01, u_inkR, d); } - // A country whose regions are on screen steps back so its regions read. - if (u_mode == 0 && fx.b > 0.5) a *= 1.0 - 0.32 * u_regionFade; + // A country whose regions are on screen steps back so its regions read; one with + // visited regions (fx.a) steps far back, so the regions really visited stand out. + if (u_mode == 0 && fx.b > 0.5) a *= 1.0 - (fx.a > 0.5 ? 0.82 : 0.32) * u_regionFade; vec3 base = u_land * (u_mode == 2 ? 1.0 : u_dimBase); vec3 col = mix(base, st.rgb, a); if (fx.r > 0.5) { diff --git a/client/src/mobile/screens/atlas/MAtlasLayersSheet.test.tsx b/client/src/mobile/screens/atlas/MAtlasLayersSheet.test.tsx index 698ecedb0..b44f900c0 100644 --- a/client/src/mobile/screens/atlas/MAtlasLayersSheet.test.tsx +++ b/client/src/mobile/screens/atlas/MAtlasLayersSheet.test.tsx @@ -9,16 +9,20 @@ describe('MAtlasLayersSheet', () => { expect(screen.queryByRole('dialog')).toBeNull(); }); - it('FE-ATLAS2-MOBILE-221: without flights or plugins only the planned switch stands there, and it flips', () => { - const s = buildGlobeState({ showPlanned: true }); + it('FE-ATLAS2-MOBILE-221: without flights or plugins the planned and the regions switch stand there, and they flip', () => { + const s = buildGlobeState({ showPlanned: true, regionView: false }); render(); expect(screen.getByRole('dialog', { name: 'atlas.globe.layers' })).toBeInTheDocument(); const switches = screen.getAllByRole('switch'); - expect(switches).toHaveLength(1); + expect(switches).toHaveLength(2); expect(switches[0]).toHaveAccessibleName('atlas.showPlanned'); expect(switches[0]).toHaveAttribute('aria-checked', 'true'); fireEvent.click(switches[0] as HTMLElement); expect(s.setShowPlanned).toHaveBeenCalledWith(false); + expect(switches[1]).toHaveAccessibleName('atlas.regionView'); + expect(switches[1]).toHaveAttribute('aria-checked', 'false'); + fireEvent.click(switches[1] as HTMLElement); + expect(s.setRegionView).toHaveBeenCalledWith(true); }); it('FE-ATLAS2-MOBILE-222: flights with routes add their switch, an empty flight list does not', () => { diff --git a/client/src/mobile/screens/atlas/MAtlasLayersSheet.tsx b/client/src/mobile/screens/atlas/MAtlasLayersSheet.tsx index cbe4a69f2..453a52873 100644 --- a/client/src/mobile/screens/atlas/MAtlasLayersSheet.tsx +++ b/client/src/mobile/screens/atlas/MAtlasLayersSheet.tsx @@ -1,4 +1,4 @@ -import { CalendarClock, Plane, Puzzle, X } from 'lucide-react'; +import { CalendarClock, MapPinned, Plane, Puzzle, X } from 'lucide-react'; import React from 'react'; import type { GlobeColorMode } from '../../../pages/atlas/atlasGlobePaint'; import type { AtlasGlobeState } from '../../../pages/atlas/useAtlasGlobe'; @@ -35,6 +35,13 @@ export default function MAtlasLayersSheet({ on: s.showPlanned, toggle: () => s.setShowPlanned(!s.showPlanned), }, + { + key: 'regions', + Icon: MapPinned, + label: s.t('atlas.regionView'), + on: s.regionView, + toggle: () => s.setRegionView(!s.regionView), + }, ...(s.flights?.routes.length ? [ { diff --git a/client/src/pages/atlas/AtlasGlobeDialogs.test.tsx b/client/src/pages/atlas/AtlasGlobeDialogs.test.tsx index fa6b34e9e..30611aa2f 100644 --- a/client/src/pages/atlas/AtlasGlobeDialogs.test.tsx +++ b/client/src/pages/atlas/AtlasGlobeDialogs.test.tsx @@ -181,6 +181,15 @@ describe('GlobeLayersDialog', () => { expect(screen.queryByRole('button', { name: 'atlas.globe.flights' })).not.toBeInTheDocument(); }); + it('FE-ATLAS2-VIEWB-105: the regions switch turns the regions view on and off', () => { + const setRegionView = vi.fn(); + render(); + const sw = screen.getByRole('button', { name: 'atlas.regionView' }); + expect(sw).toHaveAttribute('aria-pressed', 'true'); + fireEvent.click(sw); + expect(setRegionView).toHaveBeenCalledWith(false); + }); + it('FE-ATLAS2-VIEWB-101: with flights there is a flights switch', () => { const setShowFlights = vi.fn(); render( diff --git a/client/src/pages/atlas/AtlasGlobeDialogs.tsx b/client/src/pages/atlas/AtlasGlobeDialogs.tsx index 369fde1ca..b7559bc7a 100644 --- a/client/src/pages/atlas/AtlasGlobeDialogs.tsx +++ b/client/src/pages/atlas/AtlasGlobeDialogs.tsx @@ -198,6 +198,7 @@ export function GlobeLayersDialog({ s, onClose }: { s: AtlasGlobeState; onClose: >
{row(s.t('atlas.showPlanned'), s.showPlanned, () => s.setShowPlanned(!s.showPlanned))} + {row(s.t('atlas.regionView'), s.regionView, () => s.setRegionView(!s.regionView))} {!!s.flights?.routes.length && row(s.t('atlas.globe.flights'), s.showFlights, () => s.setShowFlights(!s.showFlights))} {s.pluginLayers.map((l) => { diff --git a/client/src/pages/atlas/atlasGlobePaint.test.ts b/client/src/pages/atlas/atlasGlobePaint.test.ts index 40be2baa1..c2375761f 100644 --- a/client/src/pages/atlas/atlasGlobePaint.test.ts +++ b/client/src/pages/atlas/atlasGlobePaint.test.ts @@ -11,6 +11,7 @@ import { paintGlobe, PLUGIN_TONES, regionProgress, + regionViewCountries, type GlobePaintInput, } from './atlasGlobePaint'; import { countryColor, type AtlasCountry, type AtlasData, type BucketItem } from './atlasModel'; @@ -456,3 +457,39 @@ describe('regionProgress', () => { }); }); }); + +describe('the regions view', () => { + const FR = mc('FR', 'FRA'); + const DE = mc('DE', 'DEU'); + + it('FE-ATLAS2-PAINT-031: counts a country by its regions only when one of them is visited', () => { + expect( + regionViewCountries({ + FR: [region('FR-IDF', 'Ile-de-France')], + DE: [region('DE-BY', 'Bavaria', 'planned')], + CA: [region('CA-AB', 'Alberta', 'planned'), region('CA-BC', 'British Columbia', 'visited')], + }) + ).toEqual(['FR', 'CA']); + }); + + it('FE-ATLAS2-PAINT-032: a visited country with visited regions steps far back once zoomed in, others do not', () => { + const { engine, at } = fakeEngine({ countries: [FR, DE], loadedRegions: ['FR:r0'] }); + const data = buildAtlasData({ countries: [country('FR'), country('DE')] }); + paintGlobe(engine, input({ data, regions: { FR: [region('FR-IDF', 'Ile-de-France')] } })); + expect(at(0)?.fx?.[3]).toBe(255); + expect(at(0)?.color[3]).toBe(235); + expect(at(1)?.fx?.[3]).toBe(0); + }); + + it('FE-ATLAS2-PAINT-033: in the regions view the country only tints faintly beneath its drawn regions', () => { + const regions = { FR: [region('FR-IDF', 'Ile-de-France')] }; + const data = buildAtlasData({ countries: [country('FR')] }); + const drawn = fakeEngine({ countries: [FR], loadedRegions: ['FR:r0'] }); + paintGlobe(drawn.engine, input({ data, regions, regionView: true })); + expect(drawn.at(0)?.color[3]).toBe(40); + // Until its regions are on the GPU the country keeps its full colour, so it never goes blank. + const waiting = fakeEngine({ countries: [FR] }); + paintGlobe(waiting.engine, input({ data, regions, regionView: true })); + expect(waiting.at(0)?.color[3]).toBe(235); + }); +}); diff --git a/client/src/pages/atlas/atlasGlobePaint.ts b/client/src/pages/atlas/atlasGlobePaint.ts index f30680578..51bab795d 100644 --- a/client/src/pages/atlas/atlasGlobePaint.ts +++ b/client/src/pages/atlas/atlasGlobePaint.ts @@ -36,6 +36,16 @@ export interface GlobePaintInput { gaps?: boolean; /** Country tints from plugin layers (atlasLayerProvider), by ISO A2, as hex. */ pluginTint?: Map; + /** The regions view: a country with visited regions shows those, not itself, at every zoom. */ + regionView?: boolean; +} + +/** How faintly a country shows under its own visited regions in the regions view (of 255). */ +const UNDER_REGIONS = 40; + +/** The countries the regions view draws as their regions: those with at least one visited region. */ +export function regionViewCountries(regions: Record): string[] { + return Object.keys(regions).filter((a2) => regions[a2].some((r) => (r.status ?? 'visited') === 'visited')); } /** The plugin tones, the same palette the classic Atlas and the plugin map markers use. */ @@ -135,6 +145,10 @@ export function paintGlobe(engine: GlobeEngine, input: GlobePaintInput): void { input.bucket.filter((b) => !b.region_code && b.country_code).map((b) => b.country_code as string) ); const wishRegions = wishlistRegionCodes(input.bucket); + // Countries with visited regions: zoomed in, the rest of the country steps far back so those + // regions stand out (the spare fx channel tells the shader); in the regions view, also zoomed out. + const withVisitedRegions = new Set(regionViewCountries(input.regions)); + const byRegions = input.regionView ? withVisitedRegions : new Set(); m.countries.forEach((c, i) => { const a2 = c.a2; @@ -144,7 +158,8 @@ export function paintGlobe(engine: GlobeEngine, input: GlobePaintInput): void { const status = row ? countryStatus(row) : null; const year = row?.firstVisit ? Number(row.firstVisit.slice(0, 4)) : null; const inYear = input.year === null || (year !== null && year <= input.year); - const fx: [number, number, number, number] = [0, reveal, hasRegions ? 255 : 0, 0]; + const marked = !!a2 && withVisitedRegions.has(a2); + const fx: [number, number, number, number] = [0, reveal, hasRegions ? 255 : 0, marked ? 255 : 0]; if (status === 'visited' && inYear) { const hex = input.colorMode === 'status' @@ -152,13 +167,15 @@ export function paintGlobe(engine: GlobeEngine, input: GlobePaintInput): void { : input.colorMode === 'year' && year ? yearColor(year, firstYear, lastYear) : countryColor(c.a3); - r.setStatus(i, [...rgbToBytes(hexToRgb(hex)), 235], fx); + // In the regions view, once its regions are drawn, the country only shows faintly beneath them. + const strength = hasRegions && a2 && byRegions.has(a2) ? UNDER_REGIONS : 235; + r.setStatus(i, [...rgbToBytes(hexToRgb(hex)), strength], fx); } else if (status && status !== 'visited' && input.showPlanned) { r.setStatus(i, [...rgbToBytes(hexToRgb(PLANNED)), 95], fx); } else if (a2 && input.pluginTint?.has(a2)) { r.setStatus(i, [...rgbToBytes(hexToRgb(input.pluginTint.get(a2) as string)), 90], fx); } else if (a2 && wishCountries.has(a2)) { - r.setStatus(i, [...rgbToBytes(hexToRgb(WISH)), 0], [255, reveal, fx[2], 0]); + r.setStatus(i, [...rgbToBytes(hexToRgb(WISH)), 0], [255, reveal, fx[2], fx[3]]); } else { r.setStatus(i, [0, 0, 0, 0], fx); } diff --git a/client/src/pages/atlas/useAtlasGlobe.test.ts b/client/src/pages/atlas/useAtlasGlobe.test.ts index 7c5104eb2..61736689b 100644 --- a/client/src/pages/atlas/useAtlasGlobe.test.ts +++ b/client/src/pages/atlas/useAtlasGlobe.test.ts @@ -131,6 +131,7 @@ function fakeEngine() { idOf: vi.fn<(hit: GlobeHit) => number>(() => 600), startInk: vi.fn<(id: number, lon: number, lat: number) => void>(), zoomBy: vi.fn<(factor: number) => void>(), + setPinnedRegions: vi.fn<(a2s: readonly string[]) => void>(), }; } @@ -800,6 +801,24 @@ describe('useAtlasGlobe: switches', () => { expect(window.localStorage.getItem('trek_atlas_show_planned')).toBe('1'); }); + it('FE-ATLAS2-HOOK-077: the regions view is remembered and hands the engine the countries with visited regions', async () => { + const { result, engine } = await mountLoaded(); + expect(result.current.regionView).toBe(false); + act(() => + result.current.setRegions({ + CA: [{ code: 'CA-AB', name: 'Alberta', placeCount: 1, status: 'visited' }], + DE: [{ code: 'DE-BY', name: 'Bavaria', placeCount: 0, status: 'planned' }], + }) + ); + expect(engine.setPinnedRegions).toHaveBeenLastCalledWith([]); + act(() => result.current.setRegionView(true)); + expect(window.localStorage.getItem('trek_atlas_region_view')).toBe('1'); + expect(engine.setPinnedRegions).toHaveBeenLastCalledWith(['CA']); + act(() => result.current.setRegionView(false)); + expect(window.localStorage.getItem('trek_atlas_region_view')).toBe('0'); + expect(engine.setPinnedRegions).toHaveBeenLastCalledWith([]); + }); + it('FE-ATLAS2-HOOK-049: blocked storage starts with planned hidden and the switch still works', async () => { const getItem = vi.spyOn(Storage.prototype, 'getItem').mockImplementation(() => { throw new Error('blocked'); diff --git a/client/src/pages/atlas/useAtlasGlobe.ts b/client/src/pages/atlas/useAtlasGlobe.ts index 3c3b97ec0..96c390bf2 100644 --- a/client/src/pages/atlas/useAtlasGlobe.ts +++ b/client/src/pages/atlas/useAtlasGlobe.ts @@ -18,7 +18,7 @@ import { useAuthStore } from '../../store/authStore'; import { useSettingsStore } from '../../store/settingsStore'; import { useServerPing } from '../../sync/useServerPing'; import { getApiErrorMessage } from '../../types'; -import { PLUGIN_TONES, paintGlobe, regionProgress, type GlobeColorMode } from './atlasGlobePaint'; +import { PLUGIN_TONES, paintGlobe, regionProgress, regionViewCountries, type GlobeColorMode } from './atlasGlobePaint'; import { countryStatus, type AtlasData, type BucketItem, type CountryDetail } from './atlasModel'; import { useAtlasBucket } from './useAtlasBucket'; import type { AtlasConfirmAction, VisitedRegionMap } from './useAtlasCountryActions'; @@ -31,18 +31,27 @@ function foldSearch(s: string): string { } const SHOW_PLANNED_KEY = 'trek_atlas_show_planned'; +const REGION_VIEW_KEY = 'trek_atlas_region_view'; /** Tries of the first read after the first one fails (1, 2, 4, 8, 16 s apart). */ const LOAD_RETRIES = 5; -/** Whether planned countries show: what this device chose before, off until then (#1048). */ -function readShowPlanned(): boolean { +/** A layer switch as this device left it (planned countries #1048, the regions view), off until then. */ +function readFlag(key: string): boolean { try { - return window.localStorage.getItem(SHOW_PLANNED_KEY) === '1'; + return window.localStorage.getItem(key) === '1'; } catch { return false; } } +function writeFlag(key: string, on: boolean): void { + try { + window.localStorage.setItem(key, on ? '1' : '0'); + } catch { + // Storage blocked: the switch still works for this visit. + } +} + export type AtlasHubTab = 'overview' | 'badges' | 'wishlist' | 'dawarich' | 'tours' | 'travellers'; type GlobeSelection = @@ -84,14 +93,16 @@ export function useAtlasGlobe({ globeRef, skyRef }: AtlasGlobeRefs) { const [manifest, setManifest] = useState(null); const [selection, setSelection] = useState(null); const [hover, setHover] = useState(null); - const [showPlanned, setShowPlannedState] = useState(readShowPlanned); + const [showPlanned, setShowPlannedState] = useState(() => readFlag(SHOW_PLANNED_KEY)); const setShowPlanned = useCallback((on: boolean) => { setShowPlannedState(on); - try { - window.localStorage.setItem(SHOW_PLANNED_KEY, on ? '1' : '0'); - } catch { - // Storage blocked: the switch still works for this visit. - } + writeFlag(SHOW_PLANNED_KEY, on); + }, []); + // The regions view: a country with visited regions shows those regions at every zoom. + const [regionView, setRegionViewState] = useState(() => readFlag(REGION_VIEW_KEY)); + const setRegionView = useCallback((on: boolean) => { + setRegionViewState(on); + writeFlag(REGION_VIEW_KEY, on); }, []); const [colorMode, setColorMode] = useState('country'); const [year, setYear] = useState(null); @@ -208,8 +219,19 @@ export function useAtlasGlobe({ globeRef, skyRef }: AtlasGlobeRefs) { const [compareCodes, setCompareCodes] = useState(null); const [gapsOn, setGapsOn] = useState(false); const paintInput = useMemo( - () => ({ data, regions, bucket, showPlanned, colorMode, year, compare: compareCodes, gaps: gapsOn, pluginTint }), - [data, regions, bucket, showPlanned, colorMode, year, compareCodes, gapsOn, pluginTint] + () => ({ + data, + regions, + bucket, + showPlanned, + colorMode, + year, + compare: compareCodes, + gaps: gapsOn, + pluginTint, + regionView, + }), + [data, regions, bucket, showPlanned, colorMode, year, compareCodes, gapsOn, pluginTint, regionView] ); const paint = useCallback((engine: GlobeEngine) => paintGlobe(engine, paintInput), [paintInput]); const paintKey = useMemo(() => [paintInput, regionTick], [paintInput, regionTick]); @@ -227,6 +249,11 @@ export function useAtlasGlobe({ globeRef, skyRef }: AtlasGlobeRefs) { }, []); const engine = useCallback((): GlobeEngine | null => globeRef.current?.engine ?? null, [globeRef]); + // Which countries the engine keeps their regions up for; the manifest marks the engine as ready. + const pinnedCountries = useMemo(() => (regionView ? regionViewCountries(regions) : []), [regionView, regions]); + useEffect(() => { + engine()?.setPinnedRegions(pinnedCountries); + }, [engine, pinnedCountries, manifest]); // Once the globe and the data are there, fetch in the background the regions // of the countries this user is most likely to zoom into: the visited ones @@ -661,6 +688,8 @@ export function useAtlasGlobe({ globeRef, skyRef }: AtlasGlobeRefs) { placeLang, showPlanned, setShowPlanned, + regionView, + setRegionView, flights, showFlights, setShowFlights, diff --git a/client/tests/helpers/atlasGlobeState.ts b/client/tests/helpers/atlasGlobeState.ts index 79459ef9a..6c0ef6b87 100644 --- a/client/tests/helpers/atlasGlobeState.ts +++ b/client/tests/helpers/atlasGlobeState.ts @@ -91,6 +91,8 @@ export function buildGlobeState(over: Record = {}): AtlasGlobeS // layers showPlanned: false, setShowPlanned: vi.fn(), + regionView: false, + setRegionView: vi.fn(), flights: null, showFlights: false, setShowFlights: vi.fn(), diff --git a/client/tests/helpers/atlasGlobeViews.ts b/client/tests/helpers/atlasGlobeViews.ts index b40098489..9d01945bb 100644 --- a/client/tests/helpers/atlasGlobeViews.ts +++ b/client/tests/helpers/atlasGlobeViews.ts @@ -91,6 +91,8 @@ export function viewState(over: Record = {}): AtlasGlobeState { resolveName: (code: string) => `name-${code}`, showPlanned: false, setShowPlanned: vi.fn(), + regionView: false, + setRegionView: vi.fn(), flights: null, showFlights: false, setShowFlights: vi.fn(), diff --git a/shared/src/i18n/ar/atlas.ts b/shared/src/i18n/ar/atlas.ts index c12abce9b..7ad6d3aa2 100644 --- a/shared/src/i18n/ar/atlas.ts +++ b/shared/src/i18n/ar/atlas.ts @@ -93,6 +93,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'أخرى', 'atlas.planned': 'مُخطط', 'atlas.showPlanned': 'إظهار الدول المخطط زيارتها', + 'atlas.regionView': 'المناطق بدلًا من الدول', 'atlas.antarctica': 'أنتاركتيكا', 'atlas.globe.continents': 'القارات', 'atlas.globe.colorBy': 'التلوين حسب', diff --git a/shared/src/i18n/az/atlas.ts b/shared/src/i18n/az/atlas.ts index 1f1005248..871afec13 100644 --- a/shared/src/i18n/az/atlas.ts +++ b/shared/src/i18n/az/atlas.ts @@ -68,6 +68,7 @@ const atlas: TranslationStrings = { 'atlas.planned': 'Planlaşdırılıb', 'atlas.showPlanned': 'Planlaşdırılan ölkələri göstər', + 'atlas.regionView': 'Ölkələr əvəzinə regionlar', 'atlas.antarctica': 'Antarktida', 'atlas.globe.continents': 'Qitələr', 'atlas.globe.colorBy': 'Rəngləmə meyarı', diff --git a/shared/src/i18n/br/atlas.ts b/shared/src/i18n/br/atlas.ts index 83cbcb3b7..a99bed980 100644 --- a/shared/src/i18n/br/atlas.ts +++ b/shared/src/i18n/br/atlas.ts @@ -61,6 +61,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'Outro', 'atlas.planned': 'Planejado', 'atlas.showPlanned': 'Mostrar países planejados', + 'atlas.regionView': 'Regiões em vez de países', 'atlas.antarctica': 'Antártida', 'atlas.globe.continents': 'Continentes', 'atlas.globe.colorBy': 'Colorir por', diff --git a/shared/src/i18n/ca/atlas.ts b/shared/src/i18n/ca/atlas.ts index 993742a47..341557745 100644 --- a/shared/src/i18n/ca/atlas.ts +++ b/shared/src/i18n/ca/atlas.ts @@ -61,6 +61,7 @@ const atlas: TranslationStrings = { 'atlas.bucketDuplicate': 'Ja és a la teva llista de desitjos', 'atlas.planned': 'Planificat', 'atlas.showPlanned': 'Mostra els països planificats', + 'atlas.regionView': 'Regions en lloc de països', 'atlas.antarctica': 'Antàrtida', 'atlas.globe.continents': 'Continents', // same-as-en 'atlas.globe.colorBy': 'Acoloreix per', diff --git a/shared/src/i18n/cs/atlas.ts b/shared/src/i18n/cs/atlas.ts index b2fca4ebc..0f6fab9ed 100644 --- a/shared/src/i18n/cs/atlas.ts +++ b/shared/src/i18n/cs/atlas.ts @@ -69,6 +69,7 @@ const atlas: TranslationStrings = { 'atlas.searchPlaces': 'Místa', 'atlas.planned': 'Plánováno', 'atlas.showPlanned': 'Zobrazit plánované země', + 'atlas.regionView': 'Regiony místo zemí', 'atlas.antarctica': 'Antarktida', 'atlas.globe.continents': 'Kontinenty', 'atlas.globe.colorBy': 'Obarvit podle', diff --git a/shared/src/i18n/de/atlas.ts b/shared/src/i18n/de/atlas.ts index bdfe8a508..c90a52b2f 100644 --- a/shared/src/i18n/de/atlas.ts +++ b/shared/src/i18n/de/atlas.ts @@ -61,6 +61,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'Andere', 'atlas.planned': 'Geplant', 'atlas.showPlanned': 'Geplante Länder anzeigen', + 'atlas.regionView': 'Regionen statt Ländern', 'atlas.antarctica': 'Antarktis', 'atlas.globe.continents': 'Kontinente', 'atlas.globe.colorBy': 'Färben nach', diff --git a/shared/src/i18n/en/atlas.ts b/shared/src/i18n/en/atlas.ts index 90422cf76..8a2f84058 100644 --- a/shared/src/i18n/en/atlas.ts +++ b/shared/src/i18n/en/atlas.ts @@ -61,6 +61,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'Other', 'atlas.planned': 'Planned', 'atlas.showPlanned': 'Show planned countries', + 'atlas.regionView': 'Regions instead of countries', 'atlas.antarctica': 'Antarctica', 'atlas.globe.continents': 'Continents', 'atlas.globe.colorBy': 'Colour by', diff --git a/shared/src/i18n/es/atlas.ts b/shared/src/i18n/es/atlas.ts index 37eb0a22f..f4871589a 100644 --- a/shared/src/i18n/es/atlas.ts +++ b/shared/src/i18n/es/atlas.ts @@ -61,6 +61,7 @@ const atlas: TranslationStrings = { 'atlas.bucketDuplicate': 'Ya está en tu lista de deseos', 'atlas.planned': 'Planeado', 'atlas.showPlanned': 'Mostrar países planeados', + 'atlas.regionView': 'Regiones en lugar de países', 'atlas.antarctica': 'Antártida', 'atlas.globe.continents': 'Continentes', 'atlas.globe.colorBy': 'Colorear por', diff --git a/shared/src/i18n/et/atlas.ts b/shared/src/i18n/et/atlas.ts index fbeb8537e..3efc6d038 100644 --- a/shared/src/i18n/et/atlas.ts +++ b/shared/src/i18n/et/atlas.ts @@ -61,6 +61,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'Muu', 'atlas.planned': 'Plaanis', 'atlas.showPlanned': 'Näita plaanis olevaid riike', + 'atlas.regionView': 'Piirkonnad riikide asemel', 'atlas.antarctica': 'Antarktika', 'atlas.globe.continents': 'Mandrid', 'atlas.globe.colorBy': 'Värvimise alus', diff --git a/shared/src/i18n/fr/atlas.ts b/shared/src/i18n/fr/atlas.ts index 296922959..9f2dbc447 100644 --- a/shared/src/i18n/fr/atlas.ts +++ b/shared/src/i18n/fr/atlas.ts @@ -61,6 +61,7 @@ const atlas: TranslationStrings = { 'atlas.bucketDuplicate': 'Déjà dans votre bucket list', 'atlas.planned': 'Prévu', 'atlas.showPlanned': 'Afficher les pays prévus', + 'atlas.regionView': 'Régions plutôt que pays', 'atlas.antarctica': 'Antarctique', 'atlas.globe.continents': 'Continents', // same-as-en 'atlas.globe.colorBy': 'Colorier par', diff --git a/shared/src/i18n/gr/atlas.ts b/shared/src/i18n/gr/atlas.ts index 7d840da60..865ebd121 100644 --- a/shared/src/i18n/gr/atlas.ts +++ b/shared/src/i18n/gr/atlas.ts @@ -61,6 +61,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'Άλλο', 'atlas.planned': 'Προγραμματισμένο', 'atlas.showPlanned': 'Εμφάνιση προγραμματισμένων χωρών', + 'atlas.regionView': 'Περιοχές αντί για χώρες', 'atlas.antarctica': 'Ανταρκτική', 'atlas.globe.continents': 'Ήπειροι', 'atlas.globe.colorBy': 'Χρωματισμός ανά', diff --git a/shared/src/i18n/he/atlas.ts b/shared/src/i18n/he/atlas.ts index d0877350f..a85e04ac0 100644 --- a/shared/src/i18n/he/atlas.ts +++ b/shared/src/i18n/he/atlas.ts @@ -69,6 +69,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'אחר', 'atlas.planned': 'מתוכנן', 'atlas.showPlanned': 'הצגת מדינות מתוכננות', + 'atlas.regionView': 'אזורים במקום מדינות', 'atlas.antarctica': 'אנטארקטיקה', 'atlas.globe.continents': 'יבשות', 'atlas.globe.colorBy': 'צביעה לפי', diff --git a/shared/src/i18n/hu/atlas.ts b/shared/src/i18n/hu/atlas.ts index 3f4263403..1cdea0e51 100644 --- a/shared/src/i18n/hu/atlas.ts +++ b/shared/src/i18n/hu/atlas.ts @@ -61,6 +61,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'Egyéb', 'atlas.planned': 'Tervezett', 'atlas.showPlanned': 'Tervezett országok megjelenítése', + 'atlas.regionView': 'Régiók országok helyett', 'atlas.antarctica': 'Antarktisz', 'atlas.globe.continents': 'Kontinensek', 'atlas.globe.colorBy': 'Színezés alapja', diff --git a/shared/src/i18n/id/atlas.ts b/shared/src/i18n/id/atlas.ts index cf51a4b92..4d5affc20 100644 --- a/shared/src/i18n/id/atlas.ts +++ b/shared/src/i18n/id/atlas.ts @@ -53,6 +53,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'Lainnya', 'atlas.planned': 'Direncanakan', 'atlas.showPlanned': 'Tampilkan negara yang direncanakan', + 'atlas.regionView': 'Wilayah alih-alih negara', 'atlas.antarctica': 'Antarktika', 'atlas.globe.continents': 'Benua', 'atlas.globe.colorBy': 'Warnai menurut', diff --git a/shared/src/i18n/it/atlas.ts b/shared/src/i18n/it/atlas.ts index 47451d4d7..2abd9f81b 100644 --- a/shared/src/i18n/it/atlas.ts +++ b/shared/src/i18n/it/atlas.ts @@ -61,6 +61,7 @@ const atlas: TranslationStrings = { 'atlas.searchPlaces': 'Luoghi', 'atlas.planned': 'In programma', 'atlas.showPlanned': 'Mostra i paesi in programma', + 'atlas.regionView': 'Regioni invece dei paesi', 'atlas.antarctica': 'Antartide', 'atlas.globe.continents': 'Continenti', 'atlas.globe.colorBy': 'Colora per', diff --git a/shared/src/i18n/ja/atlas.ts b/shared/src/i18n/ja/atlas.ts index 1e6aa4f7e..75f084730 100644 --- a/shared/src/i18n/ja/atlas.ts +++ b/shared/src/i18n/ja/atlas.ts @@ -53,6 +53,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'その他', 'atlas.planned': '予定', 'atlas.showPlanned': '予定の国を表示', + 'atlas.regionView': '国ではなく地域で表示', 'atlas.antarctica': '南極', 'atlas.globe.continents': '大陸', 'atlas.globe.colorBy': '色分け', diff --git a/shared/src/i18n/ko/atlas.ts b/shared/src/i18n/ko/atlas.ts index 0a147875d..295d120b5 100644 --- a/shared/src/i18n/ko/atlas.ts +++ b/shared/src/i18n/ko/atlas.ts @@ -53,6 +53,7 @@ const atlas: TranslationStrings = { 'atlas.other': '기타', 'atlas.planned': '예정', 'atlas.showPlanned': '예정된 국가 표시', + 'atlas.regionView': '국가 대신 지역', 'atlas.antarctica': '남극', 'atlas.globe.continents': '대륙', 'atlas.globe.colorBy': '색상 기준', diff --git a/shared/src/i18n/nl/atlas.ts b/shared/src/i18n/nl/atlas.ts index 955b36a1f..b64021a18 100644 --- a/shared/src/i18n/nl/atlas.ts +++ b/shared/src/i18n/nl/atlas.ts @@ -61,6 +61,7 @@ const atlas: TranslationStrings = { 'atlas.bucketDuplicate': 'Staat al op je bucket list', 'atlas.planned': 'Gepland', 'atlas.showPlanned': 'Geplande landen tonen', + 'atlas.regionView': 'Regio’s in plaats van landen', 'atlas.antarctica': 'Antarctica', // same-as-en 'atlas.globe.continents': 'Continenten', 'atlas.globe.colorBy': 'Kleur op', diff --git a/shared/src/i18n/pl/atlas.ts b/shared/src/i18n/pl/atlas.ts index 9983dfce3..b2d83b60b 100644 --- a/shared/src/i18n/pl/atlas.ts +++ b/shared/src/i18n/pl/atlas.ts @@ -77,6 +77,7 @@ const atlas: TranslationStrings = { 'atlas.searchPlaces': 'Miejsca', 'atlas.planned': 'Zaplanowane', 'atlas.showPlanned': 'Pokaż zaplanowane kraje', + 'atlas.regionView': 'Regiony zamiast krajów', 'atlas.antarctica': 'Antarktyda', 'atlas.globe.continents': 'Kontynenty', 'atlas.globe.colorBy': 'Koloruj według', diff --git a/shared/src/i18n/ru/atlas.ts b/shared/src/i18n/ru/atlas.ts index ec0d72eec..8d91c3a92 100644 --- a/shared/src/i18n/ru/atlas.ts +++ b/shared/src/i18n/ru/atlas.ts @@ -77,6 +77,7 @@ const atlas: TranslationStrings = { 'atlas.bucketDuplicate': 'Уже в вашем списке желаний', 'atlas.planned': 'Запланировано', 'atlas.showPlanned': 'Показать запланированные страны', + 'atlas.regionView': 'Регионы вместо стран', 'atlas.antarctica': 'Антарктида', 'atlas.globe.continents': 'Континенты', 'atlas.globe.colorBy': 'Раскрасить по', diff --git a/shared/src/i18n/sk/atlas.ts b/shared/src/i18n/sk/atlas.ts index 1eeaa7e04..7537b23f8 100644 --- a/shared/src/i18n/sk/atlas.ts +++ b/shared/src/i18n/sk/atlas.ts @@ -69,6 +69,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'Ostatné', 'atlas.planned': 'Plánované', 'atlas.showPlanned': 'Zobraziť plánované krajiny', + 'atlas.regionView': 'Regióny namiesto krajín', 'atlas.antarctica': 'Antarktída', 'atlas.globe.continents': 'Kontinenty', 'atlas.globe.colorBy': 'Farbiť podľa', diff --git a/shared/src/i18n/sv/atlas.ts b/shared/src/i18n/sv/atlas.ts index ba3ffa833..1022c9219 100644 --- a/shared/src/i18n/sv/atlas.ts +++ b/shared/src/i18n/sv/atlas.ts @@ -61,6 +61,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'Andra', 'atlas.planned': 'Planerat', 'atlas.showPlanned': 'Visa planerade länder', + 'atlas.regionView': 'Regioner i stället för länder', 'atlas.antarctica': 'Antarktis', 'atlas.globe.continents': 'Världsdelar', 'atlas.globe.colorBy': 'Färga efter', diff --git a/shared/src/i18n/th/atlas.ts b/shared/src/i18n/th/atlas.ts index 659ce6644..54facad51 100644 --- a/shared/src/i18n/th/atlas.ts +++ b/shared/src/i18n/th/atlas.ts @@ -53,6 +53,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'อื่นๆ', 'atlas.planned': 'วางแผนแล้ว', 'atlas.showPlanned': 'แสดงประเทศที่วางแผนไว้', + 'atlas.regionView': 'แสดงภูมิภาคแทนประเทศ', 'atlas.antarctica': 'แอนตาร์กติกา', 'atlas.globe.continents': 'ทวีป', 'atlas.globe.colorBy': 'แบ่งสีตาม', diff --git a/shared/src/i18n/tr/atlas.ts b/shared/src/i18n/tr/atlas.ts index 33f716bd4..0be82eb56 100644 --- a/shared/src/i18n/tr/atlas.ts +++ b/shared/src/i18n/tr/atlas.ts @@ -61,6 +61,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'Diğer', 'atlas.planned': 'Planlandı', 'atlas.showPlanned': 'Planlanan ülkeleri göster', + 'atlas.regionView': 'Ülkeler yerine bölgeler', 'atlas.antarctica': 'Antarktika', 'atlas.globe.continents': 'Kıtalar', 'atlas.globe.colorBy': 'Renklendirme ölçütü', diff --git a/shared/src/i18n/uk/atlas.ts b/shared/src/i18n/uk/atlas.ts index 864983dff..722dc0a2f 100644 --- a/shared/src/i18n/uk/atlas.ts +++ b/shared/src/i18n/uk/atlas.ts @@ -77,6 +77,7 @@ const atlas: TranslationStrings = { 'atlas.bucketDuplicate': 'Вже у вашому списку бажань', 'atlas.planned': 'Заплановано', 'atlas.showPlanned': 'Показати заплановані країни', + 'atlas.regionView': 'Регіони замість країн', 'atlas.antarctica': 'Антарктида', 'atlas.globe.continents': 'Континенти', 'atlas.globe.colorBy': 'Розфарбувати за', diff --git a/shared/src/i18n/vi/atlas.ts b/shared/src/i18n/vi/atlas.ts index f0849903e..a65daa3d5 100644 --- a/shared/src/i18n/vi/atlas.ts +++ b/shared/src/i18n/vi/atlas.ts @@ -53,6 +53,7 @@ const atlas: TranslationStrings = { 'atlas.other': 'Khác', 'atlas.planned': 'Đã lên kế hoạch', 'atlas.showPlanned': 'Hiện các quốc gia đã lên kế hoạch', + 'atlas.regionView': 'Vùng thay vì quốc gia', 'atlas.antarctica': 'Nam Cực', 'atlas.globe.continents': 'Châu lục', 'atlas.globe.colorBy': 'Tô màu theo', diff --git a/shared/src/i18n/zh-TW/atlas.ts b/shared/src/i18n/zh-TW/atlas.ts index 4ca6811b2..a19394ea9 100644 --- a/shared/src/i18n/zh-TW/atlas.ts +++ b/shared/src/i18n/zh-TW/atlas.ts @@ -53,6 +53,7 @@ const atlas: TranslationStrings = { 'atlas.bucketDuplicate': '已經在你的心願單中', 'atlas.planned': '計劃中', 'atlas.showPlanned': '顯示計劃中的國家', + 'atlas.regionView': '顯示地區而非國家', 'atlas.antarctica': '南極洲', 'atlas.globe.continents': '大洲', 'atlas.globe.colorBy': '著色依據', diff --git a/shared/src/i18n/zh/atlas.ts b/shared/src/i18n/zh/atlas.ts index 98861d5c6..6112dd292 100644 --- a/shared/src/i18n/zh/atlas.ts +++ b/shared/src/i18n/zh/atlas.ts @@ -53,6 +53,7 @@ const atlas: TranslationStrings = { 'atlas.bucketDuplicate': '已经在你的心愿单中', 'atlas.planned': '计划中', 'atlas.showPlanned': '显示计划中的国家', + 'atlas.regionView': '显示地区而非国家', 'atlas.antarctica': '南极洲', 'atlas.globe.continents': '大洲', 'atlas.globe.colorBy': '着色依据',