@bino-bi/bn-template-engine 1.0.0-alpha.0 → 1.0.0-alpha.3

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 (299) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-05a82a77.entry.js +1 -0
  3. package/dist/bn-template-engine/p-0f1504f3.entry.js +1 -0
  4. package/dist/bn-template-engine/p-1970906d.entry.js +1 -0
  5. package/dist/bn-template-engine/p-1dbd339c.entry.js +1 -0
  6. package/dist/bn-template-engine/p-2e68cf09.entry.js +1 -0
  7. package/dist/bn-template-engine/p-31cc6a2d.entry.js +1 -0
  8. package/dist/bn-template-engine/p-37881d05.entry.js +1 -0
  9. package/dist/bn-template-engine/{p-65f8962a.entry.js → p-3b894997.entry.js} +1 -1
  10. package/dist/bn-template-engine/p-50e49732.entry.js +1 -0
  11. package/dist/bn-template-engine/{p-ad94cf63.entry.js → p-6c7c0455.entry.js} +1 -1
  12. package/dist/bn-template-engine/p-6da93eae.entry.js +1 -0
  13. package/dist/bn-template-engine/p-701e1578.entry.js +1 -0
  14. package/dist/bn-template-engine/{p-_LBTIfNN.js → p-8tsCnxIz.js} +1 -1
  15. package/dist/bn-template-engine/p-997b2fe4.entry.js +1 -0
  16. package/dist/bn-template-engine/p-B4ySv9KQ.js +1 -0
  17. package/dist/bn-template-engine/p-BL8gyUwE.js +1 -0
  18. package/dist/bn-template-engine/p-BSfqOkN_.js +1 -0
  19. package/dist/bn-template-engine/{p-Cp4MVxCu.js → p-C0yAPzJz.js} +1 -1
  20. package/dist/bn-template-engine/{p--TeDldm8.js → p-CRLgp9-v.js} +1 -1
  21. package/dist/bn-template-engine/p-CYjZRKdI.js +1 -0
  22. package/dist/bn-template-engine/p-DG-1MR_T.js +1 -0
  23. package/dist/bn-template-engine/{p-CnI71OA9.js → p-DRikHQE-.js} +1 -1
  24. package/dist/bn-template-engine/p-DVMu6dEy.js +1 -0
  25. package/dist/bn-template-engine/p-DtdQCMzj.js +1 -0
  26. package/dist/bn-template-engine/p-JNHhIe7t.js +2 -0
  27. package/dist/bn-template-engine/p-a90f1cbe.entry.js +1 -0
  28. package/dist/bn-template-engine/p-b7bec050.entry.js +1 -0
  29. package/dist/bn-template-engine/p-d7f0cbaf.entry.js +1 -0
  30. package/dist/bn-template-engine/p-dfb61aa5.entry.js +1 -0
  31. package/dist/bn-template-engine/p-ece17f84.entry.js +1 -0
  32. package/dist/bn-template-engine/p-f27995c9.entry.js +1 -0
  33. package/dist/bn-template-engine/p-fd427179.entry.js +1 -0
  34. package/dist/bn-template-engine/p-sqjrku2z.js +1 -0
  35. package/dist/bn-template-engine/{p-CY1RzLjU.js → p-tzFCK9qn.js} +1 -1
  36. package/dist/cjs/{DataFormatDigits-DmTbhF8q.js → DataFormatDigits-DAmZzqbD.js} +1 -1
  37. package/dist/cjs/{DateStringFactory-Dn0aRj2Y.js → DateStringFactory-CcluhpGI.js} +4 -5
  38. package/dist/cjs/{luxon-8hyy5YD7.js → Order-BKoDS21t.js} +310 -0
  39. package/dist/cjs/{SVGVariancesStyleGroup-Czizhngt.js → SVGVariancesStyleGroup-DYYAU-81.js} +1 -1
  40. package/dist/cjs/{StringAdapter-0EbYMkR0.js → StringAdapter-Bneo8T4k.js} +1 -1
  41. package/dist/cjs/bn-asset.cjs.entry.js +5 -6
  42. package/dist/cjs/{bn-body_3.cjs.entry.js → bn-body_4.cjs.entry.js} +360 -27
  43. package/dist/cjs/bn-card.cjs.entry.js +5 -6
  44. package/dist/cjs/bn-chart-structure.cjs.entry.js +17 -22
  45. package/dist/cjs/bn-chart-time.cjs.entry.js +38 -51
  46. package/dist/cjs/bn-component-style.cjs.entry.js +5 -6
  47. package/dist/cjs/bn-context_5.cjs.entry.js +145 -78
  48. package/dist/cjs/bn-dataset.cjs.entry.js +5 -6
  49. package/dist/cjs/bn-grid.cjs.entry.js +8 -11
  50. package/dist/cjs/bn-image.cjs.entry.js +8 -11
  51. package/dist/cjs/bn-internationalization.cjs.entry.js +5 -6
  52. package/dist/cjs/bn-layout-card.cjs.entry.js +3 -3
  53. package/dist/cjs/bn-layout-page.cjs.entry.js +2 -2
  54. package/dist/cjs/bn-message.cjs.entry.js +6 -7
  55. package/dist/cjs/bn-template-engine.cjs.js +2 -2
  56. package/dist/cjs/bn-template.cjs.entry.js +4 -5
  57. package/dist/cjs/bn-text.cjs.entry.js +12 -16
  58. package/dist/cjs/bn-tree.cjs.entry.js +8 -11
  59. package/dist/cjs/{context-protocol-BkYHFkXE.js → context-protocol-CRPmux5D.js} +1 -1
  60. package/dist/cjs/editor-companion.cjs.entry.js +3 -3
  61. package/dist/cjs/ibcs-chart-structure.cjs.entry.js +31 -33
  62. package/dist/cjs/ibcs-chart-time.cjs.entry.js +42 -44
  63. package/dist/cjs/{index-CScBFiS1.js → index-Cjw0q6gP.js} +1 -2
  64. package/dist/cjs/loader.cjs.js +2 -2
  65. package/dist/cjs/{withDataset-ZdN-RRTx.js → scaling-D8sIIKft.js} +68 -3
  66. package/dist/cjs/{withBodyObserver-B0_W1VOf.js → withBodyObserver-C6gLgq_e.js} +2 -2
  67. package/dist/cjs/{componentRegister-C17UFNPh.js → withComponentStatus-_x4LQZ0N.js} +43 -6
  68. package/dist/cjs/{withComponentStyle-C6KHnZHt.js → withComponentStyle-DMtic_9Y.js} +3 -3
  69. package/dist/cjs/{withHasError-Dspb3lIV.js → withHasError-B8gHkfV2.js} +1 -1
  70. package/dist/cjs/{withStyled-Bf-stJTR.js → withStyled-CW30Bh6c.js} +18 -63
  71. package/dist/cjs/{withTranslation-Cz0M5maV.js → withTranslation-CWPAIRjh.js} +3 -3
  72. package/dist/collection/collection-manifest.json +1 -10
  73. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +2 -3
  74. package/dist/collection/components/bn-chart-time/bn-chart-time.js +21 -30
  75. package/dist/collection/components/bn-message/bn-message.js +1 -1
  76. package/dist/collection/components/bn-page/bn-page.js +1 -1
  77. package/dist/collection/components/bn-table/bn-table.js +63 -12
  78. package/dist/collection/components/bn-table/ibcs-table.css +7 -5
  79. package/dist/collection/components/bn-table/ibcs-table.js +22 -1
  80. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +56 -25
  81. package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -1
  82. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +12 -3
  83. package/dist/collection/components/bn-table/utils/helper/ColumnStatistics.js +9 -1
  84. package/dist/collection/components/bn-template/bn-template.js +1 -1
  85. package/dist/collection/components/bn-text/bn-text.js +1 -1
  86. package/dist/collection/components/bn-title/bn-title.js +1 -9
  87. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +1 -1
  88. package/dist/collection/components/editor-companion/editor-companion.js +1 -1
  89. package/dist/collection/utils/DateStringFactory.js +0 -1
  90. package/dist/collection/utils/constants.js +27 -0
  91. package/dist/collection/utils/validate.js +4 -1
  92. package/dist/components/DataFormatDigits.js +1 -1
  93. package/dist/components/DateStringFactory.js +1 -1
  94. package/dist/components/Order.js +1 -1
  95. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  96. package/dist/components/bn-chart-structure.js +1 -1
  97. package/dist/components/bn-chart-time.js +1 -1
  98. package/dist/components/bn-message2.js +1 -1
  99. package/dist/components/bn-page2.js +1 -1
  100. package/dist/components/bn-table.js +1 -1
  101. package/dist/components/bn-template.js +1 -1
  102. package/dist/components/bn-text.js +1 -1
  103. package/dist/components/bn-title2.js +1 -1
  104. package/dist/components/editor-companion.js +1 -1
  105. package/dist/components/ibcs-chart-structure2.js +1 -1
  106. package/dist/components/ibcs-chart-time2.js +1 -1
  107. package/dist/components/ibcs-table2.js +1 -1
  108. package/dist/components/ibcs-title2.js +1 -1
  109. package/dist/components/ibcsRuleSet.js +1 -1
  110. package/dist/components/scaling.js +1 -1
  111. package/dist/components/validate.js +1 -1
  112. package/dist/components/withHasError.js +1 -1
  113. package/dist/esm/{DataFormatDigits-Dt6gpIiZ.js → DataFormatDigits--qIbKvXa.js} +1 -1
  114. package/dist/esm/{DateStringFactory-_Qiv0IvF.js → DateStringFactory-XWdUjsn8.js} +1 -2
  115. package/dist/esm/{luxon-DbyXf6dF.js → Order-sqjrku2z.js} +307 -1
  116. package/dist/esm/{SVGVariancesStyleGroup-DlWgvpzs.js → SVGVariancesStyleGroup-ibg3sLjM.js} +1 -1
  117. package/dist/esm/{StringAdapter-BLvo1Krl.js → StringAdapter-BCLJpQQ8.js} +1 -1
  118. package/dist/esm/bn-asset.entry.js +5 -6
  119. package/dist/esm/{bn-body_3.entry.js → bn-body_4.entry.js} +356 -24
  120. package/dist/esm/bn-card.entry.js +5 -6
  121. package/dist/esm/bn-chart-structure.entry.js +12 -17
  122. package/dist/esm/bn-chart-time.entry.js +31 -44
  123. package/dist/esm/bn-component-style.entry.js +5 -6
  124. package/dist/esm/bn-context_5.entry.js +124 -57
  125. package/dist/esm/bn-dataset.entry.js +5 -6
  126. package/dist/esm/bn-grid.entry.js +8 -11
  127. package/dist/esm/bn-image.entry.js +8 -11
  128. package/dist/esm/bn-internationalization.entry.js +5 -6
  129. package/dist/esm/bn-layout-card.entry.js +3 -3
  130. package/dist/esm/bn-layout-page.entry.js +2 -2
  131. package/dist/esm/bn-message.entry.js +6 -7
  132. package/dist/esm/bn-template-engine.js +3 -3
  133. package/dist/esm/bn-template.entry.js +4 -5
  134. package/dist/esm/bn-text.entry.js +11 -15
  135. package/dist/esm/bn-tree.entry.js +8 -11
  136. package/dist/esm/{context-protocol-DzeqZxg6.js → context-protocol-Bz5klD-F.js} +1 -1
  137. package/dist/esm/editor-companion.entry.js +3 -3
  138. package/dist/esm/ibcs-chart-structure.entry.js +5 -7
  139. package/dist/esm/ibcs-chart-time.entry.js +6 -8
  140. package/dist/esm/{index-B27Ax6P_.js → index-JNHhIe7t.js} +2 -2
  141. package/dist/esm/loader.js +3 -3
  142. package/dist/esm/{withDataset-BT2VQCsG.js → scaling-C6K8FYSF.js} +67 -4
  143. package/dist/esm/{withBodyObserver-gZpZiEIK.js → withBodyObserver-DczL5ia8.js} +2 -2
  144. package/dist/esm/{componentRegister-BtVfu16B.js → withComponentStatus-DodoSXe-.js} +36 -1
  145. package/dist/esm/{withComponentStyle-NaxfakAG.js → withComponentStyle-BerJY64r.js} +3 -3
  146. package/dist/esm/{withHasError-C48fTE2k.js → withHasError-B3QX2emi.js} +1 -1
  147. package/dist/esm/{withStyled-CpUTv74m.js → withStyled-D1fAWJ3g.js} +8 -51
  148. package/dist/esm/{withTranslation-Do4GhleK.js → withTranslation-mimbJdER.js} +3 -3
  149. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +1 -2
  150. package/dist/types/components/bn-table/bn-table.d.ts +11 -7
  151. package/dist/types/components/bn-table/ibcs-table.d.ts +1 -0
  152. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +1 -0
  153. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +3 -0
  154. package/dist/types/components/bn-title/bn-title.d.ts +0 -1
  155. package/dist/types/components.d.ts +22 -403
  156. package/dist/types/utils/constants.d.ts +15 -0
  157. package/dist/types/utils/validate.d.ts +1 -0
  158. package/package.json +2 -3
  159. package/readme.md +0 -1
  160. package/dist/bn-template-engine/assets/gpx/Chasing_Legends.gpx +0 -195076
  161. package/dist/bn-template-engine/assets/gpx/Fahrt_am_Nachmittag.gpx +0 -142007
  162. package/dist/bn-template-engine/assets/icons/gpx-finish.png +0 -0
  163. package/dist/bn-template-engine/assets/icons/gpx-shadow.png +0 -0
  164. package/dist/bn-template-engine/assets/icons/gpx-start.png +0 -0
  165. package/dist/bn-template-engine/assets/icons/marker-example.png +0 -0
  166. package/dist/bn-template-engine/assets/icons/pin-icon-end.png +0 -0
  167. package/dist/bn-template-engine/assets/icons/pin-icon-start.png +0 -0
  168. package/dist/bn-template-engine/assets/icons/pin-icon-wpt.png +0 -0
  169. package/dist/bn-template-engine/assets/icons/pin-shadow.png +0 -0
  170. package/dist/bn-template-engine/assets/icons/pin.png +0 -0
  171. package/dist/bn-template-engine/p-0e7dc113.entry.js +0 -1
  172. package/dist/bn-template-engine/p-264c6bad.entry.js +0 -1
  173. package/dist/bn-template-engine/p-326a0902.entry.js +0 -1
  174. package/dist/bn-template-engine/p-38a8bde3.entry.js +0 -1
  175. package/dist/bn-template-engine/p-577eafcd.entry.js +0 -1
  176. package/dist/bn-template-engine/p-5905cc43.entry.js +0 -1
  177. package/dist/bn-template-engine/p-5d155a72.entry.js +0 -1
  178. package/dist/bn-template-engine/p-6b8d1ebf.entry.js +0 -1
  179. package/dist/bn-template-engine/p-7995acb2.entry.js +0 -1
  180. package/dist/bn-template-engine/p-7afe431e.entry.js +0 -1
  181. package/dist/bn-template-engine/p-8014b1ac.entry.js +0 -1
  182. package/dist/bn-template-engine/p-80423fc8.entry.js +0 -1
  183. package/dist/bn-template-engine/p-91e74d42.entry.js +0 -1
  184. package/dist/bn-template-engine/p-930a9e29.entry.js +0 -1
  185. package/dist/bn-template-engine/p-93C9jL8R.js +0 -1
  186. package/dist/bn-template-engine/p-93ff8584.entry.js +0 -1
  187. package/dist/bn-template-engine/p-B0m0U4wJ.js +0 -1
  188. package/dist/bn-template-engine/p-B27Ax6P_.js +0 -2
  189. package/dist/bn-template-engine/p-B79VcHiT.js +0 -1
  190. package/dist/bn-template-engine/p-BBd0ZVLL.js +0 -1
  191. package/dist/bn-template-engine/p-BFatTBqh.js +0 -1
  192. package/dist/bn-template-engine/p-BQp6ZPYW.js +0 -1
  193. package/dist/bn-template-engine/p-BhEQy-2D.js +0 -1
  194. package/dist/bn-template-engine/p-BtVfu16B.js +0 -1
  195. package/dist/bn-template-engine/p-CfWnag33.js +0 -1
  196. package/dist/bn-template-engine/p-DbyXf6dF.js +0 -1
  197. package/dist/bn-template-engine/p-TdL-LRR9.js +0 -1
  198. package/dist/bn-template-engine/p-a342cd3c.entry.js +0 -1
  199. package/dist/bn-template-engine/p-bc37d750.entry.js +0 -1
  200. package/dist/bn-template-engine/p-c9f050bf.entry.js +0 -1
  201. package/dist/bn-template-engine/p-d07a0ca3.entry.js +0 -1
  202. package/dist/bn-template-engine/p-e5f372af.entry.js +0 -1
  203. package/dist/bn-template-engine/p-e620028c.entry.js +0 -1
  204. package/dist/bn-template-engine/p-e81e116a.entry.js +0 -1
  205. package/dist/bn-template-engine/p-eca98070.entry.js +0 -1
  206. package/dist/bn-template-engine/p-ee6de950.entry.js +0 -1
  207. package/dist/bn-template-engine/p-efe0ef1e.entry.js +0 -1
  208. package/dist/bn-template-engine/p-f034f1b8.entry.js +0 -1
  209. package/dist/bn-template-engine/p-f1c1a8a3.entry.js +0 -1
  210. package/dist/bn-template-engine/p-fe573a1a.entry.js +0 -1
  211. package/dist/bn-template-engine/p-kMyLevYy.js +0 -1
  212. package/dist/cjs/Order-B4NIqQWe.js +0 -129
  213. package/dist/cjs/bn-map.cjs.entry.js +0 -425
  214. package/dist/cjs/constants-DHqQXSSd.js +0 -158
  215. package/dist/cjs/ibcs-map.cjs.entry.js +0 -1075
  216. package/dist/cjs/ibcs-title.cjs.entry.js +0 -352
  217. package/dist/cjs/scaling-B23eOtsC.js +0 -67
  218. package/dist/cjs/test-runner-card.cjs.entry.js +0 -27
  219. package/dist/cjs/test-runner-chart-time.cjs.entry.js +0 -230
  220. package/dist/cjs/test-runner-chart.cjs.entry.js +0 -326
  221. package/dist/cjs/test-runner-map.cjs.entry.js +0 -1862
  222. package/dist/cjs/test-runner-table.cjs.entry.js +0 -477
  223. package/dist/cjs/test-runner-time.cjs.entry.js +0 -381
  224. package/dist/cjs/test-runner-title.cjs.entry.js +0 -115
  225. package/dist/cjs/withComponentStatus-BrxL7usr.js +0 -39
  226. package/dist/collection/components/bn-map/bn-map.css +0 -4
  227. package/dist/collection/components/bn-map/bn-map.js +0 -725
  228. package/dist/collection/components/bn-map/ibcs-map/assets/gpx/Chasing_Legends.gpx +0 -195076
  229. package/dist/collection/components/bn-map/ibcs-map/assets/gpx/Fahrt_am_Nachmittag.gpx +0 -142007
  230. package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-finish.png +0 -0
  231. package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-shadow.png +0 -0
  232. package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-start.png +0 -0
  233. package/dist/collection/components/bn-map/ibcs-map/assets/icons/marker-example.png +0 -0
  234. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-end.png +0 -0
  235. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-start.png +0 -0
  236. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-wpt.png +0 -0
  237. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-shadow.png +0 -0
  238. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin.png +0 -0
  239. package/dist/collection/components/bn-map/ibcs-map/ibcs-map.css +0 -674
  240. package/dist/collection/components/bn-map/ibcs-map/ibcs-map.js +0 -744
  241. package/dist/collection/components/bn-map/ibcs-map/utils/model/GeoJsonLayer.js +0 -9
  242. package/dist/collection/components/bn-map/ibcs-map/utils/model/GpxLayer.js +0 -13
  243. package/dist/collection/components/bn-map/ibcs-map/utils/model/Marker.js +0 -11
  244. package/dist/collection/components/bn-map/ibcs-map/utils/model/index.js +0 -2
  245. package/dist/collection/test-runner/test-runner-card.js +0 -36
  246. package/dist/collection/test-runner/test-runner-chart-time.js +0 -234
  247. package/dist/collection/test-runner/test-runner-chart.js +0 -364
  248. package/dist/collection/test-runner/test-runner-map.js +0 -1901
  249. package/dist/collection/test-runner/test-runner-table.js +0 -469
  250. package/dist/collection/test-runner/test-runner-time.js +0 -399
  251. package/dist/collection/test-runner/test-runner-title.js +0 -108
  252. package/dist/components/bn-map.d.ts +0 -11
  253. package/dist/components/bn-map.js +0 -1
  254. package/dist/components/componentRegister.js +0 -1
  255. package/dist/components/ibcs-map.d.ts +0 -11
  256. package/dist/components/ibcs-map.js +0 -1
  257. package/dist/components/ibcs-map2.js +0 -1
  258. package/dist/components/test-runner-card.d.ts +0 -11
  259. package/dist/components/test-runner-card.js +0 -1
  260. package/dist/components/test-runner-chart-time.d.ts +0 -11
  261. package/dist/components/test-runner-chart-time.js +0 -1
  262. package/dist/components/test-runner-chart.d.ts +0 -11
  263. package/dist/components/test-runner-chart.js +0 -1
  264. package/dist/components/test-runner-map.d.ts +0 -11
  265. package/dist/components/test-runner-map.js +0 -1
  266. package/dist/components/test-runner-table.d.ts +0 -11
  267. package/dist/components/test-runner-table.js +0 -1
  268. package/dist/components/test-runner-time.d.ts +0 -11
  269. package/dist/components/test-runner-time.js +0 -1
  270. package/dist/components/test-runner-title.d.ts +0 -11
  271. package/dist/components/test-runner-title.js +0 -1
  272. package/dist/components/withDataset.js +0 -1
  273. package/dist/esm/Order-B4fpLe_f.js +0 -125
  274. package/dist/esm/bn-map.entry.js +0 -423
  275. package/dist/esm/constants-kMyLevYy.js +0 -158
  276. package/dist/esm/ibcs-map.entry.js +0 -1073
  277. package/dist/esm/ibcs-title.entry.js +0 -350
  278. package/dist/esm/scaling-BBd0ZVLL.js +0 -64
  279. package/dist/esm/test-runner-card.entry.js +0 -25
  280. package/dist/esm/test-runner-chart-time.entry.js +0 -228
  281. package/dist/esm/test-runner-chart.entry.js +0 -324
  282. package/dist/esm/test-runner-map.entry.js +0 -1860
  283. package/dist/esm/test-runner-table.entry.js +0 -475
  284. package/dist/esm/test-runner-time.entry.js +0 -379
  285. package/dist/esm/test-runner-title.entry.js +0 -113
  286. package/dist/esm/withComponentStatus-elELReKt.js +0 -37
  287. package/dist/types/components/bn-map/bn-map.d.ts +0 -122
  288. package/dist/types/components/bn-map/ibcs-map/ibcs-map.d.ts +0 -73
  289. package/dist/types/components/bn-map/ibcs-map/utils/model/GeoJsonLayer.d.ts +0 -8
  290. package/dist/types/components/bn-map/ibcs-map/utils/model/GpxLayer.d.ts +0 -11
  291. package/dist/types/components/bn-map/ibcs-map/utils/model/Marker.d.ts +0 -9
  292. package/dist/types/components/bn-map/ibcs-map/utils/model/index.d.ts +0 -2
  293. package/dist/types/test-runner/test-runner-card.d.ts +0 -3
  294. package/dist/types/test-runner/test-runner-chart-time.d.ts +0 -3
  295. package/dist/types/test-runner/test-runner-chart.d.ts +0 -3
  296. package/dist/types/test-runner/test-runner-map.d.ts +0 -3
  297. package/dist/types/test-runner/test-runner-table.d.ts +0 -3
  298. package/dist/types/test-runner/test-runner-time.d.ts +0 -3
  299. package/dist/types/test-runner/test-runner-title.d.ts +0 -3
@@ -1,1075 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-CScBFiS1.js');
4
- var componentRegister = require('./componentRegister-C17UFNPh.js');
5
-
6
- /**
7
- * Copyright (C) 2011-2012 Pavel Shramov
8
- * Copyright (C) 2013-2017 Maxime Petazzoni <maxime.petazzoni@bulix.org>
9
- * All Rights Reserved.
10
- *
11
- * Redistribution and use in source and binary forms, with or without
12
- * modification, are permitted provided that the following conditions are met:
13
- *
14
- * - Redistributions of source code must retain the above copyright notice,
15
- * this list of conditions and the following disclaimer.
16
- *
17
- * - Redistributions in binary form must reproduce the above copyright notice,
18
- * this list of conditions and the following disclaimer in the documentation
19
- * and/or other materials provided with the distribution.
20
- *
21
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
- * POSSIBILITY OF SUCH DAMAGE.
32
- */
33
-
34
-
35
- var _MAX_POINT_INTERVAL_MS = 15000;
36
- var _SECOND_IN_MILLIS = 1000;
37
- var _MINUTE_IN_MILLIS = 60 * _SECOND_IN_MILLIS;
38
- var _HOUR_IN_MILLIS = 60 * _MINUTE_IN_MILLIS;
39
- var _DAY_IN_MILLIS = 24 * _HOUR_IN_MILLIS;
40
-
41
- var _GPX_STYLE_NS = 'http://www.topografix.com/GPX/gpx_style/0/2';
42
- var _DEFAULT_ICON = new L.Icon.Default;
43
-
44
- var _DEFAULT_MARKERS = {
45
- startIcon: _DEFAULT_ICON,
46
- endIcon: _DEFAULT_ICON,
47
-
48
- // Based on 'sym' waypoint key
49
- wptIcons: {
50
- '': _DEFAULT_ICON,
51
- },
52
-
53
- // Based on 'type' waypoint key
54
- wptTypeIcons: {
55
- '': _DEFAULT_ICON
56
- },
57
-
58
- // Based on a regex over the waypoint's name
59
- pointMatchers: [],
60
- };
61
-
62
- var _DEFAULT_MARKER_OPTS = {
63
- iconSize: [33, 45],
64
- iconAnchor: [16, 45],
65
- clickable: false
66
- };
67
-
68
- var _DEFAULT_POLYLINE_OPTS = {
69
- color: 'blue'
70
- };
71
-
72
- var _DEFAULT_GPX_OPTS = {
73
- parseElements: ['track', 'route', 'waypoint'],
74
- joinTrackSegments: true
75
- };
76
-
77
- L.GPX = L.FeatureGroup.extend({
78
- initialize: function(gpx, options) {
79
- options.max_point_interval = options.max_point_interval || _MAX_POINT_INTERVAL_MS;
80
- options.markers = this._merge_objs(
81
- _DEFAULT_MARKERS,
82
- options.markers || {});
83
- options.marker_options = this._merge_objs(
84
- _DEFAULT_MARKER_OPTS,
85
- options.marker_options || {});
86
- options.polyline_options = options.polyline_options || [];
87
- options.gpx_options = this._merge_objs(
88
- _DEFAULT_GPX_OPTS,
89
- options.gpx_options || {});
90
-
91
- L.Util.setOptions(this, options);
92
-
93
- // Base icon class for track pins.
94
- L.GPXTrackIcon = L.Icon.extend({ options: options.marker_options });
95
-
96
- this._gpx = gpx;
97
- this._layers = {};
98
- this._prepare_markers(options.markers);
99
- this._init_info();
100
-
101
- if (gpx) {
102
- this._parse(gpx, options, this.options.async);
103
- }
104
- },
105
-
106
- get_duration_string: function(duration, hidems) {
107
- var s = '';
108
-
109
- if (duration >= _DAY_IN_MILLIS) {
110
- s += Math.floor(duration / _DAY_IN_MILLIS) + 'd ';
111
- duration = duration % _DAY_IN_MILLIS;
112
- }
113
-
114
- if (duration >= _HOUR_IN_MILLIS) {
115
- s += Math.floor(duration / _HOUR_IN_MILLIS) + ':';
116
- duration = duration % _HOUR_IN_MILLIS;
117
- }
118
-
119
- var mins = Math.floor(duration / _MINUTE_IN_MILLIS);
120
- duration = duration % _MINUTE_IN_MILLIS;
121
- if (mins < 10) s += '0';
122
- s += mins + '\'';
123
-
124
- var secs = Math.floor(duration / _SECOND_IN_MILLIS);
125
- duration = duration % _SECOND_IN_MILLIS;
126
- if (secs < 10) s += '0';
127
- s += secs;
128
-
129
- if (!hidems && duration > 0) s += '.' + Math.round(Math.floor(duration)*1000)/1000;
130
- else s += '"';
131
-
132
- return s;
133
- },
134
-
135
- get_duration_string_iso: function(duration, hidems) {
136
- var s = this.get_duration_string(duration, hidems);
137
- return s.replace("'",':').replace('"','');
138
- },
139
- _toFixed_helper: function(v, unit = 0) {
140
- if (typeof(v) == 'number'){
141
- return v.toFixed(unit);
142
- }
143
- return "?";
144
- },
145
- // Public methods
146
- to_miles: function(v) { return v / 1.60934; },
147
- to_ft: function(v) { return v * 3.28084; },
148
- m_to_km: function(v) { return v / 1000; },
149
- m_to_mi: function(v) { return v / 1609.34; },
150
- ms_to_kmh: function(v) { return v * 3.6; },
151
- ms_to_mih: function(v) { return v / 1609.34 * 3600; },
152
-
153
- get_name: function() { return this._info.name; },
154
- get_desc: function() { return this._info.desc; },
155
- get_author: function() { return this._info.author; },
156
- get_copyright: function() { return this._info.copyright; },
157
- get_distance: function() { return this._info.length; },
158
- get_distance_imp: function() { return this.to_miles(this.m_to_km(this.get_distance())); },
159
-
160
- get_start_time: function() { return this._info.duration.start; },
161
- get_end_time: function() { return this._info.duration.end; },
162
- get_moving_time: function() { return this._info.duration.moving; },
163
- get_total_time: function() { return this._info.duration.total; },
164
-
165
- get_moving_pace: function() { return this.get_moving_time() / this.m_to_km(this.get_distance()); },
166
- get_moving_pace_imp: function() { return this.get_moving_time() / this.get_distance_imp(); },
167
-
168
- get_moving_speed: function() { return this.m_to_km(this.get_distance()) / (this.get_moving_time() / (3600 * 1000)) ; },
169
- get_moving_speed_imp:function() { return this.to_miles(this.m_to_km(this.get_distance())) / (this.get_moving_time() / (3600 * 1000)) ; },
170
-
171
- get_total_speed: function() { return this.m_to_km(this.get_distance()) / (this.get_total_time() / (3600 * 1000)); },
172
- get_total_speed_imp: function() { return this.to_miles(this.m_to_km(this.get_distance())) / (this.get_total_time() / (3600 * 1000)); },
173
-
174
- get_elevation_gain: function() { return this._info.elevation.gain; },
175
- get_elevation_loss: function() { return this._info.elevation.loss; },
176
- get_elevation_gain_imp: function() { return this.to_ft(this.get_elevation_gain()); },
177
- get_elevation_loss_imp: function() { return this.to_ft(this.get_elevation_loss()); },
178
- get_elevation_data: function() {
179
- var _this = this;
180
- return this._info.elevation._points.map(
181
- function(p) { return _this._prepare_data_point(p, _this.m_to_km, null,
182
- function(a, b) { return _this._toFixed_helper(a, 2) + ' km, ' + _this._toFixed_helper(b, 0) + ' m'; });
183
- });
184
- },
185
- get_elevation_data_imp: function() {
186
- var _this = this;
187
- return this._info.elevation._points.map(
188
- function(p) { return _this._prepare_data_point(p, _this.m_to_mi, _this.to_ft,
189
- function(a, b) { return _this._toFixed_helper(a, 2) + ' mi, ' + _this._toFixed_helper(b, 0) + ' ft'; });
190
- });
191
- },
192
- get_elevation_max: function() { return this._info.elevation.max; },
193
- get_elevation_min: function() { return this._info.elevation.min; },
194
- get_elevation_max_imp: function() { return this.to_ft(this.get_elevation_max()); },
195
- get_elevation_min_imp: function() { return this.to_ft(this.get_elevation_min()); },
196
-
197
- get_speed_data: function() {
198
- var _this = this;
199
- return this._info.speed._points.map(
200
- function(p) { return _this._prepare_data_point(p, _this.m_to_km, _this.ms_to_kmh,
201
- function(a, b) { return _this._toFixed_helper(a, 2) + ' km, ' + _this._toFixed_helper(b, 2) + ' km/h'; });
202
- });
203
- },
204
- get_speed_data_imp: function() {
205
- var _this = this;
206
- return this._info.speed._points.map(
207
- function(p) { return _this._prepare_data_point(p, _this.m_to_mi, _this.ms_to_mih,
208
- function(a, b) { return _this._toFixed_helper(a, 2) + ' mi, ' + _this._toFixed_helper(b, 2) + ' mi/h'; });
209
- });
210
- },
211
- get_speed_max: function() { return this.m_to_km(this._info.speed.max) * 3600; },
212
- get_speed_max_imp: function() { return this.to_miles(this.get_speed_max()); },
213
-
214
- get_average_hr: function() { return this._info.hr.avg; },
215
- get_average_temp: function() { return this._info.atemp.avg; },
216
- get_average_cadence: function() { return this._info.cad.avg; },
217
- get_heartrate_data: function() {
218
- var _this = this;
219
- return this._info.hr._points.map(
220
- function(p) { return _this._prepare_data_point(p, _this.m_to_km, null,
221
- function(a, b) { return _this._toFixed_helper(a, 2) + ' km, ' + _this._toFixed_helper(b, 0) + ' bpm'; });
222
- });
223
- },
224
- get_heartrate_data_imp: function() {
225
- var _this = this;
226
- return this._info.hr._points.map(
227
- function(p) { return _this._prepare_data_point(p, _this.m_to_mi, null,
228
- function(a, b) { return _this._toFixed_helper(a, 2) + ' mi, ' + _this._toFixed_helper(b, 0) + ' bpm'; });
229
- });
230
- },
231
- get_cadence_data: function() {
232
- var _this = this;
233
- return this._info.cad._points.map(
234
- function(p) { return _this._prepare_data_point(p, _this.m_to_km, null,
235
- function(a, b) { return _this._toFixed_helper(a, 2) + ' km, ' + _this._toFixed_helper(b, 0) + ' rpm'; });
236
- });
237
- },
238
- get_temp_data: function() {
239
- var _this = this;
240
- return this._info.atemp._points.map(
241
- function(p) { return _this._prepare_data_point(p, _this.m_to_km, null,
242
- function(a, b) { return _this._toFixed_helper(a, 2) + ' km, ' + _this._toFixed_helper(b, 0) + ' degrees'; });
243
- });
244
- },
245
- get_cadence_data_imp: function() {
246
- var _this = this;
247
- return this._info.cad._points.map(
248
- function(p) { return _this._prepare_data_point(p, _this.m_to_mi, null,
249
- function(a, b) { return _this._toFixed_helper(a, 2) + ' mi, ' + _this._toFixed_helper(b, 0) + ' rpm'; });
250
- });
251
- },
252
- get_temp_data_imp: function() {
253
- var _this = this;
254
- return this._info.atemp._points.map(
255
- function(p) { return _this._prepare_data_point(p, _this.m_to_mi, null,
256
- function(a, b) { return _this._toFixed_helper(a, 2) + ' mi, ' + _this._toFixed_helper(b, 0) + ' degrees'; });
257
- });
258
- },
259
-
260
- reload: function() {
261
- this._init_info();
262
- this.clearLayers();
263
- this._parse(this._gpx, this.options, this.options.async);
264
- },
265
-
266
- // Private methods
267
- _merge_objs: function(a, b) {
268
- var _ = {};
269
- for (var attr in a) { _[attr] = a[attr]; }
270
- for (var attr in b) { _[attr] = b[attr]; }
271
- return _;
272
- },
273
-
274
- _prepare_data_point: function(p, trans1, trans2, trans_tooltip) {
275
- var r = [trans1 && trans1(p[0]) || p[0], trans2 && trans2(p[1]) || p[1]];
276
- r.push(trans_tooltip && trans_tooltip(r[0], r[1]) || (r[0] + ': ' + r[1]));
277
- return r;
278
- },
279
-
280
- _prepare_markers: function(markers) {
281
- function iconize(url) {
282
- return new L.GPXTrackIcon({iconUrl: url});
283
- }
284
-
285
- Object.entries(markers).forEach(([key, value]) => {
286
- if (key === 'wptIcons' || key === 'wptTypeIcons') {
287
- markers[key] = this._prepare_markers(value);
288
- } else if (key === 'pointMatchers') {
289
- markers[key] = value.map(e => {
290
- if (typeof(e.icon) === 'string') {
291
- e.icon = iconize(e.icon);
292
- }
293
- return e;
294
- });
295
- } else if (typeof(value) === 'string') {
296
- markers[key] = iconize(value);
297
- } else if (typeof(value) === 'object' && value !== null) {
298
- markers[key] = value;
299
- }
300
- });
301
-
302
- return markers;
303
- },
304
-
305
- _init_info: function() {
306
- this._info = {
307
- name: null,
308
- length: 0.0,
309
- elevation: {gain: 0.0, loss: 0.0, max: 0.0, min: Infinity, _points: []},
310
- speed : {max: 0.0, _points: []},
311
- hr: {avg: 0, _total: 0, _points: []},
312
- duration: {start: null, end: null, moving: 0, total: 0},
313
- atemp: {avg: 0, _total: 0, _points: []},
314
- cad: {avg: 0, _total: 0, _points: []}
315
- };
316
- },
317
-
318
- _load_xml: function(url, cb, options, async) {
319
- if (async == undefined) async = this.options.async;
320
- if (options == undefined) options = this.options;
321
-
322
- var _this = this;
323
- var req = new window.XMLHttpRequest();
324
- req.open('GET', url, async);
325
- try {
326
- req.overrideMimeType('text/xml'); // unsupported by IE
327
- } catch(e) {}
328
- req.onloadend = function() {
329
- if (req.status == 200) {
330
- cb(req.responseXML, options);
331
- } else {
332
- _this.fire('error', { err: 'Error fetching resource: ' + url });
333
- }
334
- };
335
- req.send(null);
336
- },
337
-
338
- _parse: function(input, options, async) {
339
- var _this = this;
340
- var cb = function(gpx, options) {
341
- var layers = _this._parse_gpx_data(gpx, options);
342
- if (!layers) {
343
- _this.fire('error', { err: 'No parseable layers of type(s) ' + JSON.stringify(options.gpx_options.parseElements) });
344
- return;
345
- }
346
- _this.addLayer(layers);
347
- _this.fire('loaded', { layers: layers, element: gpx });
348
- };
349
- if (input.substr(0,1)==='<') { // direct XML has to start with a <
350
- var parser = new DOMParser();
351
- if (async) {
352
- setTimeout(function() {
353
- cb(parser.parseFromString(input, "text/xml"), options);
354
- });
355
- } else {
356
- cb(parser.parseFromString(input, "text/xml"), options);
357
- }
358
- } else {
359
- this._load_xml(input, cb, options, async);
360
- }
361
- },
362
-
363
- _parse_gpx_data: function(xml, options) {
364
- var i, el, layers = [];
365
-
366
- var name = xml.getElementsByTagName('name');
367
- if (name.length > 0) {
368
- this._info.name = name[0].textContent;
369
- }
370
- var desc = xml.getElementsByTagName('desc');
371
- if (desc.length > 0) {
372
- this._info.desc = desc[0].textContent;
373
- }
374
- var author = xml.getElementsByTagName('author');
375
- if (author.length > 0) {
376
- this._info.author = author[0].textContent;
377
- }
378
- var copyright = xml.getElementsByTagName('copyright');
379
- if (copyright.length > 0) {
380
- this._info.copyright = copyright[0].textContent;
381
- }
382
-
383
- var parseElements = options.gpx_options.parseElements;
384
- if (parseElements.indexOf('route') > -1) {
385
- // routes are <rtept> tags inside <rte> sections
386
- var routes = xml.getElementsByTagName('rte');
387
- for (i = 0; i < routes.length; i++) {
388
- var route = routes[i];
389
- var base_style = this._extract_styling(route);
390
- var polyline_options = this._get_polyline_options(options.polyline_options, i);
391
- layers = layers.concat(this._parse_segment(routes[i], options, base_style, polyline_options, 'rtept'));
392
- }
393
- }
394
-
395
- if (parseElements.indexOf('track') > -1) {
396
- // tracks are <trkpt> tags in one or more <trkseg> sections in each <trk>
397
- var tracks = xml.getElementsByTagName('trk');
398
- for (i = 0; i < tracks.length; i++) {
399
- var track = tracks[i];
400
- var base_style = this._extract_styling(track);
401
- var polyline_options = this._get_polyline_options(options.polyline_options, i);
402
-
403
- if (options.gpx_options.joinTrackSegments) {
404
- layers = layers.concat(this._parse_segment(track, options, base_style, polyline_options, 'trkpt'));
405
- } else {
406
- var segments = track.getElementsByTagName('trkseg');
407
- for (j = 0; j < segments.length; j++) {
408
- layers = layers.concat(this._parse_segment(segments[j], options, base_style, polyline_options, 'trkpt'));
409
- }
410
- }
411
- }
412
- }
413
-
414
- this._info.hr.avg = Math.round(this._info.hr._total / this._info.hr._points.length);
415
- this._info.cad.avg = Math.round(this._info.cad._total / this._info.cad._points.length);
416
- this._info.atemp.avg = Math.round(this._info.atemp._total / this._info.atemp._points.length);
417
-
418
- // parse waypoints and add markers for each of them
419
- if (parseElements.indexOf('waypoint') > -1) {
420
- el = xml.getElementsByTagName('wpt');
421
- for (i = 0; i < el.length; i++) {
422
- var ll = new L.LatLng(
423
- el[i].getAttribute('lat'),
424
- el[i].getAttribute('lon'));
425
-
426
- var nameEl = el[i].getElementsByTagName('name');
427
- var name = nameEl.length > 0 ? nameEl[0].textContent : '';
428
-
429
- var descEl = el[i].getElementsByTagName('desc');
430
- var desc = descEl.length > 0 ? descEl[0].textContent : '';
431
-
432
- var symEl = el[i].getElementsByTagName('sym');
433
- var symKey = symEl.length > 0 ? symEl[0].textContent : null;
434
-
435
- var typeEl = el[i].getElementsByTagName('type');
436
- var typeKey = typeEl.length > 0 ? typeEl[0].textContent : null;
437
-
438
- /*
439
- * Add waypoint marker based on the waypoint symbol key.
440
- *
441
- * First look for a configured icon for that symKey. If not found, look
442
- * for a configured icon URL for that symKey and build an icon from it.
443
- * If none of those match, look through the point matchers for a match
444
- * on the waypoint's name.
445
- *
446
- * Otherwise, fall back to the default icon if one was configured, or
447
- * finally to the default icon URL, if one was configured.
448
- */
449
- var wptIcons = options.markers.wptIcons;
450
- var wptTypeIcons = options.markers.wptTypeIcons;
451
- var ptMatchers = options.markers.pointMatchers || [];
452
- var symIcon;
453
- if (wptIcons && symKey && wptIcons[symKey]) {
454
- symIcon = wptIcons[symKey];
455
- } else if (wptTypeIcons && typeKey && wptTypeIcons[typeKey]) {
456
- symIcon = wptTypeIcons[typeKey];
457
- } else if (ptMatchers.length > 0) {
458
- for (var j = 0; j < ptMatchers.length; j++) {
459
- if (ptMatchers[j].regex.test(name)) {
460
- symIcon = ptMatchers[j].icon;
461
- break;
462
- }
463
- }
464
- } else if (wptIcons && wptIcons['']) {
465
- symIcon = wptIcons[''];
466
- }
467
-
468
- if (!symIcon) {
469
- console.log(
470
- 'No waypoint icon could be matched for symKey=%s,typeKey=%s,name=%s on waypoint %o',
471
- symKey, typeKey, name, el[i]);
472
- continue;
473
- }
474
-
475
- var marker = new L.Marker(ll, {
476
- clickable: options.marker_options.clickable,
477
- title: name,
478
- icon: symIcon,
479
- type: 'waypoint'
480
- });
481
- marker.bindPopup("<b>" + name + "</b>" + (desc.length > 0 ? '<br>' + desc : '')).openPopup();
482
- this.fire('addpoint', { point: marker, point_type: 'waypoint', element: el[i] });
483
- layers.push(marker);
484
- }
485
- }
486
-
487
- if (layers.length > 1) {
488
- return new L.FeatureGroup(layers);
489
- } else if (layers.length == 1) {
490
- return layers[0];
491
- }
492
- },
493
-
494
- _parse_segment: function(line, options, base_style, polyline_options, tag) {
495
- var el = line.getElementsByTagName(tag);
496
- if (!el.length) return [];
497
-
498
- var coords = [];
499
- var markers = [];
500
- var layers = [];
501
- var last = null;
502
-
503
- for (var i = 0; i < el.length; i++) {
504
- var _, ll = new L.LatLng(
505
- el[i].getAttribute('lat'),
506
- el[i].getAttribute('lon'));
507
- ll.meta = { time: null, ele: null, hr: null, cad: null, atemp: null, speed: null };
508
-
509
- _ = el[i].getElementsByTagName('time');
510
- if (_.length > 0) {
511
- ll.meta.time = new Date(Date.parse(_[0].textContent));
512
- } else {
513
- ll.meta.time = new Date('1970-01-01T00:00:00');
514
- }
515
- var time_diff = last != null ? Math.abs(ll.meta.time - last.meta.time) : 0;
516
-
517
- _ = el[i].getElementsByTagName('ele');
518
- if (_.length > 0) {
519
- ll.meta.ele = parseFloat(_[0].textContent);
520
- } else {
521
- // If the point doesn't have an <ele> tag, assume it has the same
522
- // elevation as the point before it (if it had one).
523
- ll.meta.ele = last != null ? last.meta.ele : null;
524
- }
525
- var ele_diff = last != null ? ll.meta.ele - last.meta.ele : 0;
526
- var dist_3d = last != null ? this._dist3d(last, ll) : 0;
527
-
528
- _ = el[i].getElementsByTagName('speed');
529
- if (_.length > 0) {
530
- ll.meta.speed = parseFloat(_[0].textContent);
531
- } else {
532
- // speed in meter per second
533
- ll.meta.speed = time_diff > 0 ? 1000.0 * dist_3d / time_diff : 0;
534
- }
535
-
536
- _ = el[i].getElementsByTagName('name');
537
- if (_.length > 0) {
538
- var name = _[0].textContent;
539
- var ptMatchers = options.markers.pointMatchers || [];
540
-
541
- for (var j = 0; j < ptMatchers.length; j++) {
542
- if (ptMatchers[j].regex.test(name)) {
543
- markers.push({ label: name, coords: ll, icon: ptMatchers[j].icon, element: el[i] });
544
- break;
545
- }
546
- }
547
- }
548
-
549
- this._info.length += dist_3d;
550
-
551
- _ = el[i].getElementsByTagNameNS('*', 'hr');
552
- if (_.length > 0) {
553
- ll.meta.hr = parseInt(_[0].textContent);
554
- this._info.hr._points.push([this._info.length, ll.meta.hr]);
555
- this._info.hr._total += ll.meta.hr;
556
- }
557
-
558
- _ = el[i].getElementsByTagNameNS('*', 'cad');
559
- if (_.length > 0) {
560
- ll.meta.cad = parseInt(_[0].textContent);
561
- this._info.cad._points.push([this._info.length, ll.meta.cad]);
562
- this._info.cad._total += ll.meta.cad;
563
- }
564
-
565
- _ = el[i].getElementsByTagNameNS('*', 'atemp');
566
- if (_.length > 0) {
567
- ll.meta.atemp = parseInt(_[0].textContent);
568
- this._info.atemp._points.push([this._info.length, ll.meta.atemp]);
569
- this._info.atemp._total += ll.meta.atemp;
570
- }
571
-
572
- if (ll.meta.ele > this._info.elevation.max) {
573
- this._info.elevation.max = ll.meta.ele;
574
- }
575
- if (ll.meta.ele < this._info.elevation.min) {
576
- this._info.elevation.min = ll.meta.ele;
577
- }
578
- this._info.elevation._points.push([this._info.length, ll.meta.ele]);
579
-
580
- if (ll.meta.speed > this._info.speed.max) {
581
- this._info.speed.max = ll.meta.speed;
582
- }
583
- this._info.speed._points.push([this._info.length, ll.meta.speed]);
584
-
585
- if ((last == null) && (this._info.duration.start == null)) {
586
- this._info.duration.start = ll.meta.time;
587
- }
588
- this._info.duration.end = ll.meta.time;
589
- this._info.duration.total += time_diff;
590
- if (time_diff < options.max_point_interval) {
591
- this._info.duration.moving += time_diff;
592
- }
593
-
594
- if (ele_diff > 0) {
595
- this._info.elevation.gain += ele_diff;
596
- } else {
597
- this._info.elevation.loss += Math.abs(ele_diff);
598
- }
599
-
600
- last = ll;
601
- coords.push(ll);
602
- }
603
-
604
- // add track
605
- var l = new L.Polyline(coords, this._extract_styling(line, base_style, polyline_options));
606
- this.fire('addline', { line: l, element: line });
607
- layers.push(l);
608
-
609
- if (options.markers.startIcon) {
610
- // add start pin
611
- var marker = new L.Marker(coords[0], {
612
- clickable: options.marker_options.clickable,
613
- icon: options.markers.startIcon,
614
- });
615
- this.fire('addpoint', { point: marker, point_type: 'start', element: el[0], line: line });
616
- layers.push(marker);
617
- }
618
-
619
- if (options.markers.endIcon) {
620
- // add end pin
621
- var marker = new L.Marker(coords[coords.length-1], {
622
- clickable: options.marker_options.clickable,
623
- icon: options.markers.endIcon,
624
- });
625
- this.fire('addpoint', { point: marker, point_type: 'end', element: el[el.length-1], line: line });
626
- layers.push(marker);
627
- }
628
-
629
- // add named markers
630
- for (var i = 0; i < markers.length; i++) {
631
- var marker = new L.Marker(markers[i].coords, {
632
- clickable: options.marker_options.clickable,
633
- title: markers[i].label,
634
- icon: markers[i].icon
635
- });
636
- this.fire('addpoint', { point: marker, point_type: 'label', element: markers[i].element });
637
- layers.push(marker);
638
- }
639
-
640
- return layers;
641
- },
642
-
643
- _get_polyline_options: function(polyline_options, i) {
644
- /*
645
- * Handle backwards compatibility with polyline_options being provided as a single object.
646
- * In this situation, the provided style is expected to apply to all routes and tracks in the file.
647
- */
648
- if (! Array.isArray(polyline_options)) {
649
- return polyline_options;
650
- }
651
- return polyline_options[i] || {};
652
- },
653
-
654
- _extract_styling: function(el, base, overrides) {
655
- var style = this._merge_objs(_DEFAULT_POLYLINE_OPTS, base);
656
- var e = el.getElementsByTagNameNS(_GPX_STYLE_NS, 'line');
657
- if (e.length > 0) {
658
- var _ = e[0].getElementsByTagName('color');
659
- if (_.length > 0) style.color = '#' + _[0].textContent;
660
- var _ = e[0].getElementsByTagName('opacity');
661
- if (_.length > 0) style.opacity = _[0].textContent;
662
- var _ = e[0].getElementsByTagName('weight');
663
- if (_.length > 0) style.weight = _[0].textContent;
664
- var _ = e[0].getElementsByTagName('linecap');
665
- if (_.length > 0) style.lineCap = _[0].textContent;
666
- var _ = e[0].getElementsByTagName('linejoin');
667
- if (_.length > 0) style.lineJoin = _[0].textContent;
668
- var _ = e[0].getElementsByTagName('dasharray');
669
- if (_.length > 0) style.dashArray = _[0].textContent;
670
- var _ = e[0].getElementsByTagName('dashoffset');
671
- if (_.length > 0) style.dashOffset = _[0].textContent;
672
- }
673
- return this._merge_objs(style, overrides)
674
- },
675
-
676
- _dist2d: function(a, b) {
677
- var R = 6371000;
678
- var dLat = this._deg2rad(b.lat - a.lat);
679
- var dLon = this._deg2rad(b.lng - a.lng);
680
- var r = Math.sin(dLat/2) *
681
- Math.sin(dLat/2) +
682
- Math.cos(this._deg2rad(a.lat)) *
683
- Math.cos(this._deg2rad(b.lat)) *
684
- Math.sin(dLon/2) *
685
- Math.sin(dLon/2);
686
- var c = 2 * Math.atan2(Math.sqrt(r), Math.sqrt(1-r));
687
- var d = R * c;
688
- return d;
689
- },
690
-
691
- _dist3d: function(a, b) {
692
- var planar = this._dist2d(a, b);
693
- var height = Math.abs(b.meta.ele - a.meta.ele);
694
- return Math.sqrt(Math.pow(planar, 2) + Math.pow(height, 2));
695
- },
696
-
697
- _deg2rad: function(deg) {
698
- return deg * Math.PI / 180;
699
- }
700
- });
701
-
702
- const ibcsMapCss = () => `.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none !important;max-height:none !important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none !important;max-height:none !important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity 0.2s linear;-moz-transition:opacity 0.2s linear;transition:opacity 0.2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform 0.25s cubic-bezier(0,0,0.25,1);-moz-transition:-moz-transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078A8}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,0.5)}.leaflet-container{font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;font-size:12px;font-size:0.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,0.65);border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:bold 18px 'Lucida Console', Monaco, monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,0.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(images/marker-icon.png)}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255, 255, 255, 0.8);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline !important;vertical-align:baseline !important;width:1em;height:0.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;-moz-box-sizing:border-box;box-sizing:border-box;background:rgba(255, 255, 255, 0.8);text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,0.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:17px 0;margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:white;color:#333;box-shadow:0 3px 14px rgba(0,0,0,0.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma, Verdana, sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,0.4)}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}:host{position:relative;display:block}.map{display:block;width:100%;height:100%;min-width:100px;min-height:100px}`;
703
-
704
- const IbcsMap = class {
705
- constructor(hostRef) {
706
- index.registerInstance(this, hostRef);
707
- this.stateUpdated = index.createEvent(this, "stateUpdated", 7);
708
- this.dragZoomEnded = index.createEvent(this, "dragZoomEnded", 7);
709
- //@Prop() tileLayer: string = 'https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}{r}.png';
710
- this._tileLayer = "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
711
- this.tileLayer = this._tileLayer;
712
- this._manualPosOverride = true;
713
- this.manualPosOverride = this._manualPosOverride;
714
- this._latitude = 50.137634;
715
- this.latitude = this._latitude;
716
- this._longitude = 8.679129;
717
- this.longitude = this._longitude;
718
- this._scale = 11;
719
- this.scale = this._scale;
720
- this._customView = false;
721
- this.customView = this._customView;
722
- this._showScale = false;
723
- this.showScale = this._showScale;
724
- this._showZoom = false;
725
- this.showZoom = this._showZoom;
726
- this._attribution = "";
727
- this.attribution = this._attribution;
728
- this._gpxs = [];
729
- this.gpxs = this._gpxs;
730
- this._markers = [];
731
- this.markers = this._markers;
732
- this._geojsons = [];
733
- this.geojsons = this._geojsons;
734
- this.lmap = null;
735
- this.gpxLayer = [];
736
- this.mapMarker = [];
737
- this.geoJsonLayer = [];
738
- // @ts-ignore
739
- this.scaleControl = undefined.scale();
740
- // @ts-ignore
741
- this.zoomControl = undefined.zoom();
742
- // @ts-ignore
743
- this.tileLayerControl = undefined(this._tileLayer);
744
- this.cumlatedBounds = {
745
- northEast: null,
746
- southWest: null,
747
- };
748
- }
749
- async setProps(data) {
750
- Object.keys(data).forEach((key) => {
751
- //@ts-ignore
752
- this[key] = data[key];
753
- });
754
- }
755
- async unSetProps(data) {
756
- Object.keys(data).forEach((key) => {
757
- //@ts-ignore
758
- this[key] = undefined;
759
- });
760
- }
761
- parseTileLayer(tileLayer) {
762
- this._tileLayer = tileLayer;
763
- }
764
- parseManualPosOverride(manualPosOverride) {
765
- this._manualPosOverride = JSON.parse(manualPosOverride);
766
- }
767
- parseLatitude(latitude) {
768
- this._latitude = Number(latitude);
769
- }
770
- parseLongitude(longitude) {
771
- this._longitude = Number(longitude);
772
- }
773
- parseScale(scale) {
774
- this._scale = Number(scale);
775
- }
776
- parseCustomView(customView) {
777
- this._customView = JSON.parse(customView);
778
- }
779
- parseShowScale(showScale) {
780
- this._showScale = JSON.parse(showScale);
781
- }
782
- parseShowZoom(showZoom) {
783
- this._showZoom = JSON.parse(showZoom);
784
- }
785
- parseAttribution(attribution) {
786
- this._attribution = attribution;
787
- }
788
- parseGpxLayers(gpxs) {
789
- if (typeof gpxs === "string") {
790
- this._gpxs = JSON.parse(gpxs);
791
- }
792
- else {
793
- this._gpxs = gpxs;
794
- }
795
- this.gpxLayerUpdate(this._gpxs);
796
- }
797
- parseMarkers(markers) {
798
- if (typeof markers === "string") {
799
- this._markers = JSON.parse(markers);
800
- }
801
- else {
802
- this._markers = markers;
803
- }
804
- this.mapMarkerUpdate(this._markers);
805
- }
806
- parseGeoJson(geojsons) {
807
- if (typeof geojsons === "string") {
808
- this._geojsons = JSON.parse(geojsons);
809
- }
810
- else {
811
- this._geojsons = geojsons;
812
- }
813
- this.geoJsonUpdate(this._geojsons);
814
- }
815
- render() {
816
- return (index.h(index.Host, { key: '955a4572190c7e73f4dd654e42814a260f6e4062' }, index.h("div", { key: 'ca831888a3202fe8877dd98a00042be6ae58903f', ref: (el) => (this.drawElement = el), id: "map", class: "map" })));
817
- }
818
- gpxLayerUpdate(gpxOptionsLayers) {
819
- this.gpxLayer.forEach((layer) => {
820
- layer.remove();
821
- });
822
- this.gpxLayer = [];
823
- for (const gpxOptions of gpxOptionsLayers) {
824
- if (gpxOptions === undefined) {
825
- continue;
826
- }
827
- const regex = /^data:application\/octet-stream;/;
828
- let decodedData = gpxOptions.file;
829
- if (regex.test(gpxOptions.file)) {
830
- const dataPart = gpxOptions.file.split(",")[1];
831
- decodedData = atob(dataPart);
832
- }
833
- // @ts-ignore
834
- this.gpxLayer.push(new undefined(decodedData, {
835
- async: true,
836
- marker_options: {
837
- startIconUrl: gpxOptions.startIconUrl,
838
- endIconUrl: gpxOptions.endIconUrl,
839
- shadowUrl: gpxOptions.shadowUrl,
840
- },
841
- polyline_options: {
842
- color: gpxOptions.color,
843
- opacity: gpxOptions.opacity,
844
- lineCap: gpxOptions.lineCap,
845
- weight: gpxOptions.weight,
846
- },
847
- }).on("loaded", (e) => {
848
- this.updateCumulatedBounds(e);
849
- if (this._manualPosOverride === false) {
850
- this.lmap.fitBounds([this.cumlatedBounds.northEast, this.cumlatedBounds.southWest]);
851
- }
852
- this.stateUpdated.emit(componentRegister.ComponentStatus.SUCCESSFUL);
853
- }));
854
- }
855
- }
856
- updateCumulatedBounds(e) {
857
- if (this.cumlatedBounds.northEast == null) {
858
- this.cumlatedBounds.northEast = {
859
- lat: e.target.getBounds().getNorthEast().lat,
860
- lng: e.target.getBounds().getNorthEast().lng,
861
- };
862
- }
863
- if (this.cumlatedBounds.southWest == null) {
864
- this.cumlatedBounds.southWest = {
865
- lat: e.target.getBounds().getSouthWest().lat,
866
- lng: e.target.getBounds().getSouthWest().lng,
867
- };
868
- }
869
- if (e.target.getBounds().getNorthEast().lat > this.cumlatedBounds.northEast.lat) {
870
- this.cumlatedBounds.northEast.lat = e.target.getBounds().getNorthEast().lat;
871
- }
872
- if (e.target.getBounds().getNorthEast().lng > this.cumlatedBounds.northEast.lng) {
873
- this.cumlatedBounds.northEast.lng = e.target.getBounds().getNorthEast().lng;
874
- }
875
- if (e.target.getBounds().getSouthWest().lat < this.cumlatedBounds.southWest.lat) {
876
- this.cumlatedBounds.southWest.lat = e.target.getBounds().getSouthWest().lat;
877
- }
878
- if (e.target.getBounds().getSouthWest().lng < this.cumlatedBounds.southWest.lng) {
879
- this.cumlatedBounds.southWest.lng = e.target.getBounds().getSouthWest().lng;
880
- }
881
- }
882
- mapMarkerUpdate(markes) {
883
- this.mapMarker.forEach((layer) => {
884
- layer.remove();
885
- });
886
- this.mapMarker = [];
887
- for (const markerOptions of markes) {
888
- // Icon options
889
- const iconOptions = {
890
- iconUrl: markerOptions.iconUrl,
891
- iconSize: [markerOptions.iconWidth, markerOptions.iconHeight],
892
- };
893
- // @ts-ignore
894
- const customIcon = undefined(iconOptions);
895
- const options = {
896
- title: markerOptions.title,
897
- icon: customIcon,
898
- };
899
- // @ts-ignore
900
- this.mapMarker.push(undefined([markerOptions.latitude, markerOptions.longitude], options));
901
- }
902
- }
903
- geoJsonUpdate(geojsons) {
904
- this.geoJsonLayer.forEach((layer) => {
905
- layer.remove();
906
- });
907
- this.geoJsonLayer = [];
908
- for (const geoJson of geojsons) {
909
- const jsonStyle = {
910
- color: geoJson.color,
911
- weight: geoJson.weight,
912
- opacity: geoJson.opacity,
913
- lineCap: geoJson.lineCap,
914
- };
915
- const options = {
916
- style: jsonStyle,
917
- };
918
- // @ts-ignore
919
- this.geoJsonLayer.push(undefined(DataUriUtil.dataURItoObject(geoJson.file), options));
920
- }
921
- }
922
- componentWillLoad() {
923
- this.stateUpdated.emit(componentRegister.ComponentStatus.RUNNING);
924
- this.parseMarkers(this.markers);
925
- this.parseGeoJson(this.geojsons);
926
- this.parseGpxLayers(this.gpxs);
927
- this.parseAttribution(this.attribution);
928
- this.parseShowZoom(this.showZoom);
929
- this.parseShowScale(this.showScale);
930
- this.parseScale(this.scale);
931
- this.parseLongitude(this.longitude);
932
- this.parseLatitude(this.latitude);
933
- this.parseTileLayer(this.tileLayer);
934
- }
935
- componentDidLoad() {
936
- if (this.drawElement == null) {
937
- return;
938
- }
939
- // @ts-ignore
940
- this.lmap = undefined(this.drawElement, { zoomControl: false });
941
- this.setView();
942
- this.setTileLayer();
943
- this.setGeoJsonLayer();
944
- this.setGPXLayer();
945
- this.setMarker();
946
- this.setShowScale();
947
- this.setShowZoom();
948
- this.setAttribution();
949
- this.lmap.addEventListener("dragend", this.dragZoomEnd.bind(this));
950
- this.lmap.addEventListener("zoomend", this.dragZoomEnd.bind(this));
951
- }
952
- disconnectedCallback() {
953
- this.lmap.removeEventListener("dragend", this.dragZoomEnd.bind(this));
954
- this.lmap.removeEventListener("zoomend", this.dragZoomEnd.bind(this));
955
- }
956
- componentDidUpdate() {
957
- if (this.drawElement == null) {
958
- return;
959
- }
960
- this.setView();
961
- this.setTileLayer();
962
- this.setGeoJsonLayer();
963
- this.setGPXLayer();
964
- this.setMarker();
965
- this.setShowScale();
966
- this.setShowZoom();
967
- this.setAttribution();
968
- }
969
- dragZoomEnd() {
970
- const { lat, lng } = this.lmap.getCenter();
971
- const zoom = this.lmap.getZoom();
972
- this.dragZoomEnded.emit({
973
- longitude: lng,
974
- latitude: lat,
975
- scale: zoom,
976
- });
977
- }
978
- setView() {
979
- //if(this._customView == false) {
980
- // return;
981
- //}
982
- this.lmap.setView([this._latitude, this._longitude], this._scale);
983
- }
984
- setTileLayer() {
985
- this.tileLayerControl.setUrl(this._tileLayer, true);
986
- this.tileLayerControl.addTo(this.lmap);
987
- }
988
- setAttribution() {
989
- this.lmap.attributionControl.setPrefix(this._attribution);
990
- }
991
- setShowScale() {
992
- this.scaleControl.remove();
993
- if (this._showScale === true) {
994
- this.scaleControl.addTo(this.lmap);
995
- }
996
- }
997
- setShowZoom() {
998
- this.zoomControl.remove();
999
- if (this._showZoom === true) {
1000
- this.zoomControl.addTo(this.lmap);
1001
- }
1002
- }
1003
- setGPXLayer() {
1004
- this.gpxLayer.forEach((layer) => {
1005
- try {
1006
- layer.addTo(this.lmap);
1007
- }
1008
- catch (e) {
1009
- console.error("gpxLayer", e);
1010
- }
1011
- });
1012
- }
1013
- setMarker() {
1014
- this.mapMarker.forEach((layer) => {
1015
- try {
1016
- layer.addTo(this.lmap);
1017
- }
1018
- catch (e) {
1019
- console.error("markerLayer", e);
1020
- }
1021
- });
1022
- }
1023
- setGeoJsonLayer() {
1024
- this.geoJsonLayer.forEach((layer) => {
1025
- try {
1026
- layer.addTo(this.lmap);
1027
- }
1028
- catch (e) {
1029
- console.error("gpxLayer", e);
1030
- }
1031
- });
1032
- }
1033
- static get assetsDirs() { return ["assets"]; }
1034
- static get watchers() { return {
1035
- "tileLayer": [{
1036
- "parseTileLayer": 0
1037
- }],
1038
- "manualPosOverride": [{
1039
- "parseManualPosOverride": 0
1040
- }],
1041
- "latitude": [{
1042
- "parseLatitude": 0
1043
- }],
1044
- "longitude": [{
1045
- "parseLongitude": 0
1046
- }],
1047
- "scale": [{
1048
- "parseScale": 0
1049
- }],
1050
- "customView": [{
1051
- "parseCustomView": 0
1052
- }],
1053
- "showScale": [{
1054
- "parseShowScale": 0
1055
- }],
1056
- "showZoom": [{
1057
- "parseShowZoom": 0
1058
- }],
1059
- "attribution": [{
1060
- "parseAttribution": 0
1061
- }],
1062
- "gpxs": [{
1063
- "parseGpxLayers": 0
1064
- }],
1065
- "markers": [{
1066
- "parseMarkers": 0
1067
- }],
1068
- "geojsons": [{
1069
- "parseGeoJson": 0
1070
- }]
1071
- }; }
1072
- };
1073
- IbcsMap.style = ibcsMapCss();
1074
-
1075
- exports.ibcs_map = IbcsMap;