Change region to use top-left and bottom-right coordinates

Replace center+delta region representation with a bounding box defined
by topLeft and bottomRight coordinate pairs, which maps more directly
to the visible map area.

https://claude.ai/code/session_0162emnCi1KxW5FkTNn2ZrvH
This commit is contained in:
Claude
2026-03-23 22:05:57 +00:00
parent 946f8dd342
commit fe649c81eb
5 changed files with 18 additions and 24 deletions

View File

@@ -18,10 +18,8 @@ type System {
} }
type Region { type Region {
latitude: Float! topLeft: Coordinates!
longitude: Float! bottomRight: Coordinates!
latitudeDelta: Float!
longitudeDelta: Float!
} }
type ParkingSystem { type ParkingSystem {

View File

@@ -12,9 +12,7 @@ export interface ICoordinates {
} }
export interface IRegion { export interface IRegion {
latitude: number; topLeft: ICoordinates;
longitude: number; bottomRight: ICoordinates;
latitudeDelta: number;
longitudeDelta: number;
} }

View File

@@ -26,10 +26,8 @@ const supportedSystems: InterchangeSystemBuilderArguments[] = [
useSelfUpdatingEtas: true, useSelfUpdatingEtas: true,
shuttleStopArrivalDegreeDelta: 0.001, shuttleStopArrivalDegreeDelta: 0.001,
initialRegion: { initialRegion: {
latitude: 33.7937, topLeft: { latitude: 33.7987, longitude: -117.8581 },
longitude: -117.8531, bottomRight: { latitude: 33.7887, longitude: -117.8481 },
latitudeDelta: 0.01,
longitudeDelta: 0.01,
}, },
} }
] ]

View File

@@ -40,10 +40,14 @@ describe("SystemResolvers", () => {
query GetSystemInitialRegion($systemId: ID!) { query GetSystemInitialRegion($systemId: ID!) {
system(id: $systemId) { system(id: $systemId) {
initialRegion { initialRegion {
latitude topLeft {
longitude latitude
latitudeDelta longitude
longitudeDelta }
bottomRight {
latitude
longitude
}
} }
} }
} }
@@ -56,10 +60,8 @@ describe("SystemResolvers", () => {
expect(response.body.singleResult.errors).toBeUndefined(); expect(response.body.singleResult.errors).toBeUndefined();
const initialRegion = (response.body.singleResult.data as any).system.initialRegion; const initialRegion = (response.body.singleResult.data as any).system.initialRegion;
expect(initialRegion).toEqual({ expect(initialRegion).toEqual({
latitude: 33.7937, topLeft: { latitude: 33.7987, longitude: -117.8581 },
longitude: -117.8531, bottomRight: { latitude: 33.7887, longitude: -117.8481 },
latitudeDelta: 0.01,
longitudeDelta: 0.01,
}); });
}); });
}); });

View File

@@ -27,10 +27,8 @@ const systemInfoForTesting: InterchangeSystemBuilderArguments = {
useSelfUpdatingEtas: false, useSelfUpdatingEtas: false,
shuttleStopArrivalDegreeDelta: 0.001, shuttleStopArrivalDegreeDelta: 0.001,
initialRegion: { initialRegion: {
latitude: 33.7937, topLeft: { latitude: 33.7987, longitude: -117.8581 },
longitude: -117.8531, bottomRight: { latitude: 33.7887, longitude: -117.8481 },
latitudeDelta: 0.01,
longitudeDelta: 0.01,
}, },
}; };