fix(outlines): harden shared cache and provider lifecycle

This commit is contained in:
manjunath22466 committed 2026-10-02 22:32:46 +05:30
1 parent 9559e7a282
commit 177b5951a0
27 files changed
+3363 -248

No files matched your search

+27
View File
@@ -7,11 +7,38 @@ import {
polygonCentroid,
clipTileLine,
createOpenFreeMapSource,
estimateOpenFreeMapProjectionBytes,
} from './openFreeMap.js';
import { createVectorTileSource } from './vectorTiles.js';
const fixture = (name) =>
readFileSync(new URL(`../data/fixtures/${name}`, import.meta.url));
test('projected tile geometry has deterministic accounting and a coordinate cap', () => {
const small = {
streets: [
{
name: 'A',
coordinates: [
[0, 1],
[2, 3],
],
},
],
};
assert.equal(
estimateOpenFreeMapProjectionBytes(small),
estimateOpenFreeMapProjectionBytes(structuredClone(small)),
);
assert.ok(estimateOpenFreeMapProjectionBytes(small) > 4 * 8);
assert.throws(
() =>
estimateOpenFreeMapProjectionBytes({
coordinates: Array.from({ length: 250_001 }, () => [0, 0]),
}),
/coordinate limit/,
);
});
test('real z14 and z12 Austin tiles decode only drivable roads', () => {
for (const [z, x, y, name] of [
[14, 3743, 6745, 'ofm-austin-14-3743-6745.pbf'],