|
@@ -54,7 +54,52 @@ export default {
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ multiPolygonToPolygons(multiPolygon) {
|
|
|
|
+ const polygons = [];
|
|
|
|
+ multiPolygon.coordinates.forEach(polygonCoordinates => {
|
|
|
|
+ polygons.push({
|
|
|
|
+ type: 'Polygon',
|
|
|
|
+ coordinates: polygonCoordinates
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ return polygons;
|
|
|
|
+ },
|
|
|
|
+ // draw_vector_tdgy_gy_jd(data) {
|
|
|
|
+ // const that = this;
|
|
|
|
+ // data.forEach((res) => {
|
|
|
|
+ // res.type = this.title
|
|
|
|
+ // if (res.geom) {
|
|
|
|
+ // res.geom.coordinates.forEach((res_coordinates) => {
|
|
|
|
+ // // let arrayt = [];
|
|
|
|
+ // // if (res_coordinates.length == 1) {
|
|
|
|
+ // // arrayt = res_coordinates[0]
|
|
|
|
+ // // const twoDArray = arrayt;
|
|
|
|
+ // // const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
|
|
|
|
+ // // tdsy.add(res, oneDArray);
|
|
|
|
+ // // } else {
|
|
|
|
+ // // // arrayt = res_coordinates
|
|
|
|
+ // // }
|
|
|
|
+
|
|
|
|
+ // // 多面转单面
|
|
|
|
+ // // if (res.geom.type == 'MultiPolygon') {
|
|
|
|
+ // // let polygons = that.multiPolygonToPolygons(geojson);
|
|
|
|
+
|
|
|
|
+ // // // 在
|
|
|
|
+ // // polygons.forEach((res) => {
|
|
|
|
+ // // that.add_viewer_for_vector(res, data);
|
|
|
|
+ // // tdsy.add(res, oneDArray);
|
|
|
|
+
|
|
|
|
+ // // })
|
|
|
|
+ // // } else {
|
|
|
|
+
|
|
|
|
+ // // }
|
|
|
|
+
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
draw_vector_tdgy_gy_jd(data) {
|
|
draw_vector_tdgy_gy_jd(data) {
|
|
|
|
+ // tdsy.remove();
|
|
data.forEach((res) => {
|
|
data.forEach((res) => {
|
|
res.type = this.title
|
|
res.type = this.title
|
|
if (res.geom) {
|
|
if (res.geom) {
|
|
@@ -62,19 +107,17 @@ export default {
|
|
let arrayt = [];
|
|
let arrayt = [];
|
|
if (res_coordinates.length == 1) {
|
|
if (res_coordinates.length == 1) {
|
|
arrayt = res_coordinates[0]
|
|
arrayt = res_coordinates[0]
|
|
- const twoDArray = arrayt;
|
|
|
|
- const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
|
|
|
|
- tdsy.add(res, oneDArray);
|
|
|
|
} else {
|
|
} else {
|
|
- // arrayt = res_coordinates
|
|
|
|
|
|
+ arrayt = res_coordinates
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+ const twoDArray = arrayt;
|
|
|
|
+ const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
|
|
|
|
+ tdsy.add(res, oneDArray);
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
-
|
|
|
|
close() {
|
|
close() {
|
|
|
|
|
|
store.setViewerFlagb(true);
|
|
store.setViewerFlagb(true);
|