@realsee/dnalogel 2.3.6-alpha.1 → 2.3.7-0

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 (273) hide show
  1. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +5 -5
  2. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +5 -6
  3. package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +6 -9
  4. package/dist/PanoMeasurePlugin/Controller/ViewController.d.ts +6 -3
  5. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +3 -3
  6. package/dist/PanoMeasurePlugin/Controller/index.d.ts +27 -9
  7. package/dist/PanoMeasurePlugin/Model/index.d.ts +17 -17
  8. package/dist/PanoMeasurePlugin/Model/line.d.ts +6 -4
  9. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -4
  10. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +37 -12
  11. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +2 -0
  12. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +3 -4
  13. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -2
  14. package/dist/PanoMeasurePlugin/index.d.ts +6 -2
  15. package/dist/PanoMeasurePlugin/typings/data.d.ts +6 -16
  16. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +18 -14
  17. package/dist/PanoMeasurePlugin/typings/index.d.ts +4 -2
  18. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +4 -3
  19. package/dist/index.cjs.js +96 -96
  20. package/dist/index.js +2535 -2459
  21. package/dist/index.umd.js +91 -91
  22. package/docs/assets/search.js +1 -1
  23. package/docs/classes/CSS3DRender.html +31 -31
  24. package/docs/classes/CruisePluginController.html +24 -24
  25. package/docs/classes/Magnifier.html +16 -16
  26. package/docs/classes/ModelRoomLabelController.html +11 -11
  27. package/docs/classes/Object3DHelperController.html +24 -24
  28. package/docs/classes/PaintBrush.html +15 -15
  29. package/docs/classes/PanoMeasurePluginLine.html +301 -0
  30. package/docs/classes/PanoMeasurePluginModel.html +275 -0
  31. package/docs/classes/PanoMeasurePluginPoint.html +160 -0
  32. package/docs/classes/PanoMeasurePluginPolyline.html +306 -0
  33. package/docs/classes/PanoTagPluginController.html +39 -39
  34. package/docs/classes/Util.BetterTween.html +8 -8
  35. package/docs/classes/Util.FivePointSelector.html +12 -12
  36. package/docs/classes/Util.Interval.html +12 -12
  37. package/docs/classes/Util.Magnifier.html +17 -17
  38. package/docs/classes/Util.PointDomHelper.html +11 -11
  39. package/docs/classes/Util.PointHelper.html +11 -11
  40. package/docs/classes/Util.Rectangle.html +13 -13
  41. package/docs/enums/CameraMovementEffect.html +7 -7
  42. package/docs/enums/ContentType.html +12 -12
  43. package/docs/enums/DIRECTION.html +9 -9
  44. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
  45. package/docs/enums/DimensionType.html +7 -7
  46. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
  47. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
  48. package/docs/enums/LinkType.html +7 -7
  49. package/docs/enums/PaintBrushTypeEnum.html +8 -8
  50. package/docs/enums/PointType.html +7 -7
  51. package/docs/enums/Rotation.html +8 -8
  52. package/docs/functions/CSS3DRenderPlugin.html +12 -7
  53. package/docs/functions/CameraMovementPlugin.html +12 -7
  54. package/docs/functions/CruisePlugin.html +12 -7
  55. package/docs/functions/GuideLinePlugin.html +13 -8
  56. package/docs/functions/ItemLabelPlugin.html +12 -7
  57. package/docs/functions/MapviewFloorplanPlugin.html +12 -7
  58. package/docs/functions/ModelChassisCompassPlugin.html +12 -7
  59. package/docs/functions/ModelEntryDoorGuidePlugin.html +12 -7
  60. package/docs/functions/ModelFloorplanPlugin.html +12 -7
  61. package/docs/functions/ModelItemLabelPlugin.html +12 -7
  62. package/docs/functions/ModelRoomLabelPlugin.html +12 -7
  63. package/docs/functions/ModelTVVideoPlugin.html +12 -7
  64. package/docs/functions/ModelViewPlugin.html +12 -7
  65. package/docs/functions/Object3DHelperPlugin.html +12 -7
  66. package/docs/functions/PanoCompassPlugin.html +12 -7
  67. package/docs/functions/PanoCursorRaycasterPlugin.html +12 -7
  68. package/docs/functions/PanoDoorLabelPlugin.html +12 -7
  69. package/docs/functions/PanoFloorplanRadarPlugin.html +12 -7
  70. package/docs/functions/PanoMeasurePlugin.html +12 -7
  71. package/docs/functions/PanoRulerPlugin.html +12 -7
  72. package/docs/functions/PanoRulerProPlugin.html +12 -7
  73. package/docs/functions/PanoSpatialTagPlugin.html +12 -7
  74. package/docs/functions/PanoTagPlugin.html +12 -7
  75. package/docs/functions/TopviewFloorplanPlugin.html +12 -7
  76. package/docs/functions/Util.getCoordsFromClient.html +5 -5
  77. package/docs/functions/Util.getCoordsFromElement.html +5 -5
  78. package/docs/functions/Util.getFrameTime.html +5 -5
  79. package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
  80. package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
  81. package/docs/functions/Util.isNil.html +5 -5
  82. package/docs/functions/Util.nextFrame.html +5 -5
  83. package/docs/functions/Util.notNil.html +5 -5
  84. package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
  85. package/docs/functions/Util.tweenProgress.html +5 -5
  86. package/docs/functions/pluginFlag.html +13 -8
  87. package/docs/index.html +12 -7
  88. package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
  89. package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
  90. package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
  91. package/docs/interfaces/ContentTypeMap.html +12 -12
  92. package/docs/interfaces/FloorplanBounding.html +8 -8
  93. package/docs/interfaces/FloorplanData.html +10 -10
  94. package/docs/interfaces/FloorplanEntrance.html +11 -11
  95. package/docs/interfaces/FloorplanExtraObject.html +10 -10
  96. package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
  97. package/docs/interfaces/FloorplanFloorData.html +9 -9
  98. package/docs/interfaces/FloorplanImagePosition.html +7 -7
  99. package/docs/interfaces/FloorplanObserver.html +9 -9
  100. package/docs/interfaces/FloorplanOutlineItem.html +9 -9
  101. package/docs/interfaces/FloorplanPosition.html +7 -7
  102. package/docs/interfaces/FloorplanRoomItem.html +13 -13
  103. package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
  104. package/docs/interfaces/FloorplanServerBounding.html +8 -8
  105. package/docs/interfaces/FloorplanServerComputedData.html +10 -10
  106. package/docs/interfaces/FloorplanServerData.html +7 -7
  107. package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
  108. package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
  109. package/docs/interfaces/FloorplanServerEntrance.html +11 -11
  110. package/docs/interfaces/FloorplanServerFloorData.html +9 -9
  111. package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
  112. package/docs/interfaces/FloorplanServerObserver.html +9 -9
  113. package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
  114. package/docs/interfaces/FloorplanServerPosition.html +7 -7
  115. package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
  116. package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
  117. package/docs/interfaces/ItemLabelPluginData.html +6 -6
  118. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
  119. package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
  120. package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
  121. package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
  122. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
  123. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
  124. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
  125. package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
  126. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
  127. package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
  128. package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
  129. package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
  130. package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
  131. package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
  132. package/docs/interfaces/ModelViewPluginExportType.html +11 -11
  133. package/docs/interfaces/Object3DHelperState.html +8 -8
  134. package/docs/interfaces/PaintBrushAction.html +12 -12
  135. package/docs/interfaces/PaintBrushConfigs.html +12 -12
  136. package/docs/interfaces/PaintBrushState.html +10 -10
  137. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
  138. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +13 -8
  139. package/docs/interfaces/PanoMeasureParameterType.html +24 -14
  140. package/docs/interfaces/PanoMeasurePluginLineJson.html +78 -0
  141. package/docs/interfaces/{OpenParameter.html → PanoMeasurePluginOpenParameter.html} +15 -15
  142. package/docs/interfaces/{LineJson.html → PanoMeasurePluginPointJson.html} +18 -18
  143. package/docs/interfaces/{PointJson.html → PanoMeasurePluginPolylineJson.html} +24 -22
  144. package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
  145. package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
  146. package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
  147. package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
  148. package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
  149. package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
  150. package/docs/interfaces/PanoRulerProPluginState.html +8 -8
  151. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +13 -8
  152. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +13 -8
  153. package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
  154. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
  155. package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
  156. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
  157. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
  158. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
  159. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
  160. package/docs/interfaces/Point.html +8 -8
  161. package/docs/interfaces/Room.html +9 -9
  162. package/docs/interfaces/RoomInfo.html +7 -7
  163. package/docs/interfaces/RoomLabel.html +14 -14
  164. package/docs/interfaces/RoomRules.html +13 -8
  165. package/docs/interfaces/Rooms.html +13 -8
  166. package/docs/interfaces/Scissor.html +9 -9
  167. package/docs/interfaces/TagConfig.html +10 -10
  168. package/docs/interfaces/Tags.html +9 -9
  169. package/docs/interfaces/Util.MagnifierParameter.html +11 -11
  170. package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
  171. package/docs/modules/Util.html +5 -5
  172. package/docs/modules.html +20 -10
  173. package/docs/types/ArrayPosition.html +13 -8
  174. package/docs/types/CSS3DRenderExportType.html +13 -8
  175. package/docs/types/CSS3DRenderPluginExportType.html +13 -8
  176. package/docs/types/CSS3DRenderPluginParameterType.html +13 -8
  177. package/docs/types/Color.html +13 -8
  178. package/docs/types/ContentTypeConfigKey.html +13 -8
  179. package/docs/types/ContentTypeConfigKeyArray.html +13 -8
  180. package/docs/types/Create3DDomContainerReturnType.html +13 -8
  181. package/docs/types/Create3DElementReturnType.html +13 -8
  182. package/docs/types/CruisePluginExportType.html +13 -8
  183. package/docs/types/Direction-1.html +13 -8
  184. package/docs/types/Direction4.html +13 -8
  185. package/docs/types/FloorplanRuleLabels.html +13 -8
  186. package/docs/types/FloorplanServerRuleLabels.html +13 -8
  187. package/docs/types/GuideLinePluginExportType.html +13 -8
  188. package/docs/types/HelperEventMap.html +13 -8
  189. package/docs/types/MapviewFloorplanPluginParameterType.html +13 -8
  190. package/docs/types/MapviewFloorplanPluginReturnType.html +13 -8
  191. package/docs/types/MediaData.html +13 -8
  192. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +13 -8
  193. package/docs/types/ModelFloorplanPluginParameterType.html +13 -8
  194. package/docs/types/ModelFloorplanPluginReturnType.html +13 -8
  195. package/docs/types/ModelRoomLabelPluginParameters.html +13 -8
  196. package/docs/types/ModelRoomLabelPluginReturnType.html +13 -8
  197. package/docs/types/MoveArgs.html +13 -8
  198. package/docs/types/MoveOpts.html +13 -8
  199. package/docs/types/Object3DHelperEventMap.html +13 -8
  200. package/docs/types/ObjectFit.html +13 -8
  201. package/docs/types/PaintBrushEventMap.html +13 -8
  202. package/docs/types/PanoCompassPluginData.html +13 -8
  203. package/docs/types/PanoCompassPluginExportType.html +13 -8
  204. package/docs/types/PanoCompassPluginParameterType.html +13 -8
  205. package/docs/types/PanoFloorplanRadarPluginParameterType.html +13 -8
  206. package/docs/types/PanoFloorplanRadarPluginReturnType.html +13 -8
  207. package/docs/types/PanoMeasurePluginEvent.html +13 -8
  208. package/docs/types/PanoMeasureReturnType.html +13 -8
  209. package/docs/types/PanoSpatialTagPluginId.html +13 -8
  210. package/docs/types/PanoTagPluginExportInterface.html +13 -8
  211. package/docs/types/PanoTagPluginParamsInterface.html +13 -8
  212. package/docs/types/PlaneTag.html +13 -8
  213. package/docs/types/PointTag.html +13 -8
  214. package/docs/types/Position.html +13 -8
  215. package/docs/types/RotateArgs.html +13 -8
  216. package/docs/types/RotateOpts.html +13 -8
  217. package/docs/types/RuleLabelsKey.html +13 -8
  218. package/docs/types/RuleLabelsValue.html +13 -8
  219. package/docs/types/Tag.html +13 -8
  220. package/docs/types/Tag2D.html +13 -8
  221. package/docs/types/Tag3D.html +13 -8
  222. package/docs/types/TagId.html +13 -8
  223. package/docs/types/TopviewFloorplanPluginParameterType.html +13 -8
  224. package/docs/types/TopviewFloorplanPluginReturnType.html +13 -8
  225. package/docs/variables/FLOOR_TYPE_MAP.html +13 -8
  226. package/docs/variables/PLUGIN.html +13 -8
  227. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +13 -8
  228. package/docs/variables/ROOM_TYPE_MAP.html +13 -8
  229. package/docs/variables/VERSION.html +13 -8
  230. package/docs/variables/itemLabelPluginServerParams.html +13 -8
  231. package/docs/variables/modelItemLabelPluginServerParams.html +13 -8
  232. package/docs/variables/modelRoomLabelPluginServerParams.html +13 -8
  233. package/libs/PanoCompassPlugin/Controller.js +3 -8
  234. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +5 -5
  235. package/libs/PanoMeasurePlugin/Controller/BaseController.js +8 -8
  236. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +5 -6
  237. package/libs/PanoMeasurePlugin/Controller/EditController.js +56 -57
  238. package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +6 -9
  239. package/libs/PanoMeasurePlugin/Controller/MixedController.js +38 -37
  240. package/libs/PanoMeasurePlugin/Controller/ViewController.d.ts +6 -3
  241. package/libs/PanoMeasurePlugin/Controller/ViewController.js +68 -52
  242. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +3 -3
  243. package/libs/PanoMeasurePlugin/Controller/WatchController.js +39 -41
  244. package/libs/PanoMeasurePlugin/Controller/index.d.ts +27 -9
  245. package/libs/PanoMeasurePlugin/Controller/index.js +117 -92
  246. package/libs/PanoMeasurePlugin/Model/index.d.ts +17 -17
  247. package/libs/PanoMeasurePlugin/Model/index.js +49 -72
  248. package/libs/PanoMeasurePlugin/Model/line.d.ts +6 -4
  249. package/libs/PanoMeasurePlugin/Model/line.js +29 -25
  250. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -4
  251. package/libs/PanoMeasurePlugin/Model/point.js +3 -3
  252. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +37 -12
  253. package/libs/PanoMeasurePlugin/Model/polyline.js +90 -37
  254. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +2 -0
  255. package/libs/PanoMeasurePlugin/Modules/GuideController.js +16 -11
  256. package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +1 -1
  257. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +5 -4
  258. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +3 -4
  259. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +21 -21
  260. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -2
  261. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +22 -22
  262. package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +1 -1
  263. package/libs/PanoMeasurePlugin/Modules/UIController/mobileMainBtnController.js +5 -4
  264. package/libs/PanoMeasurePlugin/Modules/UIController/style.js +10 -10
  265. package/libs/PanoMeasurePlugin/index.d.ts +6 -2
  266. package/libs/PanoMeasurePlugin/index.js +31 -27
  267. package/libs/PanoMeasurePlugin/typings/data.d.ts +6 -16
  268. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +18 -14
  269. package/libs/PanoMeasurePlugin/typings/index.d.ts +4 -2
  270. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +4 -3
  271. package/libs/PanoMeasurePlugin/utils/distanceDom.js +57 -41
  272. package/libs/index.js +109 -105
  273. package/package.json +1 -1
@@ -1,36 +1,36 @@
1
- var i = Object.defineProperty;
2
- var h = (r, e, o) => e in r ? i(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o;
3
- var t = (r, e, o) => (h(r, typeof e != "symbol" ? e + "" : e, o), o);
4
- class a {
5
- constructor(e, o) {
6
- t(this, "container");
7
- t(this, "revokeIcon");
8
- t(this, "revokeItem");
9
- t(this, "measureController");
10
- t(this, "onClick", () => {
1
+ var h = Object.defineProperty;
2
+ var i = (r, e, n) => e in r ? h(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
3
+ var o = (r, e, n) => (i(r, typeof e != "symbol" ? e + "" : e, n), n);
4
+ import "three";
5
+ class l {
6
+ constructor(e, n) {
7
+ o(this, "container");
8
+ o(this, "revokeIcon");
9
+ o(this, "revokeItem");
10
+ o(this, "measureController");
11
+ o(this, "onClick", () => {
11
12
  this.measureController.revoke();
12
13
  });
13
- t(this, "onModeChange", (e) => {
14
+ o(this, "onModeChange", (e) => {
14
15
  if (e !== "Edit" && this.revokeItem.className.includes("enabled")) {
15
- this.revokeItem.classList.remove("enabled");
16
+ this.revokeItem.classList.remove("enabled"), this.measureController.hook.off("anchorChange", this.onAnchorChange);
16
17
  return;
17
18
  }
18
- this.measureController.hook.on("anchorChange", (o) => {
19
- o && this.revokeItem.classList.add("enabled");
20
- });
19
+ this.measureController.hook.on("anchorChange", this.onAnchorChange);
21
20
  });
22
- t(this, "handleRevoke", () => () => {
21
+ o(this, "onAnchorChange", (e) => {
22
+ e && this.revokeItem.classList.add("enabled");
23
23
  });
24
- this.measureController = e, this.container = o;
25
- const n = this.container.querySelector(".fpm__revoke-icon"), s = this.container.querySelector(".fpm__revoke");
26
- if (!n || !s)
24
+ this.measureController = e, this.container = n;
25
+ const t = this.container.querySelector(".fpm__revoke-icon"), s = this.container.querySelector(".fpm__revoke");
26
+ if (!t || !s)
27
27
  throw new Error("\u4E0D\u6B63\u786E\u7684\u9009\u62E9\u5668");
28
- this.revokeIcon = n, this.revokeItem = s, this.revokeItem.addEventListener("click", this.onClick), e.hook.on("modeChange", this.onModeChange);
28
+ this.revokeIcon = t, this.revokeItem = s, this.revokeItem.addEventListener("click", this.onClick), e.hook.on("modeChange", this.onModeChange);
29
29
  }
30
30
  dispose() {
31
31
  this.revokeItem.removeEventListener("click", this.onClick), this.measureController.hook.off("modeChange", this.onModeChange);
32
32
  }
33
33
  }
34
34
  export {
35
- a as Revoke
35
+ l as Revoke
36
36
  };
@@ -1,8 +1,7 @@
1
1
  import type MeasureController from '../../Controller';
2
- import type { OpenParameter } from '../../typings/data';
3
2
  export interface UIControllerParams {
4
3
  container: Element;
5
- openParams?: OpenParameter;
4
+ mode?: 'pc' | 'mobile';
6
5
  startButtonText?: string;
7
6
  endButtonText?: string;
8
7
  revokeButtonText?: string;
@@ -1,26 +1,26 @@
1
- var h = Object.defineProperty;
2
- var m = (s, t, e) => t in s ? h(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
- var i = (s, t, e) => (m(s, typeof t != "symbol" ? t + "" : t, e), e);
4
- import { htmlString as p } from "./HTML.js";
5
- import { mobileHTMLString as d } from "./mobileHTML.js";
6
- import { controllerBackgroundStyle as y, operatingSpaceStyle as u, uiWrapperStyle as f, textStyle as v, exitItemStyle as C, exitIconStyle as _ } from "./style.js";
7
- import { MainBtnController as b } from "./MainBtnController.js";
1
+ var c = Object.defineProperty;
2
+ var h = (i, t, e) => t in i ? c(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var s = (i, t, e) => (h(i, typeof t != "symbol" ? t + "" : t, e), e);
4
+ import { htmlString as m } from "./HTML.js";
5
+ import { mobileHTMLString as p } from "./mobileHTML.js";
6
+ import { controllerBackgroundStyle as d, operatingSpaceStyle as y, uiWrapperStyle as u, textStyle as f, exitItemStyle as v, exitIconStyle as C } from "./style.js";
7
+ import { MainBtnController as _ } from "./MainBtnController.js";
8
8
  import { MobileMainBtnController as E } from "./mobileMainBtnController.js";
9
9
  import { Revoke as S } from "./Revoke/index.js";
10
- class O {
10
+ class w {
11
11
  constructor(t, e) {
12
- i(this, "revoke");
13
- i(this, "container");
14
- i(this, "mainController");
15
- i(this, "disposers", []);
16
- i(this, "measureController");
17
- i(this, "mode");
18
- i(this, "_params");
19
- i(this, "handleExit", () => {
12
+ s(this, "revoke");
13
+ s(this, "container");
14
+ s(this, "mainController");
15
+ s(this, "disposers", []);
16
+ s(this, "measureController");
17
+ s(this, "mode");
18
+ s(this, "_params");
19
+ s(this, "handleExit", () => {
20
20
  const t = this.container.querySelector(".fpm__exit-icon"), e = this.container.querySelector(".fpm__exit");
21
21
  if (!e || !t)
22
22
  throw new Error("cannot find dom");
23
- this.mode === "pc" && (Object.assign(e.style, C), Object.assign(t == null ? void 0 : t.style, _));
23
+ this.mode === "pc" && (Object.assign(e.style, v), Object.assign(t == null ? void 0 : t.style, C));
24
24
  const o = () => {
25
25
  e.style.opacity = "1";
26
26
  }, r = () => {
@@ -32,16 +32,16 @@ class O {
32
32
  e.removeEventListener("click", n), e.removeEventListener("mouseenter", o), e.removeEventListener("mouseleave", r);
33
33
  };
34
34
  });
35
- var l, a;
36
- this._params = e, this.measureController = t, this.mode = (l = e.openParams) != null && l.isMobile ? "mobile" : "pc", this.container = document.createElement("div"), this.container.innerHTML = (a = e.openParams) != null && a.isMobile ? d : p, this.container.classList.add("fpm__ui-controller", this.mode), e.container.appendChild(this.container);
35
+ var l;
36
+ this._params = e, this.measureController = t, this.mode = (l = e.mode) != null ? l : "pc", this.container = document.createElement("div"), this.container.innerHTML = this.mode === "mobile" ? p : m, this.container.classList.add("fpm__ui-controller", this.mode), e.container.appendChild(this.container);
37
37
  const o = this.container.querySelectorAll(".fpm__text"), r = this.container.querySelector(".fpm_ui-bg"), n = this.container.querySelector(".fpm_operating-space");
38
- Object.assign(r == null ? void 0 : r.style, y), Object.assign(n == null ? void 0 : n.style, u), Object.assign(this.container.style, f), o.forEach((c) => Object.assign(c.style, v));
38
+ Object.assign(r == null ? void 0 : r.style, d), Object.assign(n == null ? void 0 : n.style, y), Object.assign(this.container.style, u), o.forEach((a) => Object.assign(a.style, f));
39
39
  }
40
40
  dispose() {
41
41
  this.hide(), this.container.remove();
42
42
  }
43
43
  show() {
44
- return this.container.style.display = "block", this.container.style.opacity = "1", this.container.style.transform = "translate(0, 0)", this.mode === "pc" ? (this.revoke = new S(this.measureController, this.container), this.mainController = new b(this.measureController, this.container, this._params)) : this.mainController = new E(this.measureController, this.container, this._params), this.disposers.push(this.handleExit()), this;
44
+ return this.container.style.display = "block", this.container.style.opacity = "1", this.container.style.transform = "translate(0, 0)", this.mode === "pc" ? (this.revoke = new S(this.measureController, this.container), this.mainController = new _(this.measureController, this.container, this._params)) : this.mainController = new E(this.measureController, this.container, this._params), this.disposers.push(this.handleExit()), this;
45
45
  }
46
46
  hide() {
47
47
  var t, e;
@@ -49,5 +49,5 @@ class O {
49
49
  }
50
50
  }
51
51
  export {
52
- O as UIController
52
+ w as UIController
53
53
  };
@@ -71,7 +71,7 @@ const I = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzIiIGhlaWdodD0iNzIiIHhtbG5
71
71
  <div class="fpm_operating-space fpm_operating--mobile">
72
72
  <div class="fpm__main fpm__main-btn">
73
73
  <div class="fpm__main-icon fpm__main__start"></div>
74
- <div class="fpm__main-text fpm__main-btn-text"></div>
74
+ <div class="fpm__text fpm__main-text fpm__main-btn-text"></div>
75
75
  </div>
76
76
  </div>
77
77
  `;
@@ -1,8 +1,9 @@
1
1
  var _ = Object.defineProperty;
2
2
  var r = (i, t, e) => t in i ? _(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
3
  var n = (i, t, e) => (r(i, typeof t != "symbol" ? t + "" : t, e), e);
4
- import { mainIconStyle as l, mainItemStyle as c } from "./style.js";
5
- class d {
4
+ import { mainIconStyle as l, mainItemStyle as o } from "./style.js";
5
+ import "three";
6
+ class f {
6
7
  constructor(t, e, s) {
7
8
  n(this, "container");
8
9
  n(this, "measureController");
@@ -20,7 +21,7 @@ class d {
20
21
  this._params = s, this._btnTexts = {
21
22
  start: (a = this._params.startButtonText) != null ? a : this._btnTexts.start,
22
23
  end: (m = this._params.endButtonText) != null ? m : this._btnTexts.end
23
- }, this.measureController = t, this.container = e, this.mainElement = this.getMainElement(), Object.assign(this.mainElement.mainIcon.style, l), Object.assign(this.mainElement.mainItem.style, c), this.change2Add(), this.mainElement.mainItem.addEventListener("click", this.onClick);
24
+ }, this.measureController = t, this.container = e, this.mainElement = this.getMainElement(), Object.assign(this.mainElement.mainIcon.style, l), Object.assign(this.mainElement.mainItem.style, o), this.change2Add(), this.mainElement.mainItem.addEventListener("click", this.onClick);
24
25
  }
25
26
  dispose() {
26
27
  this.mainElement.mainItem.removeEventListener("click", this.onClick);
@@ -49,5 +50,5 @@ class d {
49
50
  }
50
51
  }
51
52
  export {
52
- d as MobileMainBtnController
53
+ f as MobileMainBtnController
53
54
  };
@@ -21,7 +21,7 @@ const t = {
21
21
  pointerEvents: "all",
22
22
  color: "#fff",
23
23
  zIndex: "10"
24
- }, o = {
24
+ }, n = {
25
25
  position: "absolute",
26
26
  bottom: "0",
27
27
  left: "0",
@@ -30,7 +30,7 @@ const t = {
30
30
  height: "184px",
31
31
  background: "linear-gradient(180deg, rgba(0,0,0,0.00) 0%, #000000 100%)",
32
32
  zIndex: "0"
33
- }, n = {
33
+ }, o = {
34
34
  margin: "0 64px"
35
35
  }, i = {
36
36
  opacity: "0.85"
@@ -40,23 +40,23 @@ const t = {
40
40
  backgroundSize: "100%",
41
41
  cursor: "pointer",
42
42
  transition: "all 200ms ease-in-out"
43
- }, r = {
43
+ }, s = {
44
44
  width: "24px",
45
45
  height: "24px",
46
46
  marginRight: "4px",
47
47
  backgroundSize: "100%",
48
48
  cursor: "pointer"
49
- }, s = {
50
- cursor: "default",
51
- userSelect: "none"
49
+ }, r = {
50
+ userSelect: "none",
51
+ pointerEvents: "none"
52
52
  };
53
53
  export {
54
- o as controllerBackgroundStyle,
55
- r as exitIconStyle,
54
+ n as controllerBackgroundStyle,
55
+ s as exitIconStyle,
56
56
  i as exitItemStyle,
57
57
  a as mainIconStyle,
58
- n as mainItemStyle,
58
+ o as mainItemStyle,
59
59
  e as operatingSpaceStyle,
60
- s as textStyle,
60
+ r as textStyle,
61
61
  t as uiWrapperStyle
62
62
  };
@@ -3,8 +3,12 @@ import MeasureController, { PanoMeasureParameterType } from './Controller';
3
3
  import Magnifier from './Modules/Magnifier';
4
4
  export declare const PanoMeasurePlugin: FivePlugin<PanoMeasureParameterType, PanoMeasureReturnType>;
5
5
  export default PanoMeasurePlugin;
6
+ export { Magnifier };
7
+ export { Model as PanoMeasurePluginModel } from './Model';
8
+ export { default as PanoMeasurePluginPoint } from './Model/point';
9
+ export { default as PanoMeasurePluginLine } from './Model/line';
10
+ export { Polyline as PanoMeasurePluginPolyline } from './Model/polyline';
6
11
  export declare type PanoMeasureReturnType = MeasureController;
7
12
  export type { PanoMeasurePluginEvent } from './typings/event.type';
8
- export type { LineJson, PointJson, OpenParameter } from './typings/data';
13
+ export type { LineJson as PanoMeasurePluginLineJson, PointJson as PanoMeasurePluginPointJson, PolylineJson as PanoMeasurePluginPolylineJson, OpenParameter as PanoMeasurePluginOpenParameter, } from './typings/data';
9
14
  export type { PanoMeasureParameterType } from './Controller';
10
- export { Magnifier };
@@ -1,21 +1,13 @@
1
- import { MeasureController as t } from "./Controller/index.js";
2
- import { Magnifier as pr } from "./Modules/Magnifier.js";
1
+ import { MeasureController as i } from "./Controller/index.js";
2
+ import { Magnifier as ro } from "./Modules/Magnifier.js";
3
+ import { Model as to } from "./Model/index.js";
4
+ import { Point as po } from "./Model/point.js";
5
+ import { Line as no } from "./Model/line.js";
6
+ import { Polyline as uo } from "./Model/polyline.js";
3
7
  import "./Modules/FiveHelper.js";
4
8
  import "three";
5
9
  import "./Controller/EditController.js";
6
10
  import "hammerjs";
7
- import "./Model/index.js";
8
- import "./Model/line.js";
9
- import "../shared-utils/uuid.js";
10
- import "./Model/polyline.js";
11
- import "./utils/line.js";
12
- import "@realsee/five/line";
13
- import "./utils/constants.js";
14
- import "@realsee/five";
15
- import "./utils/distanceDom.js";
16
- import "./utils/isNDCPointInScreen.js";
17
- import "./Model/point.js";
18
- import "../shared-utils/removeArrayItem.js";
19
11
  import "../shared-utils/throttle.js";
20
12
  import "./Controller/BaseController.js";
21
13
  import "./utils/ironbox.js";
@@ -23,7 +15,11 @@ import "./utils/getIntersectionFromEvent.js";
23
15
  import "./utils/getPointFromHammerEvent.js";
24
16
  import "./Controller/ViewController.js";
25
17
  import "./utils/math.js";
18
+ import "./utils/isNDCPointInScreen.js";
26
19
  import "./utils/findAssociatedLines.js";
20
+ import "@realsee/five/line";
21
+ import "./utils/constants.js";
22
+ import "@realsee/five";
27
23
  import "./Controller/WatchController.js";
28
24
  import "./Modules/DeleteDom/index.js";
29
25
  import "./Modules/DeleteDom/_Assets/delete.svg.js";
@@ -32,9 +28,16 @@ import "./Modules/DeleteDom/_Assets/delete_hover_bg.png.js";
32
28
  import "./utils/findClosestPoint.js";
33
29
  import "./utils/ndc2Screen.js";
34
30
  import "./Controller/MixedController.js";
31
+ import "./Modules/rangePiece/index.js";
32
+ import "@tweenjs/tween.js";
33
+ import "./Modules/rangePiece/html.js";
34
+ import "../shared-utils/animationFrame/index.js";
35
+ import "../shared-utils/animationFrame/BetterTween.js";
36
+ import "../shared-utils/noop.js";
37
+ import "./utils/calculateThreeMouse.js";
38
+ import "./utils/mouseGroup.js";
35
39
  import "../shared-utils/filter.js";
36
40
  import "../shared-utils/tap.js";
37
- import "./utils/mouseGroup.js";
38
41
  import "./Modules/UIController/index.js";
39
42
  import "./Modules/UIController/HTML.js";
40
43
  import "./Modules/UIController/mobileHTML.js";
@@ -44,18 +47,19 @@ import "./Modules/UIController/mobileMainBtnController.js";
44
47
  import "./Modules/UIController/Revoke/index.js";
45
48
  import "./Modules/GuideController.js";
46
49
  import "./Controller/ShortcutKeyController.js";
47
- import "./Modules/rangePiece/index.js";
48
- import "@tweenjs/tween.js";
49
- import "./Modules/rangePiece/html.js";
50
- import "../shared-utils/animationFrame/index.js";
51
- import "../shared-utils/animationFrame/BetterTween.js";
52
- import "../shared-utils/noop.js";
53
- import "./utils/calculateThreeMouse.js";
54
- const tr = function(r, o) {
55
- return new t(r, o);
50
+ import "../shared-utils/uuid.js";
51
+ import "../shared-utils/removeArrayItem.js";
52
+ import "./utils/line.js";
53
+ import "./utils/distanceDom.js";
54
+ const _ = function(o, r) {
55
+ return new i(o, r);
56
56
  };
57
57
  export {
58
- pr as Magnifier,
59
- tr as PanoMeasurePlugin,
60
- tr as default
58
+ ro as Magnifier,
59
+ _ as PanoMeasurePlugin,
60
+ no as PanoMeasurePluginLine,
61
+ to as PanoMeasurePluginModel,
62
+ po as PanoMeasurePluginPoint,
63
+ uo as PanoMeasurePluginPolyline,
64
+ _ as default
61
65
  };
@@ -1,29 +1,19 @@
1
- export interface LineCompletelyJson {
2
- id: string;
3
- points: PointJson[];
4
- }
5
- export interface PolylineCompletelyJson {
1
+ export interface PolylineJson {
6
2
  id: string;
7
- points: PointJson[];
8
- lines: LineCompletelyJson[];
3
+ lines: LineJson[];
4
+ /** 当前折线在哪个点位上可见,字段不存在时,不做限制 */
5
+ visiblePanoIndexes?: number[];
9
6
  }
10
7
  export interface LineJson {
11
8
  id: string;
12
- points: string[];
13
- }
14
- export interface PolylineJson {
15
- id: string;
16
- points: string[];
17
- lines: string[];
9
+ text?: string;
10
+ points: PointJson[];
18
11
  }
19
12
  export interface PointJson {
20
13
  id: string;
21
- lines: string[];
22
14
  position: number[];
23
15
  }
24
16
  export interface PluginData {
25
- lines: LineJson[];
26
- points: PointJson[];
27
17
  polylines: PolylineJson[];
28
18
  }
29
19
  /** 开放可配置参数 */
@@ -1,37 +1,41 @@
1
- import type { SubscribeEventMap } from '@realsee/five';
2
1
  import type { Vector3 } from 'three';
3
2
  import type { Mode } from '../Controller';
4
3
  import type { State } from '../Controller/MixedController';
4
+ import Line from '../Model/line';
5
5
  import type Point from '../Model/point';
6
- import type { LineCompletelyJson } from './data';
7
- interface ControllerEvent extends SubscribeEventMap {
6
+ import { Polyline } from '../Model/polyline';
7
+ declare type ControllerEvent = {
8
+ enable: (userAction: boolean) => void;
9
+ disable: (userAction: boolean) => void;
8
10
  /**
9
11
  * Mode 变更
10
12
  */
11
13
  modeChange: (mode: Mode) => void;
12
- }
13
- interface WatchEvent extends SubscribeEventMap {
14
- selectedChange: (lines: LineCompletelyJson[]) => void;
15
- }
16
- interface EditEvent {
14
+ };
15
+ declare type WatchEvent = {
16
+ selectedChange: (lines: Line[]) => void;
17
+ };
18
+ declare type EditEvent = {
17
19
  /**
18
20
  * 编辑线条变更
19
21
  */
20
- editedLineChange: (lines: LineCompletelyJson[]) => void;
22
+ editedPolylineChange: (polyline: Polyline) => void;
23
+ /** 编辑中的虚线变更 */
24
+ editedDashedLineChange: (line: Line | null) => void;
21
25
  anchorChange: (anchor: Vector3 | null) => void;
22
- }
23
- interface DragEvent extends SubscribeEventMap {
26
+ };
27
+ declare type DragEvent = {
24
28
  wantsDragLine: (event: {
25
29
  point: string;
26
30
  lines: string[];
27
31
  }) => boolean;
28
- }
32
+ };
29
33
  /** 移动端专用事件 */
30
- interface MobileEvent extends SubscribeEventMap {
34
+ declare type MobileEvent = {
31
35
  getStartPoint: (point: Point) => void;
32
36
  getEndPoint: (point: Point) => void;
33
37
  willChangeState: (state: State, newState: State) => void;
34
38
  nowPointChange: (point: Point) => void;
35
- }
39
+ };
36
40
  export declare type PanoMeasurePluginEvent = ControllerEvent & EditEvent & WatchEvent & DragEvent & MobileEvent;
37
41
  export {};
@@ -1,8 +1,10 @@
1
1
  import type { UserDistanceItem } from '../utils/distanceDom';
2
2
  export interface Config {
3
- userDistanceItemCreator: undefined | (() => UserDistanceItem);
3
+ userDistanceItemCreator?: undefined | (() => UserDistanceItem);
4
4
  /** 展示 distance DOM 时,使用的转换函数
5
5
  * @param distance 单位是 m
6
6
  */
7
- getDistanceText: (distance: number) => string;
7
+ getDistanceText?: (distance: number) => string;
8
+ /** 默认的 distance DOM 文本 */
9
+ defaultText?: string | null;
8
10
  }
@@ -1,15 +1,15 @@
1
1
  import type Line from '../Model/line';
2
2
  import type { Five } from '@realsee/five';
3
- import type { LineCompletelyJson, PolylineCompletelyJson } from '../typings/data';
4
3
  import { Vector3 } from 'three';
4
+ import { Polyline } from '../Model/polyline';
5
5
  export declare type DistanceItem = ReturnType<typeof createDistanceItem>;
6
6
  export interface UserDistanceItem {
7
7
  element: Element;
8
8
  highlight: () => void;
9
9
  unHighlight: () => void;
10
10
  update: (params: {
11
- line: LineCompletelyJson;
12
- polyline: PolylineCompletelyJson;
11
+ line: Line;
12
+ polyline: Polyline;
13
13
  }) => void;
14
14
  }
15
15
  export interface CreateDistanceItemProps {
@@ -25,4 +25,5 @@ export declare function createDistanceItem(props: CreateDistanceItemProps): {
25
25
  remove: () => void;
26
26
  highlight: () => void;
27
27
  unHighlight: () => void;
28
+ getCurrentContent: () => string;
28
29
  };
@@ -1,6 +1,9 @@
1
- import { Vector3 as A, Vector2 as E } from "three";
2
- import { isNDCPointInScreen as m } from "./isNDCPointInScreen.js";
3
- function M() {
1
+ import { Vector3 as M, Vector2 as v } from "three";
2
+ import { isNDCPointInScreen as g } from "./isNDCPointInScreen.js";
3
+ import "@realsee/five/line";
4
+ import "./constants.js";
5
+ import "@realsee/five";
6
+ function S() {
4
7
  const t = document.createElement("div");
5
8
  return t.setAttribute("style", "backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);"), t.style.padding = "3px 6px", t.style.lineHeight = "1", t.style.textAlign = "center", t.style.transform = "translate(-50%, -50%)", t.style.borderRadius = "100px", t.style.fontSize = "14px", t.style.color = "#fff", t.style.background = "rgba(195,195,195,0.70)", t.style.border = "0.5px solid rgba(255,255,255,0.6)", t.style.pointerEvents = "all", t.style.cursor = "pointer", t;
6
9
  }
@@ -8,55 +11,68 @@ function z(t) {
8
11
  const e = document.createElement("div");
9
12
  return e.id = "distance_" + t.id, e.classList.add("five-plugin-measure__distance"), e.style.opacity = "0", e.style.position = "absolute", e.style.left = "0", e.style.top = "0", e.style.transform = "translate3d(0, 0, 0)", e.style.transformOrigin = "left top", e;
10
13
  }
11
- function J(t) {
12
- function e() {
13
- var s;
14
- (s = t.clickCallback) == null || s.call(t, g);
15
- }
16
- function v() {
17
- if (o)
18
- return o.highlight();
19
- i.style.border = "0.5px solid #95AEFF", i.style.background = "linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)";
14
+ function O(t) {
15
+ const { line: e } = t, E = e.id, c = S(), n = z(e), i = t.userDistanceItem, P = new M(0, 0, 0), h = {
16
+ lineID: E,
17
+ ndcPosition: P,
18
+ update: C,
19
+ appendTo: F,
20
+ remove: H,
21
+ highlight: k,
22
+ unHighlight: D,
23
+ getCurrentContent: x
24
+ };
25
+ i != null && i.element ? n.appendChild(i.element) : n.appendChild(c);
26
+ function b() {
27
+ var o;
28
+ (o = t.clickCallback) == null || o.call(t, h);
20
29
  }
21
30
  function k() {
22
- if (o)
23
- return o.unHighlight();
24
- i.style.border = "0.5px solid rgba(255,255,255,0.6)", i.style.background = "rgba(195,195,195,0.70)";
31
+ if (i)
32
+ return i.highlight();
33
+ c.style.border = "0.5px solid #95AEFF", c.style.background = "linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)";
25
34
  }
26
- function D(s) {
27
- const a = s.getElement();
28
- if (!a)
35
+ function D() {
36
+ if (i)
37
+ return i.unHighlight();
38
+ c.style.border = "0.5px solid rgba(255,255,255,0.6)", c.style.background = "rgba(195,195,195,0.70)";
39
+ }
40
+ function C(o) {
41
+ if (e.mesh.visible === !1) {
42
+ n.style.opacity = "0", n.style.pointerEvents = "none";
29
43
  return;
30
- const d = a.clientWidth, u = a.clientHeight;
31
- if (r.points.length < 2)
44
+ }
45
+ const f = o.getElement();
46
+ if (!f)
47
+ return;
48
+ const a = f.clientWidth, l = f.clientHeight;
49
+ if (e.points.length < 2)
32
50
  return;
33
- const [h, b] = r.points, l = h.position.clone().project(s.camera), c = b.position.clone().project(s.camera), f = l.clone().lerp(c, 0.5), y = new E(l.x * d, l.y * u), p = new E(c.x * d, c.y * u);
34
- if ((() => !(Math.abs(l.z) > 1 || Math.abs(c.z) > 1 || !m(l) && !m(c) || !m(f) || y.distanceTo(p) < 20))() === !1) {
51
+ const [y, u] = e.points, r = y.position.clone().project(o.camera), s = u.position.clone().project(o.camera), d = r.clone().lerp(s, 0.5), p = new v(r.x * a, r.y * l), m = new v(s.x * a, s.y * l);
52
+ if ((() => !(Math.abs(r.z) > 1 || Math.abs(s.z) > 1 || !g(r) && !g(s) || !g(d) || p.distanceTo(m) < 20))() === !1) {
35
53
  n.style.opacity = "0", n.style.pointerEvents = "none";
36
54
  return;
37
55
  }
38
- const H = (f.x + 1) / 2 * d, I = -(f.y - 1) / 2 * u, S = -(Math.atan((y.y - p.y) / (y.x - p.x)) * 180) / Math.PI;
39
- n.style.transform = `translate(${H}px, ${I}px) rotate(${S}deg)`, n.style.opacity = "1", n.style.pointerEvents = "all", o && o.update({ line: r.toCompletelyJson(), polyline: r.getPolyline().toCompletelyJson() });
40
- const w = h.position.clone().distanceTo(b.position), x = t.line.model.params.getDistanceText(w);
41
- i.innerText !== x && (i.innerText = x);
56
+ const I = (d.x + 1) / 2 * a, T = -(d.y - 1) / 2 * l, w = -(Math.atan((p.y - m.y) / (p.x - m.x)) * 180) / Math.PI;
57
+ n.style.transform = `translate(${I}px, ${T}px) rotate(${w}deg)`, n.style.opacity = "1", n.style.pointerEvents = "all", i && i.update({ line: e, polyline: e.getPolyline() });
58
+ const A = x();
59
+ c.innerText = A;
42
60
  }
43
- function P(s) {
44
- s.appendChild(n), n.addEventListener("click", e);
61
+ function F(o) {
62
+ o.appendChild(n), n.addEventListener("click", b);
45
63
  }
46
- function C() {
47
- i.removeEventListener("click", e), n.remove();
64
+ function H() {
65
+ c.removeEventListener("click", b), n.remove();
48
66
  }
49
- const { line: r } = t, F = r.id, i = M(), n = z(r), o = t.userDistanceItem, T = new A(0, 0, 0), g = {
50
- lineID: F,
51
- ndcPosition: T,
52
- update: D,
53
- appendTo: P,
54
- remove: C,
55
- highlight: v,
56
- unHighlight: k
57
- };
58
- return o != null && o.element ? n.appendChild(o.element) : n.appendChild(i), g;
67
+ function x() {
68
+ var r, s, d;
69
+ if (e.points.length < 2)
70
+ return "";
71
+ const [o, f] = e.points, a = o.position.clone().distanceTo(f.position), l = (r = t.line.text) != null ? r : t.line.model.config.defaultText, y = (d = (s = t.line.model.config) == null ? void 0 : s.getDistanceText) == null ? void 0 : d.call(s, a), u = l != null ? l : y;
72
+ return u != null ? u : a.toFixed(2) + "m";
73
+ }
74
+ return h;
59
75
  }
60
76
  export {
61
- J as createDistanceItem
77
+ O as createDistanceItem
62
78
  };