deeptwins-engine-3d 0.1.29 → 0.1.31

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.
@@ -67,7 +67,7 @@ var PolygonPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
67
67
  vertexFormat: currVertexFormat,
68
68
  stRotation: stRotation
69
69
  }, style));
70
- if (materialAppearance) {
70
+ if (materialAppearance && !style.extrudedHeight) {
71
71
  geometry = Cesium.PolygonGeometry.createGeometry(polygonGeometry);
72
72
  geometry.attributes.st = new Cesium.GeometryAttribute({
73
73
  componentDatatype: Cesium.ComponentDatatype.FLOAT,
package/dist/esm/index.js CHANGED
@@ -51,7 +51,7 @@ loadCss(Cesium.buildModuleUrl('Widgets/widgets.css'));
51
51
  export var DeepTwinsEngine3D = /*#__PURE__*/_createClass(function DeepTwinsEngine3D() {
52
52
  _classCallCheck(this, DeepTwinsEngine3D);
53
53
  });
54
- _defineProperty(DeepTwinsEngine3D, "Version", "0.1.29");
54
+ _defineProperty(DeepTwinsEngine3D, "Version", "0.1.31");
55
55
  _defineProperty(DeepTwinsEngine3D, "Map", Map);
56
56
  _defineProperty(DeepTwinsEngine3D, "GroundSkyBox", GroundSkyBox);
57
57
  _defineProperty(DeepTwinsEngine3D, "RasterLayer", RasterLayer);
@@ -11,7 +11,7 @@ export default class BaseVideo {
11
11
  hls: any;
12
12
  private onErrorFun;
13
13
  private _maskImage;
14
- constructor(options: any);
14
+ constructor(map: any, options: any);
15
15
  getMap(): any;
16
16
  _canOperate(): boolean;
17
17
  private _init;
@@ -14,7 +14,7 @@ import * as utils from "../tool/utils";
14
14
 
15
15
  // 视频
16
16
  var BaseVideo = /*#__PURE__*/function () {
17
- function BaseVideo(options) {
17
+ function BaseVideo(map, options) {
18
18
  _classCallCheck(this, BaseVideo);
19
19
  _defineProperty(this, "_mapContext", void 0);
20
20
  _defineProperty(this, "options", void 0);
@@ -28,6 +28,7 @@ var BaseVideo = /*#__PURE__*/function () {
28
28
  _defineProperty(this, "onErrorFun", void 0);
29
29
  _defineProperty(this, "_maskImage", null);
30
30
  this.options = options;
31
+ this._mapContext = map._mapContext;
31
32
  if (options.video) {
32
33
  this.videoType = 'video';
33
34
  }
@@ -3,7 +3,7 @@ export default class VideoProject extends BaseVideo {
3
3
  type: 'fixed' | 'projection';
4
4
  frustum: any;
5
5
  frustumLineLayer: any;
6
- constructor(options: any);
6
+ constructor(map: any, options: any);
7
7
  addToMap(map: any): void;
8
8
  show(isShow: boolean): void;
9
9
  private _drawLine;
@@ -25,10 +25,10 @@ import BaseVideo from "./BaseVideo";
25
25
  var VideoProject = /*#__PURE__*/function (_BaseVideo) {
26
26
  _inherits(VideoProject, _BaseVideo);
27
27
  var _super = _createSuper(VideoProject);
28
- function VideoProject(options) {
28
+ function VideoProject(map, options) {
29
29
  var _this;
30
30
  _classCallCheck(this, VideoProject);
31
- _this = _super.call(this, options);
31
+ _this = _super.call(this, map, options);
32
32
  _defineProperty(_assertThisInitialized(_this), "type", 'fixed');
33
33
  _defineProperty(_assertThisInitialized(_this), "frustum", void 0);
34
34
  _defineProperty(_assertThisInitialized(_this), "frustumLineLayer", void 0);
@@ -41,7 +41,6 @@ var VideoProject = /*#__PURE__*/function (_BaseVideo) {
41
41
  if (!this._canOperate()) {
42
42
  return;
43
43
  }
44
- this._mapContext = map._mapContext;
45
44
  var videoOptions;
46
45
  if (this.videoType === 'video') {
47
46
  this.options.video.autoPlay && this.play();
@@ -1,5 +1,5 @@
1
1
  import BaseVideo from './BaseVideo';
2
2
  export default class VideoTexture extends BaseVideo {
3
- constructor(options: any);
3
+ constructor(map: any, options: any);
4
4
  addToMap(map: any): void;
5
5
  }
@@ -26,9 +26,9 @@ import BaseVideo from "./BaseVideo";
26
26
  var VideoTexture = /*#__PURE__*/function (_BaseVideo) {
27
27
  _inherits(VideoTexture, _BaseVideo);
28
28
  var _super = _createSuper(VideoTexture);
29
- function VideoTexture(options) {
29
+ function VideoTexture(map, options) {
30
30
  _classCallCheck(this, VideoTexture);
31
- return _super.call(this, options);
31
+ return _super.call(this, map, options);
32
32
  }
33
33
  _createClass(VideoTexture, [{
34
34
  key: "addToMap",
@@ -37,7 +37,6 @@ var VideoTexture = /*#__PURE__*/function (_BaseVideo) {
37
37
  if (!this._canOperate()) {
38
38
  return;
39
39
  }
40
- this._mapContext = map._mapContext;
41
40
  var videoOptions;
42
41
  if (this.videoType === 'video') {
43
42
  this.options.video.autoPlay && this.play();
@@ -1,4 +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
+ 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; }
3
+ 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; }
2
4
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
5
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
6
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -80,7 +82,6 @@ var Airspace = /*#__PURE__*/function () {
80
82
  new BoxPrimitiveInstance({
81
83
  positions: source[i].positions,
82
84
  style: {
83
- show: this._isShow,
84
85
  color: source[i].properties.color,
85
86
  dimensions: this.options.dimensions,
86
87
  scale: this.options.scale
@@ -89,7 +90,9 @@ var Airspace = /*#__PURE__*/function () {
89
90
  });
90
91
  }
91
92
  boxPrimitive.createPrimitive({
92
- style: this.options
93
+ style: _objectSpread(_objectSpread({}, this.options), {}, {
94
+ show: this._isShow
95
+ })
93
96
  }, primitiveInstance);
94
97
  this.getMap().scene.primitives.add(boxPrimitive.primitive);
95
98
  }
@@ -15,6 +15,7 @@ export default class BaseHeatmap {
15
15
  heatmapEntity: any;
16
16
  heatmapPrimitive: any;
17
17
  constructor(options?: any);
18
+ _init(): void;
18
19
  _canOperate(): boolean;
19
20
  getMap(): any;
20
21
  flyTo(options: any): void;
@@ -19,7 +19,6 @@ import h337 from "../tool/heatmap.js";
19
19
  import * as utils from "../tool/utils";
20
20
  var BaseHeatmap = /*#__PURE__*/function () {
21
21
  function BaseHeatmap() {
22
- var _this$getMap;
23
22
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
24
23
  _classCallCheck(this, BaseHeatmap);
25
24
  _defineProperty(this, "_mapContext", void 0);
@@ -40,26 +39,31 @@ var BaseHeatmap = /*#__PURE__*/function () {
40
39
  _options$style = options.style,
41
40
  style = _options$style === void 0 ? {} : _options$style;
42
41
  this.id = uuidv4();
43
- this.style = merge(constant.DEFAULT_HEATMAP_STYLE(), cloneDeep(style));
44
- var el = document.createElement('div');
45
- el.id = this.id;
46
- el.style.cssText = 'width: 100%; height: 100%; pointer-events: none; overflow: hidden; opacity: 0;';
47
- var heatmapContainer = (_this$getMap = this.getMap()) === null || _this$getMap === void 0 || (_this$getMap = _this$getMap.container) === null || _this$getMap === void 0 ? void 0 : _this$getMap.querySelector('#' + constant.HEATMAP_CONTAINER_ID);
48
- if (!heatmapContainer) {
49
- return;
50
- }
51
- heatmapContainer.appendChild(el);
52
- this.heatmapInstance = h337.create(_objectSpread({
53
- container: el
54
- }, this.style));
55
- this.canvasW = this.heatmapInstance._renderer.canvas.width;
56
- this.canvasH = this.heatmapInstance._renderer.canvas.height;
57
42
  this.positions = positions;
58
- this._translatePositions();
43
+ this.style = merge(constant.DEFAULT_HEATMAP_STYLE(), cloneDeep(style));
59
44
  }
60
-
61
- // 是否能进行操作
62
45
  _createClass(BaseHeatmap, [{
46
+ key: "_init",
47
+ value: function _init() {
48
+ var _this$getMap;
49
+ var el = document.createElement('div');
50
+ el.id = this.id;
51
+ el.style.cssText = 'width: 100%; height: 100%; pointer-events: none; overflow: hidden; opacity: 0;';
52
+ var heatmapContainer = (_this$getMap = this.getMap()) === null || _this$getMap === void 0 || (_this$getMap = _this$getMap.container) === null || _this$getMap === void 0 ? void 0 : _this$getMap.querySelector('#' + constant.HEATMAP_CONTAINER_ID);
53
+ if (!heatmapContainer) {
54
+ return;
55
+ }
56
+ heatmapContainer.appendChild(el);
57
+ this.heatmapInstance = h337.create(_objectSpread({
58
+ container: el
59
+ }, this.style));
60
+ this.canvasW = this.heatmapInstance._renderer.canvas.width;
61
+ this.canvasH = this.heatmapInstance._renderer.canvas.height;
62
+ this._translatePositions();
63
+ }
64
+
65
+ // 是否能进行操作
66
+ }, {
63
67
  key: "_canOperate",
64
68
  value: function _canOperate() {
65
69
  if (this.isDestroyed) {
@@ -36,6 +36,7 @@ var Heatmap2d = /*#__PURE__*/function (_BaseHeatmap) {
36
36
  return;
37
37
  }
38
38
  this._mapContext = map._mapContext;
39
+ this._init();
39
40
  if (!this.boundBox) return;
40
41
  var _this$style = this.style,
41
42
  min = _this$style.min,
@@ -36,6 +36,7 @@ var Heatmap3d = /*#__PURE__*/function (_BaseHeatmap) {
36
36
  return;
37
37
  }
38
38
  this._mapContext = map._mapContext;
39
+ this._init();
39
40
  if (!this.boundBox) return;
40
41
  var _this$style = this.style,
41
42
  min = _this$style.min,