@itwin/map-layers 5.4.4 → 5.6.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 (304) hide show
  1. package/CHANGELOG.md +18 -2
  2. package/README.md +7 -7
  3. package/lib/cjs/BrowserStorage.d.ts.map +1 -1
  4. package/lib/cjs/BrowserStorage.js +23 -13
  5. package/lib/cjs/BrowserStorage.js.map +1 -1
  6. package/lib/cjs/CustomParamUtils.d.ts +1 -1
  7. package/lib/cjs/CustomParamUtils.d.ts.map +1 -1
  8. package/lib/cjs/CustomParamUtils.js +6 -3
  9. package/lib/cjs/CustomParamUtils.js.map +1 -1
  10. package/lib/cjs/CustomParamsMappingStorage.d.ts +1 -1
  11. package/lib/cjs/CustomParamsMappingStorage.d.ts.map +1 -1
  12. package/lib/cjs/CustomParamsMappingStorage.js +3 -3
  13. package/lib/cjs/CustomParamsMappingStorage.js.map +1 -1
  14. package/lib/cjs/CustomParamsStorage.d.ts +1 -1
  15. package/lib/cjs/CustomParamsStorage.d.ts.map +1 -1
  16. package/lib/cjs/CustomParamsStorage.js +3 -3
  17. package/lib/cjs/CustomParamsStorage.js.map +1 -1
  18. package/lib/cjs/MapLayerPreferences.d.ts +2 -1
  19. package/lib/cjs/MapLayerPreferences.d.ts.map +1 -1
  20. package/lib/cjs/MapLayerPreferences.js +50 -25
  21. package/lib/cjs/MapLayerPreferences.js.map +1 -1
  22. package/lib/cjs/MapLayersActionIds.d.ts +5 -0
  23. package/lib/cjs/MapLayersActionIds.d.ts.map +1 -0
  24. package/lib/cjs/MapLayersActionIds.js +10 -0
  25. package/lib/cjs/MapLayersActionIds.js.map +1 -0
  26. package/lib/cjs/MapLayersPrefBrowserStorage.d.ts.map +1 -1
  27. package/lib/cjs/MapLayersPrefBrowserStorage.js +4 -5
  28. package/lib/cjs/MapLayersPrefBrowserStorage.js.map +1 -1
  29. package/lib/cjs/PreferencesBrowserStorage.d.ts +17 -17
  30. package/lib/cjs/PreferencesBrowserStorage.d.ts.map +1 -1
  31. package/lib/cjs/PreferencesBrowserStorage.js +14 -14
  32. package/lib/cjs/PreferencesBrowserStorage.js.map +1 -1
  33. package/lib/cjs/map-layers.d.ts +1 -0
  34. package/lib/cjs/map-layers.d.ts.map +1 -1
  35. package/lib/cjs/map-layers.js +4 -3
  36. package/lib/cjs/map-layers.js.map +1 -1
  37. package/lib/cjs/mapLayers.d.ts +2 -2
  38. package/lib/cjs/mapLayers.d.ts.map +1 -1
  39. package/lib/cjs/mapLayers.js.map +1 -1
  40. package/lib/cjs/public/locales/en/mapLayers.json +179 -184
  41. package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts +3 -4
  42. package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -1
  43. package/lib/cjs/ui/FeatureInfoUiItemsProvider.js +48 -18
  44. package/lib/cjs/ui/FeatureInfoUiItemsProvider.js.map +1 -1
  45. package/lib/cjs/ui/Interfaces.d.ts +3 -3
  46. package/lib/cjs/ui/Interfaces.d.ts.map +1 -1
  47. package/lib/cjs/ui/Interfaces.js.map +1 -1
  48. package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts +3 -2
  49. package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts.map +1 -1
  50. package/lib/cjs/ui/MapLayersUiItemsProvider.js +2 -6
  51. package/lib/cjs/ui/MapLayersUiItemsProvider.js.map +1 -1
  52. package/lib/cjs/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
  53. package/lib/cjs/ui/widget/AttachLayerPopupButton.js +81 -46
  54. package/lib/cjs/ui/widget/AttachLayerPopupButton.js.map +1 -1
  55. package/lib/cjs/ui/widget/BasemapPanel.d.ts.map +1 -1
  56. package/lib/cjs/ui/widget/BasemapPanel.js +44 -25
  57. package/lib/cjs/ui/widget/BasemapPanel.js.map +1 -1
  58. package/lib/cjs/ui/widget/BasemapPanel.scss +2 -4
  59. package/lib/cjs/ui/widget/ConfirmMessageDialog.d.ts +1 -1
  60. package/lib/cjs/ui/widget/ConfirmMessageDialog.d.ts.map +1 -1
  61. package/lib/cjs/ui/widget/ConfirmMessageDialog.js +31 -8
  62. package/lib/cjs/ui/widget/ConfirmMessageDialog.js.map +1 -1
  63. package/lib/cjs/ui/widget/CustomParamEditDialog.d.ts +1 -1
  64. package/lib/cjs/ui/widget/CustomParamEditDialog.d.ts.map +1 -1
  65. package/lib/cjs/ui/widget/CustomParamEditDialog.js +34 -20
  66. package/lib/cjs/ui/widget/CustomParamEditDialog.js.map +1 -1
  67. package/lib/cjs/ui/widget/CustomParamEditDialog.scss +1 -2
  68. package/lib/cjs/ui/widget/CustomParamsSettings.d.ts.map +1 -1
  69. package/lib/cjs/ui/widget/CustomParamsSettings.js +42 -27
  70. package/lib/cjs/ui/widget/CustomParamsSettings.js.map +1 -1
  71. package/lib/cjs/ui/widget/CustomParamsSettings.scss +7 -9
  72. package/lib/cjs/ui/widget/FeatureInfoDataProvider.d.ts +3 -2
  73. package/lib/cjs/ui/widget/FeatureInfoDataProvider.d.ts.map +1 -1
  74. package/lib/cjs/ui/widget/FeatureInfoDataProvider.js +4 -2
  75. package/lib/cjs/ui/widget/FeatureInfoDataProvider.js.map +1 -1
  76. package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts +1 -1
  77. package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
  78. package/lib/cjs/ui/widget/FeatureInfoWidget.js +34 -15
  79. package/lib/cjs/ui/widget/FeatureInfoWidget.js.map +1 -1
  80. package/lib/cjs/ui/widget/MapLayerActionButtons.d.ts +1 -1
  81. package/lib/cjs/ui/widget/MapLayerActionButtons.d.ts.map +1 -1
  82. package/lib/cjs/ui/widget/MapLayerActionButtons.js +30 -17
  83. package/lib/cjs/ui/widget/MapLayerActionButtons.js.map +1 -1
  84. package/lib/cjs/ui/widget/MapLayerDroppable.d.ts +2 -2
  85. package/lib/cjs/ui/widget/MapLayerDroppable.d.ts.map +1 -1
  86. package/lib/cjs/ui/widget/MapLayerDroppable.js +64 -50
  87. package/lib/cjs/ui/widget/MapLayerDroppable.js.map +1 -1
  88. package/lib/cjs/ui/widget/MapLayerManager.d.ts +2 -2
  89. package/lib/cjs/ui/widget/MapLayerManager.d.ts.map +1 -1
  90. package/lib/cjs/ui/widget/MapLayerManager.js +158 -84
  91. package/lib/cjs/ui/widget/MapLayerManager.js.map +1 -1
  92. package/lib/cjs/ui/widget/MapLayerManager.scss +3 -6
  93. package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts +2 -2
  94. package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
  95. package/lib/cjs/ui/widget/MapLayerSettingsMenu.js +33 -13
  96. package/lib/cjs/ui/widget/MapLayerSettingsMenu.js.map +1 -1
  97. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
  98. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js +36 -14
  99. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
  100. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.scss +5 -5
  101. package/lib/cjs/ui/widget/MapLayersWidget.d.ts +1 -1
  102. package/lib/cjs/ui/widget/MapLayersWidget.d.ts.map +1 -1
  103. package/lib/cjs/ui/widget/MapLayersWidget.js +34 -11
  104. package/lib/cjs/ui/widget/MapLayersWidget.js.map +1 -1
  105. package/lib/cjs/ui/widget/MapManagerMapLayersHeader.d.ts.map +1 -1
  106. package/lib/cjs/ui/widget/MapManagerMapLayersHeader.js +5 -8
  107. package/lib/cjs/ui/widget/MapManagerMapLayersHeader.js.map +1 -1
  108. package/lib/cjs/ui/widget/MapManagerSettings.d.ts.map +1 -1
  109. package/lib/cjs/ui/widget/MapManagerSettings.js +55 -56
  110. package/lib/cjs/ui/widget/MapManagerSettings.js.map +1 -1
  111. package/lib/cjs/ui/widget/MapManagerSettings.scss +1 -1
  112. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.d.ts +2 -2
  113. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.d.ts.map +1 -1
  114. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.js +33 -18
  115. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.js.map +1 -1
  116. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.scss +1 -3
  117. package/lib/cjs/ui/widget/MapUrlDialog.d.ts +4 -3
  118. package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
  119. package/lib/cjs/ui/widget/MapUrlDialog.js +104 -81
  120. package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
  121. package/lib/cjs/ui/widget/MapUrlDialog.scss +6 -7
  122. package/lib/cjs/ui/widget/SelectApiKey.d.ts.map +1 -1
  123. package/lib/cjs/ui/widget/SelectApiKey.js +38 -10
  124. package/lib/cjs/ui/widget/SelectApiKey.js.map +1 -1
  125. package/lib/cjs/ui/widget/SelectCustomParam.d.ts.map +1 -1
  126. package/lib/cjs/ui/widget/SelectCustomParam.js +40 -11
  127. package/lib/cjs/ui/widget/SelectCustomParam.js.map +1 -1
  128. package/lib/cjs/ui/widget/SelectMapFormat.d.ts +3 -3
  129. package/lib/cjs/ui/widget/SelectMapFormat.d.ts.map +1 -1
  130. package/lib/cjs/ui/widget/SelectMapFormat.js +36 -16
  131. package/lib/cjs/ui/widget/SelectMapFormat.js.map +1 -1
  132. package/lib/cjs/ui/widget/SubLayersDataProvider.d.ts +2 -2
  133. package/lib/cjs/ui/widget/SubLayersDataProvider.d.ts.map +1 -1
  134. package/lib/cjs/ui/widget/SubLayersDataProvider.js +13 -9
  135. package/lib/cjs/ui/widget/SubLayersDataProvider.js.map +1 -1
  136. package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts +1 -1
  137. package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
  138. package/lib/cjs/ui/widget/SubLayersPopupButton.js +30 -12
  139. package/lib/cjs/ui/widget/SubLayersPopupButton.js.map +1 -1
  140. package/lib/cjs/ui/widget/SubLayersTree.d.ts +2 -2
  141. package/lib/cjs/ui/widget/SubLayersTree.d.ts.map +1 -1
  142. package/lib/cjs/ui/widget/SubLayersTree.js +83 -45
  143. package/lib/cjs/ui/widget/SubLayersTree.js.map +1 -1
  144. package/lib/cjs/ui/widget/SubLayersTree.scss +4 -7
  145. package/lib/cjs/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
  146. package/lib/cjs/ui/widget/TransparencyPopupButton.js +33 -16
  147. package/lib/cjs/ui/widget/TransparencyPopupButton.js.map +1 -1
  148. package/lib/cjs/ui/widget/TransparencyPopupButton.scss +1 -2
  149. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.d.ts +1 -1
  150. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.d.ts.map +1 -1
  151. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.js +2 -8
  152. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.js.map +1 -1
  153. package/lib/esm/BrowserStorage.d.ts.map +1 -1
  154. package/lib/esm/BrowserStorage.js +23 -13
  155. package/lib/esm/BrowserStorage.js.map +1 -1
  156. package/lib/esm/CustomParamUtils.d.ts +1 -1
  157. package/lib/esm/CustomParamUtils.d.ts.map +1 -1
  158. package/lib/esm/CustomParamUtils.js +6 -3
  159. package/lib/esm/CustomParamUtils.js.map +1 -1
  160. package/lib/esm/CustomParamsMappingStorage.d.ts +1 -1
  161. package/lib/esm/CustomParamsMappingStorage.d.ts.map +1 -1
  162. package/lib/esm/CustomParamsMappingStorage.js +3 -3
  163. package/lib/esm/CustomParamsMappingStorage.js.map +1 -1
  164. package/lib/esm/CustomParamsStorage.d.ts +1 -1
  165. package/lib/esm/CustomParamsStorage.d.ts.map +1 -1
  166. package/lib/esm/CustomParamsStorage.js +3 -3
  167. package/lib/esm/CustomParamsStorage.js.map +1 -1
  168. package/lib/esm/MapLayerPreferences.d.ts +2 -1
  169. package/lib/esm/MapLayerPreferences.d.ts.map +1 -1
  170. package/lib/esm/MapLayerPreferences.js +50 -25
  171. package/lib/esm/MapLayerPreferences.js.map +1 -1
  172. package/lib/esm/MapLayersActionIds.d.ts +5 -0
  173. package/lib/esm/MapLayersActionIds.d.ts.map +1 -0
  174. package/lib/esm/MapLayersActionIds.js +7 -0
  175. package/lib/esm/MapLayersActionIds.js.map +1 -0
  176. package/lib/esm/MapLayersPrefBrowserStorage.d.ts.map +1 -1
  177. package/lib/esm/MapLayersPrefBrowserStorage.js +4 -5
  178. package/lib/esm/MapLayersPrefBrowserStorage.js.map +1 -1
  179. package/lib/esm/PreferencesBrowserStorage.d.ts +17 -17
  180. package/lib/esm/PreferencesBrowserStorage.d.ts.map +1 -1
  181. package/lib/esm/PreferencesBrowserStorage.js +14 -14
  182. package/lib/esm/PreferencesBrowserStorage.js.map +1 -1
  183. package/lib/esm/map-layers.d.ts +1 -0
  184. package/lib/esm/map-layers.d.ts.map +1 -1
  185. package/lib/esm/map-layers.js +4 -3
  186. package/lib/esm/map-layers.js.map +1 -1
  187. package/lib/esm/mapLayers.d.ts +2 -2
  188. package/lib/esm/mapLayers.d.ts.map +1 -1
  189. package/lib/esm/mapLayers.js.map +1 -1
  190. package/lib/esm/public/locales/en/mapLayers.json +179 -184
  191. package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts +3 -4
  192. package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -1
  193. package/lib/esm/ui/FeatureInfoUiItemsProvider.js +48 -18
  194. package/lib/esm/ui/FeatureInfoUiItemsProvider.js.map +1 -1
  195. package/lib/esm/ui/Interfaces.d.ts +3 -3
  196. package/lib/esm/ui/Interfaces.d.ts.map +1 -1
  197. package/lib/esm/ui/Interfaces.js.map +1 -1
  198. package/lib/esm/ui/MapLayersUiItemsProvider.d.ts +3 -2
  199. package/lib/esm/ui/MapLayersUiItemsProvider.d.ts.map +1 -1
  200. package/lib/esm/ui/MapLayersUiItemsProvider.js +2 -6
  201. package/lib/esm/ui/MapLayersUiItemsProvider.js.map +1 -1
  202. package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
  203. package/lib/esm/ui/widget/AttachLayerPopupButton.js +57 -45
  204. package/lib/esm/ui/widget/AttachLayerPopupButton.js.map +1 -1
  205. package/lib/esm/ui/widget/BasemapPanel.d.ts.map +1 -1
  206. package/lib/esm/ui/widget/BasemapPanel.js +19 -23
  207. package/lib/esm/ui/widget/BasemapPanel.js.map +1 -1
  208. package/lib/esm/ui/widget/BasemapPanel.scss +2 -4
  209. package/lib/esm/ui/widget/ConfirmMessageDialog.d.ts +1 -1
  210. package/lib/esm/ui/widget/ConfirmMessageDialog.d.ts.map +1 -1
  211. package/lib/esm/ui/widget/ConfirmMessageDialog.js +5 -5
  212. package/lib/esm/ui/widget/ConfirmMessageDialog.js.map +1 -1
  213. package/lib/esm/ui/widget/CustomParamEditDialog.d.ts +1 -1
  214. package/lib/esm/ui/widget/CustomParamEditDialog.d.ts.map +1 -1
  215. package/lib/esm/ui/widget/CustomParamEditDialog.js +9 -18
  216. package/lib/esm/ui/widget/CustomParamEditDialog.js.map +1 -1
  217. package/lib/esm/ui/widget/CustomParamEditDialog.scss +1 -2
  218. package/lib/esm/ui/widget/CustomParamsSettings.d.ts.map +1 -1
  219. package/lib/esm/ui/widget/CustomParamsSettings.js +17 -25
  220. package/lib/esm/ui/widget/CustomParamsSettings.js.map +1 -1
  221. package/lib/esm/ui/widget/CustomParamsSettings.scss +7 -9
  222. package/lib/esm/ui/widget/FeatureInfoDataProvider.d.ts +3 -2
  223. package/lib/esm/ui/widget/FeatureInfoDataProvider.d.ts.map +1 -1
  224. package/lib/esm/ui/widget/FeatureInfoDataProvider.js +4 -2
  225. package/lib/esm/ui/widget/FeatureInfoDataProvider.js.map +1 -1
  226. package/lib/esm/ui/widget/FeatureInfoWidget.d.ts +1 -1
  227. package/lib/esm/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
  228. package/lib/esm/ui/widget/FeatureInfoWidget.js +10 -14
  229. package/lib/esm/ui/widget/FeatureInfoWidget.js.map +1 -1
  230. package/lib/esm/ui/widget/MapLayerActionButtons.d.ts +1 -1
  231. package/lib/esm/ui/widget/MapLayerActionButtons.d.ts.map +1 -1
  232. package/lib/esm/ui/widget/MapLayerActionButtons.js +6 -16
  233. package/lib/esm/ui/widget/MapLayerActionButtons.js.map +1 -1
  234. package/lib/esm/ui/widget/MapLayerDroppable.d.ts +2 -2
  235. package/lib/esm/ui/widget/MapLayerDroppable.d.ts.map +1 -1
  236. package/lib/esm/ui/widget/MapLayerDroppable.js +38 -47
  237. package/lib/esm/ui/widget/MapLayerDroppable.js.map +1 -1
  238. package/lib/esm/ui/widget/MapLayerManager.d.ts +2 -2
  239. package/lib/esm/ui/widget/MapLayerManager.d.ts.map +1 -1
  240. package/lib/esm/ui/widget/MapLayerManager.js +134 -83
  241. package/lib/esm/ui/widget/MapLayerManager.js.map +1 -1
  242. package/lib/esm/ui/widget/MapLayerManager.scss +3 -6
  243. package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts +2 -2
  244. package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
  245. package/lib/esm/ui/widget/MapLayerSettingsMenu.js +9 -12
  246. package/lib/esm/ui/widget/MapLayerSettingsMenu.js.map +1 -1
  247. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
  248. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js +11 -12
  249. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
  250. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.scss +5 -5
  251. package/lib/esm/ui/widget/MapLayersWidget.d.ts +1 -1
  252. package/lib/esm/ui/widget/MapLayersWidget.d.ts.map +1 -1
  253. package/lib/esm/ui/widget/MapLayersWidget.js +9 -9
  254. package/lib/esm/ui/widget/MapLayersWidget.js.map +1 -1
  255. package/lib/esm/ui/widget/MapManagerMapLayersHeader.d.ts.map +1 -1
  256. package/lib/esm/ui/widget/MapManagerMapLayersHeader.js +5 -8
  257. package/lib/esm/ui/widget/MapManagerMapLayersHeader.js.map +1 -1
  258. package/lib/esm/ui/widget/MapManagerSettings.d.ts.map +1 -1
  259. package/lib/esm/ui/widget/MapManagerSettings.js +29 -53
  260. package/lib/esm/ui/widget/MapManagerSettings.js.map +1 -1
  261. package/lib/esm/ui/widget/MapManagerSettings.scss +1 -1
  262. package/lib/esm/ui/widget/MapSelectFeaturesDialog.d.ts +2 -2
  263. package/lib/esm/ui/widget/MapSelectFeaturesDialog.d.ts.map +1 -1
  264. package/lib/esm/ui/widget/MapSelectFeaturesDialog.js +7 -15
  265. package/lib/esm/ui/widget/MapSelectFeaturesDialog.js.map +1 -1
  266. package/lib/esm/ui/widget/MapSelectFeaturesDialog.scss +1 -3
  267. package/lib/esm/ui/widget/MapUrlDialog.d.ts +4 -3
  268. package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
  269. package/lib/esm/ui/widget/MapUrlDialog.js +79 -79
  270. package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
  271. package/lib/esm/ui/widget/MapUrlDialog.scss +6 -7
  272. package/lib/esm/ui/widget/SelectApiKey.d.ts.map +1 -1
  273. package/lib/esm/ui/widget/SelectApiKey.js +12 -7
  274. package/lib/esm/ui/widget/SelectApiKey.js.map +1 -1
  275. package/lib/esm/ui/widget/SelectCustomParam.d.ts.map +1 -1
  276. package/lib/esm/ui/widget/SelectCustomParam.js +14 -8
  277. package/lib/esm/ui/widget/SelectCustomParam.js.map +1 -1
  278. package/lib/esm/ui/widget/SelectMapFormat.d.ts +3 -3
  279. package/lib/esm/ui/widget/SelectMapFormat.d.ts.map +1 -1
  280. package/lib/esm/ui/widget/SelectMapFormat.js +11 -14
  281. package/lib/esm/ui/widget/SelectMapFormat.js.map +1 -1
  282. package/lib/esm/ui/widget/SubLayersDataProvider.d.ts +2 -2
  283. package/lib/esm/ui/widget/SubLayersDataProvider.d.ts.map +1 -1
  284. package/lib/esm/ui/widget/SubLayersDataProvider.js +13 -9
  285. package/lib/esm/ui/widget/SubLayersDataProvider.js.map +1 -1
  286. package/lib/esm/ui/widget/SubLayersPopupButton.d.ts +1 -1
  287. package/lib/esm/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
  288. package/lib/esm/ui/widget/SubLayersPopupButton.js +6 -11
  289. package/lib/esm/ui/widget/SubLayersPopupButton.js.map +1 -1
  290. package/lib/esm/ui/widget/SubLayersTree.d.ts +2 -2
  291. package/lib/esm/ui/widget/SubLayersTree.d.ts.map +1 -1
  292. package/lib/esm/ui/widget/SubLayersTree.js +59 -44
  293. package/lib/esm/ui/widget/SubLayersTree.js.map +1 -1
  294. package/lib/esm/ui/widget/SubLayersTree.scss +4 -7
  295. package/lib/esm/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
  296. package/lib/esm/ui/widget/TransparencyPopupButton.js +8 -14
  297. package/lib/esm/ui/widget/TransparencyPopupButton.js.map +1 -1
  298. package/lib/esm/ui/widget/TransparencyPopupButton.scss +1 -2
  299. package/lib/esm/ui/widget/UserPreferencesStorageOptions.d.ts +1 -1
  300. package/lib/esm/ui/widget/UserPreferencesStorageOptions.d.ts.map +1 -1
  301. package/lib/esm/ui/widget/UserPreferencesStorageOptions.js +2 -8
  302. package/lib/esm/ui/widget/UserPreferencesStorageOptions.js.map +1 -1
  303. package/lib/public/locales/en/mapLayers.json +179 -184
  304. package/package.json +9 -21
package/CHANGELOG.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # Change Log - @itwin/map-layers
2
2
 
3
- This log was last generated on Tue, 21 May 2024 13:26:08 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 13 Sep 2024 17:50:00 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 5.6.0
8
+
9
+ Fri, 13 Sep 2024 17:50:00 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - Remove map layers feature info tech preview badges ([#1043](https://github.com/iTwin/viewer-components-react/pull/1043))
14
+
15
+ ## 5.5.0
16
+
17
+ Wed, 11 Sep 2024 19:11:54 GMT
18
+
19
+ ### Minor changes
20
+
21
+ - Hide map layer info tool when map layers is off or no arcgis feature layers exist ([#1016](https://github.com/iTwin/viewer-components-react/pull/1016))
22
+
7
23
  ## 5.4.4
8
24
 
9
- Tue, 21 May 2024 13:26:08 GMT
25
+ Tue, 21 May 2024 13:26:35 GMT
10
26
 
11
27
  ### Patches
12
28
 
package/README.md CHANGED
@@ -15,17 +15,17 @@ This package can also be installed into an application and the method MapLayersU
15
15
  2. The dependencies are installed as part of "rush install" in the iTwin.js repository.
16
16
  3. Build the extension as part of the "rush build" in the iTwin.js repository, or separately build using the npm build command.
17
17
 
18
- ```sh
19
- npm run build
20
- ```
18
+ ```sh
19
+ npm run build
20
+ ```
21
21
 
22
22
  4. Start the host application - go to its directory and run:
23
23
 
24
- ```sh
25
- npm run start:servers
26
- ```
24
+ ```sh
25
+ npm run start:servers
26
+ ```
27
27
 
28
- 5. Open a web browser (e.g., Chrome), and browse to http://localhost:3000.
28
+ 5. Open a web browser (e.g., Chrome), and browse to http://localhost:3000.
29
29
 
30
30
  ## Contributing
31
31
 
@@ -1 +1 @@
1
- {"version":3,"file":"BrowserStorage.d.ts","sourceRoot":"","sources":["../../src/BrowserStorage.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,UAAU,eAAe,CAAC,IAAI;IAC5B,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,yGAAyG;IACzG,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,cAAc,CAAC,IAAI;IAE9B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAC9B,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAC;gBAE9B,IAAI,EAAE,qBAAqB;IAKvC,OAAO,CAAC,eAAe;IAehB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAC,SAAS;IAezB,UAAU;IAIV,MAAM,CAAC,GAAG,EAAE,MAAM;IAmBlB,qBAAqB,CAAC,OAAO,EAAE,IAAI;IAcnC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI;CAUvC"}
1
+ {"version":3,"file":"BrowserStorage.d.ts","sourceRoot":"","sources":["../../src/BrowserStorage.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,UAAU,eAAe,CAAC,IAAI;IAC5B,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,yGAAyG;IACzG,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,cAAc,CAAC,IAAI;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAC9B,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAC;gBAE9B,IAAI,EAAE,qBAAqB;IAKvC,OAAO,CAAC,eAAe;IAgBhB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS;IAkB3B,UAAU;IAIV,MAAM,CAAC,GAAG,EAAE,MAAM;IAqBlB,qBAAqB,CAAC,OAAO,EAAE,IAAI;IAenC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI;CAWvC"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.BrowserStorage = void 0;
8
8
  class BrowserStorage {
@@ -17,21 +17,25 @@ class BrowserStorage {
17
17
  if (itemStr === null) {
18
18
  return undefined;
19
19
  }
20
- if (!itemStr || itemStr === "{}")
20
+ if (!itemStr || itemStr === "{}") {
21
21
  return map;
22
+ }
22
23
  map = JSON.parse(itemStr);
23
24
  return map;
24
25
  }
25
26
  get(key) {
26
27
  const map = this.loadFromStorage();
27
- if (map === undefined)
28
+ if (map === undefined) {
28
29
  return undefined;
30
+ }
29
31
  if (key) {
30
- if (!Object.keys(map).includes(key))
32
+ if (!Object.keys(map).includes(key)) {
31
33
  return undefined;
34
+ }
32
35
  return map[key];
33
36
  }
34
- else { // No key provided, return all objects
37
+ else {
38
+ // No key provided, return all objects
35
39
  return Object.entries(map).map(([_key, value]) => value);
36
40
  }
37
41
  }
@@ -41,16 +45,20 @@ class BrowserStorage {
41
45
  delete(key) {
42
46
  const map = this.loadFromStorage();
43
47
  if (map === undefined) {
44
- if (this._throwOnDeleteMissingKey)
48
+ if (this._throwOnDeleteMissingKey) {
45
49
  throw new Error("Could not find key from storage.");
46
- else
50
+ }
51
+ else {
47
52
  return;
53
+ }
48
54
  }
49
55
  if (!Object.keys(map).includes(key)) {
50
- if (this._throwOnDeleteMissingKey)
56
+ if (this._throwOnDeleteMissingKey) {
51
57
  throw Error("Could not find key from storage.");
52
- else
58
+ }
59
+ else {
53
60
  return;
61
+ }
54
62
  }
55
63
  delete map[key];
56
64
  window.localStorage.setItem(this._itemKeyName, JSON.stringify(map));
@@ -62,15 +70,17 @@ class BrowserStorage {
62
70
  }
63
71
  const contentJson = JSON.stringify(content);
64
72
  for (const [key, value] of Object.entries(map)) {
65
- if (JSON.stringify(value) === contentJson)
73
+ if (JSON.stringify(value) === contentJson) {
66
74
  delete map[key];
75
+ }
67
76
  }
68
77
  window.localStorage.setItem(this._itemKeyName, JSON.stringify(map));
69
78
  }
70
79
  save(key, content) {
71
80
  let map = this.loadFromStorage();
72
- if (map === undefined)
81
+ if (map === undefined) {
73
82
  map = {};
83
+ }
74
84
  map[key] = content;
75
85
  const itemValue = JSON.stringify(map);
76
86
  window.localStorage.setItem(this._itemKe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,CAAC;QACjC,IAAI,GAAG,KAAK,SAAS;YACnB,GAAG,GAAG,EAAE,CAAC;QAEX,GAAG,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;QAEnB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC;CACF;AAvFD,wCAuFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** Index signature holding preferences content\n *\n * @internal\n */\ninterface KeyContentProps<Type> {\n [preferenceKey: string]: Type;\n}\n\nexport interface BrowserStorageOptions {\n /** indicate whether or not delete function should throw an error if the provided key cannot be found. */\n throwOnDeleteMissingKey?: boolean;\n itemKeyName: string;\n}\n\nexport class BrowserStorage<Type> {\n\n private readonly _itemKeyName;\n private readonly _throwOnDeleteMissingKey;\n\n constructor(opts: BrowserStorageOptions) {\n this._itemKeyName = opts.itemKeyName;\n this._throwOnDeleteMissingKey = opts.throwOnDeleteMissingKey ?? true;\n }\n\n private loadFromStorage() {\n const storage = window.localStorage;\n\n let map: KeyContentProps<Type> = {};\n const itemStr = storage.getItem(this._itemKeyName);\n if (itemStr === null) {\n return undefined;\n }\n if (!itemStr || itemStr === \"{}\")\n return map;\n\n map = JSON.parse(itemStr);\n return map;\n }\n\n public get(key: string|undefined) {\n const map = this.loadFromStorage();\n if (map === undefined)\n return undefined;\n\n if (key) {\n if (!Object.keys(map).includes(key))\n return undefined;\n\n return map[key];\n } else { // No key provided, return all objects\n return Object.entries(map).map(([_key, value]) => value);\n }\n }\n\n public getContent() {\n return this.loadFromStorage();\n }\n\n public delete(key: string) {\n const map = this.loadFromStorage();\n if (map === undefined) {\n if (this._throwOnDeleteMissingKey)\n throw new Error(\"Could not find key from storage.\");\n else\n return;\n }\n\n if (!Object.keys(map).includes(key)) {\n if (this._throwOnDeleteMissingKey)\n throw Error(\"Could not find key from storage.\");\n else\n return;\n }\n delete map[key];\n window.localStorage.setItem(this._itemKeyName, JSON.stringify(map));\n }\n\n public deleteMatchingContent(content: Type) {\n const map = this.loadFromStorage();\n if (map === undefined) {\n return;\n }\n const contentJson = JSON.stringify(content);\n for (const [key, value] of Object.entries(map)) {\n if (JSON.stringify(value) === contentJson)\n delete map[key];\n }\n\n window.localStorage.setItem(this._itemKeyName, JSON.stringify(map));\n }\n\n public save(key: string, content: Type) {\n let map = this.loadFromStorage();\n if (map === undefined)\n map = {};\n\n map[key] = content;\n\n const itemValue = JSON.stringify(map);\n window.localStorage.setItem(this._itemKeyName, itemValue);\n }\n}\n"]}
1
+ {"version":3,"file":"BrowserStorage.js","sourceRoot":"","sources":["../../src/BrowserStorage.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAgBhG,MAAa,cAAc;IAIzB,YAAY,IAA2B;QACrC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QACrC,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,uBAAuB,IAAI,IAAI,CAAC;IACvE,CAAC;IAEO,eAAe;QACrB,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC;QAEpC,IAAI,GAAG,GAA0B,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACnD,IAAI,OAAO,KAAK,IAAI,EAAE;YACpB,OAAO,SAAS,CAAC;SAClB;QACD,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,IAAI,EAAE;YAChC,OAAO,GAAG,CAAC;SACZ;QAED,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1B,OAAO,GAAG,CAAC;IACb,CAAC;IAEM,GAAG,CAAC,GAAuB;QAChC,MAAM,GA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C;QACnC,IAAI,GAAG,KAAK,SAAS,EAAE;YACrB,OAAO;SACR;QACD,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC5C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC9C,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,WAAW,EAAE;gBACzC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;aACjB;SACF;QAED,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IACtE,CAAC;IAEM,IAAI,CAAC,GAAW,EAAE,OAAa;QACpC,IAAI,GAAG,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACjC,IAAI,GAAG,KAAK,SAAS,EAAE;YACrB,GAAG,GAAG,EAAE,CAAC;SACV;QAED,GAAG,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;QAEnB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC;CACF;AA9FD,wCA8FC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** Index signature holding preferences content\n *\n * @internal\n */\ninterface KeyContentProps<Type> {\n [preferenceKey: string]: Type;\n}\n\nexport interface BrowserStorageOptions {\n /** indicate whether or not delete function should throw an error if the provided key cannot be found. */\n throwOnDeleteMissingKey?: boolean;\n itemKeyName: string;\n}\n\nexport class BrowserStorage<Type> {\n private readonly _itemKeyName;\n private readonly _throwOnDeleteMissingKey;\n\n constructor(opts: BrowserStorageOptions) {\n this._itemKeyName = opts.itemKeyName;\n this._throwOnDeleteMissingKey = opts.throwOnDeleteMissingKey ?? true;\n }\n\n private loadFromStorage() {\n const storage = window.localStorage;\n\n let map: KeyContentProps<Type> = {};\n const itemStr = storage.getItem(this._itemKeyName);\n if (itemStr === null) {\n return undefined;\n }\n if (!itemStr || itemStr === \"{}\") {\n return map;\n }\n\n map = JSON.parse(itemStr);\n return map;\n }\n\n public get(key: string | undefined) {\n const map = this.loadFromStorage();\n if (map === undefined) {\n return undefined;\n }\n\n if (key) {\n if (!Object.keys(map).includes(key)) {\n return undefined;\n }\n\n return map[key];\n } else {\n // No key provided, return all objects\n return Object.entries(map).map(([_key, value]) => value);\n }\n }\n\n public getContent() {\n return this.loadFromStorage();\n }\n\n public delete(key: string) {\n const map = this.loadFromStorage();\n if (map === undefined) {\n if (this._throwOnDeleteMissingKey) {\n throw new Error(\"Could not find key from storage.\");\n } else {\n return;\n }\n }\n\n if (!Object.keys(map).includes(key)) {\n if (this._throwOnDeleteMissingKey) {\n throw Error(\"Could not find key from storage.\");\n } else {\n return;\n }\n }\n delete map[key];\n window.localStorage.setItem(this._itemKeyName, JSON.stringify(map));\n }\n\n public deleteMatchingContent(content: Type) {\n const map = this.loadFromStorage();\n if (map === undefined) {\n return;\n }\n const contentJson = JSON.stringify(content);\n for (const [key, value] of Object.entries(map)) {\n if (JSON.stringify(value) === contentJson) {\n delete map[key];\n }\n }\n\n window.localStorage.setItem(this._itemKeyName, JSON.stringify(map));\n }\n\n public save(key: string, content: Type) {\n let map = this.loadFromStorage();\n if (map === undefined) {\n map = {};\n }\n\n map[key] = content;\n\n const itemValue = JSON.stringify(map);\n window.localStorage.setItem(this._itemKeyName, itemValue);\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { MapLayerSource } from "@itwin/core-frontend";
1
+ import type { MapLayerSource } from "@itwin/core-frontend";
2
2
  export declare class CustomParamUtils {
3
3
  static setSourceCustomParams(source: MapLayerSource, customParamNames: string[]): void;
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CustomParamUtils.d.ts","sourceRoot":"","sources":["../../src/CustomParamUtils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD,qBAAa,gBAAgB;WACb,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,EAAE;CAyBvF"}
1
+ {"version":3,"file":"CustomParamUtils.d.ts","sourceRoot":"","sources":["../../src/CustomParamUtils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAI3D,qBAAa,gBAAgB;WACb,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,EAAE;CA4BvF"}
@@ -9,21 +9,24 @@ class CustomParamUtils {
9
9
  const paramFromStorage = cpStorage.get(paramName);
10
10
  let customParam;
11
11
  if (Array.isArray(paramFromStorage)) {
12
- if (paramFromStorage.length > 0)
12
+ if (paramFromStorage.length > 0) {
13
13
  customParam = paramFromStorage[0];
14
+ }
14
15
  }
15
16
  else {
16
17
  customParam = paramFromStorage;
17
18
  }
18
19
  if (customParam && source) {
19
20
  if (customParam.secret) {
20
- if (!source.unsavedQueryParams)
21
+ if (!source.unsavedQueryParams) {
21
22
  source.unsavedQueryParams = {};
23
+ }
22
24
  source.unsavedQueryParams[customParam.key] = customParam.value;
23
25
  }
24
26
  else {
25
- if (!source.savedQueryParams)
27
+ if (!source.savedQueryParams) {
26
28
  source.savedQueryParams = {};
29
+ }
27
30
  source.savedQueryParams[customParam.key] = customParam.value;
28
31
  }
29
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CustomParamUtils.js","sourceRoot":"","sources":["../../src/CustomParamUtils.ts"],"names":[],"mappings":";;;AAKA,+DAA4D;AAG5D,MAAa,gBAAgB;IACpB,MAAM,CAAC,qBAAqB,CAAC,MAAsB,EAAE,gBAA0B;QACpF,MAAM,SAAS,GAAG,IAAI,yCAAmB,EAAE,CAAC;QAC5C,gBAAgB,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YACrC,MAAM,gBAAgB,GAAG,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAClD,IAAI,WAAwC,CAAC;YAC7C,IAAI,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;gBACnC,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC;oBAC7B,WAAW,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;aACrC;iBAAM;gBACL,WAAW,GAAE,gBAAgB,CAAC;aAC/B;YAED,IAAI,WAAW,IAAI,MAAM,EAAE;gBACzB,IAAI,WAAW,CAAC,MAAM,EAAE;oBACtB,IAAI,CAAC,MAAM,CAAC,kBAAkB;wBAC5B,MAAM,CAAC,kBAAkB,GAAG,EAAE,CAAC;oBACjC,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC;iBAChE;qBAAM;oBACL,IAAI,CAAC,MAAM,CAAC,gBAAgB;wBAC1B,MAAM,CAAC,gBAAgB,GAAG,EAAE,CAAC;oBAC/B,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC;iBAC9D;aACF;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA1BD,4CA0BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { MapLayerSource } from \"@itwin/core-frontend\";\nimport { CustomParamsStorage } from \"./CustomParamsStorage\";\nimport { CustomParamItem } from \"./ui/Interfaces\";\n\nexport class CustomParamUtils {\n public static setSourceCustomParams(source: MapLayerSource, customParamNames: string[]) {\n const cpStorage = new CustomParamsStorage();\n customParamNames.forEach((paramName) => {\n const paramFromStorage = cpStorage.get(paramName);\n let customParam: CustomParamItem | undefined;\n if (Array.isArray(paramFromStorage)) {\n if (paramFromStorage.length > 0)\n customParam = paramFromStorage[0];\n } else {\n customParam =paramFromStorage;\n }\n\n if (customParam && source) {\n if (customParam.secret) {\n if (!source.unsavedQueryParams)\n source.unsavedQueryParams = {};\n source.unsavedQueryParams[customParam.key] = customParam.value;\n } else {\n if (!source.savedQueryParams)\n source.savedQueryParams = {};\n source.savedQueryParams[customParam.key] = customParam.value;\n }\n }\n });\n }\n}\n"]}
1
+ {"version":3,"file":"CustomParamUtils.js","sourceRoot":"","sources":["../../src/CustomParamUtils.ts"],"names":[],"mappings":";;;AAKA,+DAA4D;AAG5D,MAAa,gBAAgB;IACpB,MAAM,CAAC,qBAAqB,CAAC,MAAsB,EAAE,gBAA0B;QACpF,MAAM,SAAS,GAAG,IAAI,yCAAmB,EAAE,CAAC;QAC5C,gBAAgB,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YACrC,MAAM,gBAAgB,GAAG,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAClD,IAAI,WAAwC,CAAC;YAC7C,IAAI,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;gBACnC,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;oBAC/B,WAAW,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;iBACnC;aACF;iBAAM;gBACL,WAAW,GAAG,gBAAgB,CAAC;aAChC;YAED,IAAI,WAAW,IAAI,MAAM,EAAE;gBACzB,IAAI,WAAW,CAAC,MAAM,EAAE;oBACtB,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE;wBAC9B,MAAM,CAAC,kBAAkB,GAAG,EAAE,CAAC;qBAChC;oBACD,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC;iBAChE;qBAAM;oBACL,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE;wBAC5B,MAAM,CAAC,gBAAgB,GAAG,EAAE,CAAC;qBAC9B;oBACD,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC;iBAC9D;aACF;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA7BD,4CA6BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { MapLayerSource } from \"@itwin/core-frontend\";\nimport { CustomParamsStorage } from \"./CustomParamsStorage\";\nimport type { CustomParamItem } from \"./ui/Interfaces\";\n\nexport class CustomParamUtils {\n public static setSourceCustomParams(source: MapLayerSource, customParamNames: string[]) {\n const cpStorage = new CustomParamsStorage();\n customParamNames.forEach((paramName) => {\n const paramFromStorage = cpStorage.get(paramName);\n let customParam: CustomParamItem | undefined;\n if (Array.isArray(paramFromStorage)) {\n if (paramFromStorage.length > 0) {\n customParam = paramFromStorage[0];\n }\n } else {\n customParam = paramFromStorage;\n }\n\n if (customParam && source) {\n if (customParam.secret) {\n if (!source.unsavedQueryParams) {\n source.unsavedQueryParams = {};\n }\n source.unsavedQueryParams[customParam.key] = customParam.value;\n } else {\n if (!source.savedQueryParams) {\n source.savedQueryParams = {};\n }\n source.savedQueryParams[customParam.key] = customParam.value;\n }\n }\n });\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { BrowserStorage } from "./BrowserStorage";
2
- import { CustomParamsMappingItem } from "./ui/Interfaces";
2
+ import type { CustomParamsMappingItem } from "./ui/Interfaces";
3
3
  export declare class CustomParamsMappingStorage extends BrowserStorage<CustomParamsMappingItem> {
4
4
  constructor();
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CustomParamsMappingStorage.d.ts","sourceRoot":"","sources":["../../src/CustomParamsMappingStorage.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,qBAAa,0BAA2B,SAAQ,cAAc,CAAC,uBAAuB,CAAC;;CAItF"}
1
+ {"version":3,"file":"CustomParamsMappingStorage.d.ts","sourceRoot":"","sources":["../../src/CustomParamsMappingStorage.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/D,qBAAa,0BAA2B,SAAQ,cAAc,CAAC,uBAAuB,CAAC;;CAItF"}
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CustomParamsMappingStorage = void 0;
4
4
  /*---------------------------------------------------------------------------------------------
5
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
- * See LICENSE.md in the project root for license terms and full copyright notice.
7
- *--------------------------------------------------------------------------------------------*/
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
8
  const BrowserStorage_1 = require("./BrowserStorage");
9
9
  class CustomParamsMappingStorage extends BrowserStorage_1.BrowserStorage {
10
10
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"CustomParamsMappingStorage.js","sourceRoot":"","sources":["../../src/CustomParamsMappingStorage.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,qDAAkD;AAGlD,MAAa,0BAA2B,SAAQ,+BAAuC;IACrF;QACE,KAAK,CAAC,EAAC,WAAW,EAAE,uCAAuC,EAAC,CAAC,CAAC;IAChE,CAAC;CACF;AAJD,gEAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { BrowserStorage } from \"./BrowserStorage\";\nimport { CustomParamsMappingItem } from \"./ui/Interfaces\";\n\nexport class CustomParamsMappingStorage extends BrowserStorage<CustomParamsMappingItem> {\n constructor() {\n super({itemKeyName: \"itwinjs.mapLayers.customParamsMapping\"});\n }\n}\n"]}
1
+ {"version":3,"file":"CustomParamsMappingStorage.js","sourceRoot":"","sources":["../../src/CustomParamsMappingStorage.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,qDAAkD;AAGlD,MAAa,0BAA2B,SAAQ,+BAAuC;IACrF;QACE,KAAK,CAAC,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC,CAAC;IAClE,CAAC;CACF;AAJD,gEAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { BrowserStorage } from \"./BrowserStorage\";\nimport type { CustomParamsMappingItem } from \"./ui/Interfaces\";\n\nexport class CustomParamsMappingStorage extends BrowserStorage<CustomParamsMappingItem> {\n constructor() {\n super({ itemKeyName: \"itwinjs.mapLayers.customParamsMapping\" });\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { BrowserStorage } from "./BrowserStorage";
2
- import { CustomParamItem } from "./ui/Interfaces";
2
+ import type { CustomParamItem } from "./ui/Interfaces";
3
3
  export declare class CustomParamsStorage extends BrowserStorage<CustomParamItem> {
4
4
  constructor();
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CustomParamsStorage.d.ts","sourceRoot":"","sources":["../../src/CustomParamsStorage.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,eAAe,CAAC;;CAIvE"}
1
+ {"version":3,"file":"CustomParamsStorage.d.ts","sourceRoot":"","sources":["../../src/CustomParamsStorage.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,eAAe,CAAC;;CAIvE"}
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CustomParamsStorage = void 0;
4
4
  /*---------------------------------------------------------------------------------------------
5
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
- * See LICENSE.md in the project root for license terms and full copyright notice.
7
- *--------------------------------------------------------------------------------------------*/
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
8
  const BrowserStorage_1 = require("./BrowserStorage");
9
9
  class CustomParamsStorage extends BrowserStorage_1.BrowserStorage {
10
10
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"CustomParamsStorage.js","sourceRoot":"","sources":["../../src/CustomParamsStorage.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,qDAAkD;AAGlD,MAAa,mBAAoB,SAAQ,+BAA+B;IACtE;QACE,KAAK,CAAC,EAAC,WAAW,EAAE,gCAAgC,EAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAJD,kDAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { BrowserStorage } from \"./BrowserStorage\";\nimport { CustomParamItem } from \"./ui/Interfaces\";\n\nexport class CustomParamsStorage extends BrowserStorage<CustomParamItem> {\n constructor() {\n super({itemKeyName: \"itwinjs.mapLayers.customParams\"});\n }\n}\n"]}
1
+ {"version":3,"file":"CustomParamsStorage.js","sourceRoot":"","sources":["../../src/CustomParamsStorage.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,qDAAkD;AAGlD,MAAa,mBAAoB,SAAQ,+BAA+B;IACtE;QACE,KAAK,CAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC,CAAC;IAC3D,CAAC;CACF;AAJD,kDAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { BrowserStorage } from \"./BrowserStorage\";\nimport type { CustomParamItem } from \"./ui/Interfaces\";\n\nexport class CustomParamsStorage extends BrowserStorage<CustomParamItem> {\n constructor() {\n super({ itemKeyName: \"itwinjs.mapLayers.customParams\" });\n }\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import { MapLayerSource } from "@itwin/core-frontend";
2
- import { BeEvent, GuidString } from "@itwin/core-bentley";
2
+ import type { GuidString } from "@itwin/core-bentley";
3
+ import { BeEvent } from "@itwin/core-bentley";
3
4
  /** @internal */
4
5
  export interface MapLayerPreferencesContent {
5
6
  url: string;
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayerPreferences.d.ts","sourceRoot":"","sources":["../../src/MapLayerPreferences.ts"],"names":[],"mappings":"AAKA,OAAO,EAAa,cAAc,EAA+C,MAAM,sBAAsB,CAAC;AAC9G,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG1D,gBAAgB;AAChB,MAAM,WAAW,0BAA0B;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC5C;AAED,gBAAgB;AAChB,oBAAY,wBAAwB;IAClC,KAAK,IAAI;IACT,OAAO,IAAI;IACX,QAAQ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;;;;;;;;;;;OAWG;mBACkB,MAAM;IA8F3B;;;;OAIG;WACiB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC;IA4B9H;;;;OAIG;WACiB,UAAU,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAiDrG,OAAO,CAAC,MAAM,KAAK,oBAAoB,GAEtC;CACF"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.MapLayerPreferences = exports.MapLayerSourceChangeType = void 0;
8
8
  const core_frontend_1 = require("@itwin/core-frontend");
@@ -30,12 +30,14 @@ class MapLayerPreferences {
30
30
  * @param storeOnIModel if true store the settings object on the model, if false store it on the project
31
31
  */
32
32
  static async storeSource(source, iTwinId, iModelId, storeOnIModel) {
33
- if (!mapLayers_1.MapLayersUI.iTwinConfig)
33
+ if (!mapLayers_1.MapLayersUI.iTwinConfig) {
34
34
  return false;
35
- const accessToken = undefined !== core_frontend_1.IModelApp.authorizationClient ? (await core_frontend_1.IModelApp.authorizationClient.getAccessToken()) : undefined;
35
+ }
36
+ const accessToken = undefined !== core_frontend_1.IModelApp.authorizationClient ? await core_frontend_1.IModelApp.authorizationClient.getAccessToken() : undefined;
36
37
  const sourceJSON = source.toJSON();
37
- if (!sourceJSON.formatId)
38
+ if (!sourceJSON.formatId) {
38
39
  return false;
40
+ }
39
41
  const mapLayerSetting = {
40
42
  url: sourceJSON.url,
41
43
  name: sourceJSON.name,
@@ -69,9 +71,10 @@ class MapLayerPreferences {
69
71
  * @param iModelId
70
72
  */
71
73
  static async replaceSource(oldSource, newSource, iTwinId, iModelId) {
72
- if (!mapLayers_1.MapLayersUI.iTwinConfig)
74
+ if (!mapLayers_1.MapLayersUI.iTwinConfig) {
73
75
  return;
74
- const accessToken = undefined !== core_frontend_1.IModelApp.authorizationClient ? (await core_frontend_1.IModelApp.authorizationClient.getAccessToken()) : undefined;
76
+ }
77
+ const accessToken = undefined !== core_frontend_1.IModelApp.authorizationClient ? await core_frontend_1.IModelApp.authorizationClient.getAccessToken() : undefined;
75
78
  let storeOnIModel = false;
76
79
  try {
77
80
  await mapLayers_1.MapLayersUI.iTwinConfig.delete({
@@ -114,9 +117,10 @@ class MapLayerPreferences {
114
117
  * @param iModelId
115
118
  */
116
119
  static async deleteByName(source, iTwinId, iModelId) {
117
- if (!mapLayers_1.MapLayersUI.iTwinConfig)
120
+ if (!mapLayers_1.MapLayersUI.iTwinConfig) {
118
121
  return;
119
- const accessToken = undefined !== core_frontend_1.IModelApp.authorizationClient ? (await core_frontend_1.IModelApp.authorizationClient.getAccessToken()) : undefined;
122
+ }
123
+ const accessToken = undefined !== core_frontend_1.IModelApp.authorizationClient ? await core_frontend_1.IModelApp.authorizationClient.getAccessToken() : undefined;
120
124
  try {
121
125
  await mapLayers_1.MapLayersUI.iTwinConfig.delete({
122
126
  accessToken,
@@ -150,9 +154,10 @@ class MapLayerPreferences {
150
154
  * @param storeOnIModel
151
155
  */
152
156
  static async delete(url, name, iTwinId, iModelId, storeOnIModel) {
153
- if (!mapLayers_1.MapLayersUI.iTwinConfig)
157
+ if (!mapLayers_1.MapLayersUI.iTwinConfig) {
154
158
  return true;
155
- const accessToken = undefined !== core_frontend_1.IModelApp.authorizationClient ? (await core_frontend_1.IModelApp.authorizationClient.getAccessToken()) : undefined;
159
+ }
160
+ const accessToken = undefined !== core_frontend_1.IModelApp.authorizationClient ? await core_frontend_1.IModelApp.authorizationClient.getAccessToken() : undefined;
156
161
  const iTwinPreferenceByName = await mapLayers_1.MapLayersUI.iTwinConfig.get({
157
162
  accessToken,
158
163
  namespace: MapLayerPreferences._preferenceNamespace,
@@ -160,7 +165,9 @@ class MapLayerPreferences {
160
165
  iTwinId,
161
166
  });
162
167
  if (undefined !== iTwinPreferenceByName && storeOnIModel) {
163
- const errorMessage = core_frontend_1.IModelApp.localization.getLocalizedString("mapLayers:CustomAttach.LayerExistsAsProjectSetting", { layer: iTwinPreferenceByName.name });
168
+ const errorMessage = core_frontend_1.IModelApp.localization.getLocalizedString("mapLayers:CustomAttach.LayerExistsAsProjectSetting", {
169
+ layer: iTwinPreferenceByName.name,
170
+ });
164
171
  core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Error, errorMessage));
165
172
  return false;
166
173
  }
@@ -177,12 +184,19 @@ class MapLayerPreferences {
177
184
  // check if setting with url already exists, if it does, delete it
178
185
  const settingFromUrl = await MapLayerPreferences.getByUrl(url, iTwinId, undefined);
179
186
  if (settingFromUrl && storeOnIModel) {
180
- const errorMessage = core_frontend_1.IModelApp.localization.getLocalizedString("mapLayers:CustomAttach.LayerWithUrlExistsAsProjectSetting", { url: settingFromUrl.url, name: settingFromUrl.name });
187
+ const errorMessage = core_frontend_1.IModelApp.localization.getLocalizedString("mapLayers:CustomAttach.LayerWithUrlExistsAsProjectSetting", {
188
+ url: settingFromUrl.url,
189
+ name: settingFromUrl.name,
190
+ });
181
191
  core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Error, errorMessage));
182
192
  return false;
183
193
  }
184
194
  else if (settingFromUrl) {
185
- const infoMessage = core_frontend_1.IModelApp.localization.getLocalizedString("mapLayers:CustomAttach.LayerWithUrlExistsOverwriting", { url: settingFromUrl.url, oldName: settingFromUrl.name, newName: name });
195
+ const infoMessage = core_frontend_1.IModelApp.localization.getLocalizedString("mapLayers:CustomAttach.LayerWithUrlExistsOverwriting", {
196
+ url: settingFromUrl.url,
197
+ oldName: settingFromUrl.name,
198
+ newName: name,
199
+ });
186
200
  core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Info, infoMessage));
187
201
  await mapLayers_1.MapLayersUI.iTwinConfig.delete({
188
202
  accessToken,
@@ -191,7 +205,8 @@ class MapLayerPreferences {
191
205
  iTwinId,
192
206
  });
193
207
  }
194
- if (iModelId) { // delete any settings on model so user can update them if theres collisions
208
+ if (iModelId) {
209
+ // delete any settings on model so user can update them if theres collisions
195
210
  const settingOnIModelFromName = await mapLayers_1.MapLayersUI.iTwinConfig.get({
196
211
  accessToken,
197
212
  namespace: MapLayerPreferences._preferenceNamespace,
@@ -212,7 +227,11 @@ class MapLayerPreferences {
212
227
  });
213
228
  }
214
229
  if (settingFromUrlOnIModel) {
215
- const infoMessage = core_frontend_1.IModelApp.localization.getLocalizedString("mapLayers:CustomAttach.LayerWithUrlExistsOverwriting", { url: settingFromUrlOnIModel.url, oldName: settingFromUrlOnIModel.name, newName: name });
230
+ const infoMessage = core_frontend_1.IModelApp.localization.getLocalizedString("mapLayers:CustomAttach.LayerWithUrlExistsOverwriting", {
231
+ url: settingFromUrlOnIModel.url,
232
+ oldName: settingFromUrlOnIModel.name,
233
+ newName: name,
234
+ });
216
235
  core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Info, infoMessage));
217
236
  await mapLayers_1.MapLayersUI.iTwinConfig.delete({
218
237
  accessToken,
@@ -231,9 +250,10 @@ class MapLayerPreferences {
231
250
  * @param iModelId
232
251
  */
233
252
  static async getByUrl(url, iTwinId, iModelId) {
234
- if (!mapLayers_1.MapLayersUI.iTwinConfig)
253
+ if (!mapLayers_1.MapLayersUI.iTwinConfig) {
235
254
  return undefined;
236
- const accessToken = undefined !== core_frontend_1.IModelApp.authorizationClient ? (await core_frontend_1.IModelApp.authorizationClient.getAccessToken()) : undefined;
255
+ }
256
+ const accessToken = undefined !== core_frontend_1.IModelApp.authorizationClient ? await core_frontend_1.IModelApp.authorizationClient.getAccessToken() : undefined;
237
257
  const settingResponse = await mapLayers_1.MapLayersUI.iTwinConfig.get({
238
258
  accessToken,
239
259
  namespace: MapLayerPreferences._preferenceNamespace,
@@ -241,8 +261,9 @@ class MapLayerPreferences {
241
261
  iTwinId,
242
262
  iModelId,
243
263
  });
244
- if (undefined === settingResponse || 0 === settingResponse.length)
264
+ if (undefined === settingResponse || 0 === settingResponse.length) {
245
265
  return undefined;
266
+ }
246
267
  let savedMapLayer;
247
268
  settingResponse.settingsMap?.forEach((savedLayer) => {
248
269
  if (savedLayer.url === url) {
@@ -257,9 +278,10 @@ class MapLayerPreferences {
257
278
  * @throws if any of the calls to grab settings fail.
258
279
  */
259
280
  static async getSources(iTwinId, iModelId) {
260
- if (!mapLayers_1.MapLayersUI.iTwinConfig)
281
+ if (!mapLayers_1.MapLayersUI.iTwinConfig) {
261
282
  return [];
262
- const accessToken = undefined !== core_frontend_1.IModelApp.authorizationClient ? (await core_frontend_1.IModelApp.authorizationClient.getAccessToken()) : undefined;
283
+ }
284
+ const accessToken = undefined !== core_frontend_1.IModelApp.authorizationClient ? await core_frontend_1.IModelApp.authorizationClient.getAccessToken() : undefined;
263
285
  const mapLayerList = [];
264
286
  try {
265
287
  const userResultByProject = await mapLayers_1.MapLayersUI.iTwinConfig.get({
@@ -268,8 +290,9 @@ class MapLayerPreferences {
268
290
  key: "",
269
291
  iTwinId,
270
292
  });
271
- if (undefined !== userResultByProject)
293
+ if (undefined !== userResultByProject) {
272
294
  mapLayerList.push(userResultByProject);
295
+ }
273
296
  }
274
297
  catch (err) {
275
298
  throw new Error(core_frontend_1.IModelApp.localization.getLocalizedString("mapLayers:CustomAttach.ErrorRetrieveUserProject", { errorMessage: err }));
@@ -282,8 +305,9 @@ class MapLayerPreferences {
282
305
  iTwinId,
283
306
  iModelId,
284
307
  });
285
- if (undefined !== userResultByIModel)
308
+ if (undefined !== userResultByIModel) {
286
309
  mapLayerList.push(userResultByIModel);
310
+ }
287
311
  }
288
312
  catch (err) {
289
313
  throw new Error(core_frontend_1.IModelApp.localization.getLocalizedString("mapLayers:CustomAttach.ErrorRetrieveUserProject", { errorMessage: err }));
@@ -292,8 +316,9 @@ class MapLayerPreferences {
292
316
  for (const mapLayer of mapLayerList) {
293
317
  mapLayer.forEach((savedLayer) => {
294
318
  const mapLayerSource = core_frontend_1.MapLayerSource.fromJSON(savedLayer);
295
- if (mapLayerSource)
319
+ if (mapLayerSource) {
296
320
  savedMapLayerSources.push(mapLayerSource);
321
+ }
297
322
  });
298
323
  }
299
324
  return savedMapLayerSources;