지도 팝업 수정사항 반영
This commit is contained in:
@@ -7,6 +7,7 @@ import GisApp from "@common/business_components/ui/map/lib/gis.core";
|
||||
import { SearchBar } from "@common/business_components/ui/map/searchBar/searchBar";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { getFeatureCd } from "@/components/lib/func/mapUtil";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
|
||||
const Map = () => {
|
||||
const { comMap } = useWrStore((state) => state);
|
||||
@@ -228,7 +229,6 @@ const Map = () => {
|
||||
const popupOptions = `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=no`;
|
||||
popupRef.current = window.open(url, "지도 레이어 팝업", popupOptions);
|
||||
} else {
|
||||
console.log('isFeature 2', isFeature)
|
||||
const layerNm = getSelectedLayers(isFeature);
|
||||
const safeProps = isFeature.getProperties();
|
||||
const featureCd = getFeatureCd(safeProps, String(layerNm));
|
||||
@@ -266,7 +266,20 @@ const Map = () => {
|
||||
};
|
||||
|
||||
const onOpenPopup = (data:any) => {
|
||||
console.log(data)
|
||||
if(data){
|
||||
|
||||
const url = `/mapDetailPopUp?layerNm=${encodeURIComponent(data)}`;
|
||||
const width = window.screen.availWidth;
|
||||
const height = window.screen.availHeight;
|
||||
const left = 0;
|
||||
const top = 0;
|
||||
const popupOptions = `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=no`;
|
||||
popupRef.current = window.open(url, "지도 레이어 팝업", popupOptions);
|
||||
}else{
|
||||
toast.error('시설 및 수요처가 선택되지 않았습니다.')
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -307,7 +320,8 @@ const Map = () => {
|
||||
onOpenPopup(data)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<Toaster position="top-center" />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ export default function MapDetailPopUp() {
|
||||
const renderConditionalContent = () => {
|
||||
const layerId = searchParams.get("layerNm");
|
||||
switch (layerId) {
|
||||
case "하수재이용시설":
|
||||
case "tb_wr_bdst_ruse_fclt":
|
||||
return (
|
||||
<RuseFacility
|
||||
rtnFeature={(feature) => {
|
||||
@@ -24,7 +24,7 @@ export default function MapDetailPopUp() {
|
||||
}}
|
||||
/>
|
||||
);
|
||||
case "하수처리시설":
|
||||
case "tb_il_swage_prcs_fclt":
|
||||
return (
|
||||
<HasuFacility
|
||||
rtnFeature={(feature) => {
|
||||
@@ -32,7 +32,7 @@ export default function MapDetailPopUp() {
|
||||
}}
|
||||
/>
|
||||
);
|
||||
case "빗물이용시설":
|
||||
case "tb_wr_rnwtr_utztn_fclt":
|
||||
return (
|
||||
<RainFacility
|
||||
rtnFeature={(feature) => {
|
||||
@@ -40,7 +40,7 @@ export default function MapDetailPopUp() {
|
||||
}}
|
||||
/>
|
||||
);
|
||||
case "중수도시설":
|
||||
case "tb_wr_rswtr_fclt":
|
||||
return (
|
||||
<RswtFacility
|
||||
rtnFeature={(feature) => {
|
||||
@@ -48,7 +48,7 @@ export default function MapDetailPopUp() {
|
||||
}}
|
||||
/>
|
||||
);
|
||||
case "온배수시설":
|
||||
case "tb_wr_htdfl_fclt":
|
||||
return (
|
||||
<HtdflFacility
|
||||
rtnFeature={(feature) => {
|
||||
@@ -56,7 +56,7 @@ export default function MapDetailPopUp() {
|
||||
}}
|
||||
/>
|
||||
);
|
||||
case "수요처":
|
||||
case "tb_wr_ruse_fclt_dmd_co":
|
||||
return (
|
||||
<CoSttnMap
|
||||
rtnFeature={(feature) => {
|
||||
@@ -64,7 +64,7 @@ export default function MapDetailPopUp() {
|
||||
}}
|
||||
/>
|
||||
);
|
||||
case "잠재수요처":
|
||||
case "tb_wr_tmpr_dmd_co":
|
||||
return (
|
||||
<LdrmntCoMap
|
||||
rtnFeature={(feature) => {
|
||||
|
||||
Reference in New Issue
Block a user