sn: 침수예측현황 팝업에서 지도이동
This commit is contained in:
@@ -3617,6 +3617,11 @@ const Map = () => {
|
||||
FLOOD_DNGR_MAP_LAYER_TYPE
|
||||
)
|
||||
return;
|
||||
// 침수예측현황에서 바로 이동한 경우 레이어가 꺼져 있을 수 있으므로 자동 활성화한다.
|
||||
if (layer.getVisible?.() === false) {
|
||||
layer.setVisible?.(true);
|
||||
layer.getSource?.()?.refresh?.();
|
||||
}
|
||||
const source = layer.getSource?.();
|
||||
if (!source?.getFeatures) return;
|
||||
selectLoadedGroupFeatures(source);
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from "@common/business_components";
|
||||
import { Button } from "@common/components";
|
||||
|
||||
import { getBlobData, getRawJson } from "@/components/lib/api";
|
||||
import { getBlobData, getData, getRawJson } from "@/components/lib/api";
|
||||
import { fileDownload } from "@/components/lib/utils/fileDownload";
|
||||
import LoadingOverlay from "@/components/ui/LoadingBar";
|
||||
import { windowPopupDefinitions } from "@/features/windowPopup/model/popupDefinitions";
|
||||
@@ -57,10 +57,10 @@ const PAGE_SIZE = 10;
|
||||
const MAP_FREQUENCIES = new Set([30, 50, 80, 100]);
|
||||
const FREQUENCY_OPTIONS = [30, 50, 80, 100] as const;
|
||||
|
||||
/** 도시침수지도 DB의 3자리 빈도 코드로 변환한다. 지도는 100년까지만 제공하므로 그 이상은 100년으로 제한한다. */
|
||||
/** 도시침수지도 DB의 3자리 빈도 코드로 변환한다. 30년 이하는 030, 100년 초과는 100으로 제한한다. */
|
||||
const toFloodMapFrequencyCode = (value: number) => {
|
||||
if (!Number.isFinite(value) || value <= 0) return null;
|
||||
const normalized = value > 100 ? 100 : value;
|
||||
const normalized = value <= 30 ? 30 : value > 100 ? 100 : value;
|
||||
if (!MAP_FREQUENCIES.has(normalized)) return null;
|
||||
return String(normalized).padStart(3, "0");
|
||||
};
|
||||
@@ -328,7 +328,8 @@ export default function FldngPredcPrstPopupContent() {
|
||||
sggCd: row.sggCd,
|
||||
sbmrgFrqExpln,
|
||||
});
|
||||
const extentData = await getRawJson(
|
||||
// 백엔드 공통 응답({ data: ... })의 data 영역을 반환하는 API 헬퍼를 사용한다.
|
||||
const extentData = await getData(
|
||||
`/sewerage-service/api/v1/fldng/flood-dngr-map/group/extent?${params.toString()}`,
|
||||
);
|
||||
const extent = [
|
||||
@@ -347,13 +348,14 @@ export default function FldngPredcPrstPopupContent() {
|
||||
},
|
||||
window.location.origin,
|
||||
);
|
||||
alert("도시침수지도를 켜고 선택한 도시침수지도의 시군구·빈도로 이동하였습니다.");
|
||||
window.opener.focus();
|
||||
} catch (error) {
|
||||
console.error("침수예측현황 지도 이동 중 오류:", error);
|
||||
alert(
|
||||
error instanceof Error && error.message.includes("위치 정보")
|
||||
? error.message
|
||||
: "도시침수지도 이동에 실패했습니다.",
|
||||
: "도시침수지도 이동에 실패하였습니다.",
|
||||
);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
|
||||
Reference in New Issue
Block a user