From 7ff84c678465508cf32b275ec8a75f44ee077dd3 Mon Sep 17 00:00:00 2001 From: angatupyry Date: Wed, 30 Aug 2023 10:57:42 -0400 Subject: [PATCH] Using defaultRobotzoom if available Signed-off-by: angatupyry --- packages/dashboard/src/components/map-app.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/dashboard/src/components/map-app.tsx b/packages/dashboard/src/components/map-app.tsx index f58acfa53..7dd45132a 100644 --- a/packages/dashboard/src/components/map-app.tsx +++ b/packages/dashboard/src/components/map-app.tsx @@ -45,6 +45,7 @@ const SettingsKey = 'mapAppSettings'; const colorManager = new ColorManager(); const DEFAULT_ZOOM_LEVEL = 5; +const DEFAULT_ROBOT_ZOOM_LEVEL = 6; function getRobotId(fleetName: string, robotName: string): string { return `${fleetName}/${robotName}`; @@ -372,10 +373,10 @@ export const MapApp = styled( const mapCoords = fromRmfCoords(robotLocation); const newCenter: L.LatLngTuple = [mapCoords[1], mapCoords[0]]; AppEvents.mapCenter.next(newCenter); - AppEvents.zoom.next(6); + AppEvents.zoom.next(resourceManager?.defaultRobotZoom ?? DEFAULT_ROBOT_ZOOM_LEVEL); }); return () => sub.unsubscribe(); - }, [robotLocations, bounds]); + }, [robotLocations, bounds, resourceManager?.defaultRobotZoom]); const onViewportChanged = (viewport: Viewport) => { if (viewport.zoom && viewport.center) {