|
@@ -45,11 +45,24 @@ export default {
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
draw() {
|
|
|
- //绘制多边形
|
|
|
+
|
|
|
+
|
|
|
const that = this;
|
|
|
- that.handler_Cut_fill.clear();
|
|
|
- viewer.scene.globe.removeAllExcavationRegion();
|
|
|
+ that.clear();
|
|
|
+ // that.handler_Cut_fill.clear();
|
|
|
+ // that.handler_Cut_fill.deactivate();
|
|
|
+
|
|
|
+
|
|
|
|
|
|
+ // if (that.handler_Cut_fill.polyline) {
|
|
|
+ // that.handler_Cut_fill.polyline.show = false;
|
|
|
+ // }
|
|
|
+ // if (that.handler_Cut_fill.polyline) {
|
|
|
+ // that.handler_Cut_fill.polygon.show = false;
|
|
|
+ // }
|
|
|
+ // viewer.scene.globe.removeAllExcavationRegion();
|
|
|
+ var tooltip = createTooltip(viewer._element);
|
|
|
+ //绘制多边形
|
|
|
that.handler_Cut_fill.activeEvt.addEventListener(function (isActive) {
|
|
|
if (isActive == true) {
|
|
|
viewer.enableCursorStyle = false;
|
|
@@ -83,9 +96,6 @@ export default {
|
|
|
return;
|
|
|
};
|
|
|
var array = [].concat(result.object.positions);
|
|
|
-
|
|
|
- let cutVolume = cutFillAnalysis.VolumeAnalysis(array, that.height, that.height);
|
|
|
- that.result = cutVolume;
|
|
|
tooltip.setVisible(false);
|
|
|
var positions = [];
|
|
|
for (var i = 0, len = array.length; i < len; i++) {
|
|
@@ -93,7 +103,6 @@ export default {
|
|
|
var longitude = Cesium.Math.toDegrees(cartographic.longitude);
|
|
|
var latitude = Cesium.Math.toDegrees(cartographic.latitude);
|
|
|
var h = cartographic.height;
|
|
|
-
|
|
|
if (positions.indexOf(longitude) == -1 && positions.indexOf(latitude) == -1) {
|
|
|
positions.push(longitude);
|
|
|
positions.push(latitude);
|
|
@@ -104,7 +113,7 @@ export default {
|
|
|
viewer.scene.globe.addExcavationRegion({
|
|
|
name: 'ggg',
|
|
|
position: positions,
|
|
|
- height: that.height,
|
|
|
+ height: Number(that.height),
|
|
|
transparent: false
|
|
|
});
|
|
|
|
|
@@ -120,18 +129,34 @@ export default {
|
|
|
that.handler_Cut_fill.clear();
|
|
|
viewer.scene.globe.removeAllExcavationRegion();
|
|
|
|
|
|
- that.result=null;
|
|
|
+ that.result = null;
|
|
|
|
|
|
}
|
|
|
},
|
|
|
beforeCreate() { }, //生命周期 - 创建之前
|
|
|
created() {
|
|
|
|
|
|
+ const terrainP = new Cesium.CesiumTerrainProvider({
|
|
|
+ url: 'http://192.168.60.3:8099/iserver/services/3D-local3DCache-SanYaDSMHuanCun/rest/realspace/datas/dsm@dsm',
|
|
|
+ isSct: true//地形服务源自SuperMap iServer发布时需设置isSct为true
|
|
|
+ });
|
|
|
+
|
|
|
// const terrainP = new Cesium.CesiumTerrainProvider({
|
|
|
- // url: 'http://192.168.60.3:8099/iserver/services/3D-local3DCache-SanYaDSMHuanCun/rest/realspace/datas/dsm@dsm',
|
|
|
- // isSct: true//地形服务源自SuperMap iServer发布时需设置isSct为true
|
|
|
+ // url: 'https://www.supermapol.com/realspace/services/3D-stk_terrain/rest/realspace/datas/info/data/path',
|
|
|
+ // requestWaterMask: true,
|
|
|
+ // requestVertexNormals: true,
|
|
|
+ // isSct: false,
|
|
|
+ // });
|
|
|
+ // // 设置相机视角
|
|
|
+ // viewer.scene.camera.setView({
|
|
|
+ // destination: Cesium.Cartesian3.fromDegrees(88.3648, 29.0946, 90000),
|
|
|
+ // orientation: {
|
|
|
+ // heading: 6.10547067016156,
|
|
|
+ // pitch: -0.8475077031996778,
|
|
|
+ // roll: 6.2831853016686185
|
|
|
+ // }
|
|
|
// });
|
|
|
- // viewer.terrainProvider = terrainP;
|
|
|
+ viewer.terrainProvider = terrainP;
|
|
|
|
|
|
viewer.scene.globe.depthTestAgainstTerrain = false;
|
|
|
|