youngsuk 2023-08-23
230823 서영석 히트맵 추가
@19e4e8eb00f9cde2cebf99dc382f7fa9f71733c9
client/views/component/OpenLayers.vue
--- client/views/component/OpenLayers.vue
+++ client/views/component/OpenLayers.vue
@@ -25,6 +25,8 @@
 import { Cluster } from 'ol/source';
 import { fromExtent } from 'ol/geom/Polygon';
 import OSM from 'ol/source/OSM.js';
+import Stamen from 'ol/source/Stamen.js';
+import KML from 'ol/format/KML.js';
 
 
 // V월드 메인키
@@ -687,46 +689,33 @@
       headers: {
         'Content-Type': 'application/json; charset=UTF-8'
       },
-      data: { "dong_cd": dong_cd, "node_id": node_id },
+      data: { "dong_cd": dong_cd},
     }).then(function (response) {     
-      const tempfeatures = new GeoJSON().readFeatures(response.data);
- 
-      // const areaSize=response.data.features.area;
-      let layerSource = new VectorSource({});
-      if (geoType === vm.baseSource) {
-        layerSource = new VectorSource({
-          features: tempfeatures
-        });
-      } else {
-        tempfeatures.forEach(function (feature) {
-          // 좌표변환   
-          feature.getGeometry().transform(geoType, vm.baseSource);
-          layerSource.addFeature(feature)
-        });
-      }
-
-      const heatmapSource = new VectorSource({
-        source: layerSource,
+      console.log("url : ", sourceUrl);
+      console.log("addHeatmapLayer response : ", response.data);
+     
+      var heatfeature = new VectorSource({
+        features: new GeoJSON().readFeatures(response.data,{
+          dataProjection: "EPSG:5181",
+          featureProjection: "EPSG:5181"
+        })
       });
+    
+    const vector = new HeatmapLayer({
+      source: heatfeature,
+      blur: 50,
+      radius: 10,
+    
+      weight: function (feature) {
+        // Modify the weight function as needed
+        return 10;
+      },
+    });
 
-      const vector = new HeatmapLayer({
-        properties: { name: layerName },
-        source: heatmapSource,
-        blur: 50,
-        radius: 25,
-        weight: function (feature) {
-          const name = feature.get('name');
-          const magnitude = parseFloat(name.substr(2));
-          return magnitude - 5;
-        },
-      });
-      var layer = new TileLayer({ 
-        source: new OSM()  
-      });
-
-      vector.setZIndex(10);
-      vm.map.addLayer(layer);
-      vm.map.addLayer(vector);     
+    vector.setZIndex(10);
+    vm.map.addLayer(vector);
+    // vm.map.addLayer(raster);
+      
     }).catch(function (error) {
       console.log("error : ", error);
     });
@@ -786,11 +775,13 @@
           } else if (type == 'MultiPolygon') {
             return style
           } else if (type == 'MultiPolygonForAnalysis') {
-            if(feature.get('count')<feature.get('count')/4){
+            if (feature.get('count')<feature.get('count')/5){
+              style.getFill().setColor(`rgba(255, ${(250).toString()}, 0, 0.5)`);
+            }else if(feature.get('count')<feature.get('count')*2/5){
               style.getFill().setColor(`rgba(255, ${(180).toString()}, 0, 0.5)`);
-            }else if (feature.get('count')<feature.get('count')*2/4){
+            }else if (feature.get('count')<feature.get('count')*3/5){
               style.getFill().setColor(`rgba(255, ${(120).toString()}, 0, 0.5)`);
-            }else if (feature.get('count')<feature.get('count')*3/4){
+            }else if (feature.get('count')<feature.get('count')*4/5){
               style.getFill().setColor(`rgba(255, ${(60).toString()}, 0, 0.5)`);
             }else {
               style.getFill().setColor(`rgba(255, ${(0).toString()}, 0, 0.5)`);
client/views/pages/Analysis/Analysis.vue
--- client/views/pages/Analysis/Analysis.vue
+++ client/views/pages/Analysis/Analysis.vue
@@ -148,7 +148,7 @@
       <div class="top flex gap">
         <button class="s-btn" @click="changeClusterLayer">클러스터</button>
         <button class="s-btn" @click="changeLayer">레이어</button>
-        <!-- <button class="s-btn" @click="changeHeatmapLayer">히트맵</button> -->
+        <button class="s-btn" @click="changeHeatmapLayer"  >히트맵</button>
       </div>
       <OpenLayers ref="open_layers" />
     </div>
@@ -916,19 +916,15 @@
         vm.rittrnVhcleCrosngTotalCnt=0;
         vm.troblOcrnCrosngTotalCnt=0;
         for(var i = 0 ; i<response.data.wtrmsCrosng.length; i++){
-          [response.data.wtrmsCrosng[i].lat,response.data.wtrmsCrosng[i].lon] = transform([response.data.wtrmsCrosng[i].lat,response.data.wtrmsCrosng[i].lon],"EPSG:5181","EPSG:4326"); ;
           vm.wtrmsCrosngTotalCnt+=response.data.wtrmsCrosng[i].count;
         }
         for(var i = 0 ; i<response.data.signExtn.length; i++){
-          [response.data.signExtn[i].lat,response.data.signExtn[i].lon] = transform([response.data.signExtn[i].lat,response.data.signExtn[i].lon],"EPSG:5181","EPSG:4326"); ;
           vm.signExtnCrosngTotalCnt+=response.data.signExtn[i].count;
         }
         for(var i = 0 ; i<response.data.rittrnVhcle.length; i++){
-          [response.data.rittrnVhcle[i].lat,response.data.rittrnVhcle[i].lon] = transform([response.data.rittrnVhcle[i].lat,response.data.rittrnVhcle[i].lon],"EPSG:5181","EPSG:4326"); ;
           vm.rittrnVhcleCrosngTotalCnt+=response.data.rittrnVhcle[i].count;
         }
         for(var i = 0 ; i<response.data.troblOcrn.length; i++){
-          [response.data.troblOcrn[i].lat,response.data.troblOcrn[i].lon] = transform([response.data.troblOcrn[i].lat,response.data.troblOcrn[i].lon],"EPSG:5181","EPSG:4326"); ;
           vm.troblOcrnCrosngTotalCnt+=response.data.troblOcrn[i].count;
         }
         vm.wtrmsCrosngSearchResult=response.data.wtrmsCrosng;
@@ -988,9 +984,13 @@
         } else if (this.layerCk) {
           this.$refs.open_layers.removeLayerAll();
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
-          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonWtrmsCrosngLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonWtrmsCrosngLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);     
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonWtrmsCrosngAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
       else if (this.itemsCk == 2) {
@@ -1002,37 +1002,47 @@
         }else if (this.layerCk) {
           this.$refs.open_layers.removeLayerAll();
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
-          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonSignExtnLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonSignExtnLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);   
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonSignExtnAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
       else if (this.itemsCk == 3) {
         if (this.clusterCk) {
           this.$refs.open_layers.removeLayerAll();
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
-          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addClusterLayerByUrl( "/common/getNodeGeoJsonRittrnVhcleAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }else if (this.layerCk) {
           this.$refs.open_layers.removeLayerAll();
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
-          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonRittrnVhcleLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonRittrnVhcleLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);    
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonRittrnVhcleAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
       else if (this.itemsCk == 4) {
         if (this.clusterCk) {
           this.$refs.open_layers.removeLayerAll();
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
-          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addClusterLayerByUrl( "/common/getNodeGeoJsonTroblOcrnAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }else if (this.layerCk) {
           this.$refs.open_layers.removeLayerAll();
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
-          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonTroblOcrnLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonTroblOcrnLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonTroblOcrnAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
     },
@@ -1051,9 +1061,13 @@
         } else if (this.layerCk) {
           this.$refs.open_layers.removeLayerAll();
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
-          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonWtrmsCrosngLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonWtrmsCrosngLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);     
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonWtrmsCrosngAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
       else if (this.itemsCk == 2) {
@@ -1065,37 +1079,47 @@
         }else if (this.layerCk) {
           this.$refs.open_layers.removeLayerAll();
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
-          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonSignExtnLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonSignExtnLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);   
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonSignExtnAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
       else if (this.itemsCk == 3) {
         if (this.clusterCk) {
           this.$refs.open_layers.removeLayerAll();
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
-          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addClusterLayerByUrl( "/common/getNodeGeoJsonRittrnVhcleAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }else if (this.layerCk) {
           this.$refs.open_layers.removeLayerAll();
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
-          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonRittrnVhcleLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonRittrnVhcleLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);    
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonRittrnVhcleAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
       else if (this.itemsCk == 4) {
         if (this.clusterCk) {
           this.$refs.open_layers.removeLayerAll();
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
-          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addClusterLayerByUrl( "/common/getNodeGeoJsonTroblOcrnAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }else if (this.layerCk) {
           this.$refs.open_layers.removeLayerAll();
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
-          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonTroblOcrnLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonTroblOcrnLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonTroblOcrnAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
     },
@@ -1116,6 +1140,11 @@
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonWtrmsCrosngLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonWtrmsCrosngLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);     
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonWtrmsCrosngAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
       else if (this.itemsCk == 2) {
@@ -1129,6 +1158,11 @@
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonSignExtnLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonSignExtnLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);   
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonSignExtnAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
       else if (this.itemsCk == 3) {
@@ -1141,6 +1175,11 @@
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonRittrnVhcleLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonRittrnVhcleLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);    
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonRittrnVhcleAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
       else if (this.itemsCk == 4) {
@@ -1153,6 +1192,11 @@
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonTroblOcrnLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonTroblOcrnLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonTroblOcrnAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
     },
@@ -1169,6 +1213,11 @@
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonWtrmsCrosngLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonWtrmsCrosngLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);     
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonWtrmsCrosngAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
       else if (this.itemsCk == 2) {
@@ -1182,6 +1231,11 @@
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonSignExtnLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonSignExtnLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);   
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonSignExtnAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
       else if (this.itemsCk == 3) {
@@ -1194,6 +1248,11 @@
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonRittrnVhcleLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonRittrnVhcleLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);    
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonRittrnVhcleAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
       else if (this.itemsCk == 4) {
@@ -1206,6 +1265,11 @@
           this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonTroblOcrnLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonTroblOcrnLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonTroblOcrnAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
       }
     },
@@ -1323,6 +1387,40 @@
       this.layerCk = false;
       //히트맵 체크
       this.heatmapCk = true;
+
+      if (this.itemsCk == 1) {
+        this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer);
+          this.$refs.open_layers.addVectorLayerRemoveAutoSizeByUrl("/common/getDongsPolygonGeoJson.json","multPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonWtrmsCrosngAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
+      }
+      if (this.itemsCk == 1) {
+        this.$refs.open_layers.removeLayerAll();
+        this.$refs.open_layers.setBaseMap(vworldBaseLayer);
+        this.$refs.open_layers.addVectorLayerRemoveAutoSizeByUrl("/common/getDongsPolygonGeoJson.json","multPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+        this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonWtrmsCrosngAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
+      }
+      //신호연장
+      if (this.itemsCk == 2) {
+        this.$refs.open_layers.removeLayerAll();
+        this.$refs.open_layers.setBaseMap(vworldBaseLayer);
+        this.$refs.open_layers.addVectorLayerRemoveAutoSizeByUrl("/common/getDongsPolygonGeoJson.json","multPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+        this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonSignExtnAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
+      } 
+      //우회전 차량
+      if (this.itemsCk == 3) {
+        this.$refs.open_layers.removeLayerAll();
+        this.$refs.open_layers.setBaseMap(vworldBaseLayer);
+        this.$refs.open_layers.addVectorLayerRemoveAutoSizeByUrl("/common/getDongsPolygonGeoJson.json","multPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+        this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonRittrnVhcleAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
+      } 
+      // 장애발생
+      if (this.itemsCk == 4) {
+        this.$refs.open_layers.removeLayerAll();
+        this.$refs.open_layers.setBaseMap(vworldBaseLayer);
+        this.$refs.open_layers.addVectorLayerRemoveAutoSizeByUrl("/common/getDongsPolygonGeoJson.json","multPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+        this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonTroblOcrnAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
+      } 
     },
     childMoveEnd() {},
     childClick() {},
@@ -1362,6 +1460,10 @@
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonWtrmsCrosngLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonWtrmsCrosngLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);     
         } else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerRemoveAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonWtrmsCrosngAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
         this.searchResultState = "무단횡단 발생";
       } 
@@ -1380,6 +1482,11 @@
           this.$refs.open_layers.addVectorLayerRemoveAutoSizeByUrl("/common/getDongsPolygonGeoJson.json","multPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonSignExtnLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonSignExtnLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);   
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerRemoveAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonSignExtnAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
         this.searchResultState = "신호연장 발생";
       } 
@@ -1398,6 +1505,11 @@
           this.$refs.open_layers.addVectorLayerRemoveAutoSizeByUrl("/common/getDongsPolygonGeoJson.json","multPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonRittrnVhcleLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonRittrnVhcleLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);    
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerRemoveAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonRittrnVhcleAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
         this.searchResultState = "불법 우회전 발생";
       } 
@@ -1416,6 +1528,11 @@
           this.$refs.open_layers.addVectorLayerRemoveAutoSizeByUrl("/common/getDongsPolygonGeoJson.json","multPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
           this.$refs.open_layers.addLayerTypeLayer("/common/getPolygonGeoJsonTroblOcrnLayerTypeCntAnalysis.json","multiPolygonForAnalysis","EPSG:5181",baseStyles["MultiPolygonForAnalysis"],"MultiPolygonForAnalysis",this.address);
           this.$refs.open_layers.addLayerTypeLayer("/common/getGeoJsonTroblOcrnLayerTypeCntAnalysis.json","labelForAnalysis","EPSG:5181",baseStyles["labelForAnalysis"],"labelForAnalysis",this.address);
+        }else if (this.heatmapCk) {
+          this.$refs.open_layers.removeLayerAll();
+          this.$refs.open_layers.setBaseMap(vworldBaseLayer, event.target.value);
+          this.$refs.open_layers.addVectorLayerRemoveAutoSizeByUrl("/common/getDongsGeoJson.json","multiPolygonLayer","EPSG:5181",baseStyles["MultiPolygon"],"MultiPolygon",this.address.dong_cd);
+          this.$refs.open_layers.addHeatmapLayer( "/common/getNodeGeoJsonTroblOcrnAnalysis.json", "clusterLayer",  "EPSG:5181", baseStyles["clusterStyle"], "clusterStyle", this.address );
         }
         this.searchResultState = "장애발생";
       }
client/views/pages/CrosswalkManagement/CrosswalkSearch.vue
--- client/views/pages/CrosswalkManagement/CrosswalkSearch.vue
+++ client/views/pages/CrosswalkManagement/CrosswalkSearch.vue
@@ -1233,14 +1233,15 @@
           vm.crosswalk.siDo_dong_cd = response.data.dong_cd.slice(0, 2);
           vm.crosswalk.guGun_dong_cd = response.data.dong_cd.slice(0, 5);
           vm.crosswalk.dong_dong_cd = response.data.dong_cd;         
-          let coordinate = transform(
-            [response.data.lon, response.data.lat],
-            "EPSG:4326",
-            "EPSG:5181"
-          );
-          vm.crosswalk.lat = coordinate[0];
-          vm.crosswalk.lon = coordinate[1];
-
+          // let coordinate = transform(
+          //   [response.data.lon, response.data.lat],
+          //   "EPSG:4326",
+          //   "EPSG:5181"
+          // );
+          // vm.crosswalk.lat = coordinate[0];
+          // vm.crosswalk.lon = coordinate[1];
+          vm.crosswalk.lat = response.data.lat;
+          vm.crosswalk.lon = response.data.lon;
           if (response.data.rittrn_tfclne_yn == "y") {
             vm.crosswalk.rittrn_tfclne_yn = true;
           } else {
@@ -1384,7 +1385,7 @@
       // this.$refs.open_layers.addVectorLayerRemoveAutoSizAddChildNodeCnteByUrl("/common/getDongsCenterAndChildNodeCntJson.json","nodeLayer", "EPSG:5181", baseStyles["labelStyle"], "label", this.$route.query.dong_cd, this.$route.query.node_id);
     } else {
       this.$refs.open_layers.addVectorLayerByUrl( "/common/getDongsGeoJson.json","multiPolygonLayer", "EPSG:5181", baseStyles["MultiPolygon"], "MultiPolygon", this.address.dong_cd);
-      this.$refs.open_layers.addVectorLayerRemoveAutoSizAddChildNodeCnteByUrl("/common/getDongsCenterAndChildNodeCntJson.json","nodeLayer", "EPSG:5181", baseStyles["labelStyle"], "label", this.address.dong_cd);
+      this.$refs.open_layers.addVectorLayerRemoveAutoSizAddChildNodeCnteByUrl("/common/getDongsCenterAndChildNodeCntJson.json","nodeLayer", "EPSG:5181", baseStyles["labelStyle"], "label", this.address);
     }
     // this.$refs.open_layers.dumpTroblLayer("/common/getDongsCenterAndChildNodeCntJson.json","troblLayer", "EPSG:5181", baseStyles["labelStyle"], "label", this.address.dong_cd);
   },
Add a comment
List