feat(workbench): align v2 GIS and SCADA API
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import type { FeatureCollection, Point } from "geojson";
|
||||
import type { Map as MapLibreMap } from "maplibre-gl";
|
||||
import type { ScadaDevice } from "../api/scada-client";
|
||||
import { useEffect, useRef, useSyncExternalStore, type RefObject } from "react";
|
||||
import { getResponsiveWorkbenchPadding } from "../map/camera";
|
||||
import { WorkbenchMapController } from "../map/workbench-map-controller";
|
||||
@@ -9,7 +11,8 @@ export function useWorkbenchMapController({
|
||||
leftPanelOpen,
|
||||
rightPanelOpen,
|
||||
conditionPanelExpanded = false,
|
||||
agentPanelWidth
|
||||
agentPanelWidth,
|
||||
getScadaFeatures
|
||||
}: {
|
||||
mapRef: RefObject<MapLibreMap | null>;
|
||||
mapReady: boolean;
|
||||
@@ -17,6 +20,7 @@ export function useWorkbenchMapController({
|
||||
rightPanelOpen: boolean;
|
||||
conditionPanelExpanded?: boolean;
|
||||
agentPanelWidth?: number;
|
||||
getScadaFeatures?: (deviceIds?: string[], signal?: AbortSignal) => Promise<FeatureCollection<Point, ScadaDevice>>;
|
||||
}) {
|
||||
const valuesRef = useRef({
|
||||
mapReady,
|
||||
@@ -48,7 +52,8 @@ export function useWorkbenchMapController({
|
||||
valuesRef.current.agentPanelWidth
|
||||
)
|
||||
: { top: 48, right: 48, bottom: 48, left: 48 };
|
||||
}
|
||||
},
|
||||
getScadaFeatures
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user