gis 목록 에서 피처 선택시 오류 수정
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ NEXT_PUBLIC_REFRESH_TOKEN = refresh-token
|
||||
|
||||
|
||||
NEXT_PUBLIC_SEWERAGE_API_URL=http://con.mind-one.co.kr:11083/sewerage-service/api # 개발 서버 API
|
||||
# NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.128:8883/sewerage-service/api # 최용성
|
||||
#NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.128:8883/sewerage-service/api # 최용성
|
||||
#NEXT_PUBLIC_SEWERAGE_API_URL=http://192.168.1.66:8883/sewerage-service/api # 박이정
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,10 @@ const Map = () => {
|
||||
}, []);
|
||||
|
||||
// 체크된 레이어 정보를 받는 핸들러
|
||||
const handleCheckedLayersChange = (checkedIds: string[], checkedNodesData: any[]) => {
|
||||
const handleCheckedLayersChange = (
|
||||
checkedIds: string[],
|
||||
checkedNodesData: any[]
|
||||
) => {
|
||||
setCheckedLayers(checkedIds);
|
||||
setCheckedLayersData(checkedNodesData);
|
||||
};
|
||||
@@ -58,28 +61,38 @@ const Map = () => {
|
||||
|
||||
// 2. data가 OpenLayers Feature 인스턴스인지 확인
|
||||
let foundFeature: any = null;
|
||||
if (
|
||||
data &&
|
||||
typeof data.getGeometry === "function" &&
|
||||
typeof data.setStyle === "function"
|
||||
let featureId = data.fid;
|
||||
const layerName = data.layerNm;
|
||||
if (layerName === "tb_wr_bdst_ruse_fclt") {
|
||||
// 재이용시설
|
||||
featureId = `${layerName}.${data.searchPk}`;
|
||||
} else if ( //빗물이용시설, 중수도시설
|
||||
layerName === "tb_wr_rnwtr_utztn_fclt" ||
|
||||
layerName == "tb_wr_rswtr_fclt"
|
||||
) {
|
||||
// 이미 Feature 인스턴스라면 그대로 사용
|
||||
foundFeature = data;
|
||||
featureId = `${layerName}.${data.bdstInfoSn}`;
|
||||
} else if (layerName === "tb_il_swage_prcs_fclt") { //하수처리시설
|
||||
featureId = `${layerName}.${data.bscFctCd}`;
|
||||
} else if (layerName === "tb_wr_htdfl_fclt") { //온배수시설
|
||||
featureId = `${layerName}.${data.bdstRuseFcltSn}`;
|
||||
} else if (layerName == "tb_wr_ruse_fclt_dmd_co") { //수요처
|
||||
featureId = `${layerName}.${data.dmdInfoId.replaceAll("-", "")}`;
|
||||
} else {
|
||||
// 아니면 featureId로 맵에서 Feature 인스턴스를 찾아서 사용
|
||||
const featureId = data.fid || data.ftrIdn || data.id;
|
||||
map
|
||||
.getLayers()
|
||||
.getArray()
|
||||
.forEach((layer: any) => {
|
||||
const source = layer.getSource?.();
|
||||
if (source?.getFeatureById) {
|
||||
const feature = source.getFeatureById(String(featureId).trim());
|
||||
if (feature) foundFeature = feature;
|
||||
}
|
||||
});
|
||||
console.warn("해당 레이어에 대한 featureId 매핑 없음", layerName);
|
||||
featureId = `${layerName}.${data.fid || data.id || data.ftrIdn}`;
|
||||
}
|
||||
|
||||
map
|
||||
.getLayers()
|
||||
.getArray()
|
||||
.forEach((layer: any) => {
|
||||
const source = layer.getSource?.();
|
||||
if (source?.getFeatureById) {
|
||||
const feature = source.getFeatureById(String(featureId).trim());
|
||||
if (feature) foundFeature = feature;
|
||||
}
|
||||
});
|
||||
|
||||
// 3. 피처 선택
|
||||
if (foundFeature) {
|
||||
const geometry = foundFeature.getGeometry();
|
||||
@@ -133,7 +146,7 @@ const Map = () => {
|
||||
// />
|
||||
// )
|
||||
// }
|
||||
detailView={(props: any) =>(
|
||||
detailView={(props: any) => (
|
||||
<NewWindowPopup
|
||||
onClose={handlePopupClose} // 메모이제이션된 함수 사용
|
||||
checkedLayers={checkedLayers}
|
||||
|
||||
@@ -156,15 +156,15 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
}
|
||||
};
|
||||
const detainSttn = async (featureCd: string, layerNm: string) => {
|
||||
if (layerNm == '빗물이용시설') {
|
||||
if (layerNm == 'tb_wr_rnwtr_utztn_fclt') { //빗물이용시설
|
||||
const res = await getFetch(fetchType.WR, `/reuseFc/rainyInfoList/1/20/0/${featureCd}`)
|
||||
setRainList(res)
|
||||
}
|
||||
else if (layerNm == '중수도시설') {
|
||||
else if (layerNm == 'tb_wr_rswtr_fclt') { //중수도 시설
|
||||
const res = await getFetch(fetchType.WR, `/reuseFc/waterreuseFc/1/20/0/${featureCd}`)
|
||||
setRswtrList(res)
|
||||
}
|
||||
else if(layerNm =='수요처'){
|
||||
else if(layerNm =='tb_wr_ruse_fclt_dmd_co'){ //수요처
|
||||
const res = await getFetch(fetchType.WR, `/reuseFc/request/1/20/0/${featureCd}`)
|
||||
setMngList(res)
|
||||
}
|
||||
@@ -505,17 +505,17 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
layerId = seletectedLayerNm || '';
|
||||
}
|
||||
//하수처리시설
|
||||
const isPrcsFclt = layerId == '하수처리시설'
|
||||
const isPrcsFclt = layerId == 'tb_il_swage_prcs_fclt'
|
||||
// 재이용시설
|
||||
const isPbnst = layerId == '하수재이용시설';
|
||||
const isPbnst = layerId == 'tb_wr_bdst_ruse_fclt';
|
||||
// 빗물이용시설
|
||||
const isRain = layerId == '빗물이용시설';
|
||||
const isRain = layerId == 'tb_wr_rnwtr_utztn_fclt';
|
||||
// 중수도시설
|
||||
const isRswt = layerId == '중수도시설';
|
||||
const isRswt = layerId == 'tb_wr_rswtr_fclt';
|
||||
// 온배수시설
|
||||
const isHtdfl = layerId == '온배수시설';
|
||||
const isHtdfl = layerId == 'tb_wr_htdfl_fclt';
|
||||
// 수요처관리
|
||||
const isReuseMng = layerId == '수요처';
|
||||
const isReuseMng = layerId == 'tb_wr_ruse_fclt_dmd_co';
|
||||
if (isPrcsFclt) {
|
||||
if (viewMode == 'list') {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user