mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-16 23:40:32 +00:00
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:
@@ -18,10 +18,8 @@ type System {
|
||||
}
|
||||
|
||||
type Region {
|
||||
latitude: Float!
|
||||
longitude: Float!
|
||||
latitudeDelta: Float!
|
||||
longitudeDelta: Float!
|
||||
topLeft: Coordinates!
|
||||
bottomRight: Coordinates!
|
||||
}
|
||||
|
||||
type ParkingSystem {
|
||||
|
||||
@@ -12,9 +12,7 @@ export interface ICoordinates {
|
||||
}
|
||||
|
||||
export interface IRegion {
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
latitudeDelta: number;
|
||||
longitudeDelta: number;
|
||||
topLeft: ICoordinates;
|
||||
bottomRight: ICoordinates;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 },
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
@@ -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 },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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 },
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user