Bella пре 2 година
родитељ
комит
8f3f251f2a

+ 0 - 29
public/static/json/simplified_pdgeojson.json

@@ -152,35 +152,6 @@
       }
     },
 
-    {
-      "type": "Feature",
-      "properties": {
-        "OBJECTID": 5,
-        "FID_1": 276,
-        "LAYER": "全市街",
-        "GM_TYPE": "Unknown Area Type",
-        "ELEVATION": 0,
-        "FID_2": 10,
-        "NAME": "浦江镇",
-        "LAYER_1": "乡镇面A",
-        "GM_TYPE_1": "Text",
-        "ELEVATIO_1": 0,
-        "Distance": 235.7794516,
-        "Shape_Leng": 4559.53752501,
-        "Shape_Area": 3127.63285976
-      },
-      "geometry": {
-        "type": "Polygon",
-        "coordinates": [
-          [
-            [121.47266889895495, 31.111889399440187],
-            [121.47266568275914, 31.111889182207108],
-            [121.47266498669201, 31.11188924988246],
-            [121.47266889895495, 31.111889399440187]
-          ]
-        ]
-      }
-    },
     {
       "type": "Feature",
       "properties": {

+ 4 - 0
src/components/common/BottomForm/UploadingData.vue

@@ -133,6 +133,10 @@ export default {
       // 地图定位
       let firstPolygon = JSON.parse(JSON.stringify(geoJson));
       console.log("上传文件读取到的数据",firstPolygon);
+      firstPolygon.features.forEach((ele,index)=>{
+        let cid = `myLayer_${index}`
+        
+      })
       // let coordinates = firstPolygon.features.coordinates[0][0][0];
       // this.$store.state.mapMethodsCollection.get("RENDER").setView(firstPolygon, 16);
       // this.$store.state.mapMethodsCollection.get("RENDER").addPolygonLayer(geoJson, cid, color);

+ 7 - 7
src/components/map/MapHolder.vue

@@ -580,7 +580,7 @@ export default {
 
       map2DViewer.map = L.map("map2DViewer", {
         crs: systemConfig.imageryLayer.crs,
-        zoom: 1,
+        zoom: 0,
         minZoom: systemConfig.imageryLayer.minZoom,
         maxZoom: systemConfig.imageryLayer.maxZoom,
         attributionControl: false,
@@ -632,11 +632,11 @@ export default {
           let newCorrectCoordArr = publicFun.latLngsCorrection(correctCordArr);
           feature.geometry.coordinates = newCorrectCoordArr;
 
-          // if (
-          //   this.town.indexOf(feature.properties.NAME.replace("镇", "")) > -1
-          // ) {
-          this.renderPolygon(feature);
-          // }
+          if (
+            this.town.indexOf(feature.properties.NAME.replace("镇", "")) > -1
+          ) {
+            this.renderPolygon(feature);
+          }
         });
       });
     },
@@ -1012,7 +1012,7 @@ export default {
   position: absolute;
   width: 100%;
   height: calc(100% - 60px);
-  background-color: rgb(0,47,71);
+  background-color: rgb(0, 47, 71);
   z-index: 1;
   top: 60px;
   left: 0px;

+ 2 - 2
src/views/HomeView.vue

@@ -350,7 +350,7 @@ export default {
     homeSelect(val) {
       this.$store.commit("changeHomeSpecialTown", val);
       if (val === "全部") {
-        this.$refs.mapLoaderRef.setView(townLocationMap.get(val), 1);
+        this.$refs.mapLoaderRef.setView(townLocationMap.get(val), 0);
       } else {
         let polygon = townPolygonMap.get(val);
         map2DViewer.map.fitBounds(polygon.getBounds());
@@ -360,7 +360,7 @@ export default {
     specialTownSelect(val) {
       this.$store.commit("changeHomeSpecialTown", val);
       if (val === "全部") {
-        this.$refs.mapLoaderRef.setView(townLocationMap.get(val), 1);
+        this.$refs.mapLoaderRef.setView(townLocationMap.get(val), 0);
       } else {
         let polygon = townPolygonMap.get(val);
         map2DViewer.map.fitBounds(polygon.getBounds());