Position übernehmen beim bearbeiten von Einsätzen ändert nun die Position von Einsätzen
This commit is contained in:
@@ -26,7 +26,7 @@ export interface MapStore {
|
||||
}) => void;
|
||||
searchElements: OSMWay[];
|
||||
setSearchElements: (elements: MapStore["searchElements"]) => void;
|
||||
toggleSearchElementSelection: (elementId: number) => void;
|
||||
toggleSearchElementSelection: (elementId: number, forceState?: boolean) => void;
|
||||
setContextMenu: (popup: MapStore["contextMenu"]) => void;
|
||||
searchPopup: {
|
||||
lat: number;
|
||||
@@ -83,11 +83,11 @@ export const useMapStore = create<MapStore>((set, get) => ({
|
||||
set(() => ({
|
||||
searchElements: elements,
|
||||
})),
|
||||
toggleSearchElementSelection: (elementId) => {
|
||||
toggleSearchElementSelection: (elementId, forceState) => {
|
||||
const searchElements = get().searchElements;
|
||||
const element = searchElements.find((e) => e.wayID === elementId);
|
||||
if (!element) return;
|
||||
element.isSelected = !element.isSelected;
|
||||
element.isSelected = forceState ? forceState : !element.isSelected;
|
||||
set(() => ({
|
||||
searchElements: [...searchElements],
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user