deeptwins-engine-3d 0.0.42 → 0.0.44
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/cameraControl/ModelRoamHistory.d.ts +11 -3
- package/dist/cameraControl/ModelRoamHistory.js +101 -27
- package/dist/cameraControl/ModelRoamRealTime.d.ts +23 -47
- package/dist/cameraControl/ModelRoamRealTime.js +210 -374
- package/dist/constant.d.ts +6 -1
- package/dist/constant.js +38 -20
- package/dist/deepTwins/index.d.ts +0 -3
- package/dist/deepTwins/index.js +2 -18
- package/dist/drawer/base.js +1 -1
- package/dist/drawer/index.js +1 -1
- package/dist/graphicLayer/BaseLayer.d.ts +1 -1
- package/dist/graphicLayer/BaseLayer.js +1 -1
- package/dist/graphicLayer/BaseSource.d.ts +1 -1
- package/dist/graphicLayer/BaseSource.js +4 -6
- package/dist/graphicLayer/GraphicLayerCollection.d.ts +3 -2
- package/dist/graphicLayer/GraphicLayerCollection.js +33 -40
- package/dist/graphicLayer/PolylinePrimitiveInstance.js +2 -6
- package/dist/index.d.ts +0 -2
- package/dist/index.js +1 -5
- package/dist/map/Map.d.ts +1 -1
- package/dist/map/Map.js +12 -6
- package/dist/material/BaseMaterialProperty.d.ts +12 -0
- package/dist/material/BaseMaterialProperty.js +51 -0
- package/dist/material/CircleWaveMaterialProperty.d.ts +6 -14
- package/dist/material/CircleWaveMaterialProperty.js +63 -71
- package/dist/material/DynamicWallMaterialProperty.d.ts +6 -42
- package/dist/material/DynamicWallMaterialProperty.js +61 -123
- package/dist/material/PolylineTrailLinkMaterialProperty.d.ts +6 -16
- package/dist/material/PolylineTrailLinkMaterialProperty.js +59 -65
- package/dist/material/WeatherEffects.js +6 -6
- package/dist/material/shader/CircleWaveShader.glsl +32 -0
- package/dist/material/shader/DynamicWallShader.glsl +35 -0
- package/dist/material/shader/FogShader.glsl +48 -0
- package/dist/material/shader/PolylineTrailLinkShader.glsl +9 -0
- package/dist/material/shader/RainShader.glsl +28 -0
- package/dist/material/shader/SnowShader.glsl +48 -0
- package/dist/typings.d.ts +4 -0
- package/package.json +5 -3
- package/dist/cameraControl/ModelRoamRunTime.d.ts +0 -32
- package/dist/cameraControl/ModelRoamRunTime.js +0 -244
- package/dist/material/ImageMaterial.d.ts +0 -4
- package/dist/material/ImageMaterial.js +0 -35
package/dist/constant.d.ts
CHANGED
|
@@ -36,6 +36,9 @@ export declare const DEFAULT_VIEW_CONFIG: () => {
|
|
|
36
36
|
fog: boolean;
|
|
37
37
|
skyAtmosphere: boolean;
|
|
38
38
|
requestRenderMode: boolean;
|
|
39
|
+
postProcessStages: {
|
|
40
|
+
fxaa: boolean;
|
|
41
|
+
};
|
|
39
42
|
};
|
|
40
43
|
globe: {
|
|
41
44
|
show: boolean;
|
|
@@ -111,9 +114,11 @@ export declare const DEFAULT_BASE_LAYER_TYPE: any;
|
|
|
111
114
|
export declare const DEFAULT_BASE_LAYER: any;
|
|
112
115
|
export declare const LAYER_TYPE_TO_CLASS: any;
|
|
113
116
|
export declare const DEFAULT_SKY_BOX: any;
|
|
117
|
+
export declare const DEFAULT_POLYLINE_TRAIL_LINK_MATERIAL_STYLE: any;
|
|
118
|
+
export declare const DEFAULT_DYNAMIC_WALL_MATERIAL_STYLE: any;
|
|
119
|
+
export declare const DEFAULT_CIRCLE_WAVE_MATERIAL_STYLE: any;
|
|
114
120
|
export declare const GRAPHIC_LAYER_TYPE_TO_CLASS: any;
|
|
115
121
|
export declare const DEFAULT_YJ_LAYER: any;
|
|
116
|
-
export declare const DEFAULT_YJ_PICK: any;
|
|
117
122
|
export declare const DEFAULT_SNOW: () => {
|
|
118
123
|
size: number;
|
|
119
124
|
speed: number;
|
package/dist/constant.js
CHANGED
|
@@ -66,7 +66,10 @@ export var DEFAULT_VIEW_CONFIG = function DEFAULT_VIEW_CONFIG() {
|
|
|
66
66
|
showSkyBox: true,
|
|
67
67
|
fog: true,
|
|
68
68
|
skyAtmosphere: true,
|
|
69
|
-
requestRenderMode: false
|
|
69
|
+
requestRenderMode: false,
|
|
70
|
+
postProcessStages: {
|
|
71
|
+
fxaa: false
|
|
72
|
+
}
|
|
70
73
|
},
|
|
71
74
|
globe: {
|
|
72
75
|
show: true,
|
|
@@ -343,6 +346,40 @@ export var DEFAULT_SKY_BOX = {
|
|
|
343
346
|
}
|
|
344
347
|
};
|
|
345
348
|
|
|
349
|
+
// 流动线材质默认的配置
|
|
350
|
+
export var DEFAULT_POLYLINE_TRAIL_LINK_MATERIAL_STYLE = function DEFAULT_POLYLINE_TRAIL_LINK_MATERIAL_STYLE() {
|
|
351
|
+
return {
|
|
352
|
+
color: Cesium.Color.BLUE,
|
|
353
|
+
mixRatio: 0.5,
|
|
354
|
+
duration: 2,
|
|
355
|
+
count: 3,
|
|
356
|
+
image: utils.getDeepTwinsFile('Image/line.png')
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
// 动态墙材质默认的配置
|
|
361
|
+
export var DEFAULT_DYNAMIC_WALL_MATERIAL_STYLE = function DEFAULT_DYNAMIC_WALL_MATERIAL_STYLE() {
|
|
362
|
+
return {
|
|
363
|
+
color: Cesium.Color.BLUE,
|
|
364
|
+
mixRatio: 0.5,
|
|
365
|
+
duration: 2,
|
|
366
|
+
direction: '-',
|
|
367
|
+
freely: 'vertical',
|
|
368
|
+
count: 3,
|
|
369
|
+
image: utils.getDeepTwinsFile('Image/wall.png')
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
// 动态墙材质默认的配置
|
|
374
|
+
export var DEFAULT_CIRCLE_WAVE_MATERIAL_STYLE = function DEFAULT_CIRCLE_WAVE_MATERIAL_STYLE() {
|
|
375
|
+
return {
|
|
376
|
+
color: Cesium.Color.BLUE,
|
|
377
|
+
duration: 2,
|
|
378
|
+
count: 3,
|
|
379
|
+
gradient: 0.1
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
|
|
346
383
|
// 矢量图层类型对应的处理函数
|
|
347
384
|
export var GRAPHIC_LAYER_TYPE_TO_CLASS = {
|
|
348
385
|
point: PointEntity,
|
|
@@ -375,7 +412,6 @@ export var DEFAULT_YJ_LAYER = function DEFAULT_YJ_LAYER() {
|
|
|
375
412
|
return {
|
|
376
413
|
url: 'https://deepinnet-public-qz.oss-cn-hangzhou.aliyuncs.com/quzhou/tileset02.json',
|
|
377
414
|
depthTest: true,
|
|
378
|
-
// needSegment: true,
|
|
379
415
|
filter: {
|
|
380
416
|
saturate: 1,
|
|
381
417
|
brightness: 1
|
|
@@ -383,24 +419,6 @@ export var DEFAULT_YJ_LAYER = function DEFAULT_YJ_LAYER() {
|
|
|
383
419
|
};
|
|
384
420
|
};
|
|
385
421
|
|
|
386
|
-
// 默认的yunjing图层配置
|
|
387
|
-
export var DEFAULT_YJ_PICK = function DEFAULT_YJ_PICK() {
|
|
388
|
-
return {
|
|
389
|
-
inPointStyle: {
|
|
390
|
-
borderWidth: 4
|
|
391
|
-
},
|
|
392
|
-
polygonStyle: {
|
|
393
|
-
color: 'rgba(255, 0, 0, 0.4)'
|
|
394
|
-
},
|
|
395
|
-
model: {
|
|
396
|
-
wasmPaths: 'https://amappc.oss-cn-zhangjiakou.aliyuncs.com/gis/static/yunjing/static/onnx/',
|
|
397
|
-
encoderUrl: 'https://amappc.oss-cn-zhangjiakou.aliyuncs.com/gis/static/yunjing/static/onnx/sam_vit_b_01ec64.encoder-fp16.onnx',
|
|
398
|
-
decoderUrl: 'https://amappc.oss-cn-zhangjiakou.aliyuncs.com/gis/static/yunjing/static/onnx/sam_vit_b_01ec64.decoder.onnx',
|
|
399
|
-
name: 'test'
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
};
|
|
403
|
-
|
|
404
422
|
// 默认雪天配置
|
|
405
423
|
export var DEFAULT_SNOW = function DEFAULT_SNOW() {
|
|
406
424
|
return {
|
package/dist/deepTwins/index.js
CHANGED
|
@@ -9,7 +9,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
9
9
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
10
10
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
11
|
import { merge } from 'lodash';
|
|
12
|
-
import { DEFAULT_YJ_LAYER
|
|
12
|
+
import { DEFAULT_YJ_LAYER } from "../constant";
|
|
13
13
|
import * as utils from "../tool/utils";
|
|
14
14
|
var DeepTwins = /*#__PURE__*/function () {
|
|
15
15
|
function DeepTwins() {
|
|
@@ -39,8 +39,7 @@ var DeepTwins = /*#__PURE__*/function () {
|
|
|
39
39
|
terrain: this._getTerrain.bind(this),
|
|
40
40
|
moduleLayer: this._getModuleLayer.bind(this),
|
|
41
41
|
trafficHistoryLayer: this._YunJing.TrafficHistoryLayer,
|
|
42
|
-
trafficLayer: this._YunJing.TrafficLayer
|
|
43
|
-
singlePick: this._getSinglePick.bind(this)
|
|
42
|
+
trafficLayer: this._YunJing.TrafficLayer
|
|
44
43
|
});
|
|
45
44
|
}
|
|
46
45
|
case 5:
|
|
@@ -97,21 +96,6 @@ var DeepTwins = /*#__PURE__*/function () {
|
|
|
97
96
|
}
|
|
98
97
|
};
|
|
99
98
|
}
|
|
100
|
-
|
|
101
|
-
// 单体拾取
|
|
102
|
-
}, {
|
|
103
|
-
key: "_getSinglePick",
|
|
104
|
-
value: function _getSinglePick(options) {
|
|
105
|
-
var _this2 = this;
|
|
106
|
-
var mergeOptions = merge(DEFAULT_YJ_PICK(), options);
|
|
107
|
-
return {
|
|
108
|
-
addToMap: function addToMap(map, layer) {
|
|
109
|
-
mergeOptions.viewer = map;
|
|
110
|
-
mergeOptions.layer = layer;
|
|
111
|
-
return new _this2._YunJing.SinglePick(mergeOptions);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
99
|
}]);
|
|
116
100
|
return DeepTwins;
|
|
117
101
|
}();
|
package/dist/drawer/base.js
CHANGED
|
@@ -105,7 +105,7 @@ var BasicGraphics = /*#__PURE__*/function () {
|
|
|
105
105
|
data = this.result.position;
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
|
-
this.result = this.painter._viewer.
|
|
108
|
+
this.result = this.painter._viewer.addCustomSourceToGraphicLayer(data, {
|
|
109
109
|
type: this.painter._type,
|
|
110
110
|
id: this.result.id,
|
|
111
111
|
entity: this.result
|
package/dist/drawer/index.js
CHANGED
|
@@ -244,7 +244,7 @@ var Drawer = /*#__PURE__*/function () {
|
|
|
244
244
|
// 如果是点,则此时执行点的结束绘制操作
|
|
245
245
|
if (_this._type === 'point') {
|
|
246
246
|
var _this$$Instance;
|
|
247
|
-
_this._typeClass.result = _this._viewer.
|
|
247
|
+
_this._typeClass.result = _this._viewer.addCustomSourceToGraphicLayer(_this._typeClass.result.position, {
|
|
248
248
|
type: _this._type,
|
|
249
249
|
id: _this._typeClass.result.id,
|
|
250
250
|
entity: _this._typeClass.result
|
|
@@ -9,7 +9,7 @@ export default class BaseLayer {
|
|
|
9
9
|
isEntity: boolean;
|
|
10
10
|
isPrimitive: boolean;
|
|
11
11
|
private _isCompleteInfo;
|
|
12
|
-
private _renderClass;
|
|
12
|
+
private readonly _renderClass;
|
|
13
13
|
private _graphicLayerCollection;
|
|
14
14
|
constructor({ id, source, options, entity, graphicLayerCollection }: any);
|
|
15
15
|
private _createPrimitiveCollection;
|
|
@@ -13,6 +13,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
13
13
|
import * as constant from "../constant";
|
|
14
14
|
import BaseSource from "../graphicLayer/BaseSource";
|
|
15
15
|
import * as utils from "../tool/utils";
|
|
16
|
+
import { cameraFlyToPositions } from "../tool/utils";
|
|
16
17
|
import BoxPrimitive from "./BoxPrimitive";
|
|
17
18
|
import EllipsePrimitive from "./EllipsePrimitive";
|
|
18
19
|
import EllipsoidPrimitive from "./EllipsoidPrimitive";
|
|
@@ -21,7 +22,6 @@ import PolygonPrimitive from "./PolygonPrimitive";
|
|
|
21
22
|
import PolylinePrimitive from "./PolylinePrimitive";
|
|
22
23
|
import PolylineVolumePrimitive from "./PolylineVolumePrimitive";
|
|
23
24
|
import WallPrimitive from "./WallPrimitive";
|
|
24
|
-
import { cameraFlyToPositions } from "../tool/utils";
|
|
25
25
|
var BaseLayer = /*#__PURE__*/function () {
|
|
26
26
|
function BaseLayer(_ref) {
|
|
27
27
|
var _this = this;
|
|
@@ -7,7 +7,7 @@ export default class BaseSource {
|
|
|
7
7
|
private _graphicLayerCollection;
|
|
8
8
|
static HANDLE_FEATURE_TYPE_FUN: any;
|
|
9
9
|
static HANDLE_FEATURE_CLAMP_TYPE_FUN: any;
|
|
10
|
-
constructor({ id, source,
|
|
10
|
+
constructor({ id, source, customSource, graphicLayerCollection }: any);
|
|
11
11
|
private _canOperate;
|
|
12
12
|
private _handleGeoJson;
|
|
13
13
|
translateSource(source: any): void;
|
|
@@ -30,7 +30,7 @@ var BaseSource = /*#__PURE__*/function () {
|
|
|
30
30
|
function BaseSource(_ref) {
|
|
31
31
|
var id = _ref.id,
|
|
32
32
|
source = _ref.source,
|
|
33
|
-
|
|
33
|
+
customSource = _ref.customSource,
|
|
34
34
|
graphicLayerCollection = _ref.graphicLayerCollection;
|
|
35
35
|
_classCallCheck(this, BaseSource);
|
|
36
36
|
_defineProperty(this, "id", void 0);
|
|
@@ -43,11 +43,9 @@ var BaseSource = /*#__PURE__*/function () {
|
|
|
43
43
|
this.id = id;
|
|
44
44
|
this._graphicLayerCollection = graphicLayerCollection;
|
|
45
45
|
// 直接添加实体数据
|
|
46
|
-
if (
|
|
46
|
+
if (customSource) {
|
|
47
47
|
this._isCompleteInfo = false;
|
|
48
|
-
this.source.push(
|
|
49
|
-
positions: entitySource
|
|
50
|
-
});
|
|
48
|
+
this.source.push(customSource);
|
|
51
49
|
} else {
|
|
52
50
|
this.translateSource(source);
|
|
53
51
|
}
|
|
@@ -236,7 +234,7 @@ var BaseSource = /*#__PURE__*/function () {
|
|
|
236
234
|
return features;
|
|
237
235
|
}
|
|
238
236
|
|
|
239
|
-
// 对geoJson
|
|
237
|
+
// 对geoJson数据进行贴地处理 返回带Cartesian3坐标数据的数组
|
|
240
238
|
}, {
|
|
241
239
|
key: "geoJsonToClampCartesian3Array",
|
|
242
240
|
value: function () {
|
|
@@ -8,9 +8,10 @@ export default class GraphicLayerCollection {
|
|
|
8
8
|
constructor(map: any);
|
|
9
9
|
private _canOperate;
|
|
10
10
|
addSource(id: string, geoJson: any): BaseSource;
|
|
11
|
-
|
|
11
|
+
addCustomSource(id: string, positions: any): BaseSource;
|
|
12
12
|
addLayer(data: any, options: any): BaseLayer;
|
|
13
|
-
|
|
13
|
+
addCustomSourceToLayer(positions: any, options: any): BaseLayer;
|
|
14
|
+
private _addLayerToMap;
|
|
14
15
|
private _removeGraphicMapLayer;
|
|
15
16
|
private _removeGraphicMapSource;
|
|
16
17
|
private _clearGraphicMapLayer;
|
|
@@ -11,7 +11,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
11
11
|
import { flattenDeep } from 'lodash';
|
|
12
12
|
import { v4 as uuidv4 } from 'uuid';
|
|
13
13
|
import * as utils from "../tool/utils";
|
|
14
|
-
import {
|
|
14
|
+
import { cameraFlyToPositions, isArray } from "../tool/utils";
|
|
15
15
|
import BaseLayer from "./BaseLayer";
|
|
16
16
|
import BaseSource from "./BaseSource";
|
|
17
17
|
var GraphicLayerCollection = /*#__PURE__*/function () {
|
|
@@ -54,10 +54,10 @@ var GraphicLayerCollection = /*#__PURE__*/function () {
|
|
|
54
54
|
return source;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
//
|
|
57
|
+
// 直接添加自定义数据
|
|
58
58
|
}, {
|
|
59
|
-
key: "
|
|
60
|
-
value: function
|
|
59
|
+
key: "addCustomSource",
|
|
60
|
+
value: function addCustomSource(id, positions) {
|
|
61
61
|
this._canOperate();
|
|
62
62
|
var uuid = id;
|
|
63
63
|
if (this.graphicSources.get(uuid)) {
|
|
@@ -66,7 +66,7 @@ var GraphicLayerCollection = /*#__PURE__*/function () {
|
|
|
66
66
|
}
|
|
67
67
|
var source = new BaseSource({
|
|
68
68
|
id: uuid,
|
|
69
|
-
|
|
69
|
+
customSource: positions,
|
|
70
70
|
graphicLayerCollection: this
|
|
71
71
|
});
|
|
72
72
|
this.graphicSources.set(source.id, source);
|
|
@@ -77,7 +77,6 @@ var GraphicLayerCollection = /*#__PURE__*/function () {
|
|
|
77
77
|
}, {
|
|
78
78
|
key: "addLayer",
|
|
79
79
|
value: function addLayer(data, options) {
|
|
80
|
-
var _this = this;
|
|
81
80
|
this._canOperate();
|
|
82
81
|
var _ref = options || {},
|
|
83
82
|
id = _ref.id;
|
|
@@ -103,39 +102,17 @@ var GraphicLayerCollection = /*#__PURE__*/function () {
|
|
|
103
102
|
graphicLayerCollection: this
|
|
104
103
|
});
|
|
105
104
|
// 添加到地图上
|
|
106
|
-
|
|
107
|
-
layer.layers.forEach(function (t) {
|
|
108
|
-
if (t.entity) {
|
|
109
|
-
_this._map.entities.add(t.entity);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
} else {
|
|
113
|
-
if (['pointP', 'billboardP', 'labelP'].includes(options.type)) {
|
|
114
|
-
this._map.scene.primitives.add(layer.primitiveCollection);
|
|
115
|
-
} else {
|
|
116
|
-
this._map.scene.primitives.add(layer.primitiveCollection.primitive);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
this.graphicLayers.set(layer.id, layer);
|
|
105
|
+
this._addLayerToMap(layer, options);
|
|
120
106
|
return layer;
|
|
121
107
|
}
|
|
122
108
|
|
|
123
|
-
//
|
|
109
|
+
// 添加图层自定义数据
|
|
124
110
|
}, {
|
|
125
|
-
key: "
|
|
126
|
-
value: function
|
|
127
|
-
var _this2 = this;
|
|
111
|
+
key: "addCustomSourceToLayer",
|
|
112
|
+
value: function addCustomSourceToLayer(positions, options) {
|
|
128
113
|
this._canOperate();
|
|
129
114
|
var uuid = uuidv4();
|
|
130
|
-
var source =
|
|
131
|
-
var sourceType = BaseSource.analysisSourceType(positions);
|
|
132
|
-
if (sourceType === 'sourceInstance') {
|
|
133
|
-
source = positions;
|
|
134
|
-
} else if (sourceType === 'sourceId') {
|
|
135
|
-
source = this.graphicSources.get(positions);
|
|
136
|
-
} else {
|
|
137
|
-
source = this.addEntitySource(uuid, positions);
|
|
138
|
-
}
|
|
115
|
+
var source = this.addCustomSource(uuid, positions);
|
|
139
116
|
// 生成graphicLayer
|
|
140
117
|
var layer = new BaseLayer({
|
|
141
118
|
id: uuid,
|
|
@@ -144,13 +121,29 @@ var GraphicLayerCollection = /*#__PURE__*/function () {
|
|
|
144
121
|
graphicLayerCollection: this
|
|
145
122
|
});
|
|
146
123
|
// 添加到地图上
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
124
|
+
this._addLayerToMap(layer, options);
|
|
125
|
+
return layer;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// 将layer添加到地图上
|
|
129
|
+
}, {
|
|
130
|
+
key: "_addLayerToMap",
|
|
131
|
+
value: function _addLayerToMap(layer, options) {
|
|
132
|
+
var _this = this;
|
|
133
|
+
if (layer.isEntity) {
|
|
134
|
+
layer.layers.forEach(function (t) {
|
|
135
|
+
if (t.entity) {
|
|
136
|
+
_this._map.entities.add(t.entity);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
} else {
|
|
140
|
+
if (['pointP', 'billboardP', 'labelP'].includes(options.type)) {
|
|
141
|
+
this._map.scene.primitives.add(layer.primitiveCollection);
|
|
142
|
+
} else {
|
|
143
|
+
this._map.scene.primitives.add(layer.primitiveCollection.primitive);
|
|
150
144
|
}
|
|
151
|
-
}
|
|
145
|
+
}
|
|
152
146
|
this.graphicLayers.set(layer.id, layer);
|
|
153
|
-
return layer;
|
|
154
147
|
}
|
|
155
148
|
|
|
156
149
|
// 删除graphicLayers上的数据
|
|
@@ -359,11 +352,11 @@ var GraphicLayerCollection = /*#__PURE__*/function () {
|
|
|
359
352
|
}, {
|
|
360
353
|
key: "flyToLayers",
|
|
361
354
|
value: function flyToLayers(layers, options) {
|
|
362
|
-
var
|
|
355
|
+
var _this2 = this;
|
|
363
356
|
this._canOperate();
|
|
364
357
|
if (isArray(layers)) {
|
|
365
358
|
var graphicLayers = layers.map(function (layer) {
|
|
366
|
-
return
|
|
359
|
+
return _this2.getLayer(layer);
|
|
367
360
|
});
|
|
368
361
|
var positions = flattenDeep(graphicLayers.map(function (t) {
|
|
369
362
|
return t.layers.map(function (p) {
|
|
@@ -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 = ["style"
|
|
2
|
+
var _excluded = ["style"],
|
|
3
3
|
_excluded2 = ["color"];
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
@@ -32,10 +32,7 @@ var PolylinePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
32
32
|
var _this;
|
|
33
33
|
_classCallCheck(this, PolylinePrimitiveInstance);
|
|
34
34
|
_this = _super.call(this, options);
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
36
35
|
var style = options.style,
|
|
37
|
-
source = options.source,
|
|
38
|
-
entity = options.entity,
|
|
39
36
|
currOptions = _objectWithoutProperties(options, _excluded);
|
|
40
37
|
var mergeStyle = merge(DEFAULT_POLYLINE_PRIMITIVE_OPTIONS(), cloneDeep(style || {}));
|
|
41
38
|
var currStyle = PolylinePrimitiveInstance.handleOptions(mergeStyle);
|
|
@@ -54,12 +51,11 @@ var PolylinePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
54
51
|
var _options$style = options.style,
|
|
55
52
|
color = _options$style.color,
|
|
56
53
|
width = _options$style.width,
|
|
57
|
-
positions = options.positions,
|
|
58
54
|
primitiveCollection = options.primitiveCollection;
|
|
59
55
|
this.instance = new Cesium.GeometryInstance({
|
|
60
56
|
id: this.id,
|
|
61
57
|
geometry: new Cesium.PolylineGeometry({
|
|
62
|
-
positions: positions,
|
|
58
|
+
positions: this.source.positions,
|
|
63
59
|
width: width,
|
|
64
60
|
vertexFormat: Cesium.PolylineMaterialAppearance.VERTEX_FORMAT
|
|
65
61
|
}),
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,6 @@ declare class DeepTwinsEngine3D {
|
|
|
16
16
|
static Roam: any;
|
|
17
17
|
static RotateInPlace: any;
|
|
18
18
|
static ModelRoamHistory: any;
|
|
19
|
-
static ModelRoamRunTime: any;
|
|
20
19
|
static ModelRoamRealTime: any;
|
|
21
20
|
static TimerInterval: any;
|
|
22
21
|
static ShapeSection: any;
|
|
@@ -25,7 +24,6 @@ declare class DeepTwinsEngine3D {
|
|
|
25
24
|
static CircleWaveMaterialProperty: any;
|
|
26
25
|
static PolylineTrailLinkMaterialProperty: any;
|
|
27
26
|
static ImageMaterialProperty: any;
|
|
28
|
-
static ImageMaterial: any;
|
|
29
27
|
static Heatmap2d: any;
|
|
30
28
|
static Heatmap3d: any;
|
|
31
29
|
static PointCluster: any;
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,6 @@ import * as Cesium from 'deeptwins-cesium';
|
|
|
10
10
|
import "./assets/Build/Map3d/Widgets/widgets.css";
|
|
11
11
|
import ModelRoamHistory from "./cameraControl/ModelRoamHistory";
|
|
12
12
|
import ModelRoamRealTime from "./cameraControl/ModelRoamRealTime";
|
|
13
|
-
import ModelRoamRunTime from "./cameraControl/ModelRoamRunTime";
|
|
14
13
|
import Roam from "./cameraControl/Roam";
|
|
15
14
|
import Rotate from "./cameraControl/Rotate";
|
|
16
15
|
import RotateInPlace from "./cameraControl/RotateInPlace";
|
|
@@ -22,7 +21,6 @@ import GroundSkyBox from "./map/GroundSkyBox";
|
|
|
22
21
|
import Map from "./map/Map";
|
|
23
22
|
import CircleWaveMaterialProperty from "./material/CircleWaveMaterialProperty";
|
|
24
23
|
import DynamicWallMaterialProperty from "./material/DynamicWallMaterialProperty";
|
|
25
|
-
import ImageMaterial from "./material/ImageMaterial";
|
|
26
24
|
import ImageMaterialProperty from "./material/ImageMaterialProperty";
|
|
27
25
|
import PolylineTrailLinkMaterialProperty from "./material/PolylineTrailLinkMaterialProperty";
|
|
28
26
|
import WeatherEffects from "./material/WeatherEffects";
|
|
@@ -46,7 +44,7 @@ window.Cesium = Cesium;
|
|
|
46
44
|
var DeepTwinsEngine3D = /*#__PURE__*/_createClass(function DeepTwinsEngine3D() {
|
|
47
45
|
_classCallCheck(this, DeepTwinsEngine3D);
|
|
48
46
|
});
|
|
49
|
-
_defineProperty(DeepTwinsEngine3D, "Version", '0.0.
|
|
47
|
+
_defineProperty(DeepTwinsEngine3D, "Version", '0.0.44');
|
|
50
48
|
_defineProperty(DeepTwinsEngine3D, "Map", Map);
|
|
51
49
|
_defineProperty(DeepTwinsEngine3D, "GroundSkyBox", GroundSkyBox);
|
|
52
50
|
_defineProperty(DeepTwinsEngine3D, "RasterLayer", RasterLayer);
|
|
@@ -61,7 +59,6 @@ _defineProperty(DeepTwinsEngine3D, "Rotate", Rotate);
|
|
|
61
59
|
_defineProperty(DeepTwinsEngine3D, "Roam", Roam);
|
|
62
60
|
_defineProperty(DeepTwinsEngine3D, "RotateInPlace", RotateInPlace);
|
|
63
61
|
_defineProperty(DeepTwinsEngine3D, "ModelRoamHistory", ModelRoamHistory);
|
|
64
|
-
_defineProperty(DeepTwinsEngine3D, "ModelRoamRunTime", ModelRoamRunTime);
|
|
65
62
|
_defineProperty(DeepTwinsEngine3D, "ModelRoamRealTime", ModelRoamRealTime);
|
|
66
63
|
_defineProperty(DeepTwinsEngine3D, "TimerInterval", TimerInterval);
|
|
67
64
|
_defineProperty(DeepTwinsEngine3D, "ShapeSection", ShapeSection);
|
|
@@ -70,7 +67,6 @@ _defineProperty(DeepTwinsEngine3D, "DynamicWallMaterialProperty", DynamicWallMat
|
|
|
70
67
|
_defineProperty(DeepTwinsEngine3D, "CircleWaveMaterialProperty", CircleWaveMaterialProperty);
|
|
71
68
|
_defineProperty(DeepTwinsEngine3D, "PolylineTrailLinkMaterialProperty", PolylineTrailLinkMaterialProperty);
|
|
72
69
|
_defineProperty(DeepTwinsEngine3D, "ImageMaterialProperty", ImageMaterialProperty);
|
|
73
|
-
_defineProperty(DeepTwinsEngine3D, "ImageMaterial", ImageMaterial);
|
|
74
70
|
_defineProperty(DeepTwinsEngine3D, "Heatmap2d", Heatmap2d);
|
|
75
71
|
_defineProperty(DeepTwinsEngine3D, "Heatmap3d", Heatmap3d);
|
|
76
72
|
_defineProperty(DeepTwinsEngine3D, "PointCluster", PointCluster);
|
package/dist/map/Map.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export default class Map extends Cesium.Viewer {
|
|
|
40
40
|
addGraphicSource(id: string, data: any): any;
|
|
41
41
|
addGraphicEntityToSource(id: string, data: any): any;
|
|
42
42
|
addGraphicLayer(data: any, options: any): any;
|
|
43
|
-
|
|
43
|
+
addCustomSourceToGraphicLayer(data: any, options: any): any;
|
|
44
44
|
getGraphicSource(id: any): any;
|
|
45
45
|
getGraphicLayer(id: any): any;
|
|
46
46
|
showGraphicLayer(layer: any, isShow: boolean): void;
|
package/dist/map/Map.js
CHANGED
|
@@ -201,6 +201,7 @@ var Map = /*#__PURE__*/function (_Cesium$Viewer) {
|
|
|
201
201
|
fog = _options$scene2.fog,
|
|
202
202
|
skyAtmosphere = _options$scene2.skyAtmosphere,
|
|
203
203
|
requestRenderMode = _options$scene2.requestRenderMode,
|
|
204
|
+
postProcessStages = _options$scene2.postProcessStages,
|
|
204
205
|
_options$clock = options.clock,
|
|
205
206
|
_options$clock2 = _options$clock === void 0 ? {} : _options$clock,
|
|
206
207
|
currentTime = _options$clock2.currentTime,
|
|
@@ -231,6 +232,11 @@ var Map = /*#__PURE__*/function (_Cesium$Viewer) {
|
|
|
231
232
|
!isNil(fog) && (this.scene.fog.enabled = fog);
|
|
232
233
|
!isNil(skyAtmosphere) && (this.scene.skyAtmosphere.show = skyAtmosphere);
|
|
233
234
|
!isNil(requestRenderMode) && (this.scene.requestRenderMode = requestRenderMode);
|
|
235
|
+
if (!isNil(postProcessStages)) {
|
|
236
|
+
for (var key in postProcessStages) {
|
|
237
|
+
this.scene.postProcessStages[key].enabled = postProcessStages[key];
|
|
238
|
+
}
|
|
239
|
+
}
|
|
234
240
|
|
|
235
241
|
// clock
|
|
236
242
|
!isNil(currentTime) && (this.clock.currentTime = utils.dateToJulianDate(currentTime));
|
|
@@ -238,8 +244,8 @@ var Map = /*#__PURE__*/function (_Cesium$Viewer) {
|
|
|
238
244
|
!isNil(shouldAnimate) && (this.clock.shouldAnimate = shouldAnimate);
|
|
239
245
|
|
|
240
246
|
// cameraController
|
|
241
|
-
for (var
|
|
242
|
-
this.scene.screenSpaceCameraController[
|
|
247
|
+
for (var _key in cameraController) {
|
|
248
|
+
this.scene.screenSpaceCameraController[_key] = cameraController[_key];
|
|
243
249
|
}
|
|
244
250
|
|
|
245
251
|
// globe
|
|
@@ -458,14 +464,14 @@ var Map = /*#__PURE__*/function (_Cesium$Viewer) {
|
|
|
458
464
|
return this.graphicLayerCollection.addLayer(data, options);
|
|
459
465
|
}
|
|
460
466
|
|
|
461
|
-
//
|
|
467
|
+
// 直接自定义数据到图层
|
|
462
468
|
}, {
|
|
463
|
-
key: "
|
|
464
|
-
value: function
|
|
469
|
+
key: "addCustomSourceToGraphicLayer",
|
|
470
|
+
value: function addCustomSourceToGraphicLayer(data, options) {
|
|
465
471
|
if (!this.graphicLayerCollection) {
|
|
466
472
|
this.graphicLayerCollection = new GraphicLayerCollection(this);
|
|
467
473
|
}
|
|
468
|
-
return this.graphicLayerCollection.
|
|
474
|
+
return this.graphicLayerCollection.addCustomSourceToLayer(data, options);
|
|
469
475
|
}
|
|
470
476
|
|
|
471
477
|
// 获取矢量数据
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default class BaseMaterialProperty {
|
|
2
|
+
private _definitionChanged;
|
|
3
|
+
readonly _time: number;
|
|
4
|
+
type: string;
|
|
5
|
+
style: any;
|
|
6
|
+
constructor(type: string, style: any);
|
|
7
|
+
get isConstant(): boolean;
|
|
8
|
+
get definitionChanged(): any;
|
|
9
|
+
getType(): string;
|
|
10
|
+
getValue(time: any, result: any): any;
|
|
11
|
+
equals(other: any): boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
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
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
import * as Cesium from 'deeptwins-cesium';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
+
var BaseMaterialProperty = /*#__PURE__*/function () {
|
|
11
|
+
function BaseMaterialProperty(type, style) {
|
|
12
|
+
_classCallCheck(this, BaseMaterialProperty);
|
|
13
|
+
_defineProperty(this, "_definitionChanged", new Cesium.Event());
|
|
14
|
+
_defineProperty(this, "_time", new Date().getTime());
|
|
15
|
+
_defineProperty(this, "type", void 0);
|
|
16
|
+
_defineProperty(this, "style", void 0);
|
|
17
|
+
this.type = type + uuidv4();
|
|
18
|
+
this.style = style || {};
|
|
19
|
+
}
|
|
20
|
+
_createClass(BaseMaterialProperty, [{
|
|
21
|
+
key: "isConstant",
|
|
22
|
+
get: function get() {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
key: "definitionChanged",
|
|
27
|
+
get: function get() {
|
|
28
|
+
return this._definitionChanged;
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
key: "getType",
|
|
32
|
+
value: function getType() {
|
|
33
|
+
return this.type;
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
key: "getValue",
|
|
37
|
+
value: function getValue(time, result) {
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// 默认重新渲染
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
43
|
+
}, {
|
|
44
|
+
key: "equals",
|
|
45
|
+
value: function equals(other) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
}]);
|
|
49
|
+
return BaseMaterialProperty;
|
|
50
|
+
}();
|
|
51
|
+
export { BaseMaterialProperty as default };
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
gradient: number;
|
|
7
|
-
time: any;
|
|
8
|
-
materialType: any;
|
|
9
|
-
constructor(options: any);
|
|
1
|
+
import BaseMaterialProperty from './BaseMaterialProperty';
|
|
2
|
+
export default class CircleWaveMaterialProperty extends BaseMaterialProperty {
|
|
3
|
+
private readonly currStyle;
|
|
4
|
+
constructor(style: any);
|
|
5
|
+
static handleStyle(style: any): any;
|
|
10
6
|
private _init;
|
|
11
|
-
get isConstant(): boolean;
|
|
12
|
-
get definitionChanged(): any;
|
|
13
|
-
getType(): any;
|
|
14
7
|
getValue(time: any, result: any): any;
|
|
15
|
-
equals(other: any):
|
|
16
|
-
getShader(): string;
|
|
8
|
+
equals(other: any): boolean;
|
|
17
9
|
}
|