deeptwins-engine-3d 0.1.66 → 0.1.67
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 +9 -0
- package/dist/esm/constant.js +10 -1
- package/dist/esm/graphicLayer/BaseLayer.d.ts +23 -0
- package/dist/esm/graphicLayer/BaseLayer.js +387 -65
- package/dist/esm/graphicLayer/BasePrimitiveInstance.d.ts +0 -1
- package/dist/esm/graphicLayer/BasePrimitiveInstance.js +0 -7
- package/dist/esm/graphicLayer/BaseSource.d.ts +1 -1
- package/dist/esm/graphicLayer/BoxPrimitiveInstance.d.ts +0 -1
- package/dist/esm/graphicLayer/BoxPrimitiveInstance.js +4 -8
- package/dist/esm/graphicLayer/EllipsePrimitiveInstance.d.ts +0 -1
- package/dist/esm/graphicLayer/EllipsePrimitiveInstance.js +5 -9
- package/dist/esm/graphicLayer/EllipsoidPrimitiveInstance.d.ts +0 -1
- package/dist/esm/graphicLayer/EllipsoidPrimitiveInstance.js +5 -9
- package/dist/esm/graphicLayer/GraphicLayerCollection.js +20 -27
- package/dist/esm/graphicLayer/ModelPrimitiveInstance.d.ts +0 -1
- package/dist/esm/graphicLayer/ModelPrimitiveInstance.js +0 -7
- package/dist/esm/graphicLayer/PolygonGroundPrimitiveImageMaterialInstance.js +5 -2
- package/dist/esm/graphicLayer/PolygonPrimitiveImageMaterialInstance.js +5 -2
- package/dist/esm/graphicLayer/PolygonPrimitiveInstance.d.ts +0 -1
- package/dist/esm/graphicLayer/PolygonPrimitiveInstance.js +5 -9
- package/dist/esm/graphicLayer/PolylineGroundPrimitiveInstance.d.ts +0 -1
- package/dist/esm/graphicLayer/PolylineGroundPrimitiveInstance.js +4 -8
- package/dist/esm/graphicLayer/PolylinePrimitiveInstance.d.ts +0 -1
- package/dist/esm/graphicLayer/PolylinePrimitiveInstance.js +4 -8
- package/dist/esm/graphicLayer/PolylineVolumePrimitiveInstance.d.ts +0 -1
- package/dist/esm/graphicLayer/PolylineVolumePrimitiveInstance.js +4 -8
- package/dist/esm/graphicLayer/WallPrimitiveInstance.d.ts +0 -1
- package/dist/esm/graphicLayer/WallPrimitiveInstance.js +4 -8
- package/dist/esm/index.js +2 -2
- package/dist/esm/material/WeatherEffects.d.ts +64 -14
- package/dist/esm/material/WeatherEffects.js +279 -95
- package/dist/esm/material/shader/RainShader.glsl +44 -6
- package/dist/esm/material/shader/lightning.glsl +70 -0
- package/dist/esm/tileLayer/MvtVectorLoad.d.ts +12 -0
- package/dist/esm/tileLayer/MvtVectorLoad.js +245 -49
- package/dist/umd/deeptwins-engine-3d.min.js +1 -1
- package/package.json +1 -1
|
@@ -31,13 +31,6 @@ var BasePrimitiveInstance = /*#__PURE__*/function () {
|
|
|
31
31
|
value: function getMap() {
|
|
32
32
|
return this._mapContext && this._mapContext.getMap();
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
// 更新样式
|
|
36
|
-
}, {
|
|
37
|
-
key: "updateStyle",
|
|
38
|
-
value: function updateStyle() {
|
|
39
|
-
console.warn("".concat(this.type, "\u7C7B\u578B\u4E0D\u652F\u6301\u66F4\u65B0\u6837\u5F0F"));
|
|
40
|
-
}
|
|
41
34
|
}]);
|
|
42
35
|
return BasePrimitiveInstance;
|
|
43
36
|
}();
|
|
@@ -15,7 +15,7 @@ export default class BaseSource {
|
|
|
15
15
|
remove(): void;
|
|
16
16
|
setData(data: any): this | undefined;
|
|
17
17
|
_toDestroy(): void;
|
|
18
|
-
static analysisSourceType(data: any): "
|
|
18
|
+
static analysisSourceType(data: any): "wkt" | "sourceId" | "sourceInstance" | "geoJson" | "clampedPolygonGrid" | "other";
|
|
19
19
|
static wktToGeoJon(wkt: string): any;
|
|
20
20
|
static geoJsonToGeoCartesian3Array(geoJson: any): any[];
|
|
21
21
|
static handleFeaturePoint(feature: any): any;
|
|
@@ -52,6 +52,8 @@ var BoxPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
52
52
|
color = _options$style.color,
|
|
53
53
|
dimensions = _options$style.dimensions,
|
|
54
54
|
scale = _options$style.scale,
|
|
55
|
+
_options$style$show = _options$style.show,
|
|
56
|
+
show = _options$style$show === void 0 ? true : _options$style$show,
|
|
55
57
|
positions = options.positions,
|
|
56
58
|
primitiveInstance = options.primitiveInstance;
|
|
57
59
|
var instance = new Cesium.GeometryInstance({
|
|
@@ -62,18 +64,12 @@ var BoxPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
62
64
|
}),
|
|
63
65
|
modelMatrix: Cesium.Matrix4.multiplyByUniformScale(Cesium.Transforms.eastNorthUpToFixedFrame(positions), scale, new Cesium.Matrix4()),
|
|
64
66
|
attributes: {
|
|
65
|
-
color: color
|
|
67
|
+
color: color,
|
|
68
|
+
show: new Cesium.ShowGeometryInstanceAttribute(show)
|
|
66
69
|
}
|
|
67
70
|
});
|
|
68
71
|
primitiveInstance.push(instance);
|
|
69
72
|
}
|
|
70
|
-
|
|
71
|
-
// 更新geoJson数据
|
|
72
|
-
}, {
|
|
73
|
-
key: "updateData",
|
|
74
|
-
value: function updateData() {
|
|
75
|
-
console.warn("".concat(this.type, "\u7C7B\u578B\u4E0D\u652F\u6301\u66F4\u65B0\u6570\u636E"));
|
|
76
|
-
}
|
|
77
73
|
}], [{
|
|
78
74
|
key: "handleOptions",
|
|
79
75
|
value: function handleOptions(style) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
var _excluded = ["style"],
|
|
3
|
-
_excluded2 = ["color"],
|
|
3
|
+
_excluded2 = ["color", "show"],
|
|
4
4
|
_excluded3 = ["color", "rotation", "stRotation"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -51,6 +51,8 @@ var EllipsePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
51
51
|
function _init(options) {
|
|
52
52
|
var _options$style = options.style,
|
|
53
53
|
color = _options$style.color,
|
|
54
|
+
_options$style$show = _options$style.show,
|
|
55
|
+
show = _options$style$show === void 0 ? true : _options$style$show,
|
|
54
56
|
style = _objectWithoutProperties(_options$style, _excluded2),
|
|
55
57
|
positions = options.positions,
|
|
56
58
|
primitiveInstance = options.primitiveInstance;
|
|
@@ -65,18 +67,12 @@ var EllipsePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
65
67
|
vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
|
|
66
68
|
}, style)),
|
|
67
69
|
attributes: {
|
|
68
|
-
color: color
|
|
70
|
+
color: color,
|
|
71
|
+
show: new Cesium.ShowGeometryInstanceAttribute(show)
|
|
69
72
|
}
|
|
70
73
|
});
|
|
71
74
|
primitiveInstance.push(instance);
|
|
72
75
|
}
|
|
73
|
-
|
|
74
|
-
// 更新geoJson数据
|
|
75
|
-
}, {
|
|
76
|
-
key: "updateData",
|
|
77
|
-
value: function updateData() {
|
|
78
|
-
console.warn("".concat(this.type, "\u7C7B\u578B\u4E0D\u652F\u6301\u66F4\u65B0\u6570\u636E"));
|
|
79
|
-
}
|
|
80
76
|
}], [{
|
|
81
77
|
key: "handleOptions",
|
|
82
78
|
value: function handleOptions(style) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
var _excluded = ["style", "source", "entity"],
|
|
3
|
-
_excluded2 = ["color"],
|
|
3
|
+
_excluded2 = ["color", "show"],
|
|
4
4
|
_excluded3 = ["radii", "innerRadii", "minimumClock", "maximumClock", "minimumCone", "maximumCone", "color"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -54,6 +54,8 @@ var EllipsePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
54
54
|
function _init(options) {
|
|
55
55
|
var _options$style = options.style,
|
|
56
56
|
color = _options$style.color,
|
|
57
|
+
_options$style$show = _options$style.show,
|
|
58
|
+
show = _options$style$show === void 0 ? true : _options$style$show,
|
|
57
59
|
style = _objectWithoutProperties(_options$style, _excluded2),
|
|
58
60
|
positions = options.positions,
|
|
59
61
|
primitiveInstance = options.primitiveInstance;
|
|
@@ -64,18 +66,12 @@ var EllipsePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
64
66
|
vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
|
|
65
67
|
}, style)),
|
|
66
68
|
attributes: {
|
|
67
|
-
color: color
|
|
69
|
+
color: color,
|
|
70
|
+
show: new Cesium.ShowGeometryInstanceAttribute(show)
|
|
68
71
|
}
|
|
69
72
|
});
|
|
70
73
|
primitiveInstance.push(instance);
|
|
71
74
|
}
|
|
72
|
-
|
|
73
|
-
// 更新geoJson数据
|
|
74
|
-
}, {
|
|
75
|
-
key: "updateData",
|
|
76
|
-
value: function updateData() {
|
|
77
|
-
console.warn("".concat(this.type, "\u7C7B\u578B\u4E0D\u652F\u6301\u66F4\u65B0\u6570\u636E"));
|
|
78
|
-
}
|
|
79
75
|
}], [{
|
|
80
76
|
key: "handleOptions",
|
|
81
77
|
value: function handleOptions(style) {
|
|
@@ -287,6 +287,7 @@ var GraphicLayerCollection = /*#__PURE__*/function () {
|
|
|
287
287
|
var graphicLayer = this.getLayer(layer);
|
|
288
288
|
if (!graphicLayer) {
|
|
289
289
|
utils.warn('未找到对应图层');
|
|
290
|
+
return;
|
|
290
291
|
}
|
|
291
292
|
graphicLayer.show(isShow);
|
|
292
293
|
}
|
|
@@ -301,6 +302,7 @@ var GraphicLayerCollection = /*#__PURE__*/function () {
|
|
|
301
302
|
var graphicLayer = this.getLayer(layer);
|
|
302
303
|
if (!graphicLayer) {
|
|
303
304
|
utils.warn('未找到对应图层');
|
|
305
|
+
return;
|
|
304
306
|
}
|
|
305
307
|
graphicLayer.remove();
|
|
306
308
|
}
|
|
@@ -315,6 +317,7 @@ var GraphicLayerCollection = /*#__PURE__*/function () {
|
|
|
315
317
|
var graphicSource = this.getSource(source);
|
|
316
318
|
if (!graphicSource) {
|
|
317
319
|
utils.warn('未找到对应的数据源');
|
|
320
|
+
return;
|
|
318
321
|
}
|
|
319
322
|
graphicSource.remove();
|
|
320
323
|
}
|
|
@@ -326,22 +329,11 @@ var GraphicLayerCollection = /*#__PURE__*/function () {
|
|
|
326
329
|
if (!this._canOperate()) {
|
|
327
330
|
return;
|
|
328
331
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
_step2;
|
|
334
|
-
try {
|
|
335
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
336
|
-
var value = _step2.value;
|
|
337
|
-
value._toDestroy();
|
|
338
|
-
}
|
|
339
|
-
} catch (err) {
|
|
340
|
-
_iterator2.e(err);
|
|
341
|
-
} finally {
|
|
342
|
-
_iterator2.f();
|
|
332
|
+
var graphicLayers = Array.from(this.graphicLayers.values());
|
|
333
|
+
for (var _i = 0, _graphicLayers = graphicLayers; _i < _graphicLayers.length; _i++) {
|
|
334
|
+
var value = _graphicLayers[_i];
|
|
335
|
+
value.remove();
|
|
343
336
|
}
|
|
344
|
-
this._clearGraphicMapLayer();
|
|
345
337
|
this._clearGraphicMapSource();
|
|
346
338
|
}
|
|
347
339
|
|
|
@@ -353,17 +345,17 @@ var GraphicLayerCollection = /*#__PURE__*/function () {
|
|
|
353
345
|
return;
|
|
354
346
|
}
|
|
355
347
|
var graphicSources = this.graphicSources.values();
|
|
356
|
-
var
|
|
357
|
-
|
|
348
|
+
var _iterator2 = _createForOfIteratorHelper(graphicSources),
|
|
349
|
+
_step2;
|
|
358
350
|
try {
|
|
359
|
-
for (
|
|
360
|
-
var value =
|
|
351
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
352
|
+
var value = _step2.value;
|
|
361
353
|
value._toDestroy();
|
|
362
354
|
}
|
|
363
355
|
} catch (err) {
|
|
364
|
-
|
|
356
|
+
_iterator2.e(err);
|
|
365
357
|
} finally {
|
|
366
|
-
|
|
358
|
+
_iterator2.f();
|
|
367
359
|
}
|
|
368
360
|
this._clearGraphicMapSource();
|
|
369
361
|
}
|
|
@@ -378,6 +370,7 @@ var GraphicLayerCollection = /*#__PURE__*/function () {
|
|
|
378
370
|
var graphicLayer = this.getLayer(layer);
|
|
379
371
|
if (!graphicLayer) {
|
|
380
372
|
utils.warn('未找到对应图层');
|
|
373
|
+
return;
|
|
381
374
|
}
|
|
382
375
|
graphicLayer.setStyle(style);
|
|
383
376
|
}
|
|
@@ -403,19 +396,19 @@ var GraphicLayerCollection = /*#__PURE__*/function () {
|
|
|
403
396
|
if (layer === '_allLayer') {
|
|
404
397
|
// 找出所有需要更新的layer
|
|
405
398
|
var graphicValues = this.graphicLayers.values();
|
|
406
|
-
var
|
|
407
|
-
|
|
399
|
+
var _iterator3 = _createForOfIteratorHelper(graphicValues),
|
|
400
|
+
_step3;
|
|
408
401
|
try {
|
|
409
|
-
for (
|
|
410
|
-
var value =
|
|
402
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
403
|
+
var value = _step3.value;
|
|
411
404
|
if (value.sourceId === source.id) {
|
|
412
405
|
graphicLayers.push(value);
|
|
413
406
|
}
|
|
414
407
|
}
|
|
415
408
|
} catch (err) {
|
|
416
|
-
|
|
409
|
+
_iterator3.e(err);
|
|
417
410
|
} finally {
|
|
418
|
-
|
|
411
|
+
_iterator3.f();
|
|
419
412
|
}
|
|
420
413
|
} else {
|
|
421
414
|
graphicLayers.push(this.getLayer(layer));
|
|
@@ -57,13 +57,6 @@ var ModelPrimitive = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
57
57
|
}));
|
|
58
58
|
primitiveInstance.push(instance);
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
// 更新geoJson数据
|
|
62
|
-
}, {
|
|
63
|
-
key: "updateData",
|
|
64
|
-
value: function updateData() {
|
|
65
|
-
console.warn("".concat(this.type, "\u7C7B\u578B\u4E0D\u652F\u6301\u66F4\u65B0\u6570\u636E"));
|
|
66
|
-
}
|
|
67
60
|
}], [{
|
|
68
61
|
key: "handleOptions",
|
|
69
62
|
value: function handleOptions(style) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["color", "stRotation"];
|
|
2
|
+
var _excluded = ["color", "stRotation", "show"];
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -34,6 +34,8 @@ var PolygonGroundPrimitiveImageMaterialInstance = /*#__PURE__*/function (_Polygo
|
|
|
34
34
|
var _options$style = options.style,
|
|
35
35
|
color = _options$style.color,
|
|
36
36
|
stRotation = _options$style.stRotation,
|
|
37
|
+
_options$style$show = _options$style.show,
|
|
38
|
+
show = _options$style$show === void 0 ? true : _options$style$show,
|
|
37
39
|
style = _objectWithoutProperties(_options$style, _excluded),
|
|
38
40
|
positions = options.positions,
|
|
39
41
|
indices = options.indices,
|
|
@@ -73,7 +75,8 @@ var PolygonGroundPrimitiveImageMaterialInstance = /*#__PURE__*/function (_Polygo
|
|
|
73
75
|
id: this.id,
|
|
74
76
|
geometry: geometry,
|
|
75
77
|
attributes: {
|
|
76
|
-
color: color
|
|
78
|
+
color: color,
|
|
79
|
+
show: new Cesium.ShowGeometryInstanceAttribute(show)
|
|
77
80
|
}
|
|
78
81
|
});
|
|
79
82
|
primitiveInstance.push(instance);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["color", "stRotation"];
|
|
2
|
+
var _excluded = ["color", "stRotation", "show"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -37,6 +37,8 @@ var PolygonPrimitiveImageMaterialInstance = /*#__PURE__*/function (_PolygonPrimi
|
|
|
37
37
|
var _options$style = options.style,
|
|
38
38
|
color = _options$style.color,
|
|
39
39
|
stRotation = _options$style.stRotation,
|
|
40
|
+
_options$style$show = _options$style.show,
|
|
41
|
+
show = _options$style$show === void 0 ? true : _options$style$show,
|
|
40
42
|
style = _objectWithoutProperties(_options$style, _excluded),
|
|
41
43
|
positions = options.positions,
|
|
42
44
|
holes = options.holes,
|
|
@@ -70,7 +72,8 @@ var PolygonPrimitiveImageMaterialInstance = /*#__PURE__*/function (_PolygonPrimi
|
|
|
70
72
|
id: this.id,
|
|
71
73
|
geometry: geometry,
|
|
72
74
|
attributes: {
|
|
73
|
-
color: color
|
|
75
|
+
color: color,
|
|
76
|
+
show: new Cesium.ShowGeometryInstanceAttribute(show)
|
|
74
77
|
}
|
|
75
78
|
});
|
|
76
79
|
primitiveInstance.push(instance);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
var _excluded = ["style"],
|
|
3
|
-
_excluded2 = ["color", "stRotation"],
|
|
3
|
+
_excluded2 = ["color", "stRotation", "show"],
|
|
4
4
|
_excluded3 = ["color", "height", "stRotation"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -52,6 +52,8 @@ var PolygonPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
52
52
|
var _options$style = options.style,
|
|
53
53
|
color = _options$style.color,
|
|
54
54
|
stRotation = _options$style.stRotation,
|
|
55
|
+
_options$style$show = _options$style.show,
|
|
56
|
+
show = _options$style$show === void 0 ? true : _options$style$show,
|
|
55
57
|
style = _objectWithoutProperties(_options$style, _excluded2),
|
|
56
58
|
positions = options.positions,
|
|
57
59
|
holes = options.holes,
|
|
@@ -66,18 +68,12 @@ var PolygonPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
66
68
|
stRotation: stRotation
|
|
67
69
|
}, style)),
|
|
68
70
|
attributes: {
|
|
69
|
-
color: color
|
|
71
|
+
color: color,
|
|
72
|
+
show: new Cesium.ShowGeometryInstanceAttribute(show)
|
|
70
73
|
}
|
|
71
74
|
});
|
|
72
75
|
primitiveInstance.push(instance);
|
|
73
76
|
}
|
|
74
|
-
|
|
75
|
-
// 更新geoJson数据
|
|
76
|
-
}, {
|
|
77
|
-
key: "updateData",
|
|
78
|
-
value: function updateData() {
|
|
79
|
-
console.warn("".concat(this.type, "\u7C7B\u578B\u4E0D\u652F\u6301\u66F4\u65B0\u6570\u636E"));
|
|
80
|
-
}
|
|
81
77
|
}], [{
|
|
82
78
|
key: "handleOptions",
|
|
83
79
|
value: function handleOptions(style) {
|
|
@@ -51,6 +51,8 @@ var PolylineGroundPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInsta
|
|
|
51
51
|
var _options$style = options.style,
|
|
52
52
|
color = _options$style.color,
|
|
53
53
|
width = _options$style.width,
|
|
54
|
+
_options$style$show = _options$style.show,
|
|
55
|
+
show = _options$style$show === void 0 ? true : _options$style$show,
|
|
54
56
|
primitiveInstance = options.primitiveInstance;
|
|
55
57
|
var instance = new Cesium.GeometryInstance({
|
|
56
58
|
id: this.id,
|
|
@@ -60,18 +62,12 @@ var PolylineGroundPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInsta
|
|
|
60
62
|
granularity: 9999.0
|
|
61
63
|
}),
|
|
62
64
|
attributes: {
|
|
63
|
-
color: color
|
|
65
|
+
color: color,
|
|
66
|
+
show: new Cesium.ShowGeometryInstanceAttribute(show)
|
|
64
67
|
}
|
|
65
68
|
});
|
|
66
69
|
primitiveInstance.push(instance);
|
|
67
70
|
}
|
|
68
|
-
|
|
69
|
-
// 更新geoJson数据
|
|
70
|
-
}, {
|
|
71
|
-
key: "updateData",
|
|
72
|
-
value: function updateData() {
|
|
73
|
-
console.warn("".concat(this.type, "\u7C7B\u578B\u4E0D\u652F\u6301\u66F4\u65B0\u6570\u636E"));
|
|
74
|
-
}
|
|
75
71
|
}], [{
|
|
76
72
|
key: "handleOptions",
|
|
77
73
|
value: function handleOptions(style) {
|
|
@@ -51,6 +51,8 @@ var PolylinePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
51
51
|
var _options$style = options.style,
|
|
52
52
|
color = _options$style.color,
|
|
53
53
|
width = _options$style.width,
|
|
54
|
+
_options$style$show = _options$style.show,
|
|
55
|
+
show = _options$style$show === void 0 ? true : _options$style$show,
|
|
54
56
|
primitiveInstance = options.primitiveInstance;
|
|
55
57
|
var instance = new Cesium.GeometryInstance({
|
|
56
58
|
id: this.id,
|
|
@@ -60,18 +62,12 @@ var PolylinePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
60
62
|
vertexFormat: Cesium.PolylineMaterialAppearance.VERTEX_FORMAT
|
|
61
63
|
}),
|
|
62
64
|
attributes: {
|
|
63
|
-
color: color
|
|
65
|
+
color: color,
|
|
66
|
+
show: new Cesium.ShowGeometryInstanceAttribute(show)
|
|
64
67
|
}
|
|
65
68
|
});
|
|
66
69
|
primitiveInstance.push(instance);
|
|
67
70
|
}
|
|
68
|
-
|
|
69
|
-
// 更新geoJson数据
|
|
70
|
-
}, {
|
|
71
|
-
key: "updateData",
|
|
72
|
-
value: function updateData() {
|
|
73
|
-
console.warn("".concat(this.type, "\u7C7B\u578B\u4E0D\u652F\u6301\u66F4\u65B0\u6570\u636E"));
|
|
74
|
-
}
|
|
75
71
|
}], [{
|
|
76
72
|
key: "handleOptions",
|
|
77
73
|
value: function handleOptions(style) {
|
|
@@ -52,6 +52,8 @@ var PolylineVolumePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInsta
|
|
|
52
52
|
color = _options$style.color,
|
|
53
53
|
shapePositions = _options$style.shapePositions,
|
|
54
54
|
cornerType = _options$style.cornerType,
|
|
55
|
+
_options$style$show = _options$style.show,
|
|
56
|
+
show = _options$style$show === void 0 ? true : _options$style$show,
|
|
55
57
|
positions = options.positions,
|
|
56
58
|
primitiveInstance = options.primitiveInstance;
|
|
57
59
|
var instance = new Cesium.GeometryInstance({
|
|
@@ -63,18 +65,12 @@ var PolylineVolumePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInsta
|
|
|
63
65
|
cornerType: cornerType
|
|
64
66
|
}),
|
|
65
67
|
attributes: {
|
|
66
|
-
color: color
|
|
68
|
+
color: color,
|
|
69
|
+
show: new Cesium.ShowGeometryInstanceAttribute(show)
|
|
67
70
|
}
|
|
68
71
|
});
|
|
69
72
|
primitiveInstance.push(instance);
|
|
70
73
|
}
|
|
71
|
-
|
|
72
|
-
// 更新geoJson数据
|
|
73
|
-
}, {
|
|
74
|
-
key: "updateData",
|
|
75
|
-
value: function updateData() {
|
|
76
|
-
console.warn("".concat(this.type, "\u7C7B\u578B\u4E0D\u652F\u6301\u66F4\u65B0\u6570\u636E"));
|
|
77
|
-
}
|
|
78
74
|
}], [{
|
|
79
75
|
key: "handleOptions",
|
|
80
76
|
value: function handleOptions(style) {
|
|
@@ -52,6 +52,8 @@ var WallPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
52
52
|
color = _options$style.color,
|
|
53
53
|
minimumHeights = _options$style.minimumHeights,
|
|
54
54
|
maximumHeights = _options$style.maximumHeights,
|
|
55
|
+
_options$style$show = _options$style.show,
|
|
56
|
+
show = _options$style$show === void 0 ? true : _options$style$show,
|
|
55
57
|
positions = options.positions,
|
|
56
58
|
primitiveInstance = options.primitiveInstance;
|
|
57
59
|
var instance = new Cesium.GeometryInstance({
|
|
@@ -63,18 +65,12 @@ var WallPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
63
65
|
maximumHeights: maximumHeights
|
|
64
66
|
}),
|
|
65
67
|
attributes: {
|
|
66
|
-
color: color
|
|
68
|
+
color: color,
|
|
69
|
+
show: new Cesium.ShowGeometryInstanceAttribute(show)
|
|
67
70
|
}
|
|
68
71
|
});
|
|
69
72
|
primitiveInstance.push(instance);
|
|
70
73
|
}
|
|
71
|
-
|
|
72
|
-
// 更新geoJson数据
|
|
73
|
-
}, {
|
|
74
|
-
key: "updateData",
|
|
75
|
-
value: function updateData() {
|
|
76
|
-
console.warn("".concat(this.type, "\u7C7B\u578B\u4E0D\u652F\u6301\u66F4\u65B0\u6570\u636E"));
|
|
77
|
-
}
|
|
78
74
|
}], [{
|
|
79
75
|
key: "handleOptions",
|
|
80
76
|
value: function handleOptions(style) {
|
package/dist/esm/index.js
CHANGED
|
@@ -66,11 +66,11 @@ DEEP_TWINS_BASE_URL && (window.CESIUM_BASE_URL = DEEP_TWINS_BASE_URL);
|
|
|
66
66
|
// 全局加载css
|
|
67
67
|
loadCss(Cesium.buildModuleUrl('Widgets/widgets.css'));
|
|
68
68
|
// 打印版本信息
|
|
69
|
-
console.log('DeepTwinsEngine3D Version:', "0.1.
|
|
69
|
+
console.log('DeepTwinsEngine3D Version:', "0.1.67");
|
|
70
70
|
export var DeepTwinsEngine3D = /*#__PURE__*/_createClass(function DeepTwinsEngine3D() {
|
|
71
71
|
_classCallCheck(this, DeepTwinsEngine3D);
|
|
72
72
|
});
|
|
73
|
-
_defineProperty(DeepTwinsEngine3D, "Version", "0.1.
|
|
73
|
+
_defineProperty(DeepTwinsEngine3D, "Version", "0.1.67");
|
|
74
74
|
_defineProperty(DeepTwinsEngine3D, "Map", Map);
|
|
75
75
|
_defineProperty(DeepTwinsEngine3D, "GroundSkyBox", GroundSkyBox);
|
|
76
76
|
_defineProperty(DeepTwinsEngine3D, "RasterLayer", RasterLayer);
|
|
@@ -1,18 +1,68 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference path="../typings.d.ts" />
|
|
2
|
+
import * as Cesium from 'deeptwins-cesium';
|
|
3
|
+
import Map, { MapContext } from '../map/Map';
|
|
4
|
+
export type WeatherEffectType = 'snow' | 'rain' | 'fog';
|
|
5
|
+
export interface SnowEffectOptions {
|
|
6
|
+
size?: number;
|
|
7
|
+
speed?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface RainEffectOptions {
|
|
10
|
+
direction?: number;
|
|
11
|
+
size?: number;
|
|
12
|
+
speed?: number;
|
|
13
|
+
density?: number;
|
|
14
|
+
opacity?: number;
|
|
15
|
+
gloominess?: number;
|
|
16
|
+
color?: string | Cesium.Color;
|
|
17
|
+
lightningEnabled?: boolean;
|
|
18
|
+
lightningFrequency?: number;
|
|
19
|
+
lightningIntensity?: number;
|
|
20
|
+
lightningTint?: string | Cesium.Color;
|
|
21
|
+
lightningDuration?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface FogEffectOptions {
|
|
24
|
+
startDistance?: number;
|
|
25
|
+
endDistance?: number;
|
|
26
|
+
color?: string | Cesium.Color;
|
|
27
|
+
}
|
|
28
|
+
export type WeatherEffectOptions = SnowEffectOptions | RainEffectOptions | FogEffectOptions;
|
|
29
|
+
type ResolvedSnowEffectOptions = Required<SnowEffectOptions>;
|
|
30
|
+
type ResolvedRainEffectOptions = Required<RainEffectOptions>;
|
|
31
|
+
type ResolvedFogEffectOptions = Required<FogEffectOptions>;
|
|
32
|
+
type ResolvedWeatherEffectOptions = ResolvedSnowEffectOptions | ResolvedRainEffectOptions | ResolvedFogEffectOptions;
|
|
2
33
|
export default class WeatherEffects {
|
|
3
34
|
_mapContext: MapContext | undefined;
|
|
4
|
-
type:
|
|
5
|
-
options:
|
|
6
|
-
stage:
|
|
7
|
-
|
|
8
|
-
|
|
35
|
+
readonly type: WeatherEffectType;
|
|
36
|
+
options: ResolvedWeatherEffectOptions;
|
|
37
|
+
stage: Cesium.PostProcessStage;
|
|
38
|
+
isDestroyed: boolean;
|
|
39
|
+
private _isAdded;
|
|
40
|
+
private _extraStages;
|
|
41
|
+
private readonly _stageConfigBuilders;
|
|
42
|
+
constructor(type: WeatherEffectType, options?: WeatherEffectOptions);
|
|
43
|
+
getMap(): Map | undefined;
|
|
9
44
|
remove(): void;
|
|
10
|
-
addToMap(map:
|
|
11
|
-
setEffect(options
|
|
12
|
-
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
private
|
|
17
|
-
private
|
|
45
|
+
addToMap(map: Map): this;
|
|
46
|
+
setEffect(options?: WeatherEffectOptions): this;
|
|
47
|
+
destroy(): void;
|
|
48
|
+
private _assertWeatherEffectType;
|
|
49
|
+
private _assertNotDestroyed;
|
|
50
|
+
private _createStage;
|
|
51
|
+
private _createExtraStages;
|
|
52
|
+
private _resetStagesFromCurrentOptions;
|
|
53
|
+
private _getStages;
|
|
54
|
+
private _removeStagesFromMap;
|
|
55
|
+
private _destroyStages;
|
|
56
|
+
private _applyUniforms;
|
|
57
|
+
private _applyStageConfig;
|
|
58
|
+
private _buildStageConfig;
|
|
59
|
+
private _assertNumberInRange;
|
|
60
|
+
private _assertBoolean;
|
|
61
|
+
private _buildSnowStageConfig;
|
|
62
|
+
private _isRainLightningActive;
|
|
63
|
+
private _mapRainLightningInterval;
|
|
64
|
+
private _buildRainLightningStageConfig;
|
|
65
|
+
private _buildRainStageConfig;
|
|
66
|
+
private _buildFogStageConfig;
|
|
18
67
|
}
|
|
68
|
+
export {};
|