deeptwins-engine-3d 0.1.45 → 0.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/constant.d.ts +15 -0
- package/dist/esm/constant.js +29 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/lowAltitude/BaseGridMvtLayer.js +1 -1
- package/dist/esm/lowAltitude/FlightPlanning.d.ts +1 -1
- package/dist/esm/lowAltitude/FlightPlanning.js +6 -6
- package/dist/esm/lowAltitude/FlightRiskEvaluation.d.ts +10 -1
- package/dist/esm/lowAltitude/FlightRiskEvaluation.js +81 -90
- package/dist/esm/lowAltitude/GridDraw.js +1 -1
- package/dist/esm/lowAltitude/PoiLayer.js +1 -1
- package/dist/esm/map/Event.js +27 -1
- package/dist/esm/videoFusion/BaseVideo.js +12 -11
- package/dist/esm/videoFusion/VideoProject.d.ts +1 -1
- package/dist/esm/videoFusion/VideoProject.js +77 -75
- package/dist/esm/videoFusion/VideoTexture.d.ts +1 -1
- package/dist/esm/videoFusion/VideoTexture.js +15 -13
- package/dist/umd/deeptwins-engine-3d.min.js +1 -1
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ var VideoProject = /*#__PURE__*/function (_BaseVideo) {
|
|
|
36
36
|
}
|
|
37
37
|
_createClass(VideoProject, [{
|
|
38
38
|
key: "addToMap",
|
|
39
|
-
value: function addToMap(
|
|
39
|
+
value: function addToMap() {
|
|
40
40
|
var _this2 = this;
|
|
41
41
|
if (!this._canOperate()) {
|
|
42
42
|
return;
|
|
@@ -53,81 +53,83 @@ var VideoProject = /*#__PURE__*/function (_BaseVideo) {
|
|
|
53
53
|
if (this.videoType === 'custom') {
|
|
54
54
|
videoOptions = merge({}, this.options.custom);
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
this.videoPolygonLayer = map.addGraphicLayer({
|
|
86
|
-
type: 'Feature',
|
|
87
|
-
geometry: {
|
|
88
|
-
type: 'Polygon',
|
|
89
|
-
coordinates: [interPoints]
|
|
90
|
-
}
|
|
91
|
-
}, {
|
|
92
|
-
type: 'polygon',
|
|
93
|
-
style: {
|
|
94
|
-
material: edgeFeather ? new Cesium.ImageMaterialProperty({
|
|
95
|
-
image: new Cesium.CallbackProperty(function () {
|
|
96
|
-
return _this2._drawCanvas(videoOptions);
|
|
97
|
-
}, false),
|
|
98
|
-
transparent: true
|
|
99
|
-
}) : this.videoElement,
|
|
100
|
-
heightReference: clampToGround ? Cesium.HeightReference.CLAMP_TO_GROUND : Cesium.HeightReference.NONE,
|
|
101
|
-
perPositionHeight: !clampToGround
|
|
56
|
+
setTimeout(function () {
|
|
57
|
+
var _this2$options = _this2.options,
|
|
58
|
+
_this2$options$type = _this2$options.type,
|
|
59
|
+
type = _this2$options$type === void 0 ? 'fixed' : _this2$options$type,
|
|
60
|
+
frustum = _this2$options.frustum,
|
|
61
|
+
_this2$options$style = _this2$options.style,
|
|
62
|
+
_this2$options$style2 = _this2$options$style === void 0 ? {
|
|
63
|
+
edgeFeather: false,
|
|
64
|
+
clampToGround: 'terrain',
|
|
65
|
+
showLine: true
|
|
66
|
+
} : _this2$options$style,
|
|
67
|
+
edgeFeather = _this2$options$style2.edgeFeather,
|
|
68
|
+
clampToGround = _this2$options$style2.clampToGround,
|
|
69
|
+
showLine = _this2$options$style2.showLine;
|
|
70
|
+
frustum.show(false);
|
|
71
|
+
_this2.type = type;
|
|
72
|
+
_this2.frustum = frustum;
|
|
73
|
+
// 取后4个点
|
|
74
|
+
var points = _this2.frustum.getFrustumVertexPoints().slice(-4);
|
|
75
|
+
if (_this2.type === 'projection') {
|
|
76
|
+
// 交点数组
|
|
77
|
+
var interPoints = [];
|
|
78
|
+
points.forEach(function (point) {
|
|
79
|
+
var interPoint = _this2._getInterPointByLine(_this2.frustum.options.position, point);
|
|
80
|
+
interPoints.push(interPoint);
|
|
81
|
+
});
|
|
82
|
+
if (showLine) {
|
|
83
|
+
// 绘制线
|
|
84
|
+
_this2._drawLine(interPoints);
|
|
102
85
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
86
|
+
_this2.videoPolygonLayer = _this2.getMap().addGraphicLayer({
|
|
87
|
+
type: 'Feature',
|
|
88
|
+
geometry: {
|
|
89
|
+
type: 'Polygon',
|
|
90
|
+
coordinates: [interPoints]
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
type: 'polygon',
|
|
94
|
+
style: {
|
|
95
|
+
material: edgeFeather ? new Cesium.ImageMaterialProperty({
|
|
96
|
+
image: new Cesium.CallbackProperty(function () {
|
|
97
|
+
return _this2._drawCanvas(videoOptions);
|
|
98
|
+
}, false),
|
|
99
|
+
transparent: true
|
|
100
|
+
}) : _this2.videoElement,
|
|
101
|
+
heightReference: clampToGround ? Cesium.HeightReference.CLAMP_TO_GROUND : Cesium.HeightReference.NONE,
|
|
102
|
+
perPositionHeight: !clampToGround
|
|
103
|
+
}
|
|
104
|
+
});
|
|
109
105
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
coordinates: [points]
|
|
115
|
-
}
|
|
116
|
-
}, {
|
|
117
|
-
type: 'polygon',
|
|
118
|
-
style: {
|
|
119
|
-
material: edgeFeather ? new Cesium.ImageMaterialProperty({
|
|
120
|
-
image: new Cesium.CallbackProperty(function () {
|
|
121
|
-
return _this2._drawCanvas(videoOptions);
|
|
122
|
-
}, false),
|
|
123
|
-
transparent: true
|
|
124
|
-
}) : this.videoElement,
|
|
125
|
-
heightReference: Cesium.HeightReference.NONE,
|
|
126
|
-
perPositionHeight: true
|
|
106
|
+
if (_this2.type === 'fixed') {
|
|
107
|
+
if (showLine) {
|
|
108
|
+
// 绘制线
|
|
109
|
+
_this2._drawLine(points);
|
|
127
110
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
111
|
+
_this2.videoPolygonLayer = _this2.getMap().addGraphicLayer({
|
|
112
|
+
type: 'Feature',
|
|
113
|
+
geometry: {
|
|
114
|
+
type: 'Polygon',
|
|
115
|
+
coordinates: [points]
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
118
|
+
type: 'polygon',
|
|
119
|
+
style: {
|
|
120
|
+
material: edgeFeather ? new Cesium.ImageMaterialProperty({
|
|
121
|
+
image: new Cesium.CallbackProperty(function () {
|
|
122
|
+
return _this2._drawCanvas(videoOptions);
|
|
123
|
+
}, false),
|
|
124
|
+
transparent: true
|
|
125
|
+
}) : _this2.videoElement,
|
|
126
|
+
heightReference: Cesium.HeightReference.NONE,
|
|
127
|
+
perPositionHeight: true
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
_this2.status = 'START';
|
|
132
|
+
}, 200);
|
|
131
133
|
}
|
|
132
134
|
|
|
133
135
|
// 显示隐藏
|
|
@@ -146,7 +148,7 @@ var VideoProject = /*#__PURE__*/function (_BaseVideo) {
|
|
|
146
148
|
key: "_drawLine",
|
|
147
149
|
value: function _drawLine(interPoints) {
|
|
148
150
|
var _this3 = this,
|
|
149
|
-
_this$options$
|
|
151
|
+
_this$options$style;
|
|
150
152
|
var draw = function draw(geoJson) {
|
|
151
153
|
_this3.frustumLineLayer = _this3.getMap().addGraphicLayer(geoJson, {
|
|
152
154
|
type: 'polylineP',
|
|
@@ -157,7 +159,7 @@ var VideoProject = /*#__PURE__*/function (_BaseVideo) {
|
|
|
157
159
|
};
|
|
158
160
|
var linePoints = [];
|
|
159
161
|
// 是否计算贴地
|
|
160
|
-
if ((_this$options$
|
|
162
|
+
if ((_this$options$style = this.options.style) !== null && _this$options$style !== void 0 && _this$options$style.clampToGround && this.type === 'projection') {
|
|
161
163
|
var clampToGround = new ClampToGround(this.getMap());
|
|
162
164
|
var c3arr = utils.lngLatAltArrayToCartesian3Array(interPoints);
|
|
163
165
|
clampToGround.getLngLatAltArrToHeight(c3arr, 'terrain').then(function (result) {
|
|
@@ -32,7 +32,7 @@ var VideoTexture = /*#__PURE__*/function (_BaseVideo) {
|
|
|
32
32
|
}
|
|
33
33
|
_createClass(VideoTexture, [{
|
|
34
34
|
key: "addToMap",
|
|
35
|
-
value: function addToMap(
|
|
35
|
+
value: function addToMap() {
|
|
36
36
|
var _this = this;
|
|
37
37
|
if (!this._canOperate()) {
|
|
38
38
|
return;
|
|
@@ -55,18 +55,20 @@ var VideoTexture = /*#__PURE__*/function (_BaseVideo) {
|
|
|
55
55
|
} : _this$options$style,
|
|
56
56
|
edgeFeather = _this$options$style2.edgeFeather,
|
|
57
57
|
style = _objectWithoutProperties(_this$options$style2, _excluded);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
58
|
+
setTimeout(function () {
|
|
59
|
+
_this.videoPolygonLayer = _this.getMap().addGraphicLayer(_this.options.data, {
|
|
60
|
+
type: 'polygon',
|
|
61
|
+
style: _objectSpread({
|
|
62
|
+
material: edgeFeather ? new Cesium.ImageMaterialProperty({
|
|
63
|
+
image: new Cesium.CallbackProperty(function () {
|
|
64
|
+
return _this._drawCanvas(videoOptions);
|
|
65
|
+
}, false),
|
|
66
|
+
transparent: true
|
|
67
|
+
}) : _this.videoElement
|
|
68
|
+
}, style || {})
|
|
69
|
+
});
|
|
70
|
+
_this.status = 'START';
|
|
71
|
+
}, 200);
|
|
70
72
|
}
|
|
71
73
|
}]);
|
|
72
74
|
return VideoTexture;
|