@anov/3d-ability 0.0.4-alpha7 → 0.0.4-alpha8

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.
Files changed (130) hide show
  1. package/dist/animation/index.d.ts +0 -1
  2. package/dist/animation/index.js +1 -1
  3. package/dist/animation/index.js.map +1 -1
  4. package/dist/camera/index.d.ts +65 -0
  5. package/dist/camera/index.js +239 -0
  6. package/dist/camera/index.js.map +1 -0
  7. package/dist/city/flyinglead.d.ts +0 -0
  8. package/dist/city/radar.d.ts +0 -0
  9. package/dist/city/scanning.d.ts +0 -0
  10. package/dist/city/surroundLine.d.ts +0 -0
  11. package/dist/core/mouseDrawe.d.ts +2 -0
  12. package/dist/environment/cloud/cloud.d.ts +1 -0
  13. package/dist/environment/cloud/index.d.ts +7 -0
  14. package/dist/environment/rain.d.ts +20 -0
  15. package/dist/environment/rainShader/shader.d.ts +26 -0
  16. package/dist/environment/shaderCloud/cloudMaterial.d.ts +10 -0
  17. package/dist/environment/shaderCloud/shader.d.ts +5 -0
  18. package/dist/environment/sky/index.js +10 -13
  19. package/dist/environment/sky/index.js.map +1 -1
  20. package/dist/environment/skyBox/index.d.ts +41 -0
  21. package/dist/environment/skyBox/index.js +150 -0
  22. package/dist/environment/skyBox/index.js.map +1 -0
  23. package/dist/environment/snow.js +2 -0
  24. package/dist/environment/snow.js.map +1 -1
  25. package/dist/environment/sun/index.d.ts +13 -0
  26. package/dist/environment/volumetricCloud/cloudMaterial.d.ts +3 -0
  27. package/dist/environment/volumetricCloud/inex.d.ts +8 -0
  28. package/dist/heatmap/index.d.ts +9 -0
  29. package/dist/heatmap/index.js +138 -0
  30. package/dist/heatmap/index.js.map +1 -0
  31. package/dist/helper/view/index.d.ts +40 -0
  32. package/dist/helper/view/utils.d.ts +6 -0
  33. package/dist/index.d.ts +8 -4
  34. package/dist/index.js +8 -4
  35. package/dist/index.js.map +1 -1
  36. package/dist/line/curve.d.ts +33 -0
  37. package/dist/line/curve.js +71 -0
  38. package/dist/line/curve.js.map +1 -0
  39. package/dist/line/index.d.ts +0 -0
  40. package/dist/line/index.js +2 -0
  41. package/dist/line/index.js.map +1 -0
  42. package/dist/line/round-curve.d.ts +19 -0
  43. package/dist/line/round-curve.js +212 -0
  44. package/dist/line/round-curve.js.map +1 -0
  45. package/dist/material/finirMaterialMaterial/index.d.ts +9 -0
  46. package/dist/material/finirMaterialMaterial/index.js +47 -0
  47. package/dist/material/finirMaterialMaterial/index.js.map +1 -0
  48. package/dist/material/pristineGridMaterial/index.d.ts +20 -0
  49. package/dist/material/pristineGridMaterial/shader/fragment.d.ts +2 -0
  50. package/dist/material/pristineGridMaterial/shader/vertex.d.ts +2 -0
  51. package/dist/poi/core/Base.d.ts +7 -0
  52. package/dist/poi/core/Base.js +24 -0
  53. package/dist/poi/core/Base.js.map +1 -0
  54. package/dist/poi/core/Css2D.d.ts +20 -0
  55. package/dist/poi/core/Css2D.js +181 -0
  56. package/dist/poi/core/Css2D.js.map +1 -0
  57. package/dist/poi/core/Css3D.d.ts +1 -0
  58. package/dist/poi/core/Css3D.js +24 -0
  59. package/dist/poi/core/Css3D.js.map +1 -0
  60. package/dist/poi/core/Sprite.d.ts +11 -0
  61. package/dist/poi/core/Sprite.js +134 -0
  62. package/dist/poi/core/Sprite.js.map +1 -0
  63. package/dist/poi/core/SpriteBase.d.ts +11 -0
  64. package/dist/poi/core/SpriteBase.js +58 -0
  65. package/dist/poi/core/SpriteBase.js.map +1 -0
  66. package/dist/poi/index.d.ts +9 -16
  67. package/dist/poi/index.js +11 -96
  68. package/dist/poi/index.js.map +1 -1
  69. package/dist/poi/utils/base64.d.ts +3 -0
  70. package/dist/poi/utils/base64.js +4 -0
  71. package/dist/poi/utils/base64.js.map +1 -0
  72. package/dist/poi/utils/canvas.d.ts +3 -0
  73. package/dist/poi/utils/canvas.js +68 -0
  74. package/dist/poi/utils/canvas.js.map +1 -0
  75. package/dist/poi/utils/css.d.ts +35 -0
  76. package/dist/poi/utils/css.js +41 -0
  77. package/dist/poi/utils/css.js.map +1 -0
  78. package/dist/poi/utils/type.d.ts +35 -0
  79. package/dist/poi/utils/type.js +39 -0
  80. package/dist/poi/utils/type.js.map +1 -0
  81. package/dist/poiBack/assets.js.map +1 -0
  82. package/dist/poiBack/dom.js.map +1 -0
  83. package/dist/poiBack/index.d.ts +19 -0
  84. package/dist/poiBack/index.js +145 -0
  85. package/dist/poiBack/index.js.map +1 -0
  86. package/dist/poiBack/type.js.map +1 -0
  87. package/dist/postEffects/bloomPass.d.ts +5 -0
  88. package/dist/postEffects/index.d.ts +11 -0
  89. package/dist/postEffects/outlinePass.d.ts +16 -0
  90. package/dist/postEffects/outlinePass.js +7 -1
  91. package/dist/postEffects/outlinePass.js.map +1 -1
  92. package/dist/scene/grow/grow.d.ts +10 -0
  93. package/dist/{animation → scene}/grow/grow.js +66 -33
  94. package/dist/scene/grow/grow.js.map +1 -0
  95. package/dist/scene/grow/growStyle.js.map +1 -0
  96. package/dist/scene/grow/index.js.map +1 -0
  97. package/dist/{animation → scene}/grow/style_down.d.ts +2 -0
  98. package/dist/{animation → scene}/grow/style_down.js +22 -21
  99. package/dist/scene/grow/style_down.js.map +1 -0
  100. package/dist/{animation → scene}/grow/style_up.d.ts +2 -0
  101. package/dist/{animation → scene}/grow/style_up.js +24 -22
  102. package/dist/scene/grow/style_up.js.map +1 -0
  103. package/dist/{animation → scene}/grow/type.d.ts +12 -11
  104. package/dist/scene/grow/type.js.map +1 -0
  105. package/dist/scene/index.d.ts +1 -0
  106. package/dist/scene/index.js +2 -0
  107. package/dist/scene/index.js.map +1 -0
  108. package/dist/utils/index.d.ts +1 -0
  109. package/package.json +10 -3
  110. package/dist/animation/grow/grow.d.ts +0 -10
  111. package/dist/animation/grow/grow.js.map +0 -1
  112. package/dist/animation/grow/growStyle.js.map +0 -1
  113. package/dist/animation/grow/index.js.map +0 -1
  114. package/dist/animation/grow/style_down.js.map +0 -1
  115. package/dist/animation/grow/style_up.js.map +0 -1
  116. package/dist/animation/grow/type.js.map +0 -1
  117. package/dist/poi/assets.js.map +0 -1
  118. package/dist/poi/dom.js.map +0 -1
  119. package/dist/poi/type.js.map +0 -1
  120. /package/dist/{poi → poiBack}/assets.d.ts +0 -0
  121. /package/dist/{poi → poiBack}/assets.js +0 -0
  122. /package/dist/{poi → poiBack}/dom.d.ts +0 -0
  123. /package/dist/{poi → poiBack}/dom.js +0 -0
  124. /package/dist/{poi → poiBack}/type.d.ts +0 -0
  125. /package/dist/{poi → poiBack}/type.js +0 -0
  126. /package/dist/{animation → scene}/grow/growStyle.d.ts +0 -0
  127. /package/dist/{animation → scene}/grow/growStyle.js +0 -0
  128. /package/dist/{animation → scene}/grow/index.d.ts +0 -0
  129. /package/dist/{animation → scene}/grow/index.js +0 -0
  130. /package/dist/{animation → scene}/grow/type.js +0 -0
@@ -0,0 +1,181 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
+ 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); } }
6
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
7
+ 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); }
8
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
9
+ 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); }; }
10
+ 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); }
11
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
12
+ 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; } }
13
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
14
+ 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; }
15
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
16
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
17
+ import { Object3D, Vector2 } from '@anov/3d-core';
18
+ import { EAnimationType, EPoiType, EventType } from "../utils/type";
19
+ import { getBasePoiStyle, getPanelStyle } from "../utils/css";
20
+ var DafultOption = {
21
+ animation: {
22
+ type: EAnimationType.fadeIn,
23
+ duration: 0.3
24
+ }
25
+ };
26
+ var Css2D = /*#__PURE__*/function (_Object3D) {
27
+ _inherits(Css2D, _Object3D);
28
+ var _super = _createSuper(Css2D);
29
+ function Css2D(type, data, option) {
30
+ var _this;
31
+ _classCallCheck(this, Css2D);
32
+ _this = _super.call(this);
33
+ _defineProperty(_assertThisInitialized(_this), "element", void 0);
34
+ _defineProperty(_assertThisInitialized(_this), "contentDom", void 0);
35
+ _defineProperty(_assertThisInitialized(_this), "isCSS2DObject", void 0);
36
+ _defineProperty(_assertThisInitialized(_this), "center", void 0);
37
+ _defineProperty(_assertThisInitialized(_this), "poiType", void 0);
38
+ _defineProperty(_assertThisInitialized(_this), "data", void 0);
39
+ _defineProperty(_assertThisInitialized(_this), "option", void 0);
40
+ _this.poiType = type;
41
+ _this.data = data;
42
+ _this.option = _objectSpread(_objectSpread({}, DafultOption), option);
43
+ _this.element = _this.createElement();
44
+ if (!_this.element) throw new Error('Cannot generate HTMLElement element');
45
+ _this.isCSS2DObject = true;
46
+ _this.element.style.position = 'absolute';
47
+ _this.element.style.userSelect = 'none';
48
+ _this.element.setAttribute('draggable', 'false');
49
+ _this.center = new Vector2(0.5, 0.5); // ( 0, 0 ) is the lower left; ( 1, 1 ) is the top right
50
+
51
+ _this.addEventListener('removed', function () {
52
+ _this.traverse(function (object) {
53
+ if (object.element instanceof Element && object.element.parentNode !== null) object.element.parentNode.removeChild(object.element);
54
+ });
55
+ });
56
+ _this.setAttribute();
57
+ return _this;
58
+ }
59
+ _createClass(Css2D, [{
60
+ key: "createElement",
61
+ value: function createElement() {
62
+ var _this2 = this;
63
+ var element;
64
+ // 直接传递DOM元素
65
+ if (this.data instanceof HTMLElement) {
66
+ element = this.data;
67
+ } else {
68
+ switch (this.poiType) {
69
+ case EPoiType.Base:
70
+ // 基础POI点
71
+ element = this.titlePanel(this.data);
72
+ break;
73
+ case EPoiType.Panel:
74
+ // 面板
75
+ element = this.contentPanel(this.data);
76
+ break;
77
+ }
78
+ }
79
+ EventType.forEach(function (type) {
80
+ element.addEventListener(type.name, function (event) {
81
+ (_this2._listeners[type.name] || []).forEach(function (cb) {
82
+ cb(event);
83
+ });
84
+ });
85
+ });
86
+ return element;
87
+ }
88
+ }, {
89
+ key: "setAttribute",
90
+ value: function setAttribute() {
91
+ var _this3 = this;
92
+ var hasExecuted = false;
93
+ // 执行渐显、打印内容等操作
94
+ this.onAfterRender = function () {
95
+ if (hasExecuted) return;
96
+ setTimeout(function () {
97
+ _this3.element.style.opacity = '1';
98
+ var print = _this3.option.print;
99
+ if (_this3.poiType === EPoiType.Panel && print) _this3.print(_this3.contentDom, _this3.data.content);
100
+ });
101
+ hasExecuted = true;
102
+ };
103
+ }
104
+ }, {
105
+ key: "titlePanel",
106
+ value: function titlePanel(data) {
107
+ var defaultStyle = getBasePoiStyle();
108
+ this.assignStyle(defaultStyle);
109
+ var containerDom = document.createElement('div');
110
+ Object.keys(defaultStyle).forEach(function (key) {
111
+ containerDom.style[key] = defaultStyle[key];
112
+ });
113
+ containerDom.innerText = data;
114
+ return containerDom;
115
+ }
116
+ }, {
117
+ key: "contentPanel",
118
+ value: function contentPanel(data) {
119
+ var _this4 = this;
120
+ var defaultStyle = getPanelStyle();
121
+ this.assignStyle(defaultStyle.container);
122
+ var containerDom = document.createElement('div');
123
+ Object.keys(defaultStyle.container).forEach(function (key) {
124
+ containerDom.style[key] = defaultStyle.container[key];
125
+ });
126
+ var titleDom = document.createElement('div');
127
+ titleDom.innerText = data.title;
128
+ Object.keys(defaultStyle.title).forEach(function (key) {
129
+ titleDom.style[key] = defaultStyle.title[key];
130
+ });
131
+ containerDom.appendChild(titleDom);
132
+ this.contentDom = document.createElement('div');
133
+ if (!this.option.print) this.contentDom.innerText = data.content;
134
+ Object.keys(defaultStyle.content).forEach(function (key) {
135
+ _this4.contentDom.style[key] = defaultStyle.content[key];
136
+ });
137
+ containerDom.appendChild(this.contentDom);
138
+ return containerDom;
139
+ }
140
+ }, {
141
+ key: "assignStyle",
142
+ value: function assignStyle(style) {
143
+ var _this$option = this.option,
144
+ width = _this$option.width,
145
+ height = _this$option.height,
146
+ img = _this$option.img,
147
+ animation = _this$option.animation;
148
+ if (animation) {
149
+ switch (animation.type) {
150
+ case EAnimationType.appear:
151
+ case EAnimationType.fadeIn:
152
+ style.opacity = 0;
153
+ style.transition = "opacity ".concat(animation.duration, "s ease");
154
+ break;
155
+ case EAnimationType.grow:
156
+ break;
157
+ }
158
+ }
159
+ if (width) style.width = "".concat(width, "px");
160
+ if (height) style.height = "".concat(height, "px");
161
+ if (img) style.backgroundImage = "url(".concat(img, ")");
162
+ }
163
+ }, {
164
+ key: "print",
165
+ value: function print(container, text) {
166
+ var index = 0;
167
+ var p = function p() {
168
+ if (index < text.length) {
169
+ container.textContent += text.charAt(index);
170
+ index++;
171
+ setTimeout(p, 20); // 调整打印速度,这里是每个字符间隔30毫秒
172
+ }
173
+ };
174
+
175
+ p();
176
+ }
177
+ }]);
178
+ return Css2D;
179
+ }(Object3D);
180
+ export default Css2D;
181
+ //# sourceMappingURL=Css2D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Object3D","Vector2","EAnimationType","EPoiType","EventType","getBasePoiStyle","getPanelStyle","DafultOption","animation","type","fadeIn","duration","Css2D","data","option","poiType","element","createElement","Error","isCSS2DObject","style","position","userSelect","setAttribute","center","addEventListener","traverse","object","Element","parentNode","removeChild","HTMLElement","Base","titlePanel","Panel","contentPanel","forEach","name","event","_listeners","cb","hasExecuted","onAfterRender","setTimeout","opacity","print","contentDom","content","defaultStyle","assignStyle","containerDom","document","Object","keys","key","innerText","container","titleDom","title","appendChild","width","height","img","appear","transition","grow","backgroundImage","text","index","p","length","textContent","charAt"],"sources":["../../../src/poi/core/Css2D.ts"],"sourcesContent":["import { Object3D, Vector2, use } from '@anov/3d-core'\nimport { EAnimationType, EPoiType, EventType } from '../utils/type'\nimport type { IEventType, IOption } from '../utils/type'\nimport { getBasePoiStyle, getPanelStyle } from '../utils/css'\n\nconst DafultOption = {\n animation: {\n type: EAnimationType.fadeIn,\n duration: 0.3,\n },\n}\n\nclass Css2D extends Object3D {\n element!: HTMLElement\n contentDom!: HTMLElement\n isCSS2DObject: boolean\n center: Vector2\n\n poiType: EPoiType\n data!: any\n option!: IOption\n\n constructor(type: EPoiType, data: any, option: IOption) {\n super()\n\n this.poiType = type\n this.data = data\n this.option = { ...DafultOption, ...option }\n this.element = this.createElement()\n\n if (!this.element)\n throw new Error('Cannot generate HTMLElement element')\n\n this.isCSS2DObject = true\n\n this.element.style.position = 'absolute'\n this.element.style.userSelect = 'none'\n this.element.setAttribute('draggable', 'false')\n\n this.center = new Vector2(0.5, 0.5) // ( 0, 0 ) is the lower left; ( 1, 1 ) is the top right\n\n this.addEventListener('removed', () => {\n this.traverse((object) => {\n if (object.element instanceof Element && object.element.parentNode !== null)\n object.element.parentNode.removeChild(object.element)\n })\n })\n this.setAttribute()\n }\n\n private createElement() {\n let element!: HTMLElement\n // 直接传递DOM元素\n if (this.data instanceof HTMLElement) {\n element = this.data\n }\n else {\n switch (this.poiType) {\n case EPoiType.Base: // 基础POI点\n element = this.titlePanel(this.data)\n break\n case EPoiType.Panel: // 面板\n element = this.contentPanel(this.data)\n break\n }\n }\n\n EventType.forEach((type: IEventType) => {\n element.addEventListener(type.name, (event) => {\n (this._listeners[type.name] || []).forEach((cb: Function) => {\n cb(event)\n })\n })\n })\n return element\n }\n\n setAttribute() {\n let hasExecuted = false\n // 执行渐显、打印内容等操作\n this.onAfterRender = () => {\n if (hasExecuted)\n return\n setTimeout(() => {\n this.element.style.opacity = '1'\n const { print } = this.option\n if (this.poiType === EPoiType.Panel && print)\n this.print(this.contentDom, this.data.content)\n })\n hasExecuted = true\n }\n }\n\n private titlePanel(data: string) {\n const defaultStyle = getBasePoiStyle()\n this.assignStyle(defaultStyle)\n const containerDom = document.createElement('div')\n Object.keys(defaultStyle).forEach((key) => {\n containerDom.style[key as any] = defaultStyle[key]\n })\n containerDom.innerText = data as string\n return containerDom\n }\n\n private contentPanel(data: any) {\n const defaultStyle = getPanelStyle()\n this.assignStyle(defaultStyle.container)\n const containerDom = document.createElement('div')\n Object.keys(defaultStyle.container).forEach((key) => {\n containerDom.style[key as any] = defaultStyle.container[key]\n })\n\n const titleDom = document.createElement('div')\n titleDom.innerText = data.title\n Object.keys(defaultStyle.title).forEach((key) => {\n titleDom.style[key as any] = defaultStyle.title[key]\n })\n containerDom.appendChild(titleDom)\n\n this.contentDom = document.createElement('div')\n if (!this.option.print)\n this.contentDom.innerText = data.content\n Object.keys(defaultStyle.content).forEach((key) => {\n this.contentDom.style[key as any] = defaultStyle.content[key]\n })\n containerDom.appendChild(this.contentDom)\n return containerDom\n }\n\n private assignStyle(style: any) {\n const { width, height, img, animation } = this.option\n if (animation) {\n switch (animation.type) {\n case EAnimationType.appear:\n case EAnimationType.fadeIn:\n style.opacity = 0\n style.transition = `opacity ${animation.duration}s ease`\n break\n case EAnimationType.grow:\n break\n }\n }\n if (width)\n style.width = `${width}px`\n if (height)\n style.height = `${height}px`\n if (img)\n style.backgroundImage = `url(${img})`\n }\n\n private print(container: HTMLElement, text: string) {\n let index = 0\n const p = () => {\n if (index < text.length) {\n container.textContent += text.charAt(index)\n index++\n setTimeout(p, 20) // 调整打印速度,这里是每个字符间隔30毫秒\n }\n }\n p()\n }\n}\n\nexport default Css2D"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,QAAQ,EAAEC,OAAO,QAAa,eAAe;AACtD,SAASC,cAAc,EAAEC,QAAQ,EAAEC,SAAS;AAE5C,SAASC,eAAe,EAAEC,aAAa;AAEvC,IAAMC,YAAY,GAAG;EACnBC,SAAS,EAAE;IACTC,IAAI,EAAEP,cAAc,CAACQ,MAAM;IAC3BC,QAAQ,EAAE;EACZ;AACF,CAAC;AAAA,IAEKC,KAAK;EAAA;EAAA;EAUT,eAAYH,IAAc,EAAEI,IAAS,EAAEC,MAAe,EAAE;IAAA;IAAA;IACtD;IAAO;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAEP,MAAKC,OAAO,GAAGN,IAAI;IACnB,MAAKI,IAAI,GAAGA,IAAI;IAChB,MAAKC,MAAM,mCAAQP,YAAY,GAAKO,MAAM,CAAE;IAC5C,MAAKE,OAAO,GAAG,MAAKC,aAAa,EAAE;IAEnC,IAAI,CAAC,MAAKD,OAAO,EACf,MAAM,IAAIE,KAAK,CAAC,qCAAqC,CAAC;IAExD,MAAKC,aAAa,GAAG,IAAI;IAEzB,MAAKH,OAAO,CAACI,KAAK,CAACC,QAAQ,GAAG,UAAU;IACxC,MAAKL,OAAO,CAACI,KAAK,CAACE,UAAU,GAAG,MAAM;IACtC,MAAKN,OAAO,CAACO,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC;IAE/C,MAAKC,MAAM,GAAG,IAAIvB,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,EAAC;;IAEpC,MAAKwB,gBAAgB,CAAC,SAAS,EAAE,YAAM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AC4C,UAAU,qBAAcxD,SAAS,CAACG,QAAQ,WAAQ;YACxD;UACF,KAAKT,cAAc,CAAC+D,IAAI;YACtB;QAAK;MAEX;MACA,IAAIL,KAAK,EACPxC,KAAK,CAACwC,KAAK,aAAMA,KAAK,OAAI;MAC5B,IAAIC,MAAM,EACRzC,KAAK,CAACyC,MAAM,aAAMA,MAAM,OAAI;MAC9B,IAAIC,GAAG,EACL1C,KAAK,CAAC8C,eAAe,iBAAUJ,GAAG,MAAG;IACzC;EAAC;IAAA;IAAA,OAED,eAAcN,SAAsB,EAAEW,IAAY,EAAE;MAClD,IAAIC,KAAK,GAAG,CAAC;MACb,IAAMC,CAAC,GAAG,SAAJA,CAAC,GAAS;QACd,IAAID,KAAK,GAAGD,IAAI,CAACG,MAAM,EAAE;UACvBd,SAAS,CAACe,WAAW,IAAIJ,IAAI,CAACK,MAAM,CAACJ,KAAK,CAAC;UAC3CA,KAAK,EAAE;UACPzB,UAAU,CAAC0B,CAAC,EAAE,EAAE,CAAC,EAAC;QACpB;MACF,CAAC;;MACDA,CAAC,EAAE;IACL;EAAC;EAAA;AAAA,EApJiBrE,QAAQ;AAuJ5B,eAAeY,KAAK"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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); } }
3
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
5
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
+ 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); }
8
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
9
+ 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); }; }
10
+ 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); }
11
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
12
+ 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; } }
13
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
14
+ import Base from "./Base";
15
+ var Css3D = /*#__PURE__*/function (_Base) {
16
+ _inherits(Css3D, _Base);
17
+ var _super = _createSuper(Css3D);
18
+ function Css3D() {
19
+ _classCallCheck(this, Css3D);
20
+ return _super.call(this);
21
+ }
22
+ return _createClass(Css3D);
23
+ }(Base);
24
+ //# sourceMappingURL=Css3D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Base","Css3D"],"sources":["../../../src/poi/core/Css3D.ts"],"sourcesContent":["import Base from './Base'\n\nclass Css3D extends Base {\n constructor() {\n super()\n }\n}"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,IAAI;AAAc,IAEnBC,KAAK;EAAA;EAAA;EACT,iBAAc;IAAA;IAAA;EAEd;EAAC;AAAA,EAHiBD,IAAI"}
@@ -0,0 +1,11 @@
1
+ import { Sprite } from '@anov/3d-core';
2
+ import type { EPoiType, IOption } from '../utils/type';
3
+ declare class AnovSprite extends Sprite {
4
+ poiType: EPoiType;
5
+ data: any;
6
+ option: IOption;
7
+ constructor(type: EPoiType, data: string, option: IOption);
8
+ private create;
9
+ private setAttribute;
10
+ }
11
+ export default AnovSprite;
@@ -0,0 +1,134 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
+ 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); } }
9
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
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
+ 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; }
18
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
19
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
20
+ import { Sprite, SpriteMaterial, Texture, Vector2 } from '@anov/3d-core';
21
+ import gsap from 'gsap';
22
+ import { getCanvas } from "../utils/canvas";
23
+ import { EAnimationType } from "../utils/type";
24
+ import { POI_IMG } from "../utils/base64";
25
+ var DafultOption = {
26
+ width: 200,
27
+ height: 260,
28
+ img: POI_IMG,
29
+ scale: 60,
30
+ animation: {
31
+ type: EAnimationType.appear,
32
+ duration: 0.3
33
+ }
34
+ };
35
+ var AnovSprite = /*#__PURE__*/function (_Sprite) {
36
+ _inherits(AnovSprite, _Sprite);
37
+ var _super = _createSuper(AnovSprite);
38
+ function AnovSprite(type, data, option) {
39
+ var _this;
40
+ _classCallCheck(this, AnovSprite);
41
+ _this = _super.call(this, new SpriteMaterial({
42
+ map: null
43
+ }));
44
+ _defineProperty(_assertThisInitialized(_this), "poiType", void 0);
45
+ _defineProperty(_assertThisInitialized(_this), "data", void 0);
46
+ _defineProperty(_assertThisInitialized(_this), "option", void 0);
47
+ _this.poiType = type;
48
+ _this.data = data;
49
+ _this.option = _objectSpread(_objectSpread({}, DafultOption), option);
50
+ _this.create();
51
+ return _this;
52
+ }
53
+ _createClass(AnovSprite, [{
54
+ key: "create",
55
+ value: function create() {
56
+ var _this2 = this;
57
+ var _this$option = this.option,
58
+ _this$option$scale = _this$option.scale,
59
+ scale = _this$option$scale === void 0 ? 1 : _this$option$scale,
60
+ animation = _this$option.animation;
61
+ // 精灵的锚点
62
+ this.center = new Vector2(0.5, 0);
63
+ this.scale.setX(scale);
64
+ this.scale.setZ(scale);
65
+ this.visible = false;
66
+ // 异步生成材质
67
+ var setMaterial = /*#__PURE__*/function () {
68
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
69
+ var canvas, isFadeOrAppearAnimation, opacity, texture;
70
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
71
+ while (1) switch (_context.prev = _context.next) {
72
+ case 0:
73
+ _context.next = 2;
74
+ return getCanvas(_this2.data, _this2.option);
75
+ case 2:
76
+ canvas = _context.sent;
77
+ // 判断条件
78
+ isFadeOrAppearAnimation = (animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.fadeIn || (animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.appear; // 根据条件设置 opacity 的值
79
+ opacity = isFadeOrAppearAnimation ? 0 : 1; // 生成精灵模型
80
+ texture = new Texture(canvas);
81
+ texture.needsUpdate = true;
82
+ _this2.material = new SpriteMaterial({
83
+ map: texture,
84
+ opacity: opacity
85
+ });
86
+ _this2.visible = true;
87
+ case 9:
88
+ case "end":
89
+ return _context.stop();
90
+ }
91
+ }, _callee);
92
+ }));
93
+ return function setMaterial() {
94
+ return _ref.apply(this, arguments);
95
+ };
96
+ }();
97
+ setMaterial();
98
+ this.setAttribute();
99
+ }
100
+ }, {
101
+ key: "setAttribute",
102
+ value: function setAttribute() {
103
+ var _this3 = this;
104
+ var hasExecuted = false;
105
+ // 执行渐显、打印内容等操作
106
+ this.onAfterRender = function () {
107
+ if (hasExecuted) return;
108
+ setTimeout(function () {
109
+ var animation = _this3.option.animation;
110
+ if ((animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.fadeIn || (animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.appear) {
111
+ gsap.to(_this3.material, _objectSpread(_objectSpread({
112
+ opacity: 1
113
+ }, animation), {}, {
114
+ repeat: 0,
115
+ ease: 'none'
116
+ }));
117
+ }
118
+ if ((animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.grow || (animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.appear) {
119
+ gsap.to(_this3.scale, _objectSpread(_objectSpread({
120
+ y: _this3.option.scale
121
+ }, animation), {}, {
122
+ repeat: 0,
123
+ ease: 'power2.out'
124
+ }));
125
+ }
126
+ });
127
+ hasExecuted = true;
128
+ };
129
+ }
130
+ }]);
131
+ return AnovSprite;
132
+ }(Sprite);
133
+ export default AnovSprite;
134
+ //# sourceMappingURL=Sprite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Sprite","SpriteMaterial","Texture","Vector2","gsap","getCanvas","EAnimationType","POI_IMG","DafultOption","width","height","img","scale","animation","type","appear","duration","AnovSprite","data","option","map","poiType","create","center","setX","setZ","visible","setMaterial","canvas","isFadeOrAppearAnimation","fadeIn","opacity","texture","needsUpdate","material","setAttribute","hasExecuted","onAfterRender","setTimeout","to","repeat","ease","grow","y"],"sources":["../../../src/poi/core/Sprite.ts"],"sourcesContent":["import { Sprite, SpriteMaterial, Texture, Vector2 } from '@anov/3d-core'\nimport gsap from 'gsap'\nimport { getCanvas } from '../utils/canvas'\nimport { EAnimationType } from '../utils/type'\nimport type { EPoiType, IOption } from '../utils/type'\nimport { POI_IMG } from '../utils/base64'\n\nconst DafultOption = {\n width: 200,\n height: 260,\n img: POI_IMG,\n scale: 60,\n animation: {\n type: EAnimationType.appear,\n duration: 0.3,\n },\n}\n\nclass AnovSprite extends Sprite {\n poiType: EPoiType\n data!: any\n option!: IOption\n constructor(type: EPoiType, data: string, option: IOption) {\n super(new SpriteMaterial({ map: null }))\n this.poiType = type\n this.data = data\n this.option = { ...DafultOption, ...option }\n this.create()\n }\n\n private create() {\n const { scale = 1, animation } = this.option\n // 精灵的锚点\n this.center = new Vector2(0.5, 0)\n this.scale.setX(scale)\n this.scale.setZ(scale)\n this.visible = false\n // 异步生成材质\n const setMaterial = async () => {\n const canvas = await getCanvas(this.data, this.option)\n // 判断条件\n const isFadeOrAppearAnimation = animation?.type === EAnimationType.fadeIn || animation?.type === EAnimationType.appear\n // 根据条件设置 opacity 的值\n const opacity = isFadeOrAppearAnimation ? 0 : 1\n // 生成精灵模型\n const texture = new Texture(canvas)\n texture.needsUpdate = true\n this.material = new SpriteMaterial({ map: texture, opacity })\n this.visible = true\n }\n setMaterial()\n this.setAttribute()\n }\n\n private setAttribute() {\n let hasExecuted = false\n // 执行渐显、打印内容等操作\n this.onAfterRender = () => {\n if (hasExecuted)\n return\n setTimeout(() => {\n const { animation } = this.option\n if (animation?.type === EAnimationType.fadeIn || animation?.type === EAnimationType.appear) {\n gsap.to(this.material, {\n opacity: 1,\n ...animation,\n repeat: 0,\n ease: 'none',\n })\n }\n if (animation?.type === EAnimationType.grow || animation?.type === EAnimationType.appear) {\n gsap.to(this.scale, {\n y: this.option.scale,\n ...animation,\n repeat: 0,\n ease: 'power2.out',\n })\n }\n })\n hasExecuted = true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C,EAAE,CAAC,MAAI,CAACL,QAAQ;cACnBH,OAAO,EAAE;YAAC,GACPlB,SAAS;cACZ2B,MAAM,EAAE,CAAC;cACTC,IAAI,EAAE;YAAM,GACZ;UACJ;UACA,IAAI,CAAA5B,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEC,IAAI,MAAKR,cAAc,CAACoC,IAAI,IAAI,CAAA7B,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEC,IAAI,MAAKR,cAAc,CAACS,MAAM,EAAE;YACxFX,IAAI,CAACmC,EAAE,CAAC,MAAI,CAAC3B,KAAK;cAChB+B,CAAC,EAAE,MAAI,CAACxB,MAAM,CAACP;YAAK,GACjBC,SAAS;cACZ2B,MAAM,EAAE,CAAC;cACTC,IAAI,EAAE;YAAY,GAClB;UACJ;QACF,CAAC,CAAC;QACFL,WAAW,GAAG,IAAI;MACpB,CAAC;IACH;EAAC;EAAA;AAAA,EA/DsBpC,MAAM;AAkE/B,eAAeiB,UAAU"}
@@ -0,0 +1,11 @@
1
+ import { Sprite } from '@anov/3d-core';
2
+ import type { EPoiType, IOption } from '../utils/type';
3
+ declare class AnovSprite extends Sprite {
4
+ poiType: EPoiType;
5
+ data: HTMLElement;
6
+ option: IOption;
7
+ constructor(type: EPoiType, data: HTMLElement, option: IOption);
8
+ private create;
9
+ private dom2Canvas;
10
+ }
11
+ export default AnovSprite;
@@ -0,0 +1,58 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _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); }
6
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
7
+ 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); }; }
8
+ 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); }
9
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
10
+ 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; } }
11
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
12
+ 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; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
+ import { Sprite, SpriteMaterial, Vector2 } from '@anov/3d-core';
16
+ // @ts-ignore
17
+ import { Curtains } from 'curtainsjs';
18
+ var AnovSprite = /*#__PURE__*/function (_Sprite) {
19
+ _inherits(AnovSprite, _Sprite);
20
+ var _super = _createSuper(AnovSprite);
21
+ function AnovSprite(type, data, option) {
22
+ var _this;
23
+ _classCallCheck(this, AnovSprite);
24
+ _this = _super.call(this, new SpriteMaterial());
25
+ _defineProperty(_assertThisInitialized(_this), "poiType", void 0);
26
+ _defineProperty(_assertThisInitialized(_this), "data", void 0);
27
+ _defineProperty(_assertThisInitialized(_this), "option", void 0);
28
+ _this.poiType = type;
29
+ _this.data = data;
30
+ _this.create();
31
+ return _this;
32
+ }
33
+ _createClass(AnovSprite, [{
34
+ key: "create",
35
+ value: function create() {
36
+ var _this$option = this.option,
37
+ _this$option$scale = _this$option.scale,
38
+ scale = _this$option$scale === void 0 ? 1 : _this$option$scale,
39
+ animation = _this$option.animation;
40
+ // 精灵的锚点
41
+ this.center = new Vector2(0.5, 0);
42
+ this.scale.setX(scale);
43
+ this.scale.setZ(scale);
44
+ this.visible = false;
45
+ this.dom2Canvas();
46
+ }
47
+ }, {
48
+ key: "dom2Canvas",
49
+ value: function dom2Canvas() {
50
+ var curtains = new Curtains({
51
+ container: 'canvas'
52
+ });
53
+ }
54
+ }]);
55
+ return AnovSprite;
56
+ }(Sprite);
57
+ export default AnovSprite;
58
+ //# sourceMappingURL=SpriteBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Sprite","SpriteMaterial","Vector2","Curtains","AnovSprite","type","data","option","poiType","create","scale","animation","center","setX","setZ","visible","dom2Canvas","curtains","container"],"sources":["../../../src/poi/core/SpriteBase.ts"],"sourcesContent":["import { Sprite, SpriteMaterial, Texture, Vector2 } from '@anov/3d-core'\nimport gsap from 'gsap'\n\n// @ts-ignore\nimport { Curtains } from 'curtainsjs'\nimport { getCanvas } from '../utils/canvas'\nimport { EAnimationType } from '../utils/type'\nimport type { EPoiType, IOption } from '../utils/type'\n\nclass AnovSprite extends Sprite {\n poiType: EPoiType\n data: HTMLElement\n option!: IOption\n constructor(type: EPoiType, data: HTMLElement, option: IOption) {\n super(new SpriteMaterial())\n this.poiType = type\n this.data = data\n this.create()\n }\n\n private create() {\n const { scale = 1, animation } = this.option\n // 精灵的锚点\n this.center = new Vector2(0.5, 0)\n this.scale.setX(scale)\n this.scale.setZ(scale)\n this.visible = false\n this.dom2Canvas()\n }\n\n private dom2Canvas() {\n const curtains = new Curtains({\n container: 'canvas',\n })\n }\n}\n\nexport default AnovSprite"],"mappings":";;;;;;;;;;;;;;AAAA,SAASA,MAAM,EAAEC,cAAc,EAAWC,OAAO,QAAQ,eAAe;AAGxE;AACA,SAASC,QAAQ,QAAQ,YAAY;AAAA,IAK/BC,UAAU;EAAA;EAAA;EAId,oBAAYC,IAAc,EAAEC,IAAiB,EAAEC,MAAe,EAAE;IAAA;IAAA;IAC9D,0BAAM,IAAIN,cAAc,EAAE;IAAC;IAAA;IAAA;IAC3B,MAAKO,OAAO,GAAGH,IAAI;IACnB,MAAKC,IAAI,GAAGA,IAAI;IAChB,MAAKG,MAAM,EAAE;IAAA;EACf;EAAC;IAAA;IAAA,OAED,kBAAiB;MACf,mBAAiC,IAAI,CAACF,MAAM;QAAA,kCAApCG,KAAK;QAALA,KAAK,mCAAG,CAAC;QAAEC,SAAS,gBAATA,SAAS;MAC5B;MACA,IAAI,CAACC,MAAM,GAAG,IAAIV,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;MACjC,IAAI,CAACQ,KAAK,CAACG,IAAI,CAACH,KAAK,CAAC;MACtB,IAAI,CAACA,KAAK,CAACI,IAAI,CAACJ,KAAK,CAAC;MACtB,IAAI,CAACK,OAAO,GAAG,KAAK;MACpB,IAAI,CAACC,UAAU,EAAE;IACnB;EAAC;IAAA;IAAA,OAED,sBAAqB;MACnB,IAAMC,QAAQ,GAAG,IAAId,QAAQ,CAAC;QAC5Be,SAAS,EAAE;MACb,CAAC,CAAC;IACJ;EAAC;EAAA;AAAA,EAzBsBlB,MAAM;AA4B/B,eAAeI,UAAU"}
@@ -1,19 +1,12 @@
1
- import type { IPOIOption } from './type';
1
+ import AnovSprite from './core/Sprite';
2
+ import Css2D from './core/Css2D';
3
+ import type { IOption } from './utils/type';
4
+ import { EPoiType } from './utils/type';
2
5
  declare class Poi {
3
- private cssObjects;
4
- constructor();
5
- create(option: IPOIOption): {
6
- id: number;
7
- name: string | undefined;
8
- visible: boolean | undefined;
9
- position: number[] | undefined;
10
- };
11
- /**
12
- * 是否锁定镜头,标牌一直面向镜头
13
- */
14
- private updateAxis;
15
- private updateScale;
16
- delete(option: IPOIOption): void;
17
- update(option: IPOIOption): void;
6
+ type: EPoiType;
7
+ currentObject: AnovSprite | Css2D;
8
+ constructor(type: EPoiType);
9
+ create(data: any, option?: IOption): AnovSprite | Css2D;
18
10
  }
19
11
  export default Poi;
12
+ export { EPoiType };