|
|
@ -12,18 +12,15 @@ export function createOverlay(state = initState, payload: OverlayTypes) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export function deleteOverlays(state = initState, payload: any) { |
|
|
|
export function deleteOverlays(state = initState, payload: any) { |
|
|
|
const { selectedIds } = state.map; |
|
|
|
const { selectedIds } = state; |
|
|
|
const [id] = selectedIds!; |
|
|
|
const [id] = selectedIds!; |
|
|
|
const filterFunc = (overlay: IOverlay) => overlay.id !== id; |
|
|
|
const filterFunc = (overlay: IOverlay) => overlay.id !== id; |
|
|
|
return produce(state, (draft) => { |
|
|
|
return produce(state, (draft) => { |
|
|
|
// draft.map.status = Status.CreateOverlay;
|
|
|
|
|
|
|
|
// draft.map.command = Command.DeleteOverlays;
|
|
|
|
|
|
|
|
draft.map.rectangles = draft.map.rectangles.filter(filterFunc); |
|
|
|
draft.map.rectangles = draft.map.rectangles.filter(filterFunc); |
|
|
|
draft.map.polygons = draft.map.polygons.filter(filterFunc); |
|
|
|
draft.map.polygons = draft.map.polygons.filter(filterFunc); |
|
|
|
draft.map.polylines = draft.map.polylines.filter(filterFunc); |
|
|
|
draft.map.polylines = draft.map.polylines.filter(filterFunc); |
|
|
|
draft.map.circles = draft.map.circles.filter(filterFunc); |
|
|
|
draft.map.circles = draft.map.circles.filter(filterFunc); |
|
|
|
draft.map.selectedIds = []; |
|
|
|
draft.selectedIds = []; |
|
|
|
// draft.map.overlayType = payload as OverlayTypes;
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|