Compare commits

...

3 Commits

Author SHA1 Message Date
thkim 371be92a16 feat: 지질도 범례 추가 2025-10-28 14:50:23 +09:00
thkim 2684374663 Merge branch 'main' of https://git.vas2.com/geoinfo_eGov_work 2025-10-28 11:56:53 +09:00
thkim eebf295e96 . 2025-10-28 10:31:16 +09:00
26 changed files with 352 additions and 8 deletions

View File

@ -1 +1 @@
eclipse=D:\thkim_home\eGovFrameDev-3.8.0-64bit\geoinfo\user\eclipse
eclipse=R:\eclipse\eclipse

View File

@ -179,7 +179,12 @@ public class MainController
{
ModelAndView mv = new ModelAndView();
int nCls = MyUtil.getIntegerFromObject(request.getSession().getAttribute("CLS"));
int nCls = -1;
Object oCls = request.getSession().getAttribute("CLS");
if( oCls != null ) {
nCls = MyUtil.getIntegerFromObject(oCls);
}
mv.addObject("cls", nCls);
String src = request.getParameter("src");

View File

@ -30,7 +30,7 @@
var loginCheck = '${userId}' == "" ? false : true;
var popupFlag = Cookies.get("popupFlag");
if (loginCheck && popupFlag !== "N") {
if(('${userId}' == 'admin_user' || ${cls} === 65535 )){
if(('${userId}' == 'admin_user' || "${cls}" === "65535" )){
openPop();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 B

View File

@ -435,6 +435,224 @@ var geologyLayers = {
};
var geologyLayersKey = null; // 지질 광산 layer명
var geologyLegendPopup = null; // 지질도 범례 팝업 객체를 저장할 변수
//사용자가 제공한 범례 HTML (템플릿 리터럴로 저장)
//Iframe에 맞도록 bodyClass의 width를 760px에서 98%로 수정
var GEOLOGY_LEGEND_HTML = `
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>암상시대별 색상</title>
<style type="text/css">
body {
font-family: "Dotum", "돋움", Tahoma, Arial, sans-serif;
font-size: 12px;
color: #333333;
margin: 0;
padding: 0;
background-color: #ffffff;
}
.bodyClass {
/* 원본 760px 고정폭 대신 Iframe에 맞춤 */
width: 98%;
margin: 10px auto;
}
.cb { clear: both; height: 0; font-size: 0; line-height: 0; }
.body_title {
font-size: 16px;
font-weight: bold;
color: #115588;
border-bottom: 2px solid #dddddd;
padding-bottom: 5px;
margin-top: 10px;
margin-bottom: 15px;
}
.body_cont { width: 100%; }
/* 가로 스크롤이 필요할 경우 대비 */
.mobile_scroll { width: 100%; overflow-x: auto; }
.table_con01 {
width: 100%;
border-collapse: collapse;
border-top: 2px solid #999999;
}
.table_con01 th,
.table_con01 td {
border: 1px solid #cccccc;
padding: 5px 8px;
text-align: center;
vertical-align: middle;
line-height: 1.5;
}
.table_con01 thead th {
font-weight: bold;
color: #000000;
background-color: #f5f5f5;
padding: 8px 5px;
}
.table_con01 tbody td { color: #333333; }
.table_con01 img {
border: 1px solid #999999;
vertical-align: middle;
}
.mt10 { margin-top: 10px; }
.mb05 { margin-bottom: 5px; }
</style>
</head>
<body>
<div class="bodyClass">
<div class="cb"></div>
<h3 class="body_title">암상시대별 색상</h3>
<div class="body_cont">
<div class="mobile_scroll">
<table class="table_con01 mt10 mb05">
<colgroup>
<col width="11%">
<col width="17%">
<col width="17%">
<col width="10%">
<col width="10%">
</colgroup>
<thead>
<tr>
<th rowspan="2">코드번호</th>
<th rowspan="2" colspan="2">시대명</th>
<th rowspan="2">시대기호</th>
<th rowspan="2">기본색</th>
</tr>
</thead>
<tbody>
<tr>
<td>GA01</td>
<td rowspan="2">제4기(Quaternary)</td>
<td>충적층<br>(Alluvium)</td>
<td>Qa </td>
<td><img alt="제4기 충적층 RGB 기본색" src="../com/img/map-service/geology/index/ga01.gif"></td>
</tr>
<tr>
<td>GA02</td>
<td>홍적층<br>(Diluvium)</td>
<td>Qd </td>
<td><img alt="제4기 홍적층 RGB 기본색" src="../com/img/map-service/geology/index/ga02.gif"></td>
</tr>
<tr>
<td>GA03</td>
<td colspan="2">신제3기<br>(Neogene)<br></td>
<td>N2</td>
<td><img alt="신제3기 RGB 기본색" src="../com/img/map-service/geology/index/ga03.gif"></td>
</tr>
<tr>
<td>GA04</td>
<td colspan="2">고제3기<br>(Paleogene)</td>
<td>PG</td>
<td><img alt="고제3기 RGB 기본색" src="../com/img/map-service/geology/index/ga04.gif"></td>
</tr>
<tr>
<td>GA05</td>
<td colspan="2">백악기<br>(Cretaceous)<br></td>
<td>K </td>
<td><img alt="백악기 RGB 기본색" src="../com/img/map-service/geology/index/ga05.gif"></td>
</tr>
<tr>
<td>GA06</td>
<td colspan="2">쥬라기<br>(Jurassic)</td>
<td>J</td>
<td><img alt="쥬라기 RGB 기본색" src="../com/img/map-service/geology/index/ga06.gif"></td>
</tr>
<tr>
<td>GA07</td>
<td colspan="2">삼첩기<br>(Triassic)</td>
<td>T </td>
<td><img alt="삼첩기 RGB 기본색" src="../com/img/map-service/geology/index/ga07.gif"></td>
</tr>
<tr>
<td>GA08</td>
<td colspan="2">페름기<br>(Permian)</td>
<td>P</td>
<td><img alt="폐름기 RGB 기본색" src="../com/img/map-service/geology/index/ga08.gif"></td>
</tr>
<tr>
<td>GA09</td>
<td colspan="2">석탄기<br>(Carboniferous)</td>
<td>C</td>
<td><img alt="석탄기 RGB 기본색" src="../com/img/map-service/geology/index/ga09.gif"></td>
</tr>
<tr>
<td>GA10</td>
<td colspan="2">데본기<br>(Devonian)</td>
<td>D</td>
<td><img alt="데본기 RGB 기본색" src="../com/img/map-service/geology/index/ga10.gif"></td>
</tr>
<tr>
<td>GA11</td>
<td colspan="2">사일루리아기<br>(Silurian)</td>
<td>S</td>
<td><img alt="사일루리아기 RGB 기본색" src="../com/img/map-service/geology/index/ga11.gif"></td>
</tr>
<tr>
<td>GA12</td>
<td colspan="2">오도비스기<br>(Ordovician)</td>
<td>O</td>
<td><img alt="오도비스기 RGB 기본색" src="../com/img/map-service/geology/index/ga12.gif"></td>
</tr>
<tr>
<td>GA13</td>
<td colspan="2">캠브리아기<br>(Cambrian)</td>
<td><img alt="C" src="../com/img/map-service/geology/index/txt_c.gif"></td>
<td><img alt="캠브리아기 RGB 기본색" src="../com/img/map-service/geology/index/ga13.gif"></td>
</tr>
<tr>
<td>GA14</td>
<td rowspan="4">원생대<br>(Proterozoic)</td>
<td>PRgr</td>
<td rowspan="4">PR,<br><img alt="PC" src="../com/img/map-service/geology/index/txt_pc.gif"></td>
<td><img alt="원생대 PRgr RGB 기본색" src="../com/img/map-service/geology/index/ga14.gif"></td>
</tr>
<tr>
<td>GA15</td>
<td>PR3</td>
<td><img alt="원생대 PR3 RGB 기본색" src="../com/img/map-service/geology/index/ga15.gif"></td>
</tr>
<tr>
<td>GA16</td>
<td>PR2</td>
<td><img alt="원생대 PR2 RGB 기본색" src="../com/img/map-service/geology/index/ga16.gif"></td>
</tr>
<tr>
<td>GA17</td>
<td>PR1</td>
<td><img alt="원생대 PR1 RGB 기본색" src="../com/img/map-service/geology/index/ga17.gif"></td>
</tr>
<tr>
<td>GA18</td>
<td rowspan="3">시생대<br>(Archean)</td>
<td>AR3</td>
<td rowspan="3">AR,<br><img alt="PC" src="../com/img/map-service/geology/index/txt_pc.gif"></td>
<td><img alt="시생대 AR3 RGB 기본색" src="../com/img/map-service/geology/index/ga18.gif"></td>
</tr>
<tr>
<td>GA19</td>
<td>AR2</td>
<td><img alt="시생대 AR2 RGB 기본색" src="../com/img/map-service/geology/index/ga19.gif"></td>
</tr>
<tr>
<td>GA20</td>
<td>AR1</td>
<td><img alt="시생대 AR1 RGB 기본색" src="../com/img/map-service/geology/index/ga20.gif"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>
`;
function initApp(param){
// ---------------------
// 지도 생성
@ -5066,8 +5284,113 @@ function showSichuInfo2(){
}
/**
* 지질도 범례 팝업이 열려있으면 닫습니다.
*/
function removeGeologyLegend() {
// 팝업 드래그 이벤트를 해제합니다.
$(document).off('mousemove.legendPopup').off('mouseup.legendPopup');
// 팝업 DOM을 제거합니다.
if (geologyLegendPopup) {
geologyLegendPopup.remove();
geologyLegendPopup = null;
}
}
/**
* WMS 지질도 범례를 드래그 가능한 모달로 띄웁니다.
* (Iframe을 사용하여 외부 CSS/HTML 충돌을 방지합니다)
*/
function showGeologyLegend() {
// 1. 기존 팝업이 있다면 제거합니다.
removeGeologyLegend();
// 2. 모달의 기본 HTML 구조를 정의합니다.
var popupHtml =
'<div id="geologyLegendPopup" style="position: absolute; width: 800px; max-width: 90%; z-index: 10001; box-shadow: 0 5px 15px rgba(0,0,0,0.5); font-family: \'Malgun Gothic\', sans-serif; visibility: hidden;">' +
' <div class="popup-header" style="background-color: #004e99; color: white; font-size: 16px; font-weight: bold; padding: 8px 10px; cursor: move; display: flex; justify-content: space-between; align-items: center;">' +
' <span>암상시대별 색상 (범례)</span>' +
' <button id="closeLegendPopupBtn" style="background: none; border: none; font-size: 20px; color: white; cursor: pointer; line-height: 1;">&times;</button>' +
' </div>' +
' <div id="legendIframeContainer" style="background-color: #fff; border: 1px solid #004e99; border-top: none;">' +
' ' +
' </div>' +
'</div>';
// 3. HTML을 body에 추가하고 jQuery 객체 참조를 저장합니다.
$('body').append(popupHtml);
geologyLegendPopup = $('#geologyLegendPopup'); // 전역 변수에 할당
var iframeContainer = $('#legendIframeContainer');
// 4. Iframe을 생성하고 설정합니다.
var iframe = document.createElement('iframe');
iframe.style.width = '100%';
iframe.style.height = '500px'; // 모달 내용물의 높이
iframe.style.border = 'none';
iframe.setAttribute('frameborder', '0'); // 구형 브라우저 호환
// 5. Iframe을 모달 컨테이너에 추가합니다.
iframeContainer.append(iframe);
// 6. Iframe 내부에 범례 HTML을 동적으로 씁니다.
// (CSS/HTML 격리를 위해 이 방식이 가장 안전합니다)
try {
var doc = iframe.contentWindow || iframe.contentDocument;
if (doc.document) doc = doc.document;
doc.open();
doc.write(GEOLOGY_LEGEND_HTML); // 위에서 정의한 HTML 변수 사용
doc.close();
} catch (e) {
console.error("범례 Iframe에 내용을 쓰는 데 실패했습니다:", e);
}
// 7. 모달의 초기 위치를 화면 중앙으로 설정합니다.
var popupWidth = geologyLegendPopup.outerWidth();
var popupHeight = geologyLegendPopup.outerHeight();
var initialTop = Math.max(20, ($(window).height() - popupHeight) / 2);
var initialLeft = Math.max(20, ($(window).width() - popupWidth) / 2);
geologyLegendPopup.css({
top: initialTop + 'px',
left: initialLeft + 'px',
visibility: 'visible' // 이제 보이도록 설정
});
// 8. 드래그 이벤트를 구현합니다. (geologyMine 함수와 동일한 로직)
var isDragging = false;
var offset = { x: 0, y: 0 };
var header = geologyLegendPopup.find('.popup-header');
header.on('mousedown', function(e) {
isDragging = true;
var popupPos = geologyLegendPopup.offset();
offset.x = e.pageX - popupPos.left;
offset.y = e.pageY - popupPos.top;
e.preventDefault();
});
// 이벤트 이름에 .legendPopup 네임스페이스를 지정하여 다른 드래그와 충돌 방지
$(document).on('mousemove.legendPopup', function(e) {
if (isDragging) {
geologyLegendPopup.offset({
top: e.pageY - offset.y,
left: e.pageX - offset.x
});
}
});
$(document).on('mouseup.legendPopup', function() {
isDragging = false;
});
// 9. 닫기 버튼 이벤트를 설정합니다.
$('#closeLegendPopupBtn').on('click', function() {
removeGeologyLegend();
});
}
//기존 geologyMode 함수를 지우고 아래의 코드로 교체하세요.
function geologyMode() {
initControl(); // 다른 컨트롤 상태 초기화
@ -5086,15 +5409,17 @@ function geologyMode() {
GEOLOGY_LAYER.setVisibility(false);
CTL_INFO.setText("지질 Off");
CTL_INFO.deactivate(); // 정보창도 비활성화
removeGeologyLegend(); // 지질도를 끌 때 범례도 닫습니다.
} else {
// 레이어가 현재 숨겨져 있다면,
// 1. 표시할 기본 지질도 키를 설정합니다.
geologyLayersKey = "지질도_25만_지질도";
geologyLayersKey = "지질도_25만_지질도";
var wmsLayerName = geologyLayers[geologyLayersKey];
if (wmsLayerName) {
// 2. 정규표현식을 사용하여 URL에서 'LAYERS=' 파라미터의 값만 교체합니다.
// (광산 뷰에서 다른 레이어로 변경되었을 수 있으므로 항상 기본값으로 재설정)
var newUrl = GEOLOGY_LAYER.url.replace(/(LAYERS=)([^&]*)/, '$1' + wmsLayerName);
// 3. 레이어 객체의 url 속성을 직접 변경합니다.
@ -5104,18 +5429,32 @@ function geologyMode() {
GEOLOGY_LAYER.setVisibility(true);
GEOLOGY_LAYER.redraw(true);
// 5. 정보창 텍스트를 업데이트합니다.
// 5. 정보창 텍스트 및 버튼을 업데이트합니다.
// '범례 보기' 버튼 HTML 정의 (이전 단계에서 수정한 내용)
var legendButtonHtml = '<div id="geologyLegendBtn" onclick="showGeologyLegend()" ' +
'style="position: absolute; right: 80px; top: 50%; transform: translateY(-50%); ' +
'background: #fff; border: 1px solid #c00; color: #c00; ' +
'padding: 3px 6px; font-size: 12px; font-weight: normal; cursor: pointer; border-radius: 3px;">' +
'범례 보기</div>';
// CTL_INFO의 infoDiv가 내부 요소를 absolute 포지셔닝할 수 있도록 'relative'로 설정
$(CTL_INFO.infoDiv).css("position", "relative");
// CTL_INFO 텍스트 설정 시 버튼 HTML을 함께 삽입
//CTL_INFO.setText("지질 On" + legendButtonHtml);
CTL_INFO.setText("지질 On");
CTL_INFO.activate();
showGeologyLegend();
$("#CTL_INFO").css("bottom", "65px");
$("#CTL_INFO").css("left", "20px");
} else {
console.error("기본 지질도 레이어를 찾을 수 없습니다:", geologyLayersKey);
}
}
}
function geologyMine() {
initControl(); // 다른 컨트롤 상태 초기화