조사 지도 조건과 노후관로 범례 보완
This commit is contained in:
@@ -7,6 +7,30 @@ type ExmnLayerScope = {
|
||||
sggNm?: string;
|
||||
};
|
||||
|
||||
/** 구버전 응답이 하류맨홀을 포함해도 업로드 관로조사의 상류맨홀 피처만 지도에 전달한다. */
|
||||
export const retainUpstreamManholeFeatures = (response: any) => {
|
||||
const featureCollection = response?.data?.type === "FeatureCollection"
|
||||
? response.data
|
||||
: response?.type === "FeatureCollection"
|
||||
? response
|
||||
: null;
|
||||
if (!featureCollection || !Array.isArray(featureCollection.features)) return response;
|
||||
|
||||
const features = featureCollection.features.filter(
|
||||
(feature: any) => String(feature?.properties?.manholePosition ?? "").toUpperCase() === "UPSTREAM",
|
||||
);
|
||||
const upstreamCollection = {
|
||||
...featureCollection,
|
||||
features,
|
||||
totalFeatures: features.length,
|
||||
numberReturned: features.length,
|
||||
};
|
||||
|
||||
return response?.data === featureCollection
|
||||
? { ...response, data: upstreamCollection }
|
||||
: upstreamCollection;
|
||||
};
|
||||
|
||||
/** 사업차수·구조등급·운영등급 AND 조건으로 조사결과 GeoJSON을 조회한다. */
|
||||
export const getExmnMapLayer = async (
|
||||
jobType: ExmnMapJobType,
|
||||
@@ -21,5 +45,6 @@ export const getExmnMapLayer = async (
|
||||
if (filters.structuralGrade) query.set("structuralGrade", filters.structuralGrade);
|
||||
if (filters.operationalGrade) query.set("operationalGrade", filters.operationalGrade);
|
||||
|
||||
return getRawJson(`/sewerage-service/api/v1/exmnMap/layers?${query.toString()}`);
|
||||
const response = await getRawJson(`/sewerage-service/api/v1/exmnMap/layers?${query.toString()}`);
|
||||
return jobType === "MNHL" ? retainUpstreamManholeFeatures(response) : response;
|
||||
};
|
||||
|
||||
@@ -173,6 +173,8 @@ const AnalysisPopupMenu = dynamic(
|
||||
|
||||
const AGED_PIPE_CONTROL_NODE_ID = "SN_AGED_PIPE";
|
||||
const AGED_PIPE_HIGHLIGHT_LAYER_ID = "SN_AGED_PIPE_HIGHLIGHT";
|
||||
// 노후관로 지도 강조선과 시설물 트리의 선형 범례가 동일하게 사용하는 빨간색이다.
|
||||
const AGED_PIPE_HIGHLIGHT_COLOR = "rgba(235, 40, 40, 0.82)";
|
||||
const FLDNG_HSTRY_WFS_LAYER_ID = "SN_FLDNG_HSTRY_WFS";
|
||||
const AGED_PIPE_ROW_SELECT_MESSAGE = "SN_AGED_PIPE_ROW_SELECT";
|
||||
const AGED_PIPE_POPUP_MINIMIZE_MESSAGE = "SN_AGED_PIPE_POPUP_MINIMIZE";
|
||||
@@ -2436,8 +2438,21 @@ const extractCheckedPipeUsageStyles = (checkedNodesData: any[], zoom: number) =>
|
||||
|
||||
const appendAgedPipeControlNode = (data: any[]) => {
|
||||
if (!Array.isArray(data)) return data;
|
||||
if (data.some((item) => String(item.lyrSn) === AGED_PIPE_CONTROL_NODE_ID || item.lyrNm === "노후관로")) {
|
||||
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 [
|
||||
@@ -2451,7 +2466,7 @@ const appendAgedPipeControlNode = (data: any[]) => {
|
||||
sortOrdr: "4",
|
||||
drawOrdr: null,
|
||||
flterSql: null,
|
||||
gobjTy: "",
|
||||
gobjTy: "line",
|
||||
lyrTyNm: "tb_old_pipe",
|
||||
useYn: "Y",
|
||||
minViewSize: null,
|
||||
@@ -2463,7 +2478,7 @@ const appendAgedPipeControlNode = (data: any[]) => {
|
||||
fontExtnColor: null,
|
||||
fontExtnWdth: null,
|
||||
lnWdth: null,
|
||||
lnColor: null,
|
||||
lnColor: AGED_PIPE_HIGHLIGHT_COLOR,
|
||||
polgnColor: null,
|
||||
initEprssYn: "Y",
|
||||
clickPsblYn: "N",
|
||||
@@ -5750,7 +5765,7 @@ const Map = () => {
|
||||
srvcNm: "wfs",
|
||||
flterSql: buildAgedPipeCqlFilters(appliedAgedPipeFilters).join(" and "),
|
||||
lnWdth: "4",
|
||||
lnColor: "rgba(235, 40, 40, 0.82)",
|
||||
lnColor: AGED_PIPE_HIGHLIGHT_COLOR,
|
||||
drawOrdr: "9999",
|
||||
minViewSize: String(AGED_PIPE_MIN_ZOOM),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user