|
@@ -838,54 +838,68 @@ export default {
|
|
|
|
|
|
},
|
|
|
draw_vector_tdgy_gy_jd() {
|
|
|
-
|
|
|
+ console.log(this.vector_data, "this.vector_data");
|
|
|
this.vector_data.forEach((res) => {
|
|
|
res.type = '国有建设用地完成项目'
|
|
|
- res.geom.coordinates[0].forEach((res_coordinates) => {
|
|
|
+ if (res.geom) {
|
|
|
+ res.geom.coordinates.forEach((res_coordinates) => {
|
|
|
+ console.log('res_coordinates: ', res_coordinates);
|
|
|
+ let arrayt = [];
|
|
|
+ if (res_coordinates.length == 1) {
|
|
|
+ arrayt = res_coordinates[0]
|
|
|
+ }else{
|
|
|
+ arrayt = res_coordinates
|
|
|
+ }
|
|
|
|
|
|
- const twoDArray = res_coordinates;
|
|
|
- const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
|
|
|
+ const twoDArray = arrayt;
|
|
|
+ const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
|
|
|
+ console.log('oneDArray: ', oneDArray);
|
|
|
|
|
|
|
|
|
- this.gy_jd_entity.entities.add({
|
|
|
- // position: Cesium.Cartesian3.fromDegrees(res_coordinates[0], res_coordinates[1], 0),
|
|
|
- properties: res,
|
|
|
- name: "国有建设用地完成项目",
|
|
|
- polygon: {
|
|
|
- zIndex: 1,
|
|
|
- hierarchy: {
|
|
|
- positions: Cesium.Cartesian3.fromDegreesArrayHeights(oneDArray),
|
|
|
- },
|
|
|
- // outline: false,
|
|
|
- // material: Cesium.Color.fromCssColorString(xzqh_color),
|
|
|
-
|
|
|
- height: 0,
|
|
|
- extrudedHeight: 0,
|
|
|
- outline: true,
|
|
|
- // outlineColor : Cesium.Color.BLACK
|
|
|
- outlineColor: Cesium.Color.fromCssColorString('#55A1E3'),
|
|
|
- }
|
|
|
+ this.gy_jd_entity.entities.add({
|
|
|
+ // position: Cesium.Cartesian3.fromDegrees(res_coordinates[0], res_coordinates[1], 0),
|
|
|
+ properties: res,
|
|
|
+ name: "国有建设用地完成项目",
|
|
|
+ polygon: {
|
|
|
+ zIndex: 1,
|
|
|
+ hierarchy: {
|
|
|
+ positions: Cesium.Cartesian3.fromDegreesArrayHeights(oneDArray),
|
|
|
+ },
|
|
|
+ // outline: false,
|
|
|
+ // material: Cesium.Color.fromCssColorString(xzqh_color),
|
|
|
+
|
|
|
+ height: 0,
|
|
|
+ extrudedHeight: 0,
|
|
|
+ outline: true,
|
|
|
+ // outlineColor : Cesium.Color.BLACK
|
|
|
+ outlineColor: Cesium.Color.fromCssColorString('#55A1E3'),
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
+
|
|
|
},
|
|
|
switch_vector_tdgy_gy_jd(flag) {
|
|
|
this.gy_jd_entity.show = flag
|
|
|
},
|
|
|
async init_vector(params) {
|
|
|
- // const that = this;
|
|
|
- // let obj = {
|
|
|
- // jscType: 'jsc_tdgy_gy_zbmx',
|
|
|
- // id: params ? params.id : '4602'
|
|
|
- // };
|
|
|
- // let data = await QueryList(obj);
|
|
|
- // data.data.map((res) => {
|
|
|
- // res.geom = parse(res.geom.split(";")[1]);
|
|
|
- // })
|
|
|
- // this.vector_data = data.data;
|
|
|
+ const that = this;
|
|
|
+ let obj = {
|
|
|
+ jscType: 'jsc_tdgy_gy_zbmx',
|
|
|
+ id: params ? params.id : '4602'
|
|
|
+ };
|
|
|
+ let data = await QueryList(obj);
|
|
|
+ data.data.map((res) => {
|
|
|
+ if (res.geom) {
|
|
|
+ res.geom = parse(res.geom.split(";")[1]);
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ this.vector_data = data.data;
|
|
|
|
|
|
- // this.draw_vector_tdgy_gy_jd();
|
|
|
+ this.draw_vector_tdgy_gy_jd();
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|