deeptwins-engine-3d 0.1.13 → 0.1.14

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.
@@ -18,6 +18,7 @@ import PolygonEntity from "./graphicLayer/PolygonEntity";
18
18
  import PolygonPrimitiveInstance from "./graphicLayer/PolygonPrimitiveInstance";
19
19
  import PolylineEntity from "./graphicLayer/PolylineEntity";
20
20
  import PolylinePrimitiveInstance from "./graphicLayer/PolylinePrimitiveInstance";
21
+ import PolylineGroundPrimitiveInstance from "./graphicLayer/PolylineGroundPrimitiveInstance";
21
22
  import PolylineVolumeEntity from "./graphicLayer/PolylineVolumeEntity";
22
23
  import PolylineVolumePrimitiveInstance from "./graphicLayer/PolylineVolumePrimitiveInstance";
23
24
  import WallEntity from "./graphicLayer/WallEntity";
@@ -383,6 +384,7 @@ export var DEFAULT_CIRCLE_WAVE_MATERIAL_STYLE = function DEFAULT_CIRCLE_WAVE_MAT
383
384
  export var DEFAULT_GLOW_MATERIAL_STYLE = function DEFAULT_GLOW_MATERIAL_STYLE() {
384
385
  return {
385
386
  color: Cesium.Color.WHITE,
387
+ glowStrength: 2,
386
388
  mixRatio: 0.5
387
389
  };
388
390
  };
@@ -404,7 +406,9 @@ export var GRAPHIC_LAYER_TYPE_TO_CLASS = {
404
406
  pointP: PointPrimitive,
405
407
  billboardP: BillboardPrimitive,
406
408
  polylineP: PolylinePrimitiveInstance,
409
+ polylineGroundP: PolylineGroundPrimitiveInstance,
407
410
  polygonP: PolygonPrimitiveInstance,
411
+ polygonGroundP: PolygonPrimitiveInstance,
408
412
  boxP: BoxPrimitiveInstance,
409
413
  modelP: ModelPrimitiveInstance,
410
414
  labelP: LabelPrimitive,
@@ -17,7 +17,9 @@ import BoxPrimitive from "./BoxPrimitive";
17
17
  import EllipsePrimitive from "./EllipsePrimitive";
18
18
  import EllipsoidPrimitive from "./EllipsoidPrimitive";
19
19
  import ModelPrimitive from "./ModelPrimitive";
20
+ import PolygonGroundPrimitive from "./PolygonGroundPrimitive";
20
21
  import PolygonPrimitive from "./PolygonPrimitive";
22
+ import PolylineGroundPrimitive from "./PolylineGroundPrimitive";
21
23
  import PolylinePrimitive from "./PolylinePrimitive";
22
24
  import PolylineVolumePrimitive from "./PolylineVolumePrimitive";
23
25
  import WallPrimitive from "./WallPrimitive";
@@ -105,9 +107,15 @@ var BaseLayer = /*#__PURE__*/function () {
105
107
  polylineP: function polylineP() {
106
108
  _this2.primitiveCollection = new PolylinePrimitive(_this2._mapContext);
107
109
  },
110
+ polylineGroundP: function polylineGroundP() {
111
+ _this2.primitiveCollection = new PolylineGroundPrimitive(_this2._mapContext);
112
+ },
108
113
  polygonP: function polygonP() {
109
114
  _this2.primitiveCollection = new PolygonPrimitive(_this2._mapContext);
110
115
  },
116
+ polygonGroundP: function polygonGroundP() {
117
+ _this2.primitiveCollection = new PolygonGroundPrimitive(_this2._mapContext);
118
+ },
111
119
  boxP: function boxP() {
112
120
  _this2.primitiveCollection = new BoxPrimitive(_this2._mapContext);
113
121
  },
@@ -0,0 +1,5 @@
1
+ import BasePrimitive from './BasePrimitive';
2
+ export default class PolygonGroundPrimitive extends BasePrimitive {
3
+ constructor(mapContext: any);
4
+ createPrimitive(options: any, primitiveInstance: any[]): void;
5
+ }
@@ -0,0 +1,49 @@
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; }
5
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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); } }
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; }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
11
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
14
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
15
+ 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; } }
16
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
17
+ import * as Cesium from 'deeptwins-cesium';
18
+ import { cloneDeep, merge } from 'lodash';
19
+ import { DEFAULT_POLYGON_PRIMITIVE_OPTIONS, DEFAULT_PRIMITIVE_OPTIONS } from "../constant";
20
+ import BasePrimitive from "./BasePrimitive";
21
+ var PolygonGroundPrimitive = /*#__PURE__*/function (_BasePrimitive) {
22
+ _inherits(PolygonGroundPrimitive, _BasePrimitive);
23
+ var _super = _createSuper(PolygonGroundPrimitive);
24
+ function PolygonGroundPrimitive(mapContext) {
25
+ _classCallCheck(this, PolygonGroundPrimitive);
26
+ return _super.call(this, mapContext);
27
+ }
28
+ _createClass(PolygonGroundPrimitive, [{
29
+ key: "createPrimitive",
30
+ value: function createPrimitive() {
31
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
32
+ var primitiveInstance = arguments.length > 1 ? arguments[1] : undefined;
33
+ var style = merge(DEFAULT_POLYGON_PRIMITIVE_OPTIONS(), cloneDeep(options.style || {}));
34
+ var primitiveOptions = merge(DEFAULT_PRIMITIVE_OPTIONS(), cloneDeep(options.primitive || {}));
35
+ var appearance = new Cesium.PerInstanceColorAppearance({
36
+ translucent: !!(style !== null && style !== void 0 && style.translucent)
37
+ });
38
+ this.primitive = new Cesium.GroundPrimitive(_objectSpread({
39
+ geometryInstances: primitiveInstance,
40
+ appearance: appearance,
41
+ releaseGeometryInstances: false,
42
+ asynchronous: true
43
+ }, primitiveOptions));
44
+ this.show = !!(style !== null && style !== void 0 && style.show);
45
+ }
46
+ }]);
47
+ return PolygonGroundPrimitive;
48
+ }(BasePrimitive);
49
+ export { PolygonGroundPrimitive as default };
@@ -0,0 +1,5 @@
1
+ import BasePrimitive from './BasePrimitive';
2
+ export default class PolylineGroundPrimitive extends BasePrimitive {
3
+ constructor(map: any);
4
+ createPrimitive(options: any, primitiveInstance: any[]): void;
5
+ }
@@ -0,0 +1,55 @@
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; }
5
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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); } }
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; }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
11
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
14
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
15
+ 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; } }
16
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
17
+ import * as Cesium from 'deeptwins-cesium';
18
+ import { cloneDeep, merge } from 'lodash';
19
+ import { DEFAULT_POLYLINE_PRIMITIVE_OPTIONS, DEFAULT_PRIMITIVE_OPTIONS } from "../constant";
20
+ import * as utils from "../tool/utils";
21
+ import BasePrimitive from "./BasePrimitive";
22
+ var PolylineGroundPrimitive = /*#__PURE__*/function (_BasePrimitive) {
23
+ _inherits(PolylineGroundPrimitive, _BasePrimitive);
24
+ var _super = _createSuper(PolylineGroundPrimitive);
25
+ function PolylineGroundPrimitive(map) {
26
+ _classCallCheck(this, PolylineGroundPrimitive);
27
+ return _super.call(this, map);
28
+ }
29
+ _createClass(PolylineGroundPrimitive, [{
30
+ key: "createPrimitive",
31
+ value: function createPrimitive() {
32
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
33
+ var primitiveInstance = arguments.length > 1 ? arguments[1] : undefined;
34
+ var style = merge(DEFAULT_POLYLINE_PRIMITIVE_OPTIONS(), cloneDeep(options.style || {}));
35
+ var primitiveOptions = merge(DEFAULT_PRIMITIVE_OPTIONS(), cloneDeep(options.primitive || {}));
36
+ var appearance = new Cesium.PolylineColorAppearance({
37
+ translucent: !!(style !== null && style !== void 0 && style.translucent)
38
+ });
39
+ if (style !== null && style !== void 0 && style.material) {
40
+ appearance = new Cesium.PolylineMaterialAppearance({
41
+ material: utils.colorMaterialString(style.material)
42
+ });
43
+ }
44
+ this.primitive = new Cesium.GroundPolylinePrimitive(_objectSpread({
45
+ geometryInstances: primitiveInstance,
46
+ appearance: appearance,
47
+ releaseGeometryInstances: false,
48
+ asynchronous: true
49
+ }, primitiveOptions));
50
+ this.show = !!(style !== null && style !== void 0 && style.show);
51
+ }
52
+ }]);
53
+ return PolylineGroundPrimitive;
54
+ }(BasePrimitive);
55
+ export { PolylineGroundPrimitive as default };
@@ -0,0 +1,7 @@
1
+ import BasePrimitiveInstance from './BasePrimitiveInstance';
2
+ export default class PolylineGroundPrimitiveInstance extends BasePrimitiveInstance {
3
+ constructor(options: any);
4
+ static handleOptions(style: any): any;
5
+ private _init;
6
+ updateData(): void;
7
+ }
@@ -0,0 +1,89 @@
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"],
3
+ _excluded2 = ["color"];
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
+ 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; }
6
+ 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; }
7
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
8
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
9
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
+ 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); } }
11
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
13
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
15
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
16
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
17
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
18
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
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
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21
+ import * as Cesium from 'deeptwins-cesium';
22
+ import { cloneDeep, merge } from 'lodash';
23
+ import { DEFAULT_POLYLINE_PRIMITIVE_OPTIONS } from "../constant";
24
+ import * as utils from "../tool/utils";
25
+ import BasePrimitiveInstance from "./BasePrimitiveInstance";
26
+
27
+ // 线实体图层
28
+ var PolylineGroundPrimitiveInstance = /*#__PURE__*/function (_BasePrimitiveInstanc) {
29
+ _inherits(PolylineGroundPrimitiveInstance, _BasePrimitiveInstanc);
30
+ var _super = _createSuper(PolylineGroundPrimitiveInstance);
31
+ function PolylineGroundPrimitiveInstance(options) {
32
+ var _this;
33
+ _classCallCheck(this, PolylineGroundPrimitiveInstance);
34
+ _this = _super.call(this, options);
35
+ var style = options.style,
36
+ currOptions = _objectWithoutProperties(options, _excluded);
37
+ var mergeStyle = merge(DEFAULT_POLYLINE_PRIMITIVE_OPTIONS(), cloneDeep(style || {}));
38
+ var currStyle = PolylineGroundPrimitiveInstance.handleOptions(mergeStyle);
39
+ _this._init(_objectSpread({
40
+ style: currStyle
41
+ }, currOptions));
42
+ return _this;
43
+ }
44
+
45
+ // 处理参数
46
+ _createClass(PolylineGroundPrimitiveInstance, [{
47
+ key: "_init",
48
+ value:
49
+ // 初始化
50
+ function _init(options) {
51
+ var _options$style = options.style,
52
+ color = _options$style.color,
53
+ width = _options$style.width,
54
+ primitiveInstance = options.primitiveInstance;
55
+ var instance = new Cesium.GeometryInstance({
56
+ id: this.id,
57
+ geometry: new Cesium.GroundPolylineGeometry({
58
+ positions: this.source.positions,
59
+ width: width,
60
+ granularity: 9999.0
61
+ }),
62
+ attributes: {
63
+ color: color
64
+ }
65
+ });
66
+ primitiveInstance.push(instance);
67
+ }
68
+
69
+ // 更新geoJson数据
70
+ }, {
71
+ key: "updateData",
72
+ value: function updateData() {
73
+ console.warn("".concat(this.type, "\u7C7B\u578B\u4E0D\u652F\u6301\u66F4\u65B0\u6570\u636E"));
74
+ }
75
+ }], [{
76
+ key: "handleOptions",
77
+ value: function handleOptions(style) {
78
+ var color = style.color,
79
+ options = _objectWithoutProperties(style, _excluded2);
80
+ var backStyle = _objectSpread({}, options);
81
+ if (color) {
82
+ backStyle.color = utils.colorInstanceString(color);
83
+ }
84
+ return backStyle;
85
+ }
86
+ }]);
87
+ return PolylineGroundPrimitiveInstance;
88
+ }(BasePrimitiveInstance);
89
+ export { PolylineGroundPrimitiveInstance as default };
package/dist/esm/index.js CHANGED
@@ -50,7 +50,7 @@ loadCss(Cesium.buildModuleUrl('Widgets/widgets.css'));
50
50
  export var DeepTwinsEngine3D = /*#__PURE__*/_createClass(function DeepTwinsEngine3D() {
51
51
  _classCallCheck(this, DeepTwinsEngine3D);
52
52
  });
53
- _defineProperty(DeepTwinsEngine3D, "Version", "0.1.13");
53
+ _defineProperty(DeepTwinsEngine3D, "Version", "0.1.14");
54
54
  _defineProperty(DeepTwinsEngine3D, "Map", Map);
55
55
  _defineProperty(DeepTwinsEngine3D, "GroundSkyBox", GroundSkyBox);
56
56
  _defineProperty(DeepTwinsEngine3D, "RasterLayer", RasterLayer);