deeptwins-engine-3d 0.1.36 → 0.1.38

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.
@@ -146,6 +146,7 @@ export declare const DEFAULT_SUN_ANALYSIS_OPTIONS: () => {
146
146
  clockRange: Cesium.ClockRange;
147
147
  clockStep: Cesium.ClockStep;
148
148
  };
149
+ export declare const DEFAULT_VIEWSHED_ANALYSIS_OPTIONS: () => {};
149
150
  export declare const DEFAULT_BASE_LAYER_TYPE: any;
150
151
  export declare const DEFAULT_BASE_LAYER: any;
151
152
  export declare const LAYER_TYPE_TO_CLASS: any;
@@ -233,6 +233,11 @@ export var DEFAULT_SUN_ANALYSIS_OPTIONS = function DEFAULT_SUN_ANALYSIS_OPTIONS(
233
233
  };
234
234
  };
235
235
 
236
+ // 默认可视域分析
237
+ export var DEFAULT_VIEWSHED_ANALYSIS_OPTIONS = function DEFAULT_VIEWSHED_ANALYSIS_OPTIONS() {
238
+ return {};
239
+ };
240
+
236
241
  // 默认的底图类型
237
242
  export var DEFAULT_BASE_LAYER_TYPE = {
238
243
  GAO_DE_IMG: 'gd_img',
@@ -4,36 +4,59 @@
4
4
 
5
5
  .deeptwins-compass {
6
6
  position: relative;
7
- width: 92px;
8
- height: 92px;
9
- background: #f7f7f7;
7
+ width: 90px;
8
+ height: 90px;
10
9
  border-radius: 50%;
11
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
10
+ box-shadow: 0 0 16px 0 rgba(48, 113, 144, 0.40);
12
11
  display: flex;
13
12
  align-items: center;
13
+ justify-content: center;
14
14
  user-select: none;
15
15
  }
16
16
 
17
+ .deeptwins-compass-bg {
18
+ position: absolute;
19
+ left: 0;
20
+ top: 0;
21
+ width: 100%;
22
+ height: 100%;
23
+ z-index: -1;
24
+ }
25
+
17
26
  .deeptwins-compass-left-direction {
18
27
  cursor: pointer;
28
+ width: 8px;
29
+ height: 32.5px;
30
+ }
31
+
32
+ .deeptwins-compass-pointer {
33
+ width: 44px;
34
+ height: 44px;
35
+ margin: 0 4px;
19
36
  }
20
37
 
21
38
  .deeptwins-compass-right-direction {
22
39
  cursor: pointer;
40
+ width: 8px;
41
+ height: 32.5px;
23
42
  }
24
43
 
25
44
  .deeptwins-compass-pitch-up {
26
45
  cursor: pointer;
27
46
  position: absolute;
28
- top: 3px;
47
+ top: 10px;
29
48
  left: 50%;
30
49
  transform: translateX(-50%);
50
+ width: 9px;
51
+ height: 5.5px;
31
52
  }
32
53
 
33
54
  .deeptwins-compass-pitch-down {
34
55
  cursor: pointer;
35
56
  position: absolute;
36
- bottom: 3px;
57
+ bottom: 10px;
37
58
  left: 50%;
38
59
  transform: translateX(-50%);
60
+ width: 9px;
61
+ height: 5.5px;
39
62
  }
@@ -119,13 +119,21 @@ var BaseLayer = /*#__PURE__*/function () {
119
119
  _this2.primitiveCollection = new BoxPrimitive(_this2._mapContext);
120
120
  },
121
121
  billboardP: function billboardP() {
122
- _this2.primitiveCollection = new Cesium.BillboardCollection();
122
+ var _this2$_mapContext;
123
+ var scene = (_this2$_mapContext = _this2._mapContext) === null || _this2$_mapContext === void 0 || (_this2$_mapContext = _this2$_mapContext.getMap()) === null || _this2$_mapContext === void 0 ? void 0 : _this2$_mapContext.scene;
124
+ _this2.primitiveCollection = new Cesium.BillboardCollection({
125
+ scene: scene
126
+ });
123
127
  },
124
128
  modelP: function modelP() {
125
129
  _this2.primitiveCollection = new ModelPrimitive(_this2._mapContext);
126
130
  },
127
131
  labelP: function labelP() {
128
- _this2.primitiveCollection = new Cesium.LabelCollection();
132
+ var _this2$_mapContext2;
133
+ var scene = (_this2$_mapContext2 = _this2._mapContext) === null || _this2$_mapContext2 === void 0 || (_this2$_mapContext2 = _this2$_mapContext2.getMap()) === null || _this2$_mapContext2 === void 0 ? void 0 : _this2$_mapContext2.scene;
134
+ _this2.primitiveCollection = new Cesium.LabelCollection({
135
+ scene: scene
136
+ });
129
137
  },
130
138
  wallP: function wallP() {
131
139
  _this2.primitiveCollection = new WallPrimitive(_this2._mapContext);
@@ -63,5 +63,6 @@ export declare class DeepTwinsEngine3D {
63
63
  static SubmergenceAnalysis: any;
64
64
  static SunLightAnalysis: any;
65
65
  static KmlDataSource: any;
66
+ static Compass: any;
66
67
  }
67
68
  export default DeepTwinsEngine3D;
package/dist/esm/index.js CHANGED
@@ -34,6 +34,7 @@ import ArcGisLayer from "./tileLayer/ArcGisLayer";
34
34
  import RasterLayer from "./tileLayer/RasterLayer";
35
35
  import WmsLayer from "./tileLayer/WmsLayer";
36
36
  import WmtsLayer from "./tileLayer/WmtsLayer";
37
+ import Compass from "./tool/Compass";
37
38
  import TimerInterval from "./tool/TimerInterval";
38
39
  import { ClampToGround, ShapeSection } from "./tool/common";
39
40
  import { loadCss } from "./tool/utils";
@@ -51,11 +52,11 @@ DEEP_TWINS_BASE_URL && (window.CESIUM_BASE_URL = DEEP_TWINS_BASE_URL);
51
52
  // 全局加载css
52
53
  loadCss(Cesium.buildModuleUrl('Widgets/widgets.css'));
53
54
  // 打印版本信息
54
- console.log('DeepTwinsEngine3D Version:', "0.1.36");
55
+ console.log('DeepTwinsEngine3D Version:', "0.1.38");
55
56
  export var DeepTwinsEngine3D = /*#__PURE__*/_createClass(function DeepTwinsEngine3D() {
56
57
  _classCallCheck(this, DeepTwinsEngine3D);
57
58
  });
58
- _defineProperty(DeepTwinsEngine3D, "Version", "0.1.36");
59
+ _defineProperty(DeepTwinsEngine3D, "Version", "0.1.38");
59
60
  _defineProperty(DeepTwinsEngine3D, "Map", Map);
60
61
  _defineProperty(DeepTwinsEngine3D, "GroundSkyBox", GroundSkyBox);
61
62
  _defineProperty(DeepTwinsEngine3D, "RasterLayer", RasterLayer);
@@ -118,4 +119,5 @@ _defineProperty(DeepTwinsEngine3D, "ImageGlowingMaterialProperty", ImageGlowingM
118
119
  _defineProperty(DeepTwinsEngine3D, "SubmergenceAnalysis", SubmergenceAnalysis);
119
120
  _defineProperty(DeepTwinsEngine3D, "SunLightAnalysis", SunLightAnalysis);
120
121
  _defineProperty(DeepTwinsEngine3D, "KmlDataSource", Cesium.KmlDataSource);
122
+ _defineProperty(DeepTwinsEngine3D, "Compass", Compass);
121
123
  export default DeepTwinsEngine3D;
@@ -59,6 +59,10 @@ var Compass = /*#__PURE__*/function () {
59
59
  }
60
60
  var el = document.createElement('div');
61
61
  el.className = 'deeptwins-compass';
62
+ var bg = document.createElement('img');
63
+ bg.className = 'deeptwins-compass-bg';
64
+ bg.src = getDeepTwinsFile('Image/compass/compass-bg.png');
65
+ el.appendChild(bg);
62
66
  var leftDirection = document.createElement('img');
63
67
  leftDirection.className = 'deeptwins-compass-left-direction';
64
68
  leftDirection.src = getDeepTwinsFile('Image/compass/compass-direction-left.png');
@@ -77,7 +81,7 @@ var Compass = /*#__PURE__*/function () {
77
81
  this.compassEl.leftDirection = leftDirection;
78
82
  var pointer = document.createElement('img');
79
83
  pointer.className = 'deeptwins-compass-pointer';
80
- pointer.src = getDeepTwinsFile('Image/compass/pointer-white.png');
84
+ pointer.src = getDeepTwinsFile('Image/compass/compass-pointer.png');
81
85
  el.appendChild(pointer);
82
86
  this.compassEl.pointer = pointer;
83
87
  var rightDirection = document.createElement('img');
@@ -153,6 +157,7 @@ var Compass = /*#__PURE__*/function () {
153
157
  duration: 0,
154
158
  angle: direction * 2 // 每次旋转2度
155
159
  });
160
+ _this3._updateDirection(_this3.getMap().getCameraView());
156
161
  // 设置下次旋转
157
162
  _this3._rotateTimer = setTimeout(rotate, 16); // 约60fps
158
163
  };
@@ -1 +1 @@
1
- .deepTwins-toolTip{background:rgba(42,42,42,.9);border-radius:4px;color:#fff;display:none;font-size:12px;padding:4px 8px;pointer-events:none;position:absolute;transform:translate3d(10px,-50%,0);white-space:nowrap}.deepTwins-toolTip:before{border-bottom:5px solid transparent;border-right:5px solid rgba(0,0,0,.6);border-top:5px solid transparent;content:"";display:block;left:-5px;pointer-events:none;position:absolute;top:calc(50% - 5px)}#yunjinglogo{display:none}.deeptwins-compass{align-items:center;background:#f7f7f7;border-radius:50%;box-shadow:0 0 10px rgba(0,0,0,.3);display:flex;height:92px;position:relative;-ms-user-select:none;user-select:none;width:92px}.deeptwins-compass-left-direction,.deeptwins-compass-right-direction{cursor:pointer}.deeptwins-compass-pitch-up{top:3px}.deeptwins-compass-pitch-down,.deeptwins-compass-pitch-up{cursor:pointer;left:50%;position:absolute;transform:translateX(-50%)}.deeptwins-compass-pitch-down{bottom:3px}
1
+ .deepTwins-toolTip{background:rgba(42,42,42,.9);border-radius:4px;color:#fff;display:none;font-size:12px;padding:4px 8px;pointer-events:none;position:absolute;transform:translate3d(10px,-50%,0);white-space:nowrap}.deepTwins-toolTip:before{border-bottom:5px solid transparent;border-right:5px solid rgba(0,0,0,.6);border-top:5px solid transparent;content:"";display:block;left:-5px;pointer-events:none;position:absolute;top:calc(50% - 5px)}#yunjinglogo{display:none}.deeptwins-compass{align-items:center;border-radius:50%;box-shadow:0 0 16px 0 rgba(48,113,144,.4);display:flex;height:90px;justify-content:center;position:relative;-ms-user-select:none;user-select:none;width:90px}.deeptwins-compass-bg{height:100%;left:0;position:absolute;top:0;width:100%;z-index:-1}.deeptwins-compass-left-direction{cursor:pointer;height:32.5px;width:8px}.deeptwins-compass-pointer{height:44px;margin:0 4px;width:44px}.deeptwins-compass-right-direction{cursor:pointer;height:32.5px;width:8px}.deeptwins-compass-pitch-up{top:10px}.deeptwins-compass-pitch-down,.deeptwins-compass-pitch-up{cursor:pointer;height:5.5px;left:50%;position:absolute;transform:translateX(-50%);width:9px}.deeptwins-compass-pitch-down{bottom:10px}