mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +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 {
|
type Region {
|
||||||
latitude: Float!
|
topLeft: Coordinates!
|
||||||
longitude: Float!
|
bottomRight: Coordinates!
|
||||||
latitudeDelta: Float!
|
|
||||||
longitudeDelta: Float!
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ParkingSystem {
|
type ParkingSystem {
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -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,
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user