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