Fix Data Library share restore, dense tile layers and EPC partition reads

- Share links: the compact /share/<code> format carries the switched-on
  library entries (field 29), so Copy Link keeps them; a share opened in the
  same tab restores them; any share decides what is on, so one with every
  library entry off no longer switches on the recipient's stored entries.
- A tile entry too dense at its minimum zoom (Norway cadastre z14, depth z11)
  is hidden below that scale via minimumTerrainLevel instead of allocating
  millions of tiles when zoomed out.
- EPC partitions keep the full extent for exclusion and the 98 % extent for
  ranking only; the old trimmed-only extents are retired.
- Partition index footers that fail transiently are retried; an incomplete
  index is never cached as complete, a complete prior index is kept, and it
  is rebuilt after five minutes.
- Views that leave touching partitions unread are partial; listing and
  footer bodies are capped and ranges validated.
- The Browse dialog relabels after a language switch.
This commit is contained in:
Said Turksever committed 2026-11-12 22:37:34 +00:00
1 parent 871b7f0fcc
commit 24ccdd4dc3
20 files changed
+1220 -162

No files matched your search

+15
View File
@@ -58,6 +58,7 @@ import {
followOffsetToEnu,
layerTokenFromNumber,
layerTokenNumber,
normalizeLibraryTokens,
normalizeShareViewState,
} from './viewCodec.js';
@@ -507,6 +508,7 @@ test('the field registry is well formed and permanent', () => {
[26, 'scopeTerminusPct', null],
[27, 'styleParams', BY_STYLE],
[28, 'worldTime', null],
[29, 'library', null],
],
);
assert.deepEqual(
@@ -1571,3 +1573,16 @@ test('the follow offset for a camera is the inverse of followCameraFor', () => {
null,
);
});
test('Data Library tokens round-trip and malformed ones are skipped', () => {
const state = { lat: 1, lon: 2, library: ['00', '1z', '0a'] };
const decoded = decodeShareView(encodeShareView(state));
assert.equal(decoded.ok, true);
assert.deepEqual(decoded.state.library, ['00', '1z', '0a']);
// None on: no field, and the decoder reads no tokens.
const none = decodeShareView(encodeShareView({ lat: 1, lon: 2 }));
assert.equal(none.state.library, null);
assert.deepEqual(normalizeLibraryTokens('01.!!.01.zz'), ['01', 'zz']);
assert.equal(normalizeLibraryTokens(null), null);
assert.deepEqual(normalizeLibraryTokens('x'.repeat(500)), []);
});