feat: 시추정보 사업별 현황에서 지도 이동 안 되는 버그 수정
parent
ea171f199f
commit
5f99ed3c3b
|
|
@ -171,15 +171,41 @@ function downloadNew(mId, fName) {
|
||||||
</table></td>
|
</table></td>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
var openerCalled = false;
|
||||||
|
var checkOpenerInterval; // To store the interval ID
|
||||||
|
|
||||||
|
function tryCallingOpenerFunctions() {
|
||||||
if (typeof opener.parent.parent.moveToExtent === "function") {
|
if (typeof opener.parent.parent.moveToExtent === "function") {
|
||||||
//alert("1111");
|
// alert("1111"); // Uncomment for debugging
|
||||||
opener.parent.parent.moveToExtent("${bbox.minx}", "${bbox.miny}", "${bbox.maxx}", "${bbox.maxy}");
|
opener.parent.parent.moveToExtent("${bbox.minx}", "${bbox.miny}", "${bbox.maxx}", "${bbox.maxy}");
|
||||||
opener.parent.parent.addProjectHoles("${project.projectCode}");
|
opener.parent.parent.addProjectHoles("${project.projectCode}");
|
||||||
|
openerCalled = true; // Set flag to true
|
||||||
} else if (typeof opener.opener.moveToExtent === "function") {
|
} else if (typeof opener.opener.moveToExtent === "function") {
|
||||||
//alert("2222");
|
// alert("2222"); // Uncomment for debugging
|
||||||
opener.opener.moveToExtent("${bbox.minx}", "${bbox.miny}", "${bbox.maxx}", "${bbox.maxy}");
|
opener.opener.moveToExtent("${bbox.minx}", "${bbox.miny}", "${bbox.maxx}", "${bbox.maxy}");
|
||||||
opener.opener.addProjectHoles("${project.projectCode}");
|
opener.opener.addProjectHoles("${project.projectCode}");
|
||||||
|
openerCalled = true; // Set flag to true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If either condition was met, stop the timer
|
||||||
|
if (openerCalled) {
|
||||||
|
clearInterval(checkOpenerInterval); // Stop the interval
|
||||||
|
// console.log("Opener functions called and timer stopped."); // Uncomment for debugging
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start checking every 100 milliseconds (adjust as needed)
|
||||||
|
checkOpenerInterval = setInterval(tryCallingOpenerFunctions, 100);
|
||||||
|
|
||||||
|
// Optional: Add a timeout to stop checking after a certain period to prevent infinite loops
|
||||||
|
setTimeout(function() {
|
||||||
|
if (!openerCalled) {
|
||||||
|
clearInterval(checkOpenerInterval);
|
||||||
|
// console.warn("Opener functions could not be called within the timeout period."); // Uncomment for debugging
|
||||||
|
}
|
||||||
|
}, 200); // Stop after 5 seconds (5000 milliseconds)
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</tr>
|
</tr>
|
||||||
</table> <!--END:내용 -->
|
</table> <!--END:내용 -->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue