|
@@ -32,6 +32,8 @@ export default {
|
|
|
Cesium.DrawMode.Polygon,
|
|
|
0
|
|
|
),
|
|
|
+ //存储压平数据名称
|
|
|
+ flattenNames: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -55,10 +57,8 @@ export default {
|
|
|
if (isActive == true) {
|
|
|
viewer.enableCursorStyle = false;
|
|
|
viewer._element.style.cursor = "";
|
|
|
- // $('body').removeClass('drawCur').addClass('drawCur');
|
|
|
} else {
|
|
|
viewer.enableCursorStyle = true;
|
|
|
- // $('body').removeClass('drawCur');
|
|
|
}
|
|
|
});
|
|
|
that.handler_Cut_fill.movingEvt.addEventListener(function (
|
|
@@ -71,10 +71,10 @@ export default {
|
|
|
if (that.handler_Cut_fill.isDrawing) {
|
|
|
tooltip.showAt(
|
|
|
windowPosition,
|
|
|
- "<p>点击确定开挖区域中间点</p><p>右键单击结束绘制,进行开挖</p>"
|
|
|
+ "<p>点击确定压平区域中间点</p><p>右键单击结束绘制,进行压平</p>"
|
|
|
);
|
|
|
} else {
|
|
|
- tooltip.showAt(windowPosition, "<p>点击绘制开挖区域第一个点</p>");
|
|
|
+ tooltip.showAt(windowPosition, "<p>点击绘制压平区域第一个点</p>");
|
|
|
}
|
|
|
});
|
|
|
that.handler_Cut_fill.drawEvt.addEventListener(function (result) {
|
|
@@ -107,18 +107,29 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
viewer.scene.globe.removeAllExcavationRegion();
|
|
|
- console.log(positions, "positions");
|
|
|
+ //获取时间戳
|
|
|
+ var date = new Date().getTime();
|
|
|
+ // that.flattenNames.push(date);
|
|
|
+ store.state.flattenNames.push(date);
|
|
|
+ //调用压平api进行压平
|
|
|
store.state.tempLatData.addFlattenRegion({
|
|
|
position: positions,
|
|
|
- name: "flatten" + Math.random(),
|
|
|
+ // name: "flatten" + Math.random(),
|
|
|
+ name: "flatten" + date,
|
|
|
});
|
|
|
that.handler_Cut_fill.polygon.show = false;
|
|
|
that.handler_Cut_fill.polyline.show = false;
|
|
|
that.handler_Cut_fill.deactivate();
|
|
|
- // that.handler_Cut_fill.activate();
|
|
|
});
|
|
|
that.handler_Cut_fill.activate();
|
|
|
},
|
|
|
+ clear() {
|
|
|
+ if (store.state.flattenNames.length) {
|
|
|
+ store.state.flattenNames.forEach((el) => {
|
|
|
+ store.state.tempLatData.removeFlattenRegion("flatten" + el);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {},
|
|
|
};
|