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 {
latitude: Float!
longitude: Float!
latitudeDelta: Float!
longitudeDelta: Float!
topLeft: Coordinates!
bottomRight: Coordinates!
}
type ParkingSystem {

View File

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

View File

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

View File

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

View File

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