Ditch garbage data ingest for lat/lon and extend map. Closes #63

This commit is contained in:
Jack Kingsman
2026-03-16 14:24:58 -07:00
parent 8d7d926762
commit 749fb43fd0
39 changed files with 131 additions and 61 deletions
+19
View File
@@ -7,6 +7,7 @@ import {
formatRouteLabel,
formatRoutingOverrideInput,
getEffectiveContactRoute,
isValidLocation,
resolvePath,
formatDistance,
formatHopCounts,
@@ -665,6 +666,24 @@ describe('resolvePath', () => {
});
});
describe('isValidLocation', () => {
it('rejects null and unset coordinates', () => {
expect(isValidLocation(null, -122.3)).toBe(false);
expect(isValidLocation(47.6, null)).toBe(false);
expect(isValidLocation(0, 0)).toBe(false);
});
it('rejects out-of-range coordinates', () => {
expect(isValidLocation(-593.497573, -1659.939204)).toBe(false);
expect(isValidLocation(91, 0)).toBe(false);
expect(isValidLocation(0, 181)).toBe(false);
});
it('accepts sane coordinates', () => {
expect(isValidLocation(47.6062, -122.3321)).toBe(true);
});
});
describe('formatDistance', () => {
it('formats distances under 1km in meters', () => {
expect(formatDistance(0.5)).toBe('500m');