deeptwins-engine-3d 0.1.7 → 0.1.10
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/cameraControl/ModelRoamHistory.d.ts +2 -1
- package/dist/esm/cameraControl/ModelRoamHistory.js +33 -29
- package/dist/esm/cameraControl/ModelRoamRealTime.d.ts +4 -3
- package/dist/esm/cameraControl/ModelRoamRealTime.js +26 -22
- package/dist/esm/cameraControl/Roam.d.ts +3 -1
- package/dist/esm/cameraControl/Roam.js +17 -13
- package/dist/esm/cameraControl/Rotate.d.ts +3 -1
- package/dist/esm/cameraControl/Rotate.js +29 -25
- package/dist/esm/cameraControl/RotateInPlace.d.ts +3 -1
- package/dist/esm/cameraControl/RotateInPlace.js +22 -19
- package/dist/esm/constant.d.ts +12 -0
- package/dist/esm/constant.js +16 -0
- package/dist/esm/graphicLayer/BaseEntity.d.ts +0 -1
- package/dist/esm/graphicLayer/BaseEntity.js +0 -1
- package/dist/esm/graphicLayer/BaseLayer.d.ts +3 -2
- package/dist/esm/graphicLayer/BaseLayer.js +73 -41
- package/dist/esm/graphicLayer/BasePointPrimitive.d.ts +4 -2
- package/dist/esm/graphicLayer/BasePointPrimitive.js +14 -10
- package/dist/esm/graphicLayer/BasePrimitive.d.ts +3 -5
- package/dist/esm/graphicLayer/BasePrimitive.js +4 -18
- package/dist/esm/graphicLayer/BasePrimitiveInstance.d.ts +1 -2
- package/dist/esm/graphicLayer/BasePrimitiveInstance.js +0 -1
- package/dist/esm/graphicLayer/BaseSource.d.ts +4 -3
- package/dist/esm/graphicLayer/BaseSource.js +28 -11
- package/dist/esm/graphicLayer/BillboardEntity.js +3 -6
- package/dist/esm/graphicLayer/BillboardPrimitive.d.ts +2 -0
- package/dist/esm/graphicLayer/BillboardPrimitive.js +29 -5
- package/dist/esm/graphicLayer/BoxEntity.js +2 -5
- package/dist/esm/graphicLayer/BoxPrimitive.d.ts +2 -2
- package/dist/esm/graphicLayer/BoxPrimitive.js +11 -6
- package/dist/esm/graphicLayer/BoxPrimitiveInstance.js +4 -6
- package/dist/esm/graphicLayer/EllipseEntity.js +2 -5
- package/dist/esm/graphicLayer/EllipsePrimitive.d.ts +1 -1
- package/dist/esm/graphicLayer/EllipsePrimitive.js +9 -4
- package/dist/esm/graphicLayer/EllipsePrimitiveInstance.js +4 -7
- package/dist/esm/graphicLayer/EllipsoidEntity.js +2 -5
- package/dist/esm/graphicLayer/EllipsoidPrimitive.d.ts +1 -1
- package/dist/esm/graphicLayer/EllipsoidPrimitive.js +9 -4
- package/dist/esm/graphicLayer/EllipsoidPrimitiveInstance.js +3 -3
- package/dist/esm/graphicLayer/GraphicLayerCollection.d.ts +9 -7
- package/dist/esm/graphicLayer/GraphicLayerCollection.js +118 -42
- package/dist/esm/graphicLayer/HtmlEntity.js +20 -9
- package/dist/esm/graphicLayer/LabelEntity.js +2 -5
- package/dist/esm/graphicLayer/LabelPrimitive.d.ts +2 -0
- package/dist/esm/graphicLayer/LabelPrimitive.js +31 -8
- package/dist/esm/graphicLayer/ModelEntity.js +2 -5
- package/dist/esm/graphicLayer/ModelPrimitive.d.ts +1 -1
- package/dist/esm/graphicLayer/ModelPrimitive.js +2 -1
- package/dist/esm/graphicLayer/ModelPrimitiveInstance.js +4 -7
- package/dist/esm/graphicLayer/PointEntity.js +2 -5
- package/dist/esm/graphicLayer/PointPrimitive.d.ts +2 -0
- package/dist/esm/graphicLayer/PointPrimitive.js +29 -5
- package/dist/esm/graphicLayer/PolygonEntity.js +4 -7
- package/dist/esm/graphicLayer/PolygonPrimitive.d.ts +2 -2
- package/dist/esm/graphicLayer/PolygonPrimitive.js +11 -6
- package/dist/esm/graphicLayer/PolygonPrimitiveInstance.js +4 -7
- package/dist/esm/graphicLayer/PolylineEntity.js +4 -7
- package/dist/esm/graphicLayer/PolylinePrimitive.d.ts +1 -1
- package/dist/esm/graphicLayer/PolylinePrimitive.js +9 -4
- package/dist/esm/graphicLayer/PolylinePrimitiveInstance.js +3 -3
- package/dist/esm/graphicLayer/PolylineVolumeEntity.js +3 -5
- package/dist/esm/graphicLayer/PolylineVolumePrimitive.d.ts +1 -1
- package/dist/esm/graphicLayer/PolylineVolumePrimitive.js +9 -4
- package/dist/esm/graphicLayer/PolylineVolumePrimitiveInstance.js +4 -7
- package/dist/esm/graphicLayer/WallEntity.js +4 -7
- package/dist/esm/graphicLayer/WallPrimitive.d.ts +1 -1
- package/dist/esm/graphicLayer/WallPrimitive.js +9 -4
- package/dist/esm/graphicLayer/WallPrimitiveInstance.js +4 -7
- package/dist/esm/index.js +1 -1
- package/dist/esm/map/Event.d.ts +4 -2
- package/dist/esm/map/Event.js +19 -14
- package/dist/esm/map/Map.d.ts +6 -1
- package/dist/esm/map/Map.js +14 -4
- package/dist/esm/material/WeatherEffects.d.ts +3 -1
- package/dist/esm/material/WeatherEffects.js +11 -6
- package/dist/esm/tool/common.d.ts +3 -1
- package/dist/esm/tool/common.js +13 -8
- package/dist/esm/tool/utils.d.ts +2 -0
- package/dist/esm/tool/utils.js +10 -0
- package/dist/esm/videoFusion/BaseVideo.d.ts +6 -2
- package/dist/esm/videoFusion/BaseVideo.js +48 -19
- package/dist/esm/videoFusion/VideoProject.js +16 -10
- package/dist/esm/videoFusion/VideoTexture.js +4 -2
- package/dist/esm/visualization/Airspace.d.ts +3 -1
- package/dist/esm/visualization/Airspace.js +27 -12
- package/dist/esm/visualization/BaseFrustum.d.ts +3 -1
- package/dist/esm/visualization/BaseFrustum.js +23 -9
- package/dist/esm/visualization/BaseHeatmap.d.ts +4 -2
- package/dist/esm/visualization/BaseHeatmap.js +22 -12
- package/dist/esm/visualization/Frustum.js +6 -6
- package/dist/esm/visualization/FrustumWithCamera.js +9 -9
- package/dist/esm/visualization/Heatmap2d.js +32 -6
- package/dist/esm/visualization/Heatmap3d.js +21 -4
- package/dist/esm/visualization/PointCluster.d.ts +3 -1
- package/dist/esm/visualization/PointCluster.js +26 -14
- package/dist/umd/deeptwins-engine-3d.min.js +1 -1
- package/package.json +1 -2
|
@@ -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 = ["silhouetteColor", "color", "imageBasedLightingFactor", "lightColor"];
|
|
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 ModelPrimitive = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
32
32
|
var _this;
|
|
33
33
|
_classCallCheck(this, ModelPrimitive);
|
|
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_MODEL_PRIMITIVE_OPTIONS(), cloneDeep(style || {}));
|
|
41
38
|
var currStyle = ModelPrimitive.handleOptions(mergeStyle);
|
|
@@ -53,12 +50,12 @@ var ModelPrimitive = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
53
50
|
function _init(options) {
|
|
54
51
|
var style = options.style,
|
|
55
52
|
positions = options.positions,
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
primitiveInstance = options.primitiveInstance;
|
|
54
|
+
var instance = Cesium.Model.fromGltfAsync(_objectSpread(_objectSpread({}, style), {}, {
|
|
58
55
|
id: this.id,
|
|
59
56
|
modelMatrix: Cesium.Transforms.eastNorthUpToFixedFrame(positions)
|
|
60
57
|
}));
|
|
61
|
-
|
|
58
|
+
primitiveInstance.push(instance);
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
// 更新geoJson数据
|
|
@@ -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", "entity"],
|
|
3
3
|
_excluded2 = ["color", "outlineColor"];
|
|
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; }
|
|
@@ -33,9 +33,7 @@ var PointEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
33
33
|
var _this;
|
|
34
34
|
_classCallCheck(this, PointEntity);
|
|
35
35
|
_this = _super.call(this, options);
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
37
36
|
var style = options.style,
|
|
38
|
-
source = options.source,
|
|
39
37
|
entity = options.entity,
|
|
40
38
|
currOptions = _objectWithoutProperties(options, _excluded);
|
|
41
39
|
if (entity) {
|
|
@@ -58,11 +56,10 @@ var PointEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
58
56
|
function _init(options) {
|
|
59
57
|
var style = options.style;
|
|
60
58
|
var positions = PositionProperty.changeToPropertyData.call(this);
|
|
61
|
-
this.graphic = new Cesium.PointGraphics(style);
|
|
62
59
|
this.entity = new Cesium.Entity({
|
|
63
60
|
position: positions,
|
|
64
61
|
id: this.id,
|
|
65
|
-
point:
|
|
62
|
+
point: new Cesium.PointGraphics(style)
|
|
66
63
|
});
|
|
67
64
|
}
|
|
68
65
|
|
|
@@ -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", "outlineColor"];
|
|
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; }
|
|
@@ -29,9 +29,7 @@ var PointPrimitive = /*#__PURE__*/function (_BasePointPrimitive) {
|
|
|
29
29
|
var _this;
|
|
30
30
|
_classCallCheck(this, PointPrimitive);
|
|
31
31
|
_this = _super.call(this, options);
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
33
32
|
var style = options.style,
|
|
34
|
-
source = options.source,
|
|
35
33
|
currOptions = _objectWithoutProperties(options, _excluded);
|
|
36
34
|
var mergeStyle = merge(DEFAULT_POINT_PRIMITIVE_OPTIONS(), cloneDeep(style || {}));
|
|
37
35
|
var currStyle = PointPrimitive.handleOptions(mergeStyle);
|
|
@@ -48,19 +46,45 @@ var PointPrimitive = /*#__PURE__*/function (_BasePointPrimitive) {
|
|
|
48
46
|
var style = options.style,
|
|
49
47
|
positions = options.positions,
|
|
50
48
|
primitiveCollection = options.primitiveCollection;
|
|
51
|
-
|
|
49
|
+
primitiveCollection.add(_objectSpread({
|
|
52
50
|
id: this.id,
|
|
53
51
|
position: positions
|
|
54
52
|
}, style));
|
|
55
53
|
}
|
|
56
54
|
|
|
55
|
+
// 获取primitive
|
|
56
|
+
}, {
|
|
57
|
+
key: "getPrimitive",
|
|
58
|
+
value: function getPrimitive() {
|
|
59
|
+
var _primitiveCollection$,
|
|
60
|
+
_this2 = this;
|
|
61
|
+
var primitiveCollection = this.getPrimitiveCollection();
|
|
62
|
+
return primitiveCollection === null || primitiveCollection === void 0 || (_primitiveCollection$ = primitiveCollection._pointPrimitives) === null || _primitiveCollection$ === void 0 ? void 0 : _primitiveCollection$.find(function (t) {
|
|
63
|
+
return t.id === _this2.id;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
57
67
|
// 更新geoJson数据
|
|
58
68
|
}, {
|
|
59
69
|
key: "updateData",
|
|
60
70
|
value: function updateData(data) {
|
|
61
71
|
var positions = data.positions;
|
|
62
72
|
this.source = data;
|
|
63
|
-
|
|
73
|
+
var primitive = this.getPrimitive();
|
|
74
|
+
if (!primitive) return;
|
|
75
|
+
primitive.position = positions;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// 更新样式
|
|
79
|
+
}, {
|
|
80
|
+
key: "updateStyle",
|
|
81
|
+
value: function updateStyle(originStyle, style) {
|
|
82
|
+
this.style = merge(this.style, originStyle);
|
|
83
|
+
var primitive = this.getPrimitive();
|
|
84
|
+
if (!primitive) return;
|
|
85
|
+
for (var key in style) {
|
|
86
|
+
primitive[key] = style[key];
|
|
87
|
+
}
|
|
64
88
|
}
|
|
65
89
|
}], [{
|
|
66
90
|
key: "handleOptions",
|
|
@@ -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", "entity"],
|
|
3
3
|
_excluded2 = ["material", "outlineColor", "stRotation"];
|
|
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; }
|
|
@@ -33,9 +33,7 @@ var PolygonEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
33
33
|
var _this;
|
|
34
34
|
_classCallCheck(this, PolygonEntity);
|
|
35
35
|
_this = _super.call(this, options);
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
37
36
|
var style = options.style,
|
|
38
|
-
source = options.source,
|
|
39
37
|
entity = options.entity,
|
|
40
38
|
currOptions = _objectWithoutProperties(options, _excluded);
|
|
41
39
|
// 添加的是entity对象
|
|
@@ -59,12 +57,11 @@ var PolygonEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
59
57
|
function _init(options) {
|
|
60
58
|
var style = options.style;
|
|
61
59
|
var newHierarchy = PositionProperty.changeToPropertyHierarchy.call(this);
|
|
62
|
-
this.graphic = new Cesium.PolygonGraphics(_objectSpread(_objectSpread({}, style), {}, {
|
|
63
|
-
hierarchy: newHierarchy
|
|
64
|
-
}));
|
|
65
60
|
this.entity = new Cesium.Entity({
|
|
66
61
|
id: this.id,
|
|
67
|
-
polygon:
|
|
62
|
+
polygon: new Cesium.PolygonGraphics(_objectSpread(_objectSpread({}, style), {}, {
|
|
63
|
+
hierarchy: newHierarchy
|
|
64
|
+
}))
|
|
68
65
|
});
|
|
69
66
|
}
|
|
70
67
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BasePrimitive from './BasePrimitive';
|
|
2
2
|
export default class PolygonPrimitive extends BasePrimitive {
|
|
3
|
-
constructor(
|
|
4
|
-
createPrimitive(options
|
|
3
|
+
constructor(mapContext: any);
|
|
4
|
+
createPrimitive(options: any, primitiveInstance: any[]): void;
|
|
5
5
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
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; }
|
|
4
|
+
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; }
|
|
2
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
6
|
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
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -13,27 +16,29 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
16
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
17
|
import * as Cesium from 'deeptwins-cesium';
|
|
15
18
|
import { cloneDeep, merge } from 'lodash';
|
|
16
|
-
import { DEFAULT_POLYGON_PRIMITIVE_OPTIONS } from "../constant";
|
|
19
|
+
import { DEFAULT_POLYGON_PRIMITIVE_OPTIONS, DEFAULT_PRIMITIVE_OPTIONS } from "../constant";
|
|
17
20
|
import BasePrimitive from "./BasePrimitive";
|
|
18
21
|
var PolygonPrimitive = /*#__PURE__*/function (_BasePrimitive) {
|
|
19
22
|
_inherits(PolygonPrimitive, _BasePrimitive);
|
|
20
23
|
var _super = _createSuper(PolygonPrimitive);
|
|
21
|
-
function PolygonPrimitive(
|
|
24
|
+
function PolygonPrimitive(mapContext) {
|
|
22
25
|
_classCallCheck(this, PolygonPrimitive);
|
|
23
|
-
return _super.call(this,
|
|
26
|
+
return _super.call(this, mapContext);
|
|
24
27
|
}
|
|
25
28
|
_createClass(PolygonPrimitive, [{
|
|
26
29
|
key: "createPrimitive",
|
|
27
30
|
value: function createPrimitive() {
|
|
28
31
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
32
|
+
var primitiveInstance = arguments.length > 1 ? arguments[1] : undefined;
|
|
29
33
|
var style = merge(DEFAULT_POLYGON_PRIMITIVE_OPTIONS(), cloneDeep(options.style || {}));
|
|
34
|
+
var primitiveOptions = merge(DEFAULT_PRIMITIVE_OPTIONS(), cloneDeep(options.primitive || {}));
|
|
30
35
|
var appearance = new Cesium.PerInstanceColorAppearance({
|
|
31
36
|
translucent: !!(style !== null && style !== void 0 && style.translucent)
|
|
32
37
|
});
|
|
33
|
-
this.primitive = new Cesium.Primitive({
|
|
34
|
-
geometryInstances:
|
|
38
|
+
this.primitive = new Cesium.Primitive(_objectSpread({
|
|
39
|
+
geometryInstances: primitiveInstance,
|
|
35
40
|
appearance: appearance
|
|
36
|
-
});
|
|
41
|
+
}, primitiveOptions));
|
|
37
42
|
this.show = !!(style !== null && style !== void 0 && style.show);
|
|
38
43
|
}
|
|
39
44
|
}]);
|
|
@@ -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
|
_excluded3 = ["color", "height"];
|
|
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; }
|
|
@@ -33,10 +33,7 @@ var PolygonPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
33
33
|
var _this;
|
|
34
34
|
_classCallCheck(this, PolygonPrimitiveInstance);
|
|
35
35
|
_this = _super.call(this, options);
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
37
36
|
var style = options.style,
|
|
38
|
-
source = options.source,
|
|
39
|
-
entity = options.entity,
|
|
40
37
|
currOptions = _objectWithoutProperties(options, _excluded);
|
|
41
38
|
var mergeStyle = merge(DEFAULT_POLYGON_PRIMITIVE_OPTIONS(), cloneDeep(style || {}));
|
|
42
39
|
var currStyle = PolygonPrimitiveInstance.handleOptions(mergeStyle);
|
|
@@ -57,8 +54,8 @@ var PolygonPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
57
54
|
style = _objectWithoutProperties(_options$style, _excluded2),
|
|
58
55
|
positions = options.positions,
|
|
59
56
|
holes = options.holes,
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
primitiveInstance = options.primitiveInstance;
|
|
58
|
+
var instance = new Cesium.GeometryInstance({
|
|
62
59
|
id: this.id,
|
|
63
60
|
geometry: new Cesium.PolygonGeometry(_objectSpread(_objectSpread({
|
|
64
61
|
polygonHierarchy: new Cesium.PolygonHierarchy(positions, holes.map(function (t) {
|
|
@@ -71,7 +68,7 @@ var PolygonPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
71
68
|
color: color
|
|
72
69
|
}
|
|
73
70
|
});
|
|
74
|
-
|
|
71
|
+
primitiveInstance.push(instance);
|
|
75
72
|
}
|
|
76
73
|
|
|
77
74
|
// 更新geoJson数据
|
|
@@ -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", "entity"],
|
|
3
3
|
_excluded2 = ["material", "depthFailMaterial"];
|
|
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; }
|
|
@@ -33,9 +33,7 @@ var PolylineEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
33
33
|
var _this;
|
|
34
34
|
_classCallCheck(this, PolylineEntity);
|
|
35
35
|
_this = _super.call(this, options);
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
37
36
|
var style = options.style,
|
|
38
|
-
source = options.source,
|
|
39
37
|
entity = options.entity,
|
|
40
38
|
currOptions = _objectWithoutProperties(options, _excluded);
|
|
41
39
|
// 添加的是entity对象
|
|
@@ -59,12 +57,11 @@ var PolylineEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
59
57
|
function _init(options) {
|
|
60
58
|
var style = options.style;
|
|
61
59
|
var positions = PositionProperty.changeToPropertyData.call(this);
|
|
62
|
-
this.graphic = new Cesium.PolylineGraphics(_objectSpread(_objectSpread({}, style), {}, {
|
|
63
|
-
positions: positions
|
|
64
|
-
}));
|
|
65
60
|
this.entity = new Cesium.Entity({
|
|
66
61
|
id: this.id,
|
|
67
|
-
polyline:
|
|
62
|
+
polyline: new Cesium.PolylineGraphics(_objectSpread(_objectSpread({}, style), {}, {
|
|
63
|
+
positions: positions
|
|
64
|
+
}))
|
|
68
65
|
});
|
|
69
66
|
}
|
|
70
67
|
|
|
@@ -1,4 +1,7 @@
|
|
|
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; }
|
|
4
|
+
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; }
|
|
2
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
6
|
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
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -13,7 +16,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
16
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
17
|
import * as Cesium from 'deeptwins-cesium';
|
|
15
18
|
import { cloneDeep, merge } from 'lodash';
|
|
16
|
-
import { DEFAULT_POLYLINE_PRIMITIVE_OPTIONS } from "../constant";
|
|
19
|
+
import { DEFAULT_POLYLINE_PRIMITIVE_OPTIONS, DEFAULT_PRIMITIVE_OPTIONS } from "../constant";
|
|
17
20
|
import * as utils from "../tool/utils";
|
|
18
21
|
import BasePrimitive from "./BasePrimitive";
|
|
19
22
|
var PolylinePrimitive = /*#__PURE__*/function (_BasePrimitive) {
|
|
@@ -27,7 +30,9 @@ var PolylinePrimitive = /*#__PURE__*/function (_BasePrimitive) {
|
|
|
27
30
|
key: "createPrimitive",
|
|
28
31
|
value: function createPrimitive() {
|
|
29
32
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
33
|
+
var primitiveInstance = arguments.length > 1 ? arguments[1] : undefined;
|
|
30
34
|
var style = merge(DEFAULT_POLYLINE_PRIMITIVE_OPTIONS(), cloneDeep(options.style || {}));
|
|
35
|
+
var primitiveOptions = merge(DEFAULT_PRIMITIVE_OPTIONS(), cloneDeep(options.primitive || {}));
|
|
31
36
|
var appearance = new Cesium.PolylineColorAppearance({
|
|
32
37
|
translucent: !!(style !== null && style !== void 0 && style.translucent)
|
|
33
38
|
});
|
|
@@ -36,10 +41,10 @@ var PolylinePrimitive = /*#__PURE__*/function (_BasePrimitive) {
|
|
|
36
41
|
material: utils.colorMaterialString(style.material)
|
|
37
42
|
});
|
|
38
43
|
}
|
|
39
|
-
this.primitive = new Cesium.Primitive({
|
|
40
|
-
geometryInstances:
|
|
44
|
+
this.primitive = new Cesium.Primitive(_objectSpread({
|
|
45
|
+
geometryInstances: primitiveInstance,
|
|
41
46
|
appearance: appearance
|
|
42
|
-
});
|
|
47
|
+
}, primitiveOptions));
|
|
43
48
|
this.show = !!(style !== null && style !== void 0 && style.show);
|
|
44
49
|
}
|
|
45
50
|
}]);
|
|
@@ -51,8 +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
|
-
|
|
55
|
-
|
|
54
|
+
primitiveInstance = options.primitiveInstance;
|
|
55
|
+
var instance = new Cesium.GeometryInstance({
|
|
56
56
|
id: this.id,
|
|
57
57
|
geometry: new Cesium.PolylineGeometry({
|
|
58
58
|
positions: this.source.positions,
|
|
@@ -63,7 +63,7 @@ var PolylinePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
63
63
|
color: color
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
-
|
|
66
|
+
primitiveInstance.push(instance);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// 更新geoJson数据
|
|
@@ -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", "entity"],
|
|
3
3
|
_excluded2 = ["material", "outlineColor", "customShape"];
|
|
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,9 +32,7 @@ var PolylineVolumeEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
32
32
|
var _this;
|
|
33
33
|
_classCallCheck(this, PolylineVolumeEntity);
|
|
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
36
|
entity = options.entity,
|
|
39
37
|
currOptions = _objectWithoutProperties(options, _excluded);
|
|
40
38
|
// 添加的是entity对象
|
|
@@ -58,7 +56,7 @@ var PolylineVolumeEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
58
56
|
function _init(options) {
|
|
59
57
|
var _this2 = this;
|
|
60
58
|
var style = options.style;
|
|
61
|
-
|
|
59
|
+
var graphic = new Cesium.PolylineVolumeGraphics(_objectSpread(_objectSpread({}, style), {}, {
|
|
62
60
|
// todo 使用 positionProperty 有bug
|
|
63
61
|
positions: this.positionProperty ? new Cesium.CallbackProperty(function () {
|
|
64
62
|
return Cesium.Cartesian3.fromDegreesArrayHeights(_this2.source.geometry.coordinates.flat(1));
|
|
@@ -66,7 +64,7 @@ var PolylineVolumeEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
66
64
|
}));
|
|
67
65
|
this.entity = new Cesium.Entity({
|
|
68
66
|
id: this.id,
|
|
69
|
-
polylineVolume:
|
|
67
|
+
polylineVolume: graphic
|
|
70
68
|
});
|
|
71
69
|
}
|
|
72
70
|
|
|
@@ -1,4 +1,7 @@
|
|
|
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; }
|
|
4
|
+
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; }
|
|
2
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
6
|
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
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -13,7 +16,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
16
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
17
|
import * as Cesium from 'deeptwins-cesium';
|
|
15
18
|
import { cloneDeep, merge } from 'lodash';
|
|
16
|
-
import { DEFAULT_POLYLINE_VOLUME_PRIMITIVE_OPTIONS } from "../constant";
|
|
19
|
+
import { DEFAULT_POLYLINE_VOLUME_PRIMITIVE_OPTIONS, DEFAULT_PRIMITIVE_OPTIONS } from "../constant";
|
|
17
20
|
import BasePrimitive from "./BasePrimitive";
|
|
18
21
|
var PolylineVolumePrimitive = /*#__PURE__*/function (_BasePrimitive) {
|
|
19
22
|
_inherits(PolylineVolumePrimitive, _BasePrimitive);
|
|
@@ -26,14 +29,16 @@ var PolylineVolumePrimitive = /*#__PURE__*/function (_BasePrimitive) {
|
|
|
26
29
|
key: "createPrimitive",
|
|
27
30
|
value: function createPrimitive() {
|
|
28
31
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
32
|
+
var primitiveInstance = arguments.length > 1 ? arguments[1] : undefined;
|
|
29
33
|
var style = merge(DEFAULT_POLYLINE_VOLUME_PRIMITIVE_OPTIONS(), cloneDeep(options.style || {}));
|
|
34
|
+
var primitiveOptions = merge(DEFAULT_PRIMITIVE_OPTIONS(), cloneDeep(options.primitive || {}));
|
|
30
35
|
var appearance = new Cesium.PerInstanceColorAppearance({
|
|
31
36
|
translucent: !!(style !== null && style !== void 0 && style.translucent)
|
|
32
37
|
});
|
|
33
|
-
this.primitive = new Cesium.Primitive({
|
|
34
|
-
geometryInstances:
|
|
38
|
+
this.primitive = new Cesium.Primitive(_objectSpread({
|
|
39
|
+
geometryInstances: primitiveInstance,
|
|
35
40
|
appearance: appearance
|
|
36
|
-
});
|
|
41
|
+
}, primitiveOptions));
|
|
37
42
|
this.show = !!(style !== null && style !== void 0 && style.show);
|
|
38
43
|
}
|
|
39
44
|
}]);
|
|
@@ -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", "customShape"];
|
|
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 PolylineVolumePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInsta
|
|
|
32
32
|
var _this;
|
|
33
33
|
_classCallCheck(this, PolylineVolumePrimitiveInstance);
|
|
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_VOLUME_PRIMITIVE_OPTIONS(), cloneDeep(style || {}));
|
|
41
38
|
var currStyle = PolylineVolumePrimitiveInstance.handleOptions(mergeStyle);
|
|
@@ -56,8 +53,8 @@ var PolylineVolumePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInsta
|
|
|
56
53
|
shapePositions = _options$style.shapePositions,
|
|
57
54
|
cornerType = _options$style.cornerType,
|
|
58
55
|
positions = options.positions,
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
primitiveInstance = options.primitiveInstance;
|
|
57
|
+
var instance = new Cesium.GeometryInstance({
|
|
61
58
|
id: this.id,
|
|
62
59
|
geometry: new Cesium.PolylineVolumeGeometry({
|
|
63
60
|
vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
|
|
@@ -69,7 +66,7 @@ var PolylineVolumePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInsta
|
|
|
69
66
|
color: color
|
|
70
67
|
}
|
|
71
68
|
});
|
|
72
|
-
|
|
69
|
+
primitiveInstance.push(instance);
|
|
73
70
|
}
|
|
74
71
|
|
|
75
72
|
// 更新geoJson数据
|
|
@@ -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", "entity"],
|
|
3
3
|
_excluded2 = ["material", "outlineColor"];
|
|
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; }
|
|
@@ -33,9 +33,7 @@ var WallEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
33
33
|
var _this;
|
|
34
34
|
_classCallCheck(this, WallEntity);
|
|
35
35
|
_this = _super.call(this, options);
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
37
36
|
var style = options.style,
|
|
38
|
-
source = options.source,
|
|
39
37
|
entity = options.entity,
|
|
40
38
|
currOptions = _objectWithoutProperties(options, _excluded);
|
|
41
39
|
// 添加的是entity对象
|
|
@@ -59,12 +57,11 @@ var WallEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
59
57
|
function _init(options) {
|
|
60
58
|
var style = options.style;
|
|
61
59
|
var positions = PositionProperty.changeToPropertyData.call(this);
|
|
62
|
-
this.graphic = new Cesium.WallGraphics(_objectSpread(_objectSpread({}, style), {}, {
|
|
63
|
-
positions: positions
|
|
64
|
-
}));
|
|
65
60
|
this.entity = new Cesium.Entity({
|
|
66
61
|
id: this.id,
|
|
67
|
-
wall:
|
|
62
|
+
wall: new Cesium.WallGraphics(_objectSpread(_objectSpread({}, style), {}, {
|
|
63
|
+
positions: positions
|
|
64
|
+
}))
|
|
68
65
|
});
|
|
69
66
|
}
|
|
70
67
|
|
|
@@ -1,4 +1,7 @@
|
|
|
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; }
|
|
4
|
+
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; }
|
|
2
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
6
|
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
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -13,7 +16,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
16
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
17
|
import * as Cesium from 'deeptwins-cesium';
|
|
15
18
|
import { cloneDeep, merge } from 'lodash';
|
|
16
|
-
import { DEFAULT_WALL_PRIMITIVE_OPTIONS } from "../constant";
|
|
19
|
+
import { DEFAULT_PRIMITIVE_OPTIONS, DEFAULT_WALL_PRIMITIVE_OPTIONS } from "../constant";
|
|
17
20
|
import BasePrimitive from "./BasePrimitive";
|
|
18
21
|
var WallPrimitive = /*#__PURE__*/function (_BasePrimitive) {
|
|
19
22
|
_inherits(WallPrimitive, _BasePrimitive);
|
|
@@ -26,14 +29,16 @@ var WallPrimitive = /*#__PURE__*/function (_BasePrimitive) {
|
|
|
26
29
|
key: "createPrimitive",
|
|
27
30
|
value: function createPrimitive() {
|
|
28
31
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
32
|
+
var primitiveInstance = arguments.length > 1 ? arguments[1] : undefined;
|
|
29
33
|
var style = merge(DEFAULT_WALL_PRIMITIVE_OPTIONS(), cloneDeep(options.style || {}));
|
|
34
|
+
var primitiveOptions = merge(DEFAULT_PRIMITIVE_OPTIONS(), cloneDeep(options.primitive || {}));
|
|
30
35
|
var appearance = new Cesium.PerInstanceColorAppearance({
|
|
31
36
|
translucent: !!(style !== null && style !== void 0 && style.translucent)
|
|
32
37
|
});
|
|
33
|
-
this.primitive = new Cesium.Primitive({
|
|
34
|
-
geometryInstances:
|
|
38
|
+
this.primitive = new Cesium.Primitive(_objectSpread({
|
|
39
|
+
geometryInstances: primitiveInstance,
|
|
35
40
|
appearance: appearance
|
|
36
|
-
});
|
|
41
|
+
}, primitiveOptions));
|
|
37
42
|
this.show = !!(style !== null && style !== void 0 && style.show);
|
|
38
43
|
}
|
|
39
44
|
}]);
|
|
@@ -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 WallPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
32
32
|
var _this;
|
|
33
33
|
_classCallCheck(this, WallPrimitiveInstance);
|
|
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_WALL_PRIMITIVE_OPTIONS(), cloneDeep(style || {}));
|
|
41
38
|
var currStyle = WallPrimitiveInstance.handleOptions(mergeStyle);
|
|
@@ -56,8 +53,8 @@ var WallPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
56
53
|
minimumHeights = _options$style.minimumHeights,
|
|
57
54
|
maximumHeights = _options$style.maximumHeights,
|
|
58
55
|
positions = options.positions,
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
primitiveInstance = options.primitiveInstance;
|
|
57
|
+
var instance = new Cesium.GeometryInstance({
|
|
61
58
|
id: this.id,
|
|
62
59
|
geometry: new Cesium.WallGeometry({
|
|
63
60
|
vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
|
|
@@ -69,7 +66,7 @@ var WallPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
69
66
|
color: color
|
|
70
67
|
}
|
|
71
68
|
});
|
|
72
|
-
|
|
69
|
+
primitiveInstance.push(instance);
|
|
73
70
|
}
|
|
74
71
|
|
|
75
72
|
// 更新geoJson数据
|
package/dist/esm/index.js
CHANGED
|
@@ -48,7 +48,7 @@ loadCss(Cesium.buildModuleUrl('Widgets/widgets.css'));
|
|
|
48
48
|
export var DeepTwinsEngine3D = /*#__PURE__*/_createClass(function DeepTwinsEngine3D() {
|
|
49
49
|
_classCallCheck(this, DeepTwinsEngine3D);
|
|
50
50
|
});
|
|
51
|
-
_defineProperty(DeepTwinsEngine3D, "Version", "0.1.
|
|
51
|
+
_defineProperty(DeepTwinsEngine3D, "Version", "0.1.10");
|
|
52
52
|
_defineProperty(DeepTwinsEngine3D, "Map", Map);
|
|
53
53
|
_defineProperty(DeepTwinsEngine3D, "GroundSkyBox", GroundSkyBox);
|
|
54
54
|
_defineProperty(DeepTwinsEngine3D, "RasterLayer", RasterLayer);
|