Skip to content

Commit

Permalink
Using defaultRobotzoom if available
Browse files Browse the repository at this point in the history
Signed-off-by: angatupyry <fierrofenix@gmail.com>
  • Loading branch information
Angatupyry committed Aug 30, 2023
1 parent d362c54 commit 7ff84c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/dashboard/src/components/map-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7ff84c6

Please sign in to comment.