junggilpark пре 1 година
родитељ
комит
3a01cd5e7d

+ 1 - 1
src/main/resources/application-dev.yml

@@ -29,7 +29,7 @@ spring:
       idleTimeout: 30000
       connectTimeout: 10000
 
-kakao-url: https://dapi.kakao.com/v2/maps/sdk.js?appkey=89c10f45ef100270bc75a54eb9e5b0ca&libraries=drawing&libraries=clusterer
+kakao-url: https://dapi.kakao.com/v2/maps/sdk.js?appkey=89c10f45ef100270bc75a54eb9e5b0ca&libraries=drawing&libraries=clusterer&libraries=services
 kakao-key: 89c10f45ef100270bc75a54eb9e5b0ca
 popup-location: C:\00.PROJECT\24.01.PHITS-WEB\uploads\popup
 board-location: C:\00.PROJECT\24.01.PHITS-WEB\uploads\board

+ 49 - 19
src/main/resources/application-prod.yml

@@ -7,9 +7,9 @@ spring:
   datasource:
     hikari:
       driver-class-name: com.tmax.tibero.jdbc.TbDriver
-      jdbc-url: jdbc:tibero:thin:172.16.10.21:8620:tibero
-      username: itsdev
-      password: itsdev
+      jdbc-url: jdbc:tibero:thin:@115.91.94.42:8629:tibero
+      username: phutis
+      password: phutis
       connection-test-query: SELECT 1 FROM DUAL
       minimumIdle: 5
       maximumIdle: 10
@@ -18,19 +18,49 @@ spring:
       connectTimeout: 10000
   itcs-datasource:
     hikari:
-      driver-class-name: com.tmax.tibero.jdbc.TbDriver
-      jdbc-url: jdbc:tibero:thin:@172.16.10.21:8620:tibero
-      username: itsdev
-      password: itsdev
-      connection-test-query: SELECT 1 FROM DUAL
-      minimumIdle: 5
-      maximumIdle: 10
-      maximumPoolSize: 20
-      idleTimeout: 30000
-      connectTimeout: 10000
-kakao-url: //dapi.kakao.com/v2/maps/sdk.js?appkey=818515fbf1c2ac66fdac8c66163c7a3e&libraries=drawing&libraries=clusterer
-kakao-key: appkey=818515fbf1c2ac66fdac8c66163c7a3e
-popup-location: C:\PHITS-WEB\uploads\popup
-board-location: C:\PHITS-WEB\uploads\board
-image-location: C:\PHITS-WEB\uploads\images
-video-location: C:\PHITS-WEB\uploads\video
+        driver-class-name: com.tmax.tibero.jdbc.TbDriver
+        jdbc-url: jdbc:tibero:thin:@115.91.94.42:8629:tibero
+        username: itcs
+        password: itcs
+        connection-test-query: SELECT 1 FROM DUAL
+        minimumIdle: 5
+        maximumIdle: 10
+        maximumPoolSize: 20
+        idleTimeout: 30000
+        connectTimeout: 10000
+
+kakao-url: https://dapi.kakao.com/v2/maps/sdk.js?appkey=89c10f45ef100270bc75a54eb9e5b0ca&libraries=drawing&libraries=clusterer&libraries=services
+kakao-key: 89c10f45ef100270bc75a54eb9e5b0ca
+popup-location: D:\PHITS-WEB\uploads\popup
+board-location: D:\PHITS-WEB\uploads\board
+image-location: D:\PHITS-WEB\uploads\images
+video-location: D:\PHITS-WEB\uploads\video
+#    hikari:
+#      driver-class-name: com.tmax.tibero.jdbc.TbDriver
+#      jdbc-url: jdbc:tibero:thin:172.16.10.21:8620:tibero
+#      username: itsdev
+#      password: itsdev
+#      connection-test-query: SELECT 1 FROM DUAL
+#      minimumIdle: 5
+#      maximumIdle: 10
+#      maximumPoolSize: 20
+#      idleTimeout: 30000
+#      connectTimeout: 10000
+#  itcs-datasource:
+#    hikari:
+#      driver-class-name: com.tmax.tibero.jdbc.TbDriver
+#      jdbc-url: jdbc:tibero:thin:@172.16.10.21:8620:tibero
+#      username: itsdev
+#      password: itsdev
+#      connection-test-query: SELECT 1 FROM DUAL
+#      minimumIdle: 5
+#      maximumIdle: 10
+#      maximumPoolSize: 20
+#      idleTimeout: 30000
+#      connectTimeout: 10000
+#kakao-url: //dapi.kakao.com/v2/maps/sdk.js?appkey=818515fbf1c2ac66fdac8c66163c7a3e&libraries=drawing&libraries=clusterer
+#kakao-key: appkey=818515fbf1c2ac66fdac8c66163c7a3e
+#popup-location: C:\PHITS-WEB\uploads\popup
+#board-location: C:\PHITS-WEB\uploads\board
+#image-location: C:\PHITS-WEB\uploads\images
+#video-location: C:\PHITS-WEB\uploads\video

+ 96 - 6
src/main/resources/static/css/traffic.css

@@ -33,6 +33,72 @@ ul, li {
     cursor: pointer;
     border: 1px solid #c3c1c1;
     color: #a59d9d;
+    user-select: none;
+}
+.location-btn {
+    position: absolute;
+    left: 302px;
+    background-color: white;
+    border-radius: 5px;
+    z-index: 20;
+    width: 95px;
+    height: 36px;
+    text-align: center;
+    font-weight: bold;
+    cursor: pointer;
+    border: 1px solid #c3c1c1;
+    color: black;
+    user-select: none;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    gap: 5px;
+    top: 2px;
+}
+.location-btn.on {
+    background-color: #dbdbdb;
+}
+.location-box {
+    position: absolute;
+    left: 302px;
+    background-color: white;
+    border-radius: 5px;
+    z-index: 20;
+    text-align: center;
+    font-weight: bold;
+    color: #938f8f;
+    top: 40px;
+    display: none;
+    width: 325px;
+    height: calc(100% - 110px);
+    border: 1px solid #c3c1c1;
+    opacity: 0.8;
+}
+.location-box .top {
+    width: 100%;
+    height: 40px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    gap: 5px;
+    border-bottom: 1px solid #c3c1c1;
+}
+.location-box .top .search-btn {
+    width: 80px;
+    height: 30px;
+    border-radius: 5px;
+    background-color: #3396ff;
+    color: white;
+    line-height: 30px;
+    user-select: none;
+    cursor: pointer;
+}
+.location-box:hover{
+    opacity: 1;
+}
+.location-box input {
+    padding: 5px;
+    width: calc(100% - 100px);
 }
 
 .tab-title {
@@ -68,6 +134,10 @@ ul, li {
     color : white;
     border: 1px solid rgb(51, 102, 171);
 }
+.location-btn:hover{
+    background-color: #dbdbdb;
+}
+.location-box .top .search-btn:hover,
 .toggle-button:hover{
     filter: brightness(1.1);
 }
@@ -108,6 +178,7 @@ ul, li {
     color: #a59d9d;
 }
 
+.location-box .list-content > li:hover,
 .left-list-area .list-content > li:hover,
 .left-list-area .list-tab > li:hover {
     filter:brightness(1.1);
@@ -136,16 +207,19 @@ ul, li {
     width: 210px;
 }
 
-.left-list-area .list-content {
+.location-box .list-content {
     width: 100%;
-    height: calc(100% - 125px);
+    height: calc(100% - 50px);
     overflow: auto;
 }
-
-.left-list-area .list-content.spot {
-    display: none;
+.left-list-area .list-content {
+    width: 100%;
+    /*height: calc(100% - 125px);*/
+    height: calc(100% - 91px);
+    overflow: auto;
 }
 
+.location-box .list-content > li,
 .left-list-area .list-content > li {
     width: 100%;
     min-height: 35px;
@@ -157,12 +231,14 @@ ul, li {
     align-items: center;
     font-size: 12px;
 }
+.location-box .list-content > li.click,
 .left-list-area .list-content > li.click {
     background-color: #eeeeee;
     font-weight: bold;
     color:rgb(51, 102, 171);
 }
 
+.location-box .list-content > li.click:hover,
 .left-list-area .list-content > li.click:hover {
     filter:brightness(1);
 }
@@ -831,6 +907,8 @@ ul, li {
     .tab-title,
     .left-list-area .list-content,
     .toggle-button,
+    .location-btn,
+    .location-box,
     .legend-bottom {
         display: none;
     }
@@ -890,6 +968,11 @@ ul, li {
     }
 }
 
+@media (min-width: 1090px){
+    .location-box {
+        height: calc(100% - 68px)
+    }
+}
 @media (min-width: 605px) {
     .left-list-area {
         height: calc(100% - 27px);
@@ -903,6 +986,7 @@ ul, li {
 }
 
 @media (min-width: 920px) {
+    .location-box .list-content > div.empty,
     .left-list-area .list-content > div.empty{
         width: 100%;
         height: 100%;
@@ -930,6 +1014,10 @@ ul, li {
     .toggle-button {
         left : 400px;
     }
+    .location-box,
+    .location-btn {
+        left: 427px;
+    }
 
     .tab-title {
         height: 40px;
@@ -950,8 +1038,10 @@ ul, li {
     }
 
     .left-list-area .list-content {
-        height: calc(100% - 170px);
+        /*height: calc(100% - 170px);*/
+        height: calc(100% - 131px);
     }
+    .location-box .list-content > li,
     .left-list-area .list-content > li {
         min-height: 40px;
         padding: 10px;

BIN
src/main/resources/static/images/icon/search-icon.png


+ 304 - 84
src/main/resources/static/js/traffic/traffic.js

@@ -1,6 +1,7 @@
 let _size  = [48, 48, 48, 48, 40, 32, 24, 22, 20, 18, 18];
 let _AtrdMap = new Map();
 let selectIncidentId = null;
+let _MarkerArr = [];
 
 const vmsWHMap = new Map();
 vmsWHMap.set('VMC1', {width: 400, height: 64});
@@ -146,7 +147,7 @@ $(()=>{
         });
 
 
-    let _MarkerArr = [];
+
     $('.tab-title > div').on('click', function(){
         const $spot = $('.list-content.spot');
         const $list = $('.list-content.list');
@@ -180,10 +181,10 @@ $(()=>{
 
 
     $('#search-box').on('keyup', function () {
-        const searchType = $('.tab-title > div.active').text();
+        // const searchType = $('.tab-title > div.active').text();
         const searchText = $(this).val();
 
-        if (searchType === '리스트') {
+        // if (searchType === '리스트') {
             const $list = $('.list-content.list > li');
             if (!$list.length) return;
             const $activeTab = $('.list-tab .active');
@@ -223,92 +224,263 @@ $(()=>{
                     }
                 }
             }
-        }
-        else {
-            if (_MarkerArr.length > 0) {
-                _MarkerArr.forEach((obj)=>{
-                    obj.setMap(null);
-                });
-                _MarkerArr = [];
+        // }
+        // else {
+        //     if (_MarkerArr.length > 0) {
+        //         _MarkerArr.forEach((obj)=>{
+        //             obj.setMap(null);
+        //         });
+        //         _MarkerArr = [];
+        //     }
+        //     $('.list-content.spot').html("");
+        //     if (!searchText || !searchText.trim()) return;
+        //     $.ajax({
+        //         url: 'https://dapi.kakao.com/v2/local/search/address.json',
+        //         headers: { 'Authorization': 'KakaoAK 4896b94398b96949d349881d004835cf'},
+        //         data :{
+        //             query : searchText,
+        //         },
+        //         type: 'GET'
+        //     }).done(function(data) {
+        //         if (data && data.documents.length > 0) {
+        //             let str = "";
+        //             const setMap = new Map();
+        //
+        //             const bounds = new kakao.maps.LatLngBounds();
+        //             let minX;
+        //             let minY;
+        //             let maxX;
+        //             let maxY;
+        //             let idx = 0;
+        //             data.documents.forEach((obj)=>{
+        //                 if (!setMap.get(obj.address_name) && obj.address_name.includes("경북 포항시")) {
+        //                     idx++;
+        //                     let addr = obj.address_name;
+        //                     if (obj.x && obj.y) {
+        //                         const position = getKakaoPosition(obj.y, obj.x);
+        //                         let marker = new kakao.maps.Marker({
+        //                             position : position,
+        //                             title : addr ,
+        //                             content : addr
+        //                         });
+        //
+        //                         new kakao.maps.event.addListener(marker, 'click', function() {
+        //                             moveLocation(obj.x, obj.y, idx);
+        //                         })
+        //                         if (!minX) {
+        //                             minX = obj.x;
+        //                         }
+        //
+        //                         if (!maxX) {
+        //                             maxX = obj.x;
+        //                         }
+        //                         if (!minY) {
+        //                             minY = obj.y;
+        //                         }
+        //
+        //                         if (!maxY) {
+        //                             maxY = obj.y;
+        //                         }
+        //
+        //                         minX = minX <= obj.x ? minX : obj.x;
+        //                         maxX = maxX >= obj.x ? maxX : obj.x;
+        //                         minY = minY <= obj.y ? minY : obj.y;
+        //                         maxY = maxY >= obj.y ? maxY : obj.y;
+        //
+        //                         marker.setMap(_MapHandler.map);
+        //                         _MarkerArr.push(marker);
+        //                         setMap.set(addr, obj);
+        //
+        //                         str+= `<li id="spot-${idx}" onclick="moveLocation(${obj.x}, ${obj.y}, ${idx})">
+        //                                     ${obj.address_name}
+        //                                </li>`;
+        //                     }
+        //                 }
+        //             });
+        //
+        //             if (minX && minY && maxX && maxY) {
+        //                 bounds.extend(new kakao.maps.LatLng(minY, minX));
+        //                 bounds.extend(new kakao.maps.LatLng(maxY, maxX));
+        //                 _MapHandler.setBounds(bounds);
+        //                 $('.list-content.spot').html(str);
+        //                 getVertex();
+        //             }
+        //         }
+        //     });
+        // }
+    })
+});
+
+function searchLocation(event) {
+    if (event && event.key !== 'Enter') {
+        return;
+    }
+    $('.list-content.spot').empty();
+    const $search = $('.location-box input');
+    if (_MarkerArr.length > 0) {
+        _MarkerArr.forEach((obj)=>{
+            obj.setMap(null);
+        });
+        _MarkerArr = [];
+    }
+    const searchText = $search.val();
+    if (!searchText || !searchText.trim()) return;
+    // const addressData = await $.ajax({
+    //     url: 'https://dapi.kakao.com/v2/local/search/address.json',
+    //     headers: { 'Authorization': 'KakaoAK 4896b94398b96949d349881d004835cf'},
+    //     data :{
+    //         query : searchText,
+    //     },
+    //     type: 'GET'
+    // });
+    //
+    // const roadAddressData = await $.ajax({
+    //     url: 'https://dapi.kakao.com/v2/local/search/road_address.json',
+    //     headers: { 'Authorization': 'KakaoAK 4896b94398b96949d349881d004835cf'},
+    //     data :{
+    //         query : searchText,
+    //     },
+    //     type: 'GET'
+    // });
+    // console.log(addressData);
+    // console.log(roadAddressData);
+    const geoCoder = new kakao.maps.services.Geocoder();
+    geoCoder.addressSearch(searchText, function(result, status){
+        if (status === 'OK' && result && result.length > 0) {
+            let str = "";
+            const setMap = new Map();
+
+            const bounds = new kakao.maps.LatLngBounds();
+            let minX;
+            let minY;
+            let maxX;
+            let maxY;
+            let idx = 0;
+            result.forEach((obj)=>{
+                if (!setMap.get(obj.address_name) && obj.address_name.includes("경북 포항시")) {
+                    idx++;
+                    let addr = obj.address_name;
+                    if (obj.x && obj.y) {
+                        const position = getKakaoPosition(obj.y, obj.x);
+                        let marker = new kakao.maps.Marker({
+                            position : position,
+                            title : addr ,
+                            content : addr
+                        });
+
+                        new kakao.maps.event.addListener(marker, 'click', function() {
+                            moveLocation(obj.x, obj.y, idx);
+                        })
+                        if (!minX) {
+                            minX = obj.x;
+                        }
+
+                        if (!maxX) {
+                            maxX = obj.x;
+                        }
+                        if (!minY) {
+                            minY = obj.y;
+                        }
+
+                        if (!maxY) {
+                            maxY = obj.y;
+                        }
+
+                        minX = minX <= obj.x ? minX : obj.x;
+                        maxX = maxX >= obj.x ? maxX : obj.x;
+                        minY = minY <= obj.y ? minY : obj.y;
+                        maxY = maxY >= obj.y ? maxY : obj.y;
+
+                        marker.setMap(_MapHandler.map);
+                        _MarkerArr.push(marker);
+                        setMap.set(addr, obj);
+
+                        str+= `<li id="spot-${idx}" onclick="moveLocation(${obj.x}, ${obj.y}, ${idx})">
+                                    ${obj.address_name}
+                               </li>`;
+                    }
+                }
+            });
+
+            if (minX && minY && maxX && maxY) {
+                bounds.extend(new kakao.maps.LatLng(minY, minX));
+                bounds.extend(new kakao.maps.LatLng(maxY, maxX));
+                _MapHandler.setBounds(bounds);
+                $('.list-content.spot').html(str);
+                getVertex();
             }
-            $('.list-content.spot').html("");
-            if (!searchText || !searchText.trim()) return;
-            $.ajax({
-                url: 'https://dapi.kakao.com/v2/local/search/address.json',
-                headers: { 'Authorization': 'KakaoAK 4896b94398b96949d349881d004835cf'},
-                data :{
-                    query : searchText,
-                },
-                type: 'GET'
-            }).done(function(data) {
-                if (data && data.documents.length > 0) {
-                    let str = "";
-                    const setMap = new Map();
-
-                    const bounds = new kakao.maps.LatLngBounds();
-                    let minX;
-                    let minY;
-                    let maxX;
-                    let maxY;
-                    let idx = 0;
-                    data.documents.forEach((obj)=>{
-                        if (!setMap.get(obj.address_name) && obj.address_name.includes("경북 포항시")) {
-                            idx++;
-                            let addr = obj.address_name;
-                            if (obj.x && obj.y) {
-                                const position = getKakaoPosition(obj.y, obj.x);
-                                let marker = new kakao.maps.Marker({
-                                    position : position,
-                                    title : addr ,
-                                    content : addr
-                                });
-
-                                new kakao.maps.event.addListener(marker, 'click', function() {
-                                    moveLocation(obj.x, obj.y, idx);
-                                })
-                                if (!minX) {
-                                    minX = obj.x;
-                                }
-
-                                if (!maxX) {
-                                    maxX = obj.x;
-                                }
-                                if (!minY) {
-                                    minY = obj.y;
-                                }
-
-                                if (!maxY) {
-                                    maxY = obj.y;
-                                }
-
-                                minX = minX <= obj.x ? minX : obj.x;
-                                maxX = maxX >= obj.x ? maxX : obj.x;
-                                minY = minY <= obj.y ? minY : obj.y;
-                                maxY = maxY >= obj.y ? maxY : obj.y;
-
-                                marker.setMap(_MapHandler.map);
-                                _MarkerArr.push(marker);
-                                setMap.set(addr, obj);
-
-                                str+= `<li id="spot-${idx}" onclick="moveLocation(${obj.x}, ${obj.y}, ${idx})">
-                                            ${obj.address_name}
-                                       </li>`;
-                            }
+        }
+        console.log(result);
+        console.log(status);
+    }, {page : 1, size: 30});
+    let data;
+    // done(function(data) {
+        if (data && data.documents.length > 0) {
+            let str = "";
+            const setMap = new Map();
+
+            const bounds = new kakao.maps.LatLngBounds();
+            let minX;
+            let minY;
+            let maxX;
+            let maxY;
+            let idx = 0;
+            data.documents.forEach((obj)=>{
+                if (!setMap.get(obj.address_name) && obj.address_name.includes("경북 포항시")) {
+                    idx++;
+                    let addr = obj.address_name;
+                    if (obj.x && obj.y) {
+                        const position = getKakaoPosition(obj.y, obj.x);
+                        let marker = new kakao.maps.Marker({
+                            position : position,
+                            title : addr ,
+                            content : addr
+                        });
+
+                        new kakao.maps.event.addListener(marker, 'click', function() {
+                            moveLocation(obj.x, obj.y, idx);
+                        })
+                        if (!minX) {
+                            minX = obj.x;
                         }
-                    });
 
-                    if (minX && minY && maxX && maxY) {
-                        bounds.extend(new kakao.maps.LatLng(minY, minX));
-                        bounds.extend(new kakao.maps.LatLng(maxY, maxX));
-                        _MapHandler.setBounds(bounds);
-                        $('.list-content.spot').html(str);
-                        getVertex();
+                        if (!maxX) {
+                            maxX = obj.x;
+                        }
+                        if (!minY) {
+                            minY = obj.y;
+                        }
+
+                        if (!maxY) {
+                            maxY = obj.y;
+                        }
+
+                        minX = minX <= obj.x ? minX : obj.x;
+                        maxX = maxX >= obj.x ? maxX : obj.x;
+                        minY = minY <= obj.y ? minY : obj.y;
+                        maxY = maxY >= obj.y ? maxY : obj.y;
+
+                        marker.setMap(_MapHandler.map);
+                        _MarkerArr.push(marker);
+                        setMap.set(addr, obj);
+
+                        str+= `<li id="spot-${idx}" onclick="moveLocation(${obj.x}, ${obj.y}, ${idx})">
+                                    ${obj.address_name}
+                               </li>`;
                     }
                 }
             });
+
+            if (minX && minY && maxX && maxY) {
+                bounds.extend(new kakao.maps.LatLng(minY, minX));
+                bounds.extend(new kakao.maps.LatLng(maxY, maxX));
+                _MapHandler.setBounds(bounds);
+                $('.list-content.spot').html(str);
+                getVertex();
+            }
         }
-    })
-});
+    // });
+}
 
 /**
  * 지점 클릭 위치 이동
@@ -581,6 +753,11 @@ function atrdClickEvent(AupHillId, AdownHillId) {
     }
 }
 
+/**
+ * 간선도로 레벨 설정
+ * @param level 현재 레벨
+ * @returns {number} 데이터 레벨
+ */
 function getAtrdLevel(level) {
     if (level >= 8) {
         level = 7;
@@ -591,6 +768,9 @@ function getAtrdLevel(level) {
     return level;
 }
 
+/**
+ * 마커 객체
+ */
 class MarkerObj {
     constructor({ID, NAME, X_CRDN, Y_CRDN, URL, TYPE, IMAGE, IMAGE_TYPE, DATA, ADDR}) {
         this.ID         = ID;
@@ -1336,14 +1516,22 @@ let isHide = false
 function toggleEvent() {
     const $listArea = $('.left-list-area');
     const $toggleButton = $('.toggle-button');
+    const $locationButton = $('.location-btn');
+    const $locationBox = $('.location-box');
 
     if (!isHide) {
         $toggleButton.animate({
             left: 0
         }, 'slow');
-        $listArea .animate({
+        $listArea.animate({
             left: -$listArea.width()
         }, 'slow');
+        $locationButton.animate({
+            left: 27
+        }, 'slow');
+        $locationBox.animate({
+            left: 27
+        }, 'slow');
         $toggleButton.text('>');
     }
     else {
@@ -1353,20 +1541,32 @@ function toggleEvent() {
         $listArea .animate({
             left: 0
         }, 'slow');
+        $locationButton.animate({
+            left: $listArea.width() + 27
+        }, 'slow')
+        $locationBox.animate({
+            left: $listArea.width() + 27
+        }, 'slow')
         $toggleButton.text('<');
     }
     isHide = !isHide;
 }
 
+
+
 window.addEventListener('resize', function(event) {
     if ($(this).width() > 450) {
         const $toggleButton = $('.toggle-button');
+        const $locationButton = $('.location-btn');
         const $listArea = $('.left-list-area');
+        const $locationBox = $('.location-box');
         const left = $toggleButton.offset().left;
         const listLeft = $listArea.offset().left;
         if ($(this).width() >= 920) {
             if (left > 0 && left < 400) {
                 $toggleButton.css('left', 400);
+                $locationButton.css('left', 427);
+                $locationBox.css('left', 427);
             }
 
             if (listLeft > -400 && listLeft < 0) {
@@ -1376,6 +1576,8 @@ window.addEventListener('resize', function(event) {
         else {
             if (left > 0 && left > 275) {
                 $toggleButton.css('left', 275);
+                $locationButton.css('left', 302);
+                $locationBox.css('left', 302);
             }
 
             if (listLeft < -273) {
@@ -1383,6 +1585,10 @@ window.addEventListener('resize', function(event) {
             }
         }
     }
+    else {
+        $('.location-box').css('display', 'none');
+        $('.location-btn').removeClass('on');
+    }
 });
 
 
@@ -1787,4 +1993,18 @@ class MarkerManager{
 
         this.setIsDraw(type, isShow);
     }
-}
+}
+
+function toggleLocationBox() {
+    const $locationBox = $('.location-box');
+    if (_MarkerArr.length > 0) {
+        _MarkerArr.forEach((obj)=>{
+            obj.setMap(null);
+        });
+        _MarkerArr = [];
+    }
+    $('.location-box input').val('');
+    $('.list-content.spot').empty();
+    $locationBox.toggle();
+    $('.location-btn').toggleClass('on');
+}

+ 12 - 5
src/main/resources/templates/include/traffic.html

@@ -26,20 +26,27 @@
         </li>
     </ul>
 <!--    <div class="tab-title" th:text="${listTitle}">-->
-    <div class="tab-title">
-        <div class="active">리스트</div>
-        <div>지점 검색</div>
-    </div>
+<!--    <div class="tab-title">-->
+<!--        <div class="active">리스트</div>-->
+<!--        <div>지점 검색</div>-->
+<!--    </div>-->
     <div class="list-search">
         <div>검색</div>
         <input id="search-box" name="search-list" type="text" placeholder="검색어를 입력하세요">
     </div>
     <ul class="list-content list"></ul>
-    <ul class="list-content spot"></ul>
 </div>
 <div class="toggle-button" title="보이기/숨기기" th:onclick="toggleEvent()">
     &lt;
 </div>
+<div class="location-btn" onclick="toggleLocationBox()"><img th:src="@{/images/icon/search-icon.png}" alt="">지점검색</div>
+<div class="location-box">
+    <div class="top">
+        <input type="text" placeholder="검색어를 입력하세요" id="location-text" autocomplete="off" onkeyup="searchLocation(event)" name="location-text">
+        <div class="search-btn" onclick="searchLocation()">찾기</div>
+    </div>
+    <ul class="list-content spot"></ul>
+</div>
 <div class="traffic-color-legend">
     <span>원할</span>
     <span class="gradation"></span>