79 lines
2.0 KiB
TypeScript
79 lines
2.0 KiB
TypeScript
/** 레이어 트리 구성과 관종별 유하방향 표시 계산. 기존 값과 처리 순서를 유지한다. */
|
|
import { AGED_PIPE_CONTROL_NODE_ID, AGED_PIPE_HIGHLIGHT_COLOR, SINKHOLE_TREE_ICON_NAME } from "../model/map-constants";
|
|
|
|
|
|
|
|
|
|
export const appendAgedPipeControlNode = (data: any[]) => {
|
|
if (!Array.isArray(data)) return data;
|
|
const isAgedPipeControlNode = (item: any) =>
|
|
String(item.lyrSn ?? item.id) === AGED_PIPE_CONTROL_NODE_ID ||
|
|
item.lyrNm === "노후관로";
|
|
|
|
if (data.some(isAgedPipeControlNode)) {
|
|
return data.map((item) =>
|
|
isAgedPipeControlNode(item)
|
|
? {
|
|
...item,
|
|
gobjTy: "line",
|
|
iconNm: null,
|
|
lnColor: AGED_PIPE_HIGHLIGHT_COLOR,
|
|
}
|
|
: item,
|
|
);
|
|
}
|
|
|
|
return [
|
|
...data,
|
|
{
|
|
lyrSn: AGED_PIPE_CONTROL_NODE_ID,
|
|
id: AGED_PIPE_CONTROL_NODE_ID,
|
|
lyrNm: "노후관로",
|
|
upperLyrSn: null,
|
|
upId: null,
|
|
sortOrdr: "4",
|
|
drawOrdr: null,
|
|
flterSql: null,
|
|
gobjTy: "line",
|
|
lyrTyNm: "tb_old_pipe",
|
|
useYn: "Y",
|
|
minViewSize: null,
|
|
iconNm: null,
|
|
iconSize: null,
|
|
lblAtrbNm: null,
|
|
fontNm: null,
|
|
fontIntnColor: null,
|
|
fontExtnColor: null,
|
|
fontExtnWdth: null,
|
|
lnWdth: null,
|
|
lnColor: AGED_PIPE_HIGHLIGHT_COLOR,
|
|
polgnColor: null,
|
|
initEprssYn: "Y",
|
|
clickPsblYn: "N",
|
|
exprsYn: "Y",
|
|
cmncNm: "all",
|
|
srvcNm: "wfs",
|
|
actlLyrYn: "N",
|
|
clckZoom: null,
|
|
children: null,
|
|
},
|
|
];
|
|
};
|
|
|
|
export const normalizeTreeRowSpacing = (data: any[]) => {
|
|
if (!Array.isArray(data)) return data;
|
|
|
|
return data.map((item) => {
|
|
if (item?.lyrNm !== "지반침하정보") {
|
|
return item;
|
|
}
|
|
|
|
return {
|
|
...item,
|
|
iconNm: item.iconNm || SINKHOLE_TREE_ICON_NAME,
|
|
gobjTy: "",
|
|
};
|
|
});
|
|
};
|
|
export { extractUsageCodesFromLayerInfo, isLayerVisibleAtZoom, extractCheckedPipeUsageStyles } from "@/features/map-layers/lib/flow-direction-selection";
|