deeptwins-engine-3d 0.1.8 → 0.1.11
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 +57 -32
- 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 +31 -5
- 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,18 +1,19 @@
|
|
|
1
1
|
export default class BaseSource {
|
|
2
|
+
private readonly _mapContext;
|
|
2
3
|
id: any;
|
|
3
4
|
geoJson: any;
|
|
4
5
|
source: any;
|
|
5
6
|
isDestroyed: boolean;
|
|
6
7
|
private _isCompleteInfo;
|
|
7
|
-
private _graphicLayerCollection;
|
|
8
8
|
static HANDLE_FEATURE_TYPE_FUN: any;
|
|
9
9
|
static HANDLE_FEATURE_CLAMP_TYPE_FUN: any;
|
|
10
|
-
constructor({ id, source, customSource,
|
|
10
|
+
constructor({ id, source, customSource, mapContext }: any);
|
|
11
|
+
getMap(): any;
|
|
11
12
|
private _canOperate;
|
|
12
13
|
private _handleGeoJson;
|
|
13
14
|
translateSource(source: any): void;
|
|
14
15
|
remove(): void;
|
|
15
|
-
setData(data: any): this;
|
|
16
|
+
setData(data: any): this | undefined;
|
|
16
17
|
_toDestroy(): void;
|
|
17
18
|
static analysisSourceType(data: any): "other" | "wkt" | "sourceId" | "sourceInstance" | "geoJson";
|
|
18
19
|
static wktToGeoJon(wkt: string): any;
|
|
@@ -31,17 +31,17 @@ var BaseSource = /*#__PURE__*/function () {
|
|
|
31
31
|
var id = _ref.id,
|
|
32
32
|
source = _ref.source,
|
|
33
33
|
customSource = _ref.customSource,
|
|
34
|
-
|
|
34
|
+
mapContext = _ref.mapContext;
|
|
35
35
|
_classCallCheck(this, BaseSource);
|
|
36
|
+
_defineProperty(this, "_mapContext", void 0);
|
|
36
37
|
_defineProperty(this, "id", void 0);
|
|
37
38
|
_defineProperty(this, "geoJson", void 0);
|
|
38
39
|
_defineProperty(this, "source", []);
|
|
39
40
|
_defineProperty(this, "isDestroyed", false);
|
|
40
41
|
// 是否是完整的信息
|
|
41
42
|
_defineProperty(this, "_isCompleteInfo", true);
|
|
42
|
-
_defineProperty(this, "_graphicLayerCollection", void 0);
|
|
43
43
|
this.id = id;
|
|
44
|
-
this.
|
|
44
|
+
this._mapContext = mapContext;
|
|
45
45
|
// 直接添加实体数据
|
|
46
46
|
if (customSource) {
|
|
47
47
|
this._isCompleteInfo = false;
|
|
@@ -50,20 +50,30 @@ var BaseSource = /*#__PURE__*/function () {
|
|
|
50
50
|
this.translateSource(source);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
// 是否能进行操作
|
|
55
53
|
_createClass(BaseSource, [{
|
|
54
|
+
key: "getMap",
|
|
55
|
+
value: function getMap() {
|
|
56
|
+
return this._mapContext.getMap();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 是否能进行操作
|
|
60
|
+
}, {
|
|
56
61
|
key: "_canOperate",
|
|
57
62
|
value: function _canOperate() {
|
|
58
63
|
if (this.isDestroyed) {
|
|
59
|
-
|
|
64
|
+
utils.error('BaseSource实例已销毁');
|
|
65
|
+
return false;
|
|
60
66
|
}
|
|
67
|
+
return true;
|
|
61
68
|
}
|
|
62
69
|
|
|
63
70
|
// 处理geoJson
|
|
64
71
|
}, {
|
|
65
72
|
key: "_handleGeoJson",
|
|
66
73
|
value: function _handleGeoJson(geoJson) {
|
|
74
|
+
if (!this._canOperate()) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
67
77
|
this.geoJson = geoJson;
|
|
68
78
|
this.source = BaseSource.geoJsonToGeoCartesian3Array(geoJson);
|
|
69
79
|
}
|
|
@@ -72,6 +82,9 @@ var BaseSource = /*#__PURE__*/function () {
|
|
|
72
82
|
}, {
|
|
73
83
|
key: "translateSource",
|
|
74
84
|
value: function translateSource(source) {
|
|
85
|
+
if (!this._canOperate()) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
75
88
|
var sourceType = BaseSource.analysisSourceType(source);
|
|
76
89
|
if (sourceType === 'geoJson') {
|
|
77
90
|
this._handleGeoJson(source);
|
|
@@ -86,20 +99,24 @@ var BaseSource = /*#__PURE__*/function () {
|
|
|
86
99
|
}, {
|
|
87
100
|
key: "remove",
|
|
88
101
|
value: function remove() {
|
|
89
|
-
this._canOperate()
|
|
102
|
+
if (!this._canOperate()) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
90
105
|
this.isDestroyed = true;
|
|
91
106
|
// 移除相应的new map上的数据
|
|
92
|
-
this.
|
|
107
|
+
this.getMap().graphicLayerCollection._removeGraphicMapSource(this.id);
|
|
93
108
|
}
|
|
94
109
|
|
|
95
110
|
// 更新数据
|
|
96
111
|
}, {
|
|
97
112
|
key: "setData",
|
|
98
113
|
value: function setData(data) {
|
|
99
|
-
this._canOperate()
|
|
114
|
+
if (!this._canOperate()) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
100
117
|
this.translateSource(data);
|
|
101
|
-
this.
|
|
102
|
-
this.
|
|
118
|
+
this.getMap().graphicLayerCollection.graphicSources.set(this.id, this);
|
|
119
|
+
this.getMap().graphicLayerCollection.setLayerData('_allLayer', this);
|
|
103
120
|
return this;
|
|
104
121
|
}
|
|
105
122
|
|
|
@@ -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", "pixelOffset", "eyeOffset", "alignedAxis", "rotation"];
|
|
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; }
|
|
@@ -18,8 +18,8 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
18
18
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
19
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
20
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21
|
-
import { cloneDeep, merge } from 'lodash';
|
|
22
21
|
import * as Cesium from 'deeptwins-cesium';
|
|
22
|
+
import { cloneDeep, merge } from 'lodash';
|
|
23
23
|
import { DEFAULT_BILLBOARD_OPTIONS } from "../constant";
|
|
24
24
|
import PositionProperty from "../property/PositionProperty";
|
|
25
25
|
import * as utils from "../tool/utils";
|
|
@@ -33,9 +33,7 @@ var BillboardEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
33
33
|
var _this;
|
|
34
34
|
_classCallCheck(this, BillboardEntity);
|
|
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 BillboardEntity = /*#__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.BillboardGraphics(style);
|
|
62
59
|
this.entity = new Cesium.Entity({
|
|
63
60
|
position: positions,
|
|
64
61
|
id: this.id,
|
|
65
|
-
billboard:
|
|
62
|
+
billboard: new Cesium.BillboardGraphics(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", "pixelOffset", "eyeOffset", "alignedAxis", "rotation"];
|
|
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 BillboardPrimitive = /*#__PURE__*/function (_BasePointPrimitive) {
|
|
|
29
29
|
var _this;
|
|
30
30
|
_classCallCheck(this, BillboardPrimitive);
|
|
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_BILLBOARD_PRIMITIVE_OPTIONS(), cloneDeep(style || {}));
|
|
37
35
|
var currStyle = BillboardPrimitive.handleOptions(mergeStyle);
|
|
@@ -48,19 +46,45 @@ var BillboardPrimitive = /*#__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._billboards) === 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", "dimensions"];
|
|
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 BoxEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
33
33
|
var _this;
|
|
34
34
|
_classCallCheck(this, BoxEntity);
|
|
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,11 +57,10 @@ var BoxEntity = /*#__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.BoxGraphics(style);
|
|
63
60
|
this.entity = new Cesium.Entity({
|
|
64
61
|
id: this.id,
|
|
65
62
|
position: positions,
|
|
66
|
-
box:
|
|
63
|
+
box: new Cesium.BoxGraphics(style)
|
|
67
64
|
});
|
|
68
65
|
}
|
|
69
66
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BasePrimitive from './BasePrimitive';
|
|
2
2
|
export default class BoxPrimitive 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,28 +16,30 @@ 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_BOX_PRIMITIVE_OPTIONS } from "../constant";
|
|
19
|
+
import { DEFAULT_BOX_PRIMITIVE_OPTIONS, DEFAULT_PRIMITIVE_OPTIONS } from "../constant";
|
|
17
20
|
import BasePrimitive from "./BasePrimitive";
|
|
18
21
|
var BoxPrimitive = /*#__PURE__*/function (_BasePrimitive) {
|
|
19
22
|
_inherits(BoxPrimitive, _BasePrimitive);
|
|
20
23
|
var _super = _createSuper(BoxPrimitive);
|
|
21
|
-
function BoxPrimitive(
|
|
24
|
+
function BoxPrimitive(mapContext) {
|
|
22
25
|
_classCallCheck(this, BoxPrimitive);
|
|
23
|
-
return _super.call(this,
|
|
26
|
+
return _super.call(this, mapContext);
|
|
24
27
|
}
|
|
25
28
|
_createClass(BoxPrimitive, [{
|
|
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_BOX_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
|
closed: true
|
|
33
38
|
});
|
|
34
|
-
this.primitive = new Cesium.Primitive({
|
|
35
|
-
geometryInstances:
|
|
39
|
+
this.primitive = new Cesium.Primitive(_objectSpread({
|
|
40
|
+
geometryInstances: primitiveInstance,
|
|
36
41
|
appearance: appearance
|
|
37
|
-
});
|
|
42
|
+
}, primitiveOptions));
|
|
38
43
|
this.show = !!(style !== null && style !== void 0 && style.show);
|
|
39
44
|
}
|
|
40
45
|
}]);
|
|
@@ -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", "dimensions"];
|
|
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 BoxPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
32
32
|
var _this;
|
|
33
33
|
_classCallCheck(this, BoxPrimitiveInstance);
|
|
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
|
currOptions = _objectWithoutProperties(options, _excluded);
|
|
39
37
|
var mergeStyle = merge(DEFAULT_BOX_PRIMITIVE_OPTIONS(), cloneDeep(style || {}));
|
|
40
38
|
var currStyle = BoxPrimitiveInstance.handleOptions(mergeStyle);
|
|
@@ -55,8 +53,8 @@ var BoxPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
55
53
|
dimensions = _options$style.dimensions,
|
|
56
54
|
scale = _options$style.scale,
|
|
57
55
|
positions = options.positions,
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
primitiveInstance = options.primitiveInstance;
|
|
57
|
+
var instance = new Cesium.GeometryInstance({
|
|
60
58
|
id: this.id,
|
|
61
59
|
geometry: Cesium.BoxGeometry.fromDimensions({
|
|
62
60
|
vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
|
|
@@ -67,7 +65,7 @@ var BoxPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
67
65
|
color: color
|
|
68
66
|
}
|
|
69
67
|
});
|
|
70
|
-
|
|
68
|
+
primitiveInstance.push(instance);
|
|
71
69
|
}
|
|
72
70
|
|
|
73
71
|
// 更新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", "rotation", "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 EllipseEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
33
33
|
var _this;
|
|
34
34
|
_classCallCheck(this, EllipseEntity);
|
|
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) {
|
|
@@ -60,11 +58,10 @@ var EllipseEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
60
58
|
var alt = options.geometry.coordinates[2];
|
|
61
59
|
alt && !style.height && (style.height = alt);
|
|
62
60
|
var positions = PositionProperty.changeToPropertyData.call(this);
|
|
63
|
-
this.graphic = new Cesium.EllipseGraphics(style);
|
|
64
61
|
this.entity = new Cesium.Entity({
|
|
65
62
|
position: positions,
|
|
66
63
|
id: this.id,
|
|
67
|
-
ellipse:
|
|
64
|
+
ellipse: new Cesium.EllipseGraphics(style)
|
|
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_ELLIPSE_PRIMITIVE_OPTIONS } from "../constant";
|
|
19
|
+
import { DEFAULT_ELLIPSE_PRIMITIVE_OPTIONS, DEFAULT_PRIMITIVE_OPTIONS } from "../constant";
|
|
17
20
|
import BasePrimitive from "./BasePrimitive";
|
|
18
21
|
var EllipsePrimitive = /*#__PURE__*/function (_BasePrimitive) {
|
|
19
22
|
_inherits(EllipsePrimitive, _BasePrimitive);
|
|
@@ -26,14 +29,16 @@ var EllipsePrimitive = /*#__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_ELLIPSE_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", "rotation", "stRotation"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -33,10 +33,7 @@ var EllipsePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
33
33
|
var _this;
|
|
34
34
|
_classCallCheck(this, EllipsePrimitiveInstance);
|
|
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_ELLIPSE_PRIMITIVE_OPTIONS(), cloneDeep(style || {}));
|
|
42
39
|
var currStyle = EllipsePrimitiveInstance.handleOptions(mergeStyle);
|
|
@@ -56,12 +53,12 @@ var EllipsePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
56
53
|
color = _options$style.color,
|
|
57
54
|
style = _objectWithoutProperties(_options$style, _excluded2),
|
|
58
55
|
positions = options.positions,
|
|
59
|
-
|
|
56
|
+
primitiveInstance = options.primitiveInstance;
|
|
60
57
|
if (isNil(style.height)) {
|
|
61
58
|
var _utils$cartesian3ToLn;
|
|
62
59
|
style.height = ((_utils$cartesian3ToLn = utils.cartesian3ToLngLatAlt(positions)) === null || _utils$cartesian3ToLn === void 0 ? void 0 : _utils$cartesian3ToLn.alt) || 0;
|
|
63
60
|
}
|
|
64
|
-
|
|
61
|
+
var instance = new Cesium.GeometryInstance({
|
|
65
62
|
id: this.id,
|
|
66
63
|
geometry: new Cesium.EllipseGeometry(_objectSpread({
|
|
67
64
|
center: positions,
|
|
@@ -71,7 +68,7 @@ var EllipsePrimitiveInstance = /*#__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 = ["radii", "innerRadii", "minimumClock", "maximumClock", "minimumCone", "maximumCone", "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 EllipsoidEntity = /*#__PURE__*/function (_BaseEntity) {
|
|
|
33
33
|
var _this;
|
|
34
34
|
_classCallCheck(this, EllipsoidEntity);
|
|
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 EllipsoidEntity = /*#__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.EllipsoidGraphics(style);
|
|
62
59
|
this.entity = new Cesium.Entity({
|
|
63
60
|
position: positions,
|
|
64
61
|
id: this.id,
|
|
65
|
-
ellipsoid:
|
|
62
|
+
ellipsoid: new Cesium.EllipsoidGraphics(style)
|
|
66
63
|
});
|
|
67
64
|
}
|
|
68
65
|
|
|
@@ -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_ELLIPSOID_PRIMITIVE_OPTIONS } from "../constant";
|
|
19
|
+
import { DEFAULT_ELLIPSOID_PRIMITIVE_OPTIONS, DEFAULT_PRIMITIVE_OPTIONS } from "../constant";
|
|
17
20
|
import BasePrimitive from "./BasePrimitive";
|
|
18
21
|
var EllipsoidPrimitive = /*#__PURE__*/function (_BasePrimitive) {
|
|
19
22
|
_inherits(EllipsoidPrimitive, _BasePrimitive);
|
|
@@ -26,15 +29,17 @@ var EllipsoidPrimitive = /*#__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_ELLIPSOID_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
|
closed: true
|
|
33
38
|
});
|
|
34
|
-
this.primitive = new Cesium.Primitive({
|
|
35
|
-
geometryInstances:
|
|
39
|
+
this.primitive = new Cesium.Primitive(_objectSpread({
|
|
40
|
+
geometryInstances: primitiveInstance,
|
|
36
41
|
appearance: appearance
|
|
37
|
-
});
|
|
42
|
+
}, primitiveOptions));
|
|
38
43
|
this.show = !!(style !== null && style !== void 0 && style.show);
|
|
39
44
|
}
|
|
40
45
|
}]);
|
|
@@ -56,8 +56,8 @@ var EllipsePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
56
56
|
color = _options$style.color,
|
|
57
57
|
style = _objectWithoutProperties(_options$style, _excluded2),
|
|
58
58
|
positions = options.positions,
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
primitiveInstance = options.primitiveInstance;
|
|
60
|
+
var instance = new Cesium.GeometryInstance({
|
|
61
61
|
id: this.id,
|
|
62
62
|
modelMatrix: Cesium.Transforms.eastNorthUpToFixedFrame(positions),
|
|
63
63
|
geometry: new Cesium.EllipsoidGeometry(_objectSpread({
|
|
@@ -67,7 +67,7 @@ var EllipsePrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
|
|
|
67
67
|
color: color
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
|
-
|
|
70
|
+
primitiveInstance.push(instance);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
// 更新geoJson数据
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import { MapContext } from '../map/Map';
|
|
1
2
|
import BaseLayer from './BaseLayer';
|
|
2
3
|
import BaseSource from './BaseSource';
|
|
3
4
|
export default class GraphicLayerCollection {
|
|
4
|
-
private
|
|
5
|
-
|
|
5
|
+
private readonly _mapContext;
|
|
6
|
+
isDestroyed: boolean;
|
|
6
7
|
graphicLayers: Map<any, any>;
|
|
7
8
|
graphicSources: Map<any, any>;
|
|
8
|
-
constructor(
|
|
9
|
+
constructor(mapContext: MapContext);
|
|
9
10
|
private _canOperate;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
getMap(): any;
|
|
12
|
+
addSource(id: string, geoJson: any): BaseSource | undefined;
|
|
13
|
+
addCustomSource(id: string, positions: any): BaseSource | undefined;
|
|
14
|
+
addLayer(data: any, options: any): BaseLayer | undefined;
|
|
15
|
+
addCustomSourceToLayer(positions: any, options: any): BaseLayer | undefined;
|
|
14
16
|
private _addLayerToMap;
|
|
15
17
|
private _removeGraphicMapLayer;
|
|
16
18
|
private _removeGraphicMapSource;
|