mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
fix(outlines): harden shared cache and provider lifecycle
This commit is contained in:
1 parent
9559e7a282
commit
177b5951a0
27 files changed
+3363
-248
No files matched your search
@@ -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'],
|
||||
|
||||
Reference in new issue
Block a user