youngsuk 2023-06-29
230629 서영석 기본 지도 위치 수정 & 교차로 size로 벡터 레이어 (수정중)
@61a6a5b51249f268567c2d831b27121969b34f7b
client/views/component/OpenLayers.vue
--- client/views/component/OpenLayers.vue
+++ client/views/component/OpenLayers.vue
@@ -82,8 +82,8 @@
       // View 정보
       this.mapView = new View({
         projection: this.baseSource, ///EPSG:3857
-        center: transform([126.9757184, 37.564388], "EPSG:4326", vm.baseSource), //126.9757184, 37.564388 
-        zoom: 17,
+        center: transform([340830.93607841985, 264929.33868609794], "EPSG:5181", vm.baseSource), //126.9757184, 37.564388 
+        zoom: 12,
         minZoom : 8,
         maxZoom : 19
       });
@@ -132,7 +132,7 @@
     },
 
     // 벡터레이어 추가 JSON
-    addVectorLayerByUrl: function (sourceUrl, layerName, geoType, style, type, dong_cd) {
+    addVectorLayerByUrl: function (sourceUrl, layerName, geoType, style, type, dong_cd ,node_id) {
       const vm = this;
 
       axios({
@@ -141,9 +141,9 @@
         headers: {
           'Content-Type': 'application/json; charset=UTF-8'
         },
-        data: { "dong_cd": dong_cd },
+        data: { "dong_cd": dong_cd ,"node_id" : node_id},
       }).then(function (response) {
-        console.log(response)
+        console.log(response.data)
         const tempfeatures = new GeoJSON().readFeatures(response.data);
         let layerSource = new VectorSource({});
         if (geoType === vm.baseSource) {
@@ -174,6 +174,8 @@
             }
           },
         });
+        vm.map.getView().setCenter(transform([ tempfeatures[0].values_.geometry.flatCoordinates[0],tempfeatures[0].values_.geometry.flatCoordinates[1]], "EPSG:5181", vm.baseSource));
+
         vector.setZIndex(10);
         vm.map.addLayer(vector);
 
@@ -241,7 +243,7 @@
 
     },
     // 기본맵 세팅 
-    setBaseMap: function (map,zoom,dong_cd) {
+    setBaseMap: function (map,zoom,dong_cd, node_id) {
       const vm = this;
       var x;
       var y;
@@ -256,11 +258,11 @@
         headers: {
           'Content-Type': 'application/json; charset=UTF-8'
         },
-        data: { "dong_cd": dong_cd },
+        data: { "dong_cd" : dong_cd ,"node_id" : node_id},
       }).then(function (response) {
         const tempfeatures = new GeoJSON().readFeatures(response.data);
-        console.log("tempfeatures  :", tempfeatures);
-        console.log("tempfeatures  :", tempfeatures[0].values_.geometry.flatCoordinates);
+        // console.log("tempfeatures  :", tempfeatures);
+        // console.log("tempfeatures  :", tempfeatures[0].values_.geometry.flatCoordinates);
         vm.map.getView().setCenter(transform([ tempfeatures[0].values_.geometry.flatCoordinates[0],tempfeatures[0].values_.geometry.flatCoordinates[1]], "EPSG:5181", vm.baseSource));
 
         // this.map.getView().setCenter(transform([338492.222420045, 243951.915081981], "EPSG:5181", this.baseSource));
client/views/pages/Analysis/Analysis.vue
--- client/views/pages/Analysis/Analysis.vue
+++ client/views/pages/Analysis/Analysis.vue
@@ -25,7 +25,7 @@
               <span>~</span>
               <input type="date" name="" id="" />
             </div>
-            <DongSelectList @setDongCd="setDongCd"></DongSelectList>
+            <DongSelectList @setDongCd="setDongCd" :azimuthHiddenCk=false></DongSelectList>
             <div class="flex-between m-b">
               <label for="">횡단보도</label>
               <select name="" id=""></select>
client/views/pages/CrosswalkManagement/CrosswalkInsert.vue
--- client/views/pages/CrosswalkManagement/CrosswalkInsert.vue
+++ client/views/pages/CrosswalkManagement/CrosswalkInsert.vue
@@ -6,10 +6,6 @@
           <h2>횡단보도 등록</h2>
           <div class="box">
             <DongSelectList @setDongCd="setDongCd"></DongSelectList>
-            <div class="flex-between m-b">
-              <label for="">방위각</label>
-              <select name="" id=""></select>
-            </div>
             <div class="m-b">
               <div class="flex m-b">
                 <label for="" class="m-r">횡단보도 좌표</label
@@ -179,32 +175,32 @@
 import {baseStyles} from '../../component/OpenLayersStyle.vue';
 import DongSelectList from '../../component/dongSelectList.vue';
 
-// var freeBus = {
-//     "type": "FeatureCollection",
-//     "features": [
-//         {
-//             "type": "Feature",
-//             "properties": {
-//                 "popupContent": "18th & California Light Rail Stop",
-//                 "data" : 123
-//             },
-//             "geometry": {
-//                 "type": "Point",
-//                 "coordinates": [126.9757184, 37.564388]                
-//             }
-//         },{
-//             "type": "Feature",
-//             "properties": {
-//                 "popupContent": "20th & Welton Light Rail Stop",
-//                 "data" : 456
-//             },
-//             "geometry": {
-//                 "type": "Point",
-//                 "coordinates": [124.9748523, 37.5796212]
-//             }
-//         }
-//     ]
-// };
+var freeBus = {
+    "type": "FeatureCollection",
+    "features": [
+        {
+            "type": "Feature",
+            "properties": {
+                "popupContent": "18th & California Light Rail Stop",
+                "data" : 123
+            },
+            "geometry": {
+                "type": "Point",
+                "coordinates": [126.9757184, 37.564388]                
+            }
+        },{
+            "type": "Feature",
+            "properties": {
+                "popupContent": "20th & Welton Light Rail Stop",
+                "data" : 456
+            },
+            "geometry": {
+                "type": "Point",
+                "coordinates": [124.9748523, 37.5796212]
+            }
+        }
+    ]
+};
 
 export default {
   data() {
@@ -261,14 +257,14 @@
     },
     childClick : function(prop,coordinate){        
        
-      console.log(prop);
-      console.log(coordinate);
+      console.log("prop : ",prop);
+      console.log("coordinate : ",coordinate);
 
       // 레이어 삭제
       this.$refs.open_layers.removeLayer('point1');
 
       // Icon 그리기 
-      this.$refs.open_layers.createIcon(coordinate[0],coordinate[1],'/client/resources/images/icon/fin.png',0.3, 'point1');        
+      this.$refs.open_layers.createIcon(coordinate[0],coordinate[1],'/client/resources/images/icon/fin.png',0.3, 'point1','EPSG:5181');        
 
     },
 
client/views/pages/RealtimeStatus/RealtimeStatus.vue
--- client/views/pages/RealtimeStatus/RealtimeStatus.vue
+++ client/views/pages/RealtimeStatus/RealtimeStatus.vue
@@ -14,7 +14,7 @@
         <div class="search slide-content" v-if="showSlide">
           <h2>지역설정</h2>
           <div class="box">
-            <DongSelectList @setDongCd="setDongCd" :hiddenCk=false></DongSelectList>
+            <DongSelectList @setDongCd="setDongCd" :azimuthHiddenCk=false></DongSelectList>
           </div>
           <h2>조건설정</h2>
           <div class="box">
@@ -246,8 +246,15 @@
       console.log("statusSearch this.address : ", this.address);
       //지도 영역 수정
       this.$refs.open_layers.removeLayerAll();
-      this.$refs.open_layers.setBaseMap(vworldBaseLayer,12,this.address.dong_cd);
-      this.$refs.open_layers.addVectorLayerByUrl('/common/getDongsGeoJson.json', 'realtimeStatusMap', 'EPSG:5181', baseStyles['MultiPolygon'], 'MultiPolygon', this.address.dong_cd);
+      if(this.address.node_id==null){
+        this.$refs.open_layers.setBaseMap(vworldBaseLayer,this.address.zoomLevel,this.address.dong_cd);
+        this.$refs.open_layers.addVectorLayerByUrl('/common/getDongsGeoJson.json', 'realtimeStatusMap', 'EPSG:5181', baseStyles['MultiPolygon'], 'MultiPolygon', this.address.dong_cd);
+      }
+      else{
+        this.$refs.open_layers.setBaseMap(vworldBaseLayer,this.address.zoomLevel,this.address.dong_cd,  this.address.node_id);
+
+        this.$refs.open_layers.addVectorLayerByUrl('/node/getNodeGeoJson.json', 'realtimeStatusMap', 'EPSG:5181', baseStyles['MultiPolygon'], 'MultiPolygon', this.address.dong_cd, this.address.node_id);
+      }
       // this.$refs.open_layers.addClusterLayer('/common/getDongsGeoJson.json', 'realtimeStatusMap', 'EPSG:5181', '', '', this.address.dong_cd);
       // this.situationOccurrenceStatusSearch();
 
Add a comment
List