sn: 지도 위치 정보가 없는 경우 404>>위치 정보가 없습니다.
This commit is contained in:
@@ -7,7 +7,7 @@ import Overlay from "ol/Overlay.js";
|
||||
|
||||
import GisApp from "@common/business_components/ui/map/lib/gis.core";
|
||||
|
||||
import { getRawJson } from "@/shared/api/sewerage-api";
|
||||
import { getData } from "@/shared/api/sewerage-api";
|
||||
import { WINDOW_POPUP_MESSAGE_TYPE } from "@/features/window-popup/model/types";
|
||||
|
||||
import { getFloodRiskGradeClassName } from "./flood-risk-grade";
|
||||
@@ -251,11 +251,11 @@ export const useFloodPredictionMap = ({
|
||||
removeFloodPredictionOverlay();
|
||||
|
||||
try {
|
||||
const response = await getRawJson(
|
||||
// 공통 응답의 data만 읽어 null·생략된 값을 빈 오버레이 결과로 처리한다.
|
||||
const payload = await getData(
|
||||
`/sewerage-service/api/v1/fldng/predc/prst/gridMap?sggCd=${encodeURIComponent(sggCd)}&analysisDateTime=${encodeURIComponent(analysisDateTime)}`,
|
||||
);
|
||||
if (!navigation?.isCurrent()) return;
|
||||
const payload = response?.data ?? response;
|
||||
const row =
|
||||
payload && typeof payload === "object" && !Array.isArray(payload)
|
||||
? (payload as FloodPredictionOverlayRow)
|
||||
|
||||
@@ -367,6 +367,11 @@ export default function FldngPredcPrstPopupContent() {
|
||||
const extentData = await getData(
|
||||
`/sewerage-service/api/v1/fldng/floodDngrMap/group/extent?${params.toString()}`,
|
||||
);
|
||||
// null·생략된 data는 정상적인 위치 부재이며 부모 지도 이동·강조를 요청하지 않는다.
|
||||
if (extentData == null) {
|
||||
alert("위치 정보가 없습니다");
|
||||
return;
|
||||
}
|
||||
const extent = [
|
||||
extentData?.minX,
|
||||
extentData?.minY,
|
||||
@@ -374,7 +379,7 @@ export default function FldngPredcPrstPopupContent() {
|
||||
extentData?.maxY,
|
||||
].map(Number);
|
||||
if (extent.some((value) => !Number.isFinite(value))) {
|
||||
throw new Error("도시침수지도 위치 정보가 없습니다.");
|
||||
throw new Error("도시침수지도 위치 응답의 좌표가 올바르지 않습니다.");
|
||||
}
|
||||
window.opener.postMessage(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user