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:
@@ -137,6 +137,7 @@ export const useVehicleContext = () => ({
|
|||||||
.fn()
|
.fn()
|
||||||
.mockResolvedValue({
|
.mockResolvedValue({
|
||||||
// tests only pass without mocking the data here
|
// tests only pass without mocking the data here
|
||||||
|
// '3FAFP13P71R199267': [],
|
||||||
// '3FAFP13P31R199430': [[16.891136999999986, 26.832352999999955], [56.891136999999986, 66.832352999999955], [26.891136999999986, 36.832352999999955]],
|
// '3FAFP13P31R199430': [[16.891136999999986, 26.832352999999955], [56.891136999999986, 66.832352999999955], [26.891136999999986, 36.832352999999955]],
|
||||||
// '3FAFP13P71R199060': [[36.891136999999986, 46.832352999999955], [76.891136999999986, 16.832352999999955]],
|
// '3FAFP13P71R199060': [[36.891136999999986, 46.832352999999955], [76.891136999999986, 16.832352999999955]],
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -60,15 +60,18 @@ const ComponentVehiclePathsMap = (props) => {
|
|||||||
|
|
||||||
// validate each location
|
// validate each location
|
||||||
for (let vinLocations of resultArray) {
|
for (let vinLocations of resultArray) {
|
||||||
let path = []
|
// if there are points for the vin; skip if empty points array
|
||||||
path[0] = vinLocations[0]
|
if (vinLocations[0] && vinLocations[1] && vinLocations[1][0]) {
|
||||||
path[1] = []
|
let path = []
|
||||||
for (let location of vinLocations[1]) {
|
path[0] = vinLocations[0]
|
||||||
if (ValidateLocationVehiclePathsData(location) !== false) {
|
path[1] = []
|
||||||
path[1].push(location);
|
for (let location of vinLocations[1]) {
|
||||||
|
if (ValidateLocationVehiclePathsData(location) !== false) {
|
||||||
|
path[1].push(location);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
points.push(path)
|
||||||
}
|
}
|
||||||
points.push(path)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setMarkers(points);
|
setMarkers(points);
|
||||||
|
|||||||
Reference in New Issue
Block a user