Преглед изворни кода

生态修复山水工程geom不显示问题修改

maxiaoxiao пре 1 година
родитељ
комит
a88c1d9c34
1 измењених фајлова са 4 додато и 9 уклоњено
  1. 4 9
      src/views/cockpit/common/VectorSpace/BoxCommonVector.vue

+ 4 - 9
src/views/cockpit/common/VectorSpace/BoxCommonVector.vue

@@ -103,17 +103,12 @@ export default {
             data.forEach((res) => {
             data.forEach((res) => {
                 res.type = '图斑上图'
                 res.type = '图斑上图'
                 if (res.geom) {
                 if (res.geom) {
-                    res.geom.coordinates.forEach((res_coordinates) => {
-                        let arrayt = [];
-                        if (res_coordinates.length == 1) {
-                            arrayt = res_coordinates[0]
-                        } else {
-                            arrayt = res_coordinates
-                        }
-
-                        const twoDArray = arrayt;
+                    res.geom.coordinates.forEach((res_coordinates,ei) => {
+                        res_coordinates.forEach(coord=>{
+                        const twoDArray = coord;
                         const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
                         const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
                         tdsy.add(res, oneDArray);
                         tdsy.add(res, oneDArray);
+                        })
                     })
                     })
                 }
                 }
             })
             })