CEC-3933 - Ensure zoom to car on Vehicle Map load (#326)

* CEC-3933 - Parse VehiclePaths location data

* changes

* fixes

* stuff

* sort of works

* fix

* progress

* refactor

* fix vehicle paths query

* digital twin shows map

* new dashboard

* wider digital twin map

* snapshot

* latest; using polylines

* lag lng changes

* stuff

* path showing up

* stuff

* things

* revert home page

* whitespace

* validation

* more stuff

* fix button issue

* tests pass without mocking data

* fix code smells

* remove map from digital twin, add to tab

* fix bug

* marker click event working

* individual colors

* possible fix

* fix warning

* merge and remove unused code

* small fixes

* re add dashboard

* snaps

* CEC-3933 - Ensure zoom to car on Vehicle Map load
This commit is contained in:
Paul Adamsen
2023-05-01 11:36:10 -04:00
committed by GitHub
parent 55ae0f20b9
commit ad5a7a527e
2 changed files with 11 additions and 7 deletions

View File

@@ -137,6 +137,7 @@ export const useVehicleContext = () => ({
.fn()
.mockResolvedValue({
// tests only pass without mocking the data here
// '3FAFP13P71R199267': [],
// '3FAFP13P31R199430': [[16.891136999999986, 26.832352999999955], [56.891136999999986, 66.832352999999955], [26.891136999999986, 36.832352999999955]],
// '3FAFP13P71R199060': [[36.891136999999986, 46.832352999999955], [76.891136999999986, 16.832352999999955]],
}),

View File

@@ -60,15 +60,18 @@ const ComponentVehiclePathsMap = (props) => {
// validate each location
for (let vinLocations of resultArray) {
let path = []
path[0] = vinLocations[0]
path[1] = []
for (let location of vinLocations[1]) {
if (ValidateLocationVehiclePathsData(location) !== false) {
path[1].push(location);
// if there are points for the vin; skip if empty points array
if (vinLocations[0] && vinLocations[1] && vinLocations[1][0]) {
let path = []
path[0] = vinLocations[0]
path[1] = []
for (let location of vinLocations[1]) {
if (ValidateLocationVehiclePathsData(location) !== false) {
path[1].push(location);
}
}
points.push(path)
}
points.push(path)
}
setMarkers(points);