fix(workbench): preview lane arrow drag
This commit is contained in:
1 parent
fe73d993a9
commit
118dc8e9aa
2 files changed
+66
-4
No files matched your search
@@ -46,6 +46,7 @@ interface Props {
|
||||
laneSelectionAnchor?: Coordinate | null;
|
||||
laneSelectionAxisAzimuth?: number | null;
|
||||
/** Receives the axis-projected final map coordinate. */
|
||||
onLaneSelectionDrag?: (from: Coordinate, to: Coordinate) => void;
|
||||
onLaneSelectionDragEnd?: (from: Coordinate, to: Coordinate) => void;
|
||||
/** Authoritative preview geometry; null returns the map to the baseline. */
|
||||
preview?: Partial<Record<PreviewLayerName, GeoJson | null>> | null;
|
||||
@@ -76,6 +77,7 @@ export function MapCanvas({
|
||||
laneSelectionHiddenIds,
|
||||
laneSelectionAnchor,
|
||||
laneSelectionAxisAzimuth,
|
||||
onLaneSelectionDrag,
|
||||
onLaneSelectionDragEnd,
|
||||
preview,
|
||||
onHandleDrag,
|
||||
@@ -111,6 +113,7 @@ export function MapCanvas({
|
||||
onRangeDrag,
|
||||
onRangeEnd,
|
||||
onLaneSelectionDragEnd,
|
||||
onLaneSelectionDrag,
|
||||
laneSelectionAxisAzimuth,
|
||||
ghostPending,
|
||||
});
|
||||
@@ -121,6 +124,7 @@ export function MapCanvas({
|
||||
onRangeDrag,
|
||||
onRangeEnd,
|
||||
onLaneSelectionDragEnd,
|
||||
onLaneSelectionDrag,
|
||||
laneSelectionAxisAzimuth,
|
||||
ghostPending,
|
||||
};
|
||||
@@ -228,6 +232,8 @@ export function MapCanvas({
|
||||
geometry?.translate(dx, dy);
|
||||
feature.setGeometry(geometry);
|
||||
});
|
||||
if (laneDragAnchor)
|
||||
dragRef.current.onLaneSelectionDrag?.(laneDragOrigin, [laneDragAnchor[0] + dx, laneDragAnchor[1] + dy]);
|
||||
},
|
||||
handleUpEvent: (event) => {
|
||||
const axis = dragRef.current.laneSelectionAxisAzimuth;
|
||||
|
||||
Reference in new issue
Block a user