@itwin/map-layers 3.1.0-dev.7 → 3.2.0-dev.1

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 (143) hide show
  1. package/CHANGELOG.md +40 -4
  2. package/lib/cjs/MapLayerPreferences.d.ts +8 -8
  3. package/lib/cjs/MapLayerPreferences.d.ts.map +1 -1
  4. package/lib/cjs/MapLayerPreferences.js +13 -13
  5. package/lib/cjs/MapLayerPreferences.js.map +1 -1
  6. package/lib/cjs/map-layers.d.ts +2 -0
  7. package/lib/cjs/map-layers.d.ts.map +1 -1
  8. package/lib/cjs/map-layers.js +2 -0
  9. package/lib/cjs/map-layers.js.map +1 -1
  10. package/lib/cjs/mapLayers.d.ts +15 -17
  11. package/lib/cjs/mapLayers.d.ts.map +1 -1
  12. package/lib/cjs/mapLayers.js +25 -35
  13. package/lib/cjs/mapLayers.js.map +1 -1
  14. package/lib/cjs/public/locales/en/mapLayers.json +4 -0
  15. package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts +11 -0
  16. package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -0
  17. package/lib/cjs/ui/FeatureInfoUiItemsProvider.js +51 -0
  18. package/lib/cjs/ui/FeatureInfoUiItemsProvider.js.map +1 -0
  19. package/lib/cjs/ui/Interfaces.d.ts +19 -3
  20. package/lib/cjs/ui/Interfaces.d.ts.map +1 -1
  21. package/lib/cjs/ui/Interfaces.js.map +1 -1
  22. package/lib/cjs/ui/MapFeatureInfoTool.d.ts +14 -0
  23. package/lib/cjs/ui/MapFeatureInfoTool.d.ts.map +1 -0
  24. package/lib/cjs/ui/MapFeatureInfoTool.js +51 -0
  25. package/lib/cjs/ui/MapFeatureInfoTool.js.map +1 -0
  26. package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts +4 -18
  27. package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts.map +1 -1
  28. package/lib/cjs/ui/MapLayersUiItemsProvider.js +13 -29
  29. package/lib/cjs/ui/MapLayersUiItemsProvider.js.map +1 -1
  30. package/lib/cjs/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
  31. package/lib/cjs/ui/widget/AttachLayerPopupButton.js +23 -15
  32. package/lib/cjs/ui/widget/AttachLayerPopupButton.js.map +1 -1
  33. package/lib/cjs/ui/widget/BasemapPanel.d.ts.map +1 -1
  34. package/lib/cjs/ui/widget/BasemapPanel.js +13 -13
  35. package/lib/cjs/ui/widget/BasemapPanel.js.map +1 -1
  36. package/lib/cjs/ui/widget/BasemapPanel.scss +5 -1
  37. package/lib/cjs/ui/widget/FeatureInfoDataProvider.d.ts +41 -0
  38. package/lib/cjs/ui/widget/FeatureInfoDataProvider.d.ts.map +1 -0
  39. package/lib/cjs/ui/widget/FeatureInfoDataProvider.js +140 -0
  40. package/lib/cjs/ui/widget/FeatureInfoDataProvider.js.map +1 -0
  41. package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts +8 -0
  42. package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts.map +1 -0
  43. package/lib/cjs/ui/widget/FeatureInfoWidget.js +72 -0
  44. package/lib/cjs/ui/widget/FeatureInfoWidget.js.map +1 -0
  45. package/lib/cjs/ui/widget/MapLayerDroppable.d.ts.map +1 -1
  46. package/lib/cjs/ui/widget/MapLayerDroppable.js +14 -11
  47. package/lib/cjs/ui/widget/MapLayerDroppable.js.map +1 -1
  48. package/lib/cjs/ui/widget/MapLayerManager.d.ts +2 -2
  49. package/lib/cjs/ui/widget/MapLayerManager.d.ts.map +1 -1
  50. package/lib/cjs/ui/widget/MapLayerManager.js +25 -23
  51. package/lib/cjs/ui/widget/MapLayerManager.js.map +1 -1
  52. package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
  53. package/lib/cjs/ui/widget/MapLayerSettingsMenu.js +5 -5
  54. package/lib/cjs/ui/widget/MapLayerSettingsMenu.js.map +1 -1
  55. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
  56. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js +2 -2
  57. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
  58. package/lib/cjs/ui/widget/MapLayersWidget.d.ts.map +1 -1
  59. package/lib/cjs/ui/widget/MapLayersWidget.js +2 -2
  60. package/lib/cjs/ui/widget/MapLayersWidget.js.map +1 -1
  61. package/lib/cjs/ui/widget/MapManagerSettings.js +16 -16
  62. package/lib/cjs/ui/widget/MapManagerSettings.js.map +1 -1
  63. package/lib/cjs/ui/widget/MapUrlDialog.d.ts +3 -3
  64. package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
  65. package/lib/cjs/ui/widget/MapUrlDialog.js +50 -44
  66. package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
  67. package/lib/cjs/ui/widget/SubLayersPopupButton.js +3 -3
  68. package/lib/cjs/ui/widget/SubLayersPopupButton.js.map +1 -1
  69. package/lib/cjs/ui/widget/SubLayersTree.d.ts.map +1 -1
  70. package/lib/cjs/ui/widget/SubLayersTree.js +24 -18
  71. package/lib/cjs/ui/widget/SubLayersTree.js.map +1 -1
  72. package/lib/esm/MapLayerPreferences.d.ts +8 -8
  73. package/lib/esm/MapLayerPreferences.d.ts.map +1 -1
  74. package/lib/esm/MapLayerPreferences.js +13 -13
  75. package/lib/esm/MapLayerPreferences.js.map +1 -1
  76. package/lib/esm/map-layers.d.ts +2 -0
  77. package/lib/esm/map-layers.d.ts.map +1 -1
  78. package/lib/esm/map-layers.js +2 -0
  79. package/lib/esm/map-layers.js.map +1 -1
  80. package/lib/esm/mapLayers.d.ts +15 -17
  81. package/lib/esm/mapLayers.d.ts.map +1 -1
  82. package/lib/esm/mapLayers.js +25 -35
  83. package/lib/esm/mapLayers.js.map +1 -1
  84. package/lib/esm/public/locales/en/mapLayers.json +4 -0
  85. package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts +11 -0
  86. package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -0
  87. package/lib/esm/ui/FeatureInfoUiItemsProvider.js +47 -0
  88. package/lib/esm/ui/FeatureInfoUiItemsProvider.js.map +1 -0
  89. package/lib/esm/ui/Interfaces.d.ts +19 -3
  90. package/lib/esm/ui/Interfaces.d.ts.map +1 -1
  91. package/lib/esm/ui/Interfaces.js.map +1 -1
  92. package/lib/esm/ui/MapFeatureInfoTool.d.ts +14 -0
  93. package/lib/esm/ui/MapFeatureInfoTool.d.ts.map +1 -0
  94. package/lib/esm/ui/MapFeatureInfoTool.js +46 -0
  95. package/lib/esm/ui/MapFeatureInfoTool.js.map +1 -0
  96. package/lib/esm/ui/MapLayersUiItemsProvider.d.ts +4 -18
  97. package/lib/esm/ui/MapLayersUiItemsProvider.d.ts.map +1 -1
  98. package/lib/esm/ui/MapLayersUiItemsProvider.js +14 -29
  99. package/lib/esm/ui/MapLayersUiItemsProvider.js.map +1 -1
  100. package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
  101. package/lib/esm/ui/widget/AttachLayerPopupButton.js +23 -15
  102. package/lib/esm/ui/widget/AttachLayerPopupButton.js.map +1 -1
  103. package/lib/esm/ui/widget/BasemapPanel.d.ts.map +1 -1
  104. package/lib/esm/ui/widget/BasemapPanel.js +14 -14
  105. package/lib/esm/ui/widget/BasemapPanel.js.map +1 -1
  106. package/lib/esm/ui/widget/BasemapPanel.scss +5 -1
  107. package/lib/esm/ui/widget/FeatureInfoDataProvider.d.ts +41 -0
  108. package/lib/esm/ui/widget/FeatureInfoDataProvider.d.ts.map +1 -0
  109. package/lib/esm/ui/widget/FeatureInfoDataProvider.js +136 -0
  110. package/lib/esm/ui/widget/FeatureInfoDataProvider.js.map +1 -0
  111. package/lib/esm/ui/widget/FeatureInfoWidget.d.ts +8 -0
  112. package/lib/esm/ui/widget/FeatureInfoWidget.d.ts.map +1 -0
  113. package/lib/esm/ui/widget/FeatureInfoWidget.js +68 -0
  114. package/lib/esm/ui/widget/FeatureInfoWidget.js.map +1 -0
  115. package/lib/esm/ui/widget/MapLayerDroppable.d.ts.map +1 -1
  116. package/lib/esm/ui/widget/MapLayerDroppable.js +14 -11
  117. package/lib/esm/ui/widget/MapLayerDroppable.js.map +1 -1
  118. package/lib/esm/ui/widget/MapLayerManager.d.ts +2 -2
  119. package/lib/esm/ui/widget/MapLayerManager.d.ts.map +1 -1
  120. package/lib/esm/ui/widget/MapLayerManager.js +25 -23
  121. package/lib/esm/ui/widget/MapLayerManager.js.map +1 -1
  122. package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
  123. package/lib/esm/ui/widget/MapLayerSettingsMenu.js +5 -5
  124. package/lib/esm/ui/widget/MapLayerSettingsMenu.js.map +1 -1
  125. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
  126. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js +2 -2
  127. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
  128. package/lib/esm/ui/widget/MapLayersWidget.d.ts.map +1 -1
  129. package/lib/esm/ui/widget/MapLayersWidget.js +2 -2
  130. package/lib/esm/ui/widget/MapLayersWidget.js.map +1 -1
  131. package/lib/esm/ui/widget/MapManagerSettings.js +16 -16
  132. package/lib/esm/ui/widget/MapManagerSettings.js.map +1 -1
  133. package/lib/esm/ui/widget/MapUrlDialog.d.ts +3 -3
  134. package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
  135. package/lib/esm/ui/widget/MapUrlDialog.js +50 -44
  136. package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
  137. package/lib/esm/ui/widget/SubLayersPopupButton.js +3 -3
  138. package/lib/esm/ui/widget/SubLayersPopupButton.js.map +1 -1
  139. package/lib/esm/ui/widget/SubLayersTree.d.ts.map +1 -1
  140. package/lib/esm/ui/widget/SubLayersTree.js +24 -18
  141. package/lib/esm/ui/widget/SubLayersTree.js.map +1 -1
  142. package/lib/public/locales/en/mapLayers.json +4 -0
  143. package/package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;gBAE/B,6BAAK,SAAS,EAAC,8BAA8B;oBAE3C,8BAAM,SAAS,EAAC,4BAA4B,IAAE,WAAW,CAAQ;oBAEjE,oBAAC,YAAY,IAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,GAAI;oBAElE,8BAAM,SAAS,EAAC,4BAA4B,IAAE,gBAAgB,CAAQ;oBACtE,oBAAC,mBAAmB,IAAC,QAAQ,EAAE,CAAC,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,QAAC,YAAY,EAAE,YAAY,CAAC,iBAAiB,EAAE,QAAQ,EAAE,wBAAwB,EAAE,SAAS,EAAE,SAAS,GAAG;oBAE7L,8BAAM,SAAS,EAAC,4BAA4B,IAAE,iBAAiB,CAAQ;oBACvE,oBAAC,MAAM,IAAC,OAAO,EAAE,oBAAoB,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,2BAA2B,EAAE,IAAI,EAAC,OAAO,GAAG;oBAEvJ,8BAAM,SAAS,EAAC,4BAA4B,IAAE,iBAAiB,CAAQ;oBACvE,oBAAC,WAAW,IAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,wBAAwB,EAAE,SAAS,EAAE,SAAS,GAAI,CACnH,CAEG,CACP,CACL,CACJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n// cSpell:ignore droppable Sublayer Basemap\r\n\r\nimport * as React from \"react\";\r\nimport { NumberInput } from \"@itwin/core-react\";\r\nimport { QuantityType, ViewState3d } from \"@itwin/core-frontend\";\r\nimport { BackgroundMapProps, BackgroundMapSettings, PlanarClipMaskMode, PlanarClipMaskPriority, TerrainHeightOriginMode, TerrainProps } from \"@itwin/core-common\";\r\nimport { useSourceMapContext } from \"./MapLayerManager\";\r\nimport \"./MapManagerSettings.scss\";\r\nimport { MapLayersUiItemsProvider } from \"../MapLayersUiItemsProvider\";\r\nimport { Select, SelectOption, Slider, ToggleSwitch } from \"@itwin/itwinui-react\";\r\nimport { QuantityNumberInput } from \"@itwin/imodel-components-react\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\nenum MapMaskingOption {\r\n None,\r\n AllModels\r\n}\r\n\r\nfunction getMapMaskingFromBackgroundMapSetting(backgroundMapSettings: BackgroundMapSettings): MapMaskingOption {\r\n if (backgroundMapSettings.planarClipMask.mode === PlanarClipMaskMode.Priority && backgroundMapSettings.planarClipMask.priority) {\r\n if (backgroundMapSettings.planarClipMask.priority >= PlanarClipMaskPriority.BackgroundMap) {\r\n return MapMaskingOption.AllModels;\r\n }\r\n\r\n }\r\n return MapMaskingOption.None;\r\n}\r\n\r\nfunction getHeightOriginModeKey(mode: TerrainHeightOriginMode): string {\r\n if (TerrainHeightOriginMode.Geodetic === mode)\r\n return \"geodetic\";\r\n if (TerrainHeightOriginMode.Geoid === mode)\r\n return \"geoid\";\r\n return \"ground\";\r\n}\r\n\r\nfunction getHeightOriginModeFromKey(mode: string): TerrainHeightOriginMode {\r\n if (\"geodetic\" === mode)\r\n return TerrainHeightOriginMode.Geodetic;\r\n if (\"geoid\" === mode)\r\n return TerrainHeightOriginMode.Geoid;\r\n return TerrainHeightOriginMode.Ground;\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function MapManagerSettings() {\r\n const { activeViewport } = useSourceMapContext();\r\n const backgroundMapSettings = (activeViewport!.view as ViewState3d).getDisplayStyle3d().settings.backgroundMap;\r\n\r\n const [transparency, setTransparency] = React.useState(() =>\r\n typeof backgroundMapSettings.transparency === \"boolean\"\r\n ? 0\r\n : Math.round((backgroundMapSettings.transparency) * 100) / 100);\r\n\r\n const terrainSettings = backgroundMapSettings.terrainSettings;\r\n const [groundBias, setGroundBias] = React.useState(() => backgroundMapSettings.groundBias);\r\n\r\n const terrainHeightOptions = React.useRef<SelectOption<string>[]>([\r\n { value: \"geodetic\", label: MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.ElevationTypeGeodetic\") },\r\n { value: \"geoid\", label: MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.ElevationTypeGeoid\") },\r\n { value: \"ground\", label: MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.ElevationTypeGround\") },\r\n ]);\r\n\r\n const updateTerrainSettings = React.useCallback((props: TerrainProps) => {\r\n activeViewport!.changeBackgroundMapProps({ terrainSettings: props });\r\n activeViewport!.invalidateRenderPlan();\r\n }, [activeViewport]);\r\n\r\n const updateBackgroundMap = React.useCallback((props: BackgroundMapProps) => {\r\n activeViewport!.changeBackgroundMapProps(props);\r\n activeViewport!.invalidateRenderPlan();\r\n }, [activeViewport]);\r\n\r\n const [heightOriginMode, setHeightOriginMode] = React.useState(() => getHeightOriginModeKey(terrainSettings.heightOriginMode));\r\n const handleElevationTypeSelected = React.useCallback((newValue: string): void => {\r\n if (newValue) {\r\n const newHeightOriginMode = getHeightOriginModeFromKey(newValue);\r\n updateTerrainSettings({ heightOriginMode: newHeightOriginMode });\r\n setHeightOriginMode(newValue);\r\n }\r\n }, [updateTerrainSettings]);\r\n\r\n const [maskTransparency, setMaskTransparency] = React.useState(() =>\r\n backgroundMapSettings.planarClipMask.transparency === undefined\r\n ? undefined\r\n : Math.round((backgroundMapSettings.planarClipMask.transparency) * 100) / 100);\r\n\r\n const getNormalizedMaskTransparency = React.useCallback(() => { return (maskTransparency === undefined ? 0 : maskTransparency); }, [maskTransparency]);\r\n\r\n const updateMaskingSettings = React.useCallback((option: MapMaskingOption) => {\r\n if (option === MapMaskingOption.AllModels) {\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.Priority, priority: PlanarClipMaskPriority.BackgroundMap, transparency: maskTransparency } });\r\n }\r\n if (option === MapMaskingOption.None) {\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.None } });\r\n }\r\n\r\n activeViewport!.invalidateRenderPlan();\r\n }, [activeViewport, maskTransparency]);\r\n\r\n const [masking, setMasking] = React.useState(() => getMapMaskingFromBackgroundMapSetting(backgroundMapSettings));\r\n\r\n const onMaskingToggle = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n const maskingOption = checked ? MapMaskingOption.AllModels : MapMaskingOption.None;\r\n updateMaskingSettings(maskingOption);\r\n setMasking(maskingOption);\r\n }, [updateMaskingSettings]);\r\n\r\n const [overrideMaskTransparency, setOverrideMaskTransparency] = React.useState(() => backgroundMapSettings.planarClipMask.transparency !== undefined);\r\n\r\n const onOverrideMaskTransparencyToggle = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n const trans = checked ? getNormalizedMaskTransparency() : undefined;\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.Priority, priority: PlanarClipMaskPriority.BackgroundMap, transparency: trans } });\r\n\r\n setOverrideMaskTransparency(checked);\r\n }, [activeViewport, getNormalizedMaskTransparency]);\r\n\r\n const handleElevationChange = React.useCallback((value: number) => {\r\n if (value !== undefined) {\r\n updateBackgroundMap({ groundBias: value });\r\n setGroundBias(value);\r\n }\r\n }, [updateBackgroundMap]);\r\n\r\n const handleAlphaChange = React.useCallback((values: readonly number[]) => {\r\n const newTransparency = values[0] / 100;\r\n activeViewport!.changeBackgroundMapProps({ transparency: newTransparency });\r\n activeViewport!.invalidateRenderPlan();\r\n setTransparency(newTransparency);\r\n }, [activeViewport]);\r\n\r\n const handleMaskTransparencyChange = React.useCallback((values: readonly number[]) => {\r\n const newTransparency = values[0] / 100;\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.Priority, priority: PlanarClipMaskPriority.BackgroundMap, transparency: newTransparency } });\r\n activeViewport!.invalidateRenderPlan();\r\n setMaskTransparency(newTransparency);\r\n }, [activeViewport]);\r\n\r\n const [applyTerrain, setApplyTerrain] = React.useState(() => backgroundMapSettings.applyTerrain);\r\n\r\n const onToggleTerrain = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n updateBackgroundMap({ applyTerrain: checked });\r\n setApplyTerrain(checked);\r\n }, [updateBackgroundMap]);\r\n\r\n const [exaggeration, setExaggeration] = React.useState(() => terrainSettings.exaggeration);\r\n\r\n const handleExaggerationChange = React.useCallback((value: number | undefined, _stringValue: string) => {\r\n if (undefined !== value) {\r\n updateTerrainSettings({ exaggeration: value });\r\n setExaggeration(value);\r\n }\r\n }, [updateTerrainSettings]);\r\n\r\n const [terrainOrigin, setTerrainOrigin] = React.useState(() => terrainSettings.heightOrigin);\r\n\r\n const handleHeightOriginChange = React.useCallback((value: number) => {\r\n if (undefined !== value) {\r\n updateTerrainSettings({ heightOrigin: value });\r\n setTerrainOrigin(value);\r\n }\r\n }, [updateTerrainSettings]);\r\n\r\n const [useDepthBuffer, setUseDepthBuffer] = React.useState(() => backgroundMapSettings.useDepthBuffer);\r\n const onToggleUseDepthBuffer = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n updateBackgroundMap({ useDepthBuffer: checked });\r\n setUseDepthBuffer(checked);\r\n }, [updateBackgroundMap]);\r\n\r\n /** Disable commas and letters */\r\n const onKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n if (event.keyCode === 188 || (event.keyCode >= 65 && event.keyCode <= 90))\r\n event.preventDefault();\r\n }, []);\r\n\r\n const [isLocatable, setIsLocatable] = React.useState(() => backgroundMapSettings.locatable);\r\n const onLocatableToggle = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n updateBackgroundMap({ nonLocatable: !checked });\r\n setIsLocatable(checked);\r\n }, [updateBackgroundMap]);\r\n\r\n const [transparencyLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.Transparency\"));\r\n const [terrainLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.Terrain\"));\r\n const [enableLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.Enable\"));\r\n const [elevationOffsetLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.ElevationOffset\"));\r\n const [useDepthBufferLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.UseDepthBuffer\"));\r\n const [modelHeightLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.ModelHeight\"));\r\n const [heightOriginLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.HeightOrigin\"));\r\n const [exaggerationLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.Exaggeration\"));\r\n const [locatableLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.Locatable\"));\r\n const [maskingLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.Mask\"));\r\n const [overrideMaskTransparencyLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.OverrideMaskTransparency\"));\r\n const [maskTransparencyLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Settings.MaskTransparency\"));\r\n\r\n return (\r\n <>\r\n <div className=\"maplayers-settings-container\">\r\n\r\n <span className=\"map-manager-settings-label\">{transparencyLabel}</span>\r\n <Slider min={0} max={100} values={[transparency * 100]} onChange={handleAlphaChange} step={1} />\r\n\r\n <span className=\"map-manager-settings-label\">{locatableLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch onChange={onLocatableToggle} checked={isLocatable} />\r\n\r\n <span className=\"map-manager-settings-label\">{maskingLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch onChange={onMaskingToggle} checked={masking !== MapMaskingOption.None} />\r\n\r\n <span className=\"map-manager-settings-label\">{overrideMaskTransparencyLabel}</span>\r\n <ToggleSwitch disabled={masking === MapMaskingOption.None} onChange={onOverrideMaskTransparencyToggle} checked={overrideMaskTransparency} />\r\n\r\n <span className=\"map-manager-settings-label\">{maskTransparencyLabel}</span>\r\n <Slider disabled={masking === MapMaskingOption.None || !overrideMaskTransparency} min={0} max={100} values={[getNormalizedMaskTransparency() * 100]} onChange={handleMaskTransparencyChange} step={1} />\r\n\r\n <>\r\n <span className=\"map-manager-settings-label\">{elevationOffsetLabel}</span>\r\n <QuantityNumberInput disabled={applyTerrain} persistenceValue={groundBias} step={1} snap quantityType={QuantityType.LengthEngineering} onChange={handleElevationChange} onKeyDown={onKeyDown}/>\r\n\r\n <span className=\"map-manager-settings-label\">{useDepthBufferLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch disabled={applyTerrain} onChange={onToggleUseDepthBuffer} checked={useDepthBuffer} />\r\n </>\r\n\r\n </div>\r\n <div className=\"map-manager-settings-terrain-container\">\r\n <fieldset>\r\n <legend>{terrainLabel}</legend>\r\n\r\n <div className=\"maplayers-settings-container\">\r\n\r\n <span className=\"map-manager-settings-label\">{enableLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch onChange={onToggleTerrain} checked={applyTerrain} />\r\n\r\n <span className=\"map-manager-settings-label\">{modelHeightLabel}</span>\r\n <QuantityNumberInput disabled={!applyTerrain} persistenceValue={terrainOrigin} snap quantityType={QuantityType.LengthEngineering} onChange={handleHeightOriginChange} onKeyDown={onKeyDown}/>\r\n\r\n <span className=\"map-manager-settings-label\">{heightOriginLabel}</span>\r\n <Select options={terrainHeightOptions.current} disabled={!applyTerrain} value={heightOriginMode} onChange={handleElevationTypeSelected} size=\"small\" />\r\n\r\n <span className=\"map-manager-settings-label\">{exaggerationLabel}</span>\r\n <NumberInput value={exaggeration} disabled={!applyTerrain} onChange={handleExaggerationChange} onKeyDown={onKeyDown} />\r\n </div>\r\n\r\n </fieldset>\r\n </div>\r\n </>\r\n );\r\n}\r\n"]}
1
+ {"version":3,"file":"MapManagerSettings.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapManagerSettings.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,2CAA2C;AAE3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAG,YAAY,EAAe,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAA6C,kBAAkB,EAAE,sBAAsB,EAAE,uBAAuB,EAAgB,MAAM,oBAAoB,CAAC;AAClK,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAgB,MAAM,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,4CAA4C;AAE5C,IAAK,gBAGJ;AAHD,WAAK,gBAAgB;IACnB,uDAAI,CAAA;IACJ,iEAAS,CAAA;AACX,CAAC,EAHI,gBAAgB,KAAhB,gBAAgB,QAGpB;AAED,SAAS,qCAAqC,CAAC,qBAA4C;IACzF,IAAI,qBAAqB,CAAC,cAAc,CAAC,IAAI,KAAK,kBAAkB,CAAC,QAAQ,IAAI,qBAAqB,CAAC,cAAc,CAAC,QAAQ,EAAE;QAC9H,IAAI,qBAAqB,CAAC,cAAc,CAAC,QAAQ,IAAI,sBAAsB,CAAC,aAAa,EAAE;YACzF,OAAO,gBAAgB,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,YAAY,IAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,sBAAsB,EAAE,OAAO,EAAE,cAAc,GAAI,CAClG,CAEC;QACN,6BAAK,SAAS,EAAC,wCAAwC;YACrD;gBACE,oCAAS,YAAY,CAAU;gBAE/B,6BAAK,SAAS,EAAC,8BAA8B;oBAE3C,8BAAM,SAAS,EAAC,4BAA4B,IAAE,WAAW,CAAQ;oBAEjE,oBAAC,YAAY,IAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,GAAI;oBAElE,8BAAM,SAAS,EAAC,4BAA4B,IAAE,gBAAgB,CAAQ;oBACtE,oBAAC,mBAAmB,IAAC,QAAQ,EAAE,CAAC,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,QAAC,YAAY,EAAE,YAAY,CAAC,iBAAiB,EAAE,QAAQ,EAAE,wBAAwB,EAAE,SAAS,EAAE,SAAS,GAAG;oBAE7L,8BAAM,SAAS,EAAC,4BAA4B,IAAE,iBAAiB,CAAQ;oBACvE,oBAAC,MAAM,IAAC,OAAO,EAAE,oBAAoB,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,2BAA2B,EAAE,IAAI,EAAC,OAAO,GAAG;oBAEvJ,8BAAM,SAAS,EAAC,4BAA4B,IAAE,iBAAiB,CAAQ;oBACvE,oBAAC,WAAW,IAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,wBAAwB,EAAE,SAAS,EAAE,SAAS,GAAI,CACnH,CAEG,CACP,CACL,CACJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n// cSpell:ignore droppable Sublayer Basemap\r\n\r\nimport * as React from \"react\";\r\nimport { NumberInput } from \"@itwin/core-react\";\r\nimport { QuantityType, ViewState3d } from \"@itwin/core-frontend\";\r\nimport { BackgroundMapProps, BackgroundMapSettings, PlanarClipMaskMode, PlanarClipMaskPriority, TerrainHeightOriginMode, TerrainProps } from \"@itwin/core-common\";\r\nimport { useSourceMapContext } from \"./MapLayerManager\";\r\nimport \"./MapManagerSettings.scss\";\r\nimport { Select, SelectOption, Slider, ToggleSwitch } from \"@itwin/itwinui-react\";\r\nimport { QuantityNumberInput } from \"@itwin/imodel-components-react\";\r\nimport { MapLayersUI } from \"../../mapLayers\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\nenum MapMaskingOption {\r\n None,\r\n AllModels\r\n}\r\n\r\nfunction getMapMaskingFromBackgroundMapSetting(backgroundMapSettings: BackgroundMapSettings): MapMaskingOption {\r\n if (backgroundMapSettings.planarClipMask.mode === PlanarClipMaskMode.Priority && backgroundMapSettings.planarClipMask.priority) {\r\n if (backgroundMapSettings.planarClipMask.priority >= PlanarClipMaskPriority.BackgroundMap) {\r\n return MapMaskingOption.AllModels;\r\n }\r\n\r\n }\r\n return MapMaskingOption.None;\r\n}\r\n\r\nfunction getHeightOriginModeKey(mode: TerrainHeightOriginMode): string {\r\n if (TerrainHeightOriginMode.Geodetic === mode)\r\n return \"geodetic\";\r\n if (TerrainHeightOriginMode.Geoid === mode)\r\n return \"geoid\";\r\n return \"ground\";\r\n}\r\n\r\nfunction getHeightOriginModeFromKey(mode: string): TerrainHeightOriginMode {\r\n if (\"geodetic\" === mode)\r\n return TerrainHeightOriginMode.Geodetic;\r\n if (\"geoid\" === mode)\r\n return TerrainHeightOriginMode.Geoid;\r\n return TerrainHeightOriginMode.Ground;\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function MapManagerSettings() {\r\n const { activeViewport } = useSourceMapContext();\r\n const backgroundMapSettings = (activeViewport!.view as ViewState3d).getDisplayStyle3d().settings.backgroundMap;\r\n\r\n const [transparency, setTransparency] = React.useState(() =>\r\n typeof backgroundMapSettings.transparency === \"boolean\"\r\n ? 0\r\n : Math.round((backgroundMapSettings.transparency) * 100) / 100);\r\n\r\n const terrainSettings = backgroundMapSettings.terrainSettings;\r\n const [groundBias, setGroundBias] = React.useState(() => backgroundMapSettings.groundBias);\r\n\r\n const terrainHeightOptions = React.useRef<SelectOption<string>[]>([\r\n { value: \"geodetic\", label: MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ElevationTypeGeodetic\") },\r\n { value: \"geoid\", label: MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ElevationTypeGeoid\") },\r\n { value: \"ground\", label: MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ElevationTypeGround\") },\r\n ]);\r\n\r\n const updateTerrainSettings = React.useCallback((props: TerrainProps) => {\r\n activeViewport!.changeBackgroundMapProps({ terrainSettings: props });\r\n activeViewport!.invalidateRenderPlan();\r\n }, [activeViewport]);\r\n\r\n const updateBackgroundMap = React.useCallback((props: BackgroundMapProps) => {\r\n activeViewport!.changeBackgroundMapProps(props);\r\n activeViewport!.invalidateRenderPlan();\r\n }, [activeViewport]);\r\n\r\n const [heightOriginMode, setHeightOriginMode] = React.useState(() => getHeightOriginModeKey(terrainSettings.heightOriginMode));\r\n const handleElevationTypeSelected = React.useCallback((newValue: string): void => {\r\n if (newValue) {\r\n const newHeightOriginMode = getHeightOriginModeFromKey(newValue);\r\n updateTerrainSettings({ heightOriginMode: newHeightOriginMode });\r\n setHeightOriginMode(newValue);\r\n }\r\n }, [updateTerrainSettings]);\r\n\r\n const [maskTransparency, setMaskTransparency] = React.useState(() =>\r\n backgroundMapSettings.planarClipMask.transparency === undefined\r\n ? undefined\r\n : Math.round((backgroundMapSettings.planarClipMask.transparency) * 100) / 100);\r\n\r\n const getNormalizedMaskTransparency = React.useCallback(() => { return (maskTransparency === undefined ? 0 : maskTransparency); }, [maskTransparency]);\r\n\r\n const updateMaskingSettings = React.useCallback((option: MapMaskingOption) => {\r\n if (option === MapMaskingOption.AllModels) {\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.Priority, priority: PlanarClipMaskPriority.BackgroundMap, transparency: maskTransparency } });\r\n }\r\n if (option === MapMaskingOption.None) {\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.None } });\r\n }\r\n\r\n activeViewport!.invalidateRenderPlan();\r\n }, [activeViewport, maskTransparency]);\r\n\r\n const [masking, setMasking] = React.useState(() => getMapMaskingFromBackgroundMapSetting(backgroundMapSettings));\r\n\r\n const onMaskingToggle = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n const maskingOption = checked ? MapMaskingOption.AllModels : MapMaskingOption.None;\r\n updateMaskingSettings(maskingOption);\r\n setMasking(maskingOption);\r\n }, [updateMaskingSettings]);\r\n\r\n const [overrideMaskTransparency, setOverrideMaskTransparency] = React.useState(() => backgroundMapSettings.planarClipMask.transparency !== undefined);\r\n\r\n const onOverrideMaskTransparencyToggle = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n const trans = checked ? getNormalizedMaskTransparency() : undefined;\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.Priority, priority: PlanarClipMaskPriority.BackgroundMap, transparency: trans } });\r\n\r\n setOverrideMaskTransparency(checked);\r\n }, [activeViewport, getNormalizedMaskTransparency]);\r\n\r\n const handleElevationChange = React.useCallback((value: number) => {\r\n if (value !== undefined) {\r\n updateBackgroundMap({ groundBias: value });\r\n setGroundBias(value);\r\n }\r\n }, [updateBackgroundMap]);\r\n\r\n const handleAlphaChange = React.useCallback((values: readonly number[]) => {\r\n const newTransparency = values[0] / 100;\r\n activeViewport!.changeBackgroundMapProps({ transparency: newTransparency });\r\n activeViewport!.invalidateRenderPlan();\r\n setTransparency(newTransparency);\r\n }, [activeViewport]);\r\n\r\n const handleMaskTransparencyChange = React.useCallback((values: readonly number[]) => {\r\n const newTransparency = values[0] / 100;\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.Priority, priority: PlanarClipMaskPriority.BackgroundMap, transparency: newTransparency } });\r\n activeViewport!.invalidateRenderPlan();\r\n setMaskTransparency(newTransparency);\r\n }, [activeViewport]);\r\n\r\n const [applyTerrain, setApplyTerrain] = React.useState(() => backgroundMapSettings.applyTerrain);\r\n\r\n const onToggleTerrain = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n updateBackgroundMap({ applyTerrain: checked });\r\n setApplyTerrain(checked);\r\n }, [updateBackgroundMap]);\r\n\r\n const [exaggeration, setExaggeration] = React.useState(() => terrainSettings.exaggeration);\r\n\r\n const handleExaggerationChange = React.useCallback((value: number | undefined, _stringValue: string) => {\r\n if (undefined !== value) {\r\n updateTerrainSettings({ exaggeration: value });\r\n setExaggeration(value);\r\n }\r\n }, [updateTerrainSettings]);\r\n\r\n const [terrainOrigin, setTerrainOrigin] = React.useState(() => terrainSettings.heightOrigin);\r\n\r\n const handleHeightOriginChange = React.useCallback((value: number) => {\r\n if (undefined !== value) {\r\n updateTerrainSettings({ heightOrigin: value });\r\n setTerrainOrigin(value);\r\n }\r\n }, [updateTerrainSettings]);\r\n\r\n const [useDepthBuffer, setUseDepthBuffer] = React.useState(() => backgroundMapSettings.useDepthBuffer);\r\n const onToggleUseDepthBuffer = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n updateBackgroundMap({ useDepthBuffer: checked });\r\n setUseDepthBuffer(checked);\r\n }, [updateBackgroundMap]);\r\n\r\n /** Disable commas and letters */\r\n const onKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n if (event.keyCode === 188 || (event.keyCode >= 65 && event.keyCode <= 90))\r\n event.preventDefault();\r\n }, []);\r\n\r\n const [isLocatable, setIsLocatable] = React.useState(() => backgroundMapSettings.locatable);\r\n const onLocatableToggle = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n updateBackgroundMap({ nonLocatable: !checked });\r\n setIsLocatable(checked);\r\n }, [updateBackgroundMap]);\r\n\r\n const [transparencyLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Transparency\"));\r\n const [terrainLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Terrain\"));\r\n const [enableLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Enable\"));\r\n const [elevationOffsetLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ElevationOffset\"));\r\n const [useDepthBufferLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.UseDepthBuffer\"));\r\n const [modelHeightLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ModelHeight\"));\r\n const [heightOriginLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.HeightOrigin\"));\r\n const [exaggerationLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Exaggeration\"));\r\n const [locatableLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Locatable\"));\r\n const [maskingLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Mask\"));\r\n const [overrideMaskTransparencyLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.OverrideMaskTransparency\"));\r\n const [maskTransparencyLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.MaskTransparency\"));\r\n\r\n return (\r\n <>\r\n <div className=\"maplayers-settings-container\">\r\n\r\n <span className=\"map-manager-settings-label\">{transparencyLabel}</span>\r\n <Slider min={0} max={100} values={[transparency * 100]} onChange={handleAlphaChange} step={1} />\r\n\r\n <span className=\"map-manager-settings-label\">{locatableLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch onChange={onLocatableToggle} checked={isLocatable} />\r\n\r\n <span className=\"map-manager-settings-label\">{maskingLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch onChange={onMaskingToggle} checked={masking !== MapMaskingOption.None} />\r\n\r\n <span className=\"map-manager-settings-label\">{overrideMaskTransparencyLabel}</span>\r\n <ToggleSwitch disabled={masking === MapMaskingOption.None} onChange={onOverrideMaskTransparencyToggle} checked={overrideMaskTransparency} />\r\n\r\n <span className=\"map-manager-settings-label\">{maskTransparencyLabel}</span>\r\n <Slider disabled={masking === MapMaskingOption.None || !overrideMaskTransparency} min={0} max={100} values={[getNormalizedMaskTransparency() * 100]} onChange={handleMaskTransparencyChange} step={1} />\r\n\r\n <>\r\n <span className=\"map-manager-settings-label\">{elevationOffsetLabel}</span>\r\n <QuantityNumberInput disabled={applyTerrain} persistenceValue={groundBias} step={1} snap quantityType={QuantityType.LengthEngineering} onChange={handleElevationChange} onKeyDown={onKeyDown}/>\r\n\r\n <span className=\"map-manager-settings-label\">{useDepthBufferLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch disabled={applyTerrain} onChange={onToggleUseDepthBuffer} checked={useDepthBuffer} />\r\n </>\r\n\r\n </div>\r\n <div className=\"map-manager-settings-terrain-container\">\r\n <fieldset>\r\n <legend>{terrainLabel}</legend>\r\n\r\n <div className=\"maplayers-settings-container\">\r\n\r\n <span className=\"map-manager-settings-label\">{enableLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch onChange={onToggleTerrain} checked={applyTerrain} />\r\n\r\n <span className=\"map-manager-settings-label\">{modelHeightLabel}</span>\r\n <QuantityNumberInput disabled={!applyTerrain} persistenceValue={terrainOrigin} snap quantityType={QuantityType.LengthEngineering} onChange={handleHeightOriginChange} onKeyDown={onKeyDown}/>\r\n\r\n <span className=\"map-manager-settings-label\">{heightOriginLabel}</span>\r\n <Select options={terrainHeightOptions.current} disabled={!applyTerrain} value={heightOriginMode} onChange={handleElevationTypeSelected} size=\"small\" />\r\n\r\n <span className=\"map-manager-settings-label\">{exaggerationLabel}</span>\r\n <NumberInput value={exaggeration} disabled={!applyTerrain} onChange={handleExaggerationChange} onKeyDown={onKeyDown} />\r\n </div>\r\n\r\n </fieldset>\r\n </div>\r\n </>\r\n );\r\n}\r\n"]}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { MapTypesOptions } from "../Interfaces";
2
+ import { ImageMapLayerProps } from "@itwin/core-common";
3
3
  import { MapLayerSource, ScreenViewport } from "@itwin/core-frontend";
4
- import { MapLayerProps } from "@itwin/core-common";
4
+ import { MapTypesOptions } from "../Interfaces";
5
5
  import "./MapUrlDialog.scss";
6
6
  export declare const MAP_TYPES: {
7
7
  wms: string;
@@ -15,7 +15,7 @@ interface MapUrlDialogProps {
15
15
  onOkResult: () => void;
16
16
  onCancelResult?: () => void;
17
17
  mapTypesOptions?: MapTypesOptions;
18
- layerRequiringCredentials?: MapLayerProps;
18
+ layerRequiringCredentials?: ImageMapLayerProps;
19
19
  mapLayerSourceToEdit?: MapLayerSource;
20
20
  }
21
21
  export declare function MapUrlDialog(props: MapUrlDialogProps): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"MapUrlDialog.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACuD,cAAc,EACmB,cAAc,EAC5G,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,qBAAqB,CAAC;AAK7B,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC;AAEF,UAAU,iBAAiB;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,eAAe,CAAC;IAGlC,yBAAyB,CAAC,EAAE,aAAa,CAAC;IAE1C,oBAAoB,CAAC,EAAE,cAAc,CAAC;CACvC;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eAuepD"}
1
+ {"version":3,"file":"MapUrlDialog.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACuD,cAAc,EACmB,cAAc,EAC5G,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,qBAAqB,CAAC;AAG7B,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC;AAEF,UAAU,iBAAiB;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,eAAe,CAAC;IAGlC,yBAAyB,CAAC,EAAE,kBAAkB,CAAC;IAE/C,oBAAoB,CAAC,EAAE,cAAc,CAAC;CACvC;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eAgfpD"}
@@ -3,16 +3,16 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  // cSpell:ignore Modeless WMTS
6
- import * as React from "react";
7
- import { Dialog, Icon } from "@itwin/core-react";
6
+ import { DialogButtonType, SpecialKey } from "@itwin/appui-abstract";
8
7
  import { ModalDialogManager } from "@itwin/appui-react";
9
8
  import { Input, LabeledInput, ProgressLinear, Radio, Select } from "@itwin/itwinui-react";
10
- import { MapLayersUiItemsProvider } from "../MapLayersUiItemsProvider";
11
9
  import { IModelApp, MapLayerAuthType, MapLayerImageryProviderStatus, MapLayerSource, MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority, } from "@itwin/core-frontend";
12
- import "./MapUrlDialog.scss";
13
- import { DialogButtonType, SpecialKey } from "@itwin/appui-abstract";
10
+ import { Dialog, Icon } from "@itwin/core-react";
11
+ import * as React from "react";
14
12
  import { MapLayerPreferences } from "../../MapLayerPreferences";
15
13
  import { MapLayersUI } from "../../mapLayers";
14
+ import "./MapUrlDialog.scss";
15
+ import { Guid } from "@itwin/core-bentley";
16
16
  export const MAP_TYPES = {
17
17
  wms: "WMS",
18
18
  arcGis: "ArcGIS",
@@ -21,7 +21,7 @@ export const MAP_TYPES = {
21
21
  };
22
22
  // eslint-disable-next-line @typescript-eslint/naming-convention
23
23
  export function MapUrlDialog(props) {
24
- var _a, _b, _c, _d, _e;
24
+ var _a, _b, _c, _d, _e, _f, _g;
25
25
  const { isOverlay, onOkResult, mapTypesOptions } = props;
26
26
  const getMapUrlFromProps = React.useCallback(() => {
27
27
  var _a;
@@ -53,16 +53,16 @@ export function MapUrlDialog(props) {
53
53
  }
54
54
  return undefined;
55
55
  }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);
56
- const [dialogTitle] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(props.layerRequiringCredentials || props.mapLayerSourceToEdit ? "mapLayers:CustomAttach.EditCustomLayer" : "mapLayers:CustomAttach.AttachCustomLayer"));
57
- const [typeLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.Type"));
58
- const [nameLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.Name"));
59
- const [nameInputPlaceHolder] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.NameInputPlaceHolder"));
60
- const [urlLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.URL"));
61
- const [urlInputPlaceHolder] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.UrlInputPlaceHolder"));
62
- const [iTwinSettingsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.StoreOnITwinSettings"));
63
- const [modelSettingsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.StoreOnModelSettings"));
64
- const [missingCredentialsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.MissingCredentials"));
65
- const [invalidCredentialsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.InvalidCredentials"));
56
+ const [dialogTitle] = React.useState(MapLayersUI.localization.getLocalizedString(props.layerRequiringCredentials || props.mapLayerSourceToEdit ? "mapLayers:CustomAttach.EditCustomLayer" : "mapLayers:CustomAttach.AttachCustomLayer"));
57
+ const [typeLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.Type"));
58
+ const [nameLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.Name"));
59
+ const [nameInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.NameInputPlaceHolder"));
60
+ const [urlLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.URL"));
61
+ const [urlInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.UrlInputPlaceHolder"));
62
+ const [iTwinSettingsLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.StoreOnITwinSettings"));
63
+ const [modelSettingsLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.StoreOnModelSettings"));
64
+ const [missingCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.MissingCredentials"));
65
+ const [invalidCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.InvalidCredentials"));
66
66
  const [serverRequireCredentials, setServerRequireCredentials] = React.useState(false);
67
67
  const [invalidCredentialsProvided, setInvalidCredentialsProvided] = React.useState(false);
68
68
  const [layerAttachPending, setLayerAttachPending] = React.useState(false);
@@ -70,11 +70,11 @@ export function MapUrlDialog(props) {
70
70
  const [mapName, setMapName] = React.useState(getMapNameFromProps());
71
71
  const [userName, setUserName] = React.useState("");
72
72
  const [password, setPassword] = React.useState("");
73
- const [noSaveSettingsWarning] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.NoSaveSettingsWarning"));
74
- const [passwordLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:AuthenticationInputs.Password"));
75
- const [passwordRequiredLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:AuthenticationInputs.PasswordRequired"));
76
- const [userNameLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:AuthenticationInputs.Username"));
77
- const [userNameRequiredLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:AuthenticationInputs.UsernameRequired"));
73
+ const [noSaveSettingsWarning] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.NoSaveSettingsWarning"));
74
+ const [passwordLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:AuthenticationInputs.Password"));
75
+ const [passwordRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:AuthenticationInputs.PasswordRequired"));
76
+ const [userNameLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:AuthenticationInputs.Username"));
77
+ const [userNameRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:AuthenticationInputs.UsernameRequired"));
78
78
  const [settingsStorage, setSettingsStorageRadio] = React.useState("iTwin");
79
79
  const [layerAuthMethod, setLayerAuthMethod] = React.useState(MapLayerAuthType.None);
80
80
  const [mapType, setMapType] = React.useState((_a = getFormatFromProps()) !== null && _a !== void 0 ? _a : MAP_TYPES.arcGis);
@@ -97,7 +97,11 @@ export function MapUrlDialog(props) {
97
97
  types.push({ value: MAP_TYPES.tileUrl, label: MAP_TYPES.tileUrl });
98
98
  return types;
99
99
  });
100
- const [isSettingsStorageAvailable] = React.useState(MapLayersUI.iTwinConfig && ((_c = (_b = props === null || props === void 0 ? void 0 : props.activeViewport) === null || _b === void 0 ? void 0 : _b.iModel) === null || _c === void 0 ? void 0 : _c.iTwinId) && ((_e = (_d = props === null || props === void 0 ? void 0 : props.activeViewport) === null || _d === void 0 ? void 0 : _d.iModel) === null || _e === void 0 ? void 0 : _e.iModelId));
100
+ const [isSettingsStorageAvailable] = React.useState(MapLayersUI.iTwinConfig && ((_c = (_b = props === null || props === void 0 ? void 0 : props.activeViewport) === null || _b === void 0 ? void 0 : _b.iModel) === null || _c === void 0 ? void 0 : _c.iTwinId));
101
+ const [hasImodelContext] = React.useState(((_e = (_d = props === null || props === void 0 ? void 0 : props.activeViewport) === null || _d === void 0 ? void 0 : _d.iModel) === null || _e === void 0 ? void 0 : _e.iTwinId) !== undefined
102
+ && props.activeViewport.iModel.iTwinId !== Guid.empty
103
+ && ((_g = (_f = props === null || props === void 0 ? void 0 : props.activeViewport) === null || _f === void 0 ? void 0 : _f.iModel) === null || _g === void 0 ? void 0 : _g.iModelId) !== undefined
104
+ && (props === null || props === void 0 ? void 0 : props.activeViewport.iModel.iModelId) !== Guid.empty);
101
105
  // Even though the settings storage is available,
102
106
  // we don't always want to enable it in the UI.
103
107
  const [settingsStorageDisabled] = React.useState(!isSettingsStorageAvailable || props.mapLayerSourceToEdit !== undefined || props.layerRequiringCredentials !== undefined);
@@ -106,7 +110,7 @@ export function MapUrlDialog(props) {
106
110
  if (props.layerRequiringCredentials === undefined || !props.layerRequiringCredentials.name || !props.layerRequiringCredentials.url) {
107
111
  return undefined;
108
112
  }
109
- const indexInDisplayStyle = (_a = props.activeViewport) === null || _a === void 0 ? void 0 : _a.displayStyle.findMapLayerIndexByNameAndUrl(props.layerRequiringCredentials.name, props.layerRequiringCredentials.url, isOverlay);
113
+ const indexInDisplayStyle = (_a = props.activeViewport) === null || _a === void 0 ? void 0 : _a.displayStyle.findMapLayerIndexByNameAndSource(props.layerRequiringCredentials.name, props.layerRequiringCredentials.url, isOverlay);
110
114
  if (indexInDisplayStyle === undefined || indexInDisplayStyle < 0) {
111
115
  return undefined;
112
116
  }
@@ -160,8 +164,8 @@ export function MapUrlDialog(props) {
160
164
  const updateAttachedLayer = React.useCallback(async (source, validation) => {
161
165
  const vp = props === null || props === void 0 ? void 0 : props.activeViewport;
162
166
  if (vp === undefined || source === undefined || layerRequiringCredentialsIdx === undefined) {
163
- const error = MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:Messages.MapLayerAttachMissingViewOrSource");
164
- const msg = MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:Messages.MapLayerAttachError", { error, sourceUrl: source.url });
167
+ const error = MapLayersUI.localization.getLocalizedString("mapLayers:Messages.MapLayerAttachMissingViewOrSource");
168
+ const msg = MapLayersUI.localization.getLocalizedString("mapLayers:Messages.MapLayerAttachError", { error, sourceUrl: source.url });
165
169
  IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));
166
170
  return true;
167
171
  }
@@ -185,16 +189,16 @@ export function MapUrlDialog(props) {
185
189
  const doAttach = React.useCallback(async (source, validation) => {
186
190
  const vp = props === null || props === void 0 ? void 0 : props.activeViewport;
187
191
  if (vp === undefined || source === undefined) {
188
- const error = MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:Messages.MapLayerAttachMissingViewOrSource");
189
- const msg = MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:Messages.MapLayerAttachError", { error, sourceUrl: source.url });
192
+ const error = MapLayersUI.localization.getLocalizedString("mapLayers:Messages.MapLayerAttachMissingViewOrSource");
193
+ const msg = MapLayersUI.localization.getLocalizedString("mapLayers:Messages.MapLayerAttachError", { error, sourceUrl: source.url });
190
194
  IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));
191
195
  return true;
192
196
  }
193
197
  // Update service settings if storage is available and we are not prompting user for credentials
194
198
  if (!settingsStorageDisabled && !props.layerRequiringCredentials) {
195
- const storeOnIModel = "Model" === settingsStorage;
196
- if (!(await MapLayerPreferences.storeSource(source, storeOnIModel, vp.iModel.iTwinId, vp.iModel.iModelId))) {
197
- const msgError = MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:Messages.MapLayerPreferencesStoreFailed");
199
+ const storeOnIModel = (hasImodelContext ? "Model" === settingsStorage : undefined);
200
+ if (vp.iModel.iTwinId && !(await MapLayerPreferences.storeSource(source, vp.iModel.iTwinId, vp.iModel.iModelId, storeOnIModel))) {
201
+ const msgError = MapLayersUI.localization.getLocalizedString("mapLayers:Messages.MapLayerPreferencesStoreFailed");
198
202
  IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msgError));
199
203
  }
200
204
  }
@@ -205,8 +209,8 @@ export function MapUrlDialog(props) {
205
209
  IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));
206
210
  }
207
211
  else {
208
- const msgError = MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:Messages.MapLayerLayerSettingsConversionError");
209
- const msg = MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.MapLayerAttachError", { error: msgError, sourceUrl: source.url });
212
+ const msgError = MapLayersUI.localization.getLocalizedString("mapLayers:Messages.MapLayerLayerSettingsConversionError");
213
+ const msg = MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.MapLayerAttachError", { error: msgError, sourceUrl: source.url });
210
214
  IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));
211
215
  }
212
216
  vp.invalidateRenderPlan();
@@ -214,7 +218,7 @@ export function MapUrlDialog(props) {
214
218
  // don't call it if the dialog needs to remains open.
215
219
  onOkResult();
216
220
  return true;
217
- }, [isOverlay, onOkResult, props === null || props === void 0 ? void 0 : props.activeViewport, props.layerRequiringCredentials, settingsStorage, settingsStorageDisabled]);
221
+ }, [hasImodelContext, isOverlay, onOkResult, props === null || props === void 0 ? void 0 : props.activeViewport, props.layerRequiringCredentials, settingsStorage, settingsStorageDisabled]);
218
222
  // Validate the layer source and attempt to attach (or update) the layer.
219
223
  // Returns true if no further input is needed from end-user (i.e. close the dialog)
220
224
  const attemptAttachSource = React.useCallback(async (source) => {
@@ -232,14 +236,14 @@ export function MapUrlDialog(props) {
232
236
  return false;
233
237
  }
234
238
  else {
235
- const msg = MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.ValidationError");
239
+ const msg = MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.ValidationError");
236
240
  IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, `${msg} ${source.url}`));
237
241
  return true;
238
242
  }
239
243
  return false;
240
244
  }
241
245
  catch (error) {
242
- const msg = MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:Messages.MapLayerAttachError", { error, sourceUrl: source.url });
246
+ const msg = MapLayersUI.localization.getLocalizedString("mapLayers:Messages.MapLayerAttachError", { error, sourceUrl: source.url });
243
247
  IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));
244
248
  return true;
245
249
  }
@@ -272,8 +276,8 @@ export function MapUrlDialog(props) {
272
276
  ModalDialogManager.closeDialog();
273
277
  if (source === undefined) {
274
278
  // Close the dialog and inform end user something went wrong.
275
- const msgError = MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:Messages.MapLayerLayerSourceCreationFailed");
276
- const msg = MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:Messages.MapLayerAttachError", { error: msgError, sourceUrl: mapUrl });
279
+ const msgError = MapLayersUI.localization.getLocalizedString("mapLayers:Messages.MapLayerLayerSourceCreationFailed");
280
+ const msg = MapLayersUI.localization.getLocalizedString("mapLayers:Messages.MapLayerAttachError", { error: msgError, sourceUrl: mapUrl });
277
281
  IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));
278
282
  return;
279
283
  }
@@ -281,13 +285,13 @@ export function MapUrlDialog(props) {
281
285
  if (props.mapLayerSourceToEdit !== undefined) {
282
286
  const vp = props.activeViewport;
283
287
  void (async () => {
284
- var _a;
285
- if (isSettingsStorageAvailable && vp) {
288
+ var _a, _b;
289
+ if (isSettingsStorageAvailable && ((_a = vp === null || vp === void 0 ? void 0 : vp.iModel) === null || _a === void 0 ? void 0 : _a.iTwinId)) {
286
290
  try {
287
- await MapLayerPreferences.replaceSource(props.mapLayerSourceToEdit, source, vp.iModel.iTwinId, vp.iModel.iModelId);
291
+ await MapLayerPreferences.replaceSource(props.mapLayerSourceToEdit, source, vp.iModel.iTwinId, vp === null || vp === void 0 ? void 0 : vp.iModel.iModelId);
288
292
  }
289
293
  catch (err) {
290
- const errorMessage = IModelApp.localization.getLocalizedString("mapLayers:Messages.MapLayerEditError", { layerName: (_a = props.mapLayerSourceToEdit) === null || _a === void 0 ? void 0 : _a.name });
294
+ const errorMessage = IModelApp.localization.getLocalizedString("mapLayers:Messages.MapLayerEditError", { layerName: (_b = props.mapLayerSourceToEdit) === null || _b === void 0 ? void 0 : _b.name });
291
295
  IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));
292
296
  return;
293
297
  }
@@ -405,9 +409,11 @@ export function MapUrlDialog(props) {
405
409
  React.createElement(LabeledInput, { className: "map-layer-source-input", displayStyle: "inline", placeholder: serverRequireCredentials ? userNameRequiredLabel : userNameLabel, status: !userName && serverRequireCredentials ? "warning" : undefined, disabled: layerAttachPending, onChange: onUsernameChange, size: "small" }),
406
410
  React.createElement("span", { className: "map-layer-source-label" }, passwordLabel),
407
411
  React.createElement(LabeledInput, { className: "map-layer-source-input", displayStyle: "inline", type: "password", placeholder: serverRequireCredentials ? passwordRequiredLabel : passwordLabel, status: !password && serverRequireCredentials ? "warning" : undefined, disabled: layerAttachPending, onChange: onPasswordChange, onKeyPress: handleOnKeyDown, size: "small" })),
408
- isSettingsStorageAvailable && React.createElement("div", { title: settingsStorageDisabled ? noSaveSettingsWarning : "" },
409
- React.createElement(Radio, { disabled: settingsStorageDisabled, name: "settingsStorage", value: "iTwin", label: iTwinSettingsLabel, checked: settingsStorage === "iTwin", onChange: onRadioChange }),
410
- React.createElement(Radio, { disabled: settingsStorageDisabled, name: "settingsStorage", value: "Model", label: modelSettingsLabel, checked: settingsStorage === "Model", onChange: onRadioChange })))),
412
+ isSettingsStorageAvailable &&
413
+ React.createElement("div", { title: settingsStorageDisabled ? noSaveSettingsWarning : "" }, hasImodelContext &&
414
+ React.createElement("div", null,
415
+ React.createElement(Radio, { disabled: settingsStorageDisabled, name: "settingsStorage", value: "iTwin", label: iTwinSettingsLabel, checked: settingsStorage === "iTwin", onChange: onRadioChange }),
416
+ React.createElement(Radio, { disabled: settingsStorageDisabled, name: "settingsStorage", value: "Model", label: modelSettingsLabel, checked: settingsStorage === "Model", onChange: onRadioChange }))))),
411
417
  renderWarningMessage(),
412
418
  (layerAttachPending) &&
413
419
  React.createElement("div", { className: "map-layer-source-progressBar" },
@@ -1 +1 @@
1
- {"version":3,"file":"MapUrlDialog.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,8BAA8B;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAgB,MAAM,sBAAsB,CAAC;AACxG,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6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,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,EAC/D,QAAQ,EAAE,aAAa,GAAI,CACzB,CACF,CACF;YAGL,oBAAoB,EAAE;YAGtB,CAAC,kBAAkB,CAAC;gBACnB,6BAAK,SAAS,EAAC,8BAA8B;oBAC3C,oBAAC,cAAc,IAAC,aAAa,SAAG,CAC5B,CAED,CACJ,CACR,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n// cSpell:ignore Modeless WMTS\r\n\r\nimport * as React from \"react\";\r\nimport { Dialog, Icon } from \"@itwin/core-react\";\r\nimport { ModalDialogManager } from \"@itwin/appui-react\";\r\nimport { Input, LabeledInput, ProgressLinear, Radio, Select, SelectOption } from \"@itwin/itwinui-react\";\r\nimport { MapLayersUiItemsProvider } from \"../MapLayersUiItemsProvider\";\r\nimport { MapTypesOptions } from \"../Interfaces\";\r\nimport {\r\n IModelApp, MapLayerAuthType, MapLayerImageryProviderStatus, MapLayerSource,\r\n MapLayerSourceStatus, MapLayerSourceValidation, NotifyMessageDetails, OutputMessagePriority, ScreenViewport,\r\n} from \"@itwin/core-frontend\";\r\nimport { MapLayerProps } from \"@itwin/core-common\";\r\nimport \"./MapUrlDialog.scss\";\r\nimport { DialogButtonType, SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { MapLayerPreferences } from \"../../MapLayerPreferences\";\r\nimport { MapLayersUI } from \"../../mapLayers\";\r\n\r\nexport const MAP_TYPES = {\r\n wms: \"WMS\",\r\n arcGis: \"ArcGIS\",\r\n wmts: \"WMTS\",\r\n tileUrl: \"TileURL\",\r\n};\r\n\r\ninterface MapUrlDialogProps {\r\n activeViewport?: ScreenViewport;\r\n isOverlay: boolean;\r\n onOkResult: () => void;\r\n onCancelResult?: () => void;\r\n mapTypesOptions?: MapTypesOptions;\r\n\r\n // An optional layer definition can be provide to enable the edit mode\r\n layerRequiringCredentials?: MapLayerProps;\r\n\r\n mapLayerSourceToEdit?: MapLayerSource;\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function MapUrlDialog(props: MapUrlDialogProps) {\r\n const { isOverlay, onOkResult, mapTypesOptions } = props;\r\n\r\n const getMapUrlFromProps = React.useCallback(() => {\r\n if (props.mapLayerSourceToEdit) {\r\n return props.mapLayerSourceToEdit.url;\r\n } else if (props.layerRequiringCredentials?.url) {\r\n return props.layerRequiringCredentials.url;\r\n }\r\n return \"\";\r\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\r\n\r\n const getMapNameFromProps = React.useCallback(() => {\r\n if (props.mapLayerSourceToEdit) {\r\n return props.mapLayerSourceToEdit.name;\r\n } else if (props.layerRequiringCredentials?.name) {\r\n return props.layerRequiringCredentials.name;\r\n }\r\n return \"\";\r\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\r\n\r\n const getFormatFromProps = React.useCallback(() => {\r\n if (props.mapLayerSourceToEdit) {\r\n return props.mapLayerSourceToEdit.formatId;\r\n } else if (props.layerRequiringCredentials?.formatId) {\r\n return props.layerRequiringCredentials.formatId;\r\n }\r\n return undefined;\r\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\r\n\r\n const [dialogTitle] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(props.layerRequiringCredentials || props.mapLayerSourceToEdit ? \"mapLayers:CustomAttach.EditCustomLayer\" : \"mapLayers:CustomAttach.AttachCustomLayer\"));\r\n const [typeLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.Type\"));\r\n const [nameLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.Name\"));\r\n const [nameInputPlaceHolder] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.NameInputPlaceHolder\"));\r\n const [urlLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.URL\"));\r\n const [urlInputPlaceHolder] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.UrlInputPlaceHolder\"));\r\n const [iTwinSettingsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnITwinSettings\"));\r\n const [modelSettingsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnModelSettings\"));\r\n const [missingCredentialsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.MissingCredentials\"));\r\n const [invalidCredentialsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCredentials\"));\r\n const [serverRequireCredentials, setServerRequireCredentials] = React.useState(false);\r\n const [invalidCredentialsProvided, setInvalidCredentialsProvided] = React.useState(false);\r\n const [layerAttachPending, setLayerAttachPending] = React.useState(false);\r\n const [mapUrl, setMapUrl] = React.useState(getMapUrlFromProps());\r\n const [mapName, setMapName] = React.useState(getMapNameFromProps());\r\n const [userName, setUserName] = React.useState(\"\");\r\n const [password, setPassword] = React.useState(\"\");\r\n const [noSaveSettingsWarning] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.NoSaveSettingsWarning\"));\r\n const [passwordLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Password\"));\r\n const [passwordRequiredLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.PasswordRequired\"));\r\n const [userNameLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Username\"));\r\n const [userNameRequiredLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.UsernameRequired\"));\r\n const [settingsStorage, setSettingsStorageRadio] = React.useState(\"iTwin\");\r\n const [layerAuthMethod, setLayerAuthMethod] = React.useState(MapLayerAuthType.None);\r\n\r\n const [mapType, setMapType] = React.useState(getFormatFromProps() ?? MAP_TYPES.arcGis);\r\n\r\n // 'isMounted' is used to prevent any async operation once the hook has been\r\n // unloaded. Otherwise we get a 'Can't perform a React state update on an unmounted component.' warning in the console.\r\n const isMounted = React.useRef(false);\r\n React.useEffect(() => {\r\n isMounted.current = true;\r\n return () => {\r\n isMounted.current = false;\r\n };\r\n }, []);\r\n\r\n const [mapTypes] = React.useState((): SelectOption<string>[] => {\r\n const types = [\r\n { value: MAP_TYPES.arcGis, label: MAP_TYPES.arcGis },\r\n { value: MAP_TYPES.wms, label: MAP_TYPES.wms },\r\n { value: MAP_TYPES.wmts, label: MAP_TYPES.wmts },\r\n ];\r\n if (mapTypesOptions?.supportTileUrl)\r\n types.push({ value: MAP_TYPES.tileUrl, label: MAP_TYPES.tileUrl });\r\n return types;\r\n });\r\n\r\n const [isSettingsStorageAvailable] = React.useState(MapLayersUI.iTwinConfig && props?.activeViewport?.iModel?.iTwinId && props?.activeViewport?.iModel?.iModelId);\r\n\r\n // Even though the settings storage is available,\r\n // we don't always want to enable it in the UI.\r\n const [settingsStorageDisabled] = React.useState(!isSettingsStorageAvailable || props.mapLayerSourceToEdit !== undefined || props.layerRequiringCredentials !== undefined);\r\n\r\n const [layerRequiringCredentialsIdx] = React.useState((): number | undefined => {\r\n if (props.layerRequiringCredentials === undefined || !props.layerRequiringCredentials.name || !props.layerRequiringCredentials.url) {\r\n return undefined;\r\n }\r\n\r\n const indexInDisplayStyle = props.activeViewport?.displayStyle.findMapLayerIndexByNameAndUrl(props.layerRequiringCredentials.name, props.layerRequiringCredentials.url, isOverlay);\r\n if (indexInDisplayStyle === undefined || indexInDisplayStyle < 0) {\r\n return undefined;\r\n } else {\r\n return indexInDisplayStyle;\r\n }\r\n });\r\n\r\n // Update warning message based on the dialog state and server response\r\n const handleMapTypeSelection = React.useCallback((newValue: string) => {\r\n setMapType(newValue);\r\n\r\n // Reset few states\r\n if (invalidCredentialsProvided)\r\n setInvalidCredentialsProvided(false);\r\n\r\n if (layerAuthMethod !== MapLayerAuthType.None) {\r\n setLayerAuthMethod(MapLayerAuthType.None);\r\n }\r\n\r\n }, [invalidCredentialsProvided, layerAuthMethod]);\r\n\r\n const handleCancel = React.useCallback(() => {\r\n if (props.onCancelResult) {\r\n props.onCancelResult();\r\n return;\r\n }\r\n ModalDialogManager.closeDialog();\r\n }, [props]);\r\n\r\n const onUsernameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setUserName(event.target.value);\r\n if (invalidCredentialsProvided)\r\n setInvalidCredentialsProvided(false);\r\n }, [setUserName, invalidCredentialsProvided, setInvalidCredentialsProvided]);\r\n\r\n const onPasswordChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setPassword(event.target.value);\r\n if (invalidCredentialsProvided)\r\n setInvalidCredentialsProvided(false);\r\n }, [setPassword, invalidCredentialsProvided, setInvalidCredentialsProvided]);\r\n\r\n // return true if authorization is needed\r\n const updateAuthState = React.useCallback((sourceValidation: MapLayerSourceValidation) => {\r\n const sourceRequireAuth = (sourceValidation.status === MapLayerSourceStatus.RequireAuth);\r\n const invalidCredentials = (sourceValidation.status === MapLayerSourceStatus.InvalidCredentials);\r\n if (sourceRequireAuth && sourceValidation.authInfo?.authMethod !== undefined) {\r\n setLayerAuthMethod(sourceValidation.authInfo?.authMethod);\r\n }\r\n if (invalidCredentials) {\r\n setInvalidCredentialsProvided(true);\r\n } else if (invalidCredentialsProvided) {\r\n setInvalidCredentialsProvided(false); // flag reset\r\n }\r\n\r\n return sourceRequireAuth || invalidCredentials;\r\n }, [invalidCredentialsProvided]);\r\n\r\n const updateAttachedLayer = React.useCallback(async (source: MapLayerSource, validation: MapLayerSourceValidation) => {\r\n const vp = props?.activeViewport;\r\n if (vp === undefined || source === undefined || layerRequiringCredentialsIdx === undefined) {\r\n const error = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachMissingViewOrSource\");\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return true;\r\n }\r\n\r\n // Layer is already attached,\r\n vp.displayStyle.changeMapLayerProps({\r\n subLayers: validation.subLayers,\r\n }, layerRequiringCredentialsIdx, isOverlay);\r\n vp.displayStyle.changeMapLayerCredentials(layerRequiringCredentialsIdx, isOverlay, source.userName, source.password);\r\n\r\n // Reset the provider's status\r\n const provider = vp.getMapLayerImageryProvider(layerRequiringCredentialsIdx, isOverlay);\r\n if (provider && provider.status !== MapLayerImageryProviderStatus.Valid) {\r\n provider.status = MapLayerImageryProviderStatus.Valid;\r\n }\r\n\r\n vp.invalidateRenderPlan();\r\n\r\n // This handler will close the layer source handler, and therefore the MapUrl dialog.\r\n // don't call it if the dialog needs to remains open.\r\n onOkResult();\r\n\r\n return true;\r\n }, [isOverlay, layerRequiringCredentialsIdx, onOkResult, props.activeViewport]);\r\n\r\n // Returns true if no further input is needed from end-user.\r\n const doAttach = React.useCallback(async (source: MapLayerSource, validation: MapLayerSourceValidation): Promise<boolean> => {\r\n const vp = props?.activeViewport;\r\n if (vp === undefined || source === undefined) {\r\n const error = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachMissingViewOrSource\");\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return true;\r\n }\r\n\r\n // Update service settings if storage is available and we are not prompting user for credentials\r\n if (!settingsStorageDisabled && !props.layerRequiringCredentials) {\r\n \tconst storeOnIModel = \"Model\" === settingsStorage;\r\n if (!(await MapLayerPreferences.storeSource(source, storeOnIModel, vp.iModel.iTwinId!, vp.iModel.iModelId!))) {\r\n const msgError = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerPreferencesStoreFailed\");\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msgError));\r\n\t }\r\n }\r\n const layerSettings = source.toLayerSettings(validation.subLayers);\r\n if (layerSettings) {\r\n vp.displayStyle.attachMapLayerSettings(layerSettings, isOverlay, undefined);\r\n\r\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttached\", { sourceName: source.name, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));\r\n } else {\r\n const msgError = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSettingsConversionError\");\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.MapLayerAttachError\", { error: msgError, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n }\r\n\r\n vp.invalidateRenderPlan();\r\n\r\n // This handler will close the layer source handler, and therefore the MapUrl dialog.\r\n // don't call it if the dialog needs to remains open.\r\n onOkResult();\r\n\r\n return true;\r\n }, [isOverlay, onOkResult, props?.activeViewport, props.layerRequiringCredentials, settingsStorage, settingsStorageDisabled]);\r\n\r\n // Validate the layer source and attempt to attach (or update) the layer.\r\n // Returns true if no further input is needed from end-user (i.e. close the dialog)\r\n const attemptAttachSource = React.useCallback(async (source: MapLayerSource): Promise<boolean> => {\r\n try {\r\n const validation = await source.validateSource(true);\r\n\r\n if (validation.status === MapLayerSourceStatus.Valid) {\r\n if (layerRequiringCredentialsIdx === undefined ) {\r\n return await doAttach(source, validation);\r\n } else {\r\n return await updateAttachedLayer(source, validation);\r\n }\r\n } else if (updateAuthState(validation)) {\r\n return false;\r\n } else {\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.ValidationError\");\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, `${msg} ${source.url}`));\r\n return true;\r\n }\r\n return false;\r\n } catch (error) {\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return true;\r\n }\r\n\r\n }, [updateAuthState, doAttach, layerRequiringCredentialsIdx, updateAttachedLayer]);\r\n\r\n const onNameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setMapName(event.target.value);\r\n }, [setMapName]);\r\n\r\n const onRadioChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setSettingsStorageRadio(event.target.value);\r\n }, [setSettingsStorageRadio]);\r\n\r\n const onUrlChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setMapUrl(event.target.value);\r\n }, [setMapUrl]);\r\n\r\n const createSource = React.useCallback(() => {\r\n let source: MapLayerSource | undefined;\r\n if (mapUrl && mapName) {\r\n source = MapLayerSource.fromJSON({\r\n url: mapUrl,\r\n name: mapName,\r\n formatId: mapType,\r\n userName: userName||undefined, // When there is no value, empty string is always returned, in this case force it to undefined,\r\n password: password||undefined});\r\n }\r\n return source;\r\n }, [mapName, mapType, mapUrl, password, userName]);\r\n\r\n const handleOk = React.useCallback(() => {\r\n const source = createSource();\r\n if (source === undefined || props.mapLayerSourceToEdit) {\r\n\r\n ModalDialogManager.closeDialog();\r\n\r\n if (source === undefined) {\r\n // Close the dialog and inform end user something went wrong.\r\n const msgError = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSourceCreationFailed\");\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error: msgError, sourceUrl: mapUrl });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return;\r\n }\r\n\r\n // Simply change the source definition in the setting service\r\n if (props.mapLayerSourceToEdit !== undefined) {\r\n const vp = props.activeViewport;\r\n void (async () => {\r\n if (isSettingsStorageAvailable && vp) {\r\n try {\r\n await MapLayerPreferences.replaceSource(props.mapLayerSourceToEdit!, source, vp.iModel.iTwinId!, vp.iModel.iModelId!);\r\n } catch (err: any) {\r\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerEditError\", { layerName: props.mapLayerSourceToEdit?.name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\r\n return;\r\n }\r\n }\r\n })();\r\n return;\r\n }\r\n }\r\n\r\n setLayerAttachPending(true);\r\n\r\n // Attach source asynchronously.\r\n void (async () => {\r\n try {\r\n const closeDialog = await attemptAttachSource(source);\r\n if (isMounted.current) {\r\n setLayerAttachPending(false);\r\n }\r\n\r\n // In theory the modal dialog should always get closed by the parent\r\n // AttachLayerPanel's 'onOkResult' handler. We close it here just in case.\r\n if (closeDialog) {\r\n ModalDialogManager.closeDialog();\r\n }\r\n } catch (_error) {\r\n ModalDialogManager.closeDialog();\r\n }\r\n })();\r\n\r\n }, [createSource, props.mapLayerSourceToEdit, props.activeViewport, mapUrl, isSettingsStorageAvailable, attemptAttachSource]);\r\n\r\n // The first time the dialog is loaded and we already know the layer requires auth. (i.e ImageryProvider already made an attempt)\r\n // makes a request to discover the authentification types and adjust UI accordingly (i.e. username/password fields, Oauth popup)\r\n // Without this effect, user would have to manually click the 'OK' button in order to trigger the layer connection.\r\n React.useEffect(() => {\r\n // Attach source asynchronously.\r\n void (async () => {\r\n if (props.layerRequiringCredentials?.url !== undefined && props.layerRequiringCredentials?.name !== undefined) {\r\n try {\r\n const source = MapLayerSource.fromJSON({url: props.layerRequiringCredentials.url, name: props.layerRequiringCredentials.name,formatId: props.layerRequiringCredentials.formatId});\r\n if (source !== undefined) {\r\n setLayerAttachPending(true);\r\n const validation = await source.validateSource(true);\r\n if (isMounted.current) {\r\n setLayerAttachPending(false);\r\n }\r\n updateAuthState(validation);\r\n }\r\n } catch (_error) {}\r\n }\r\n })();\r\n\r\n // Only run this effect when the dialog is initialized, otherwise it will it creates undesirable side-effects when 'OK' button is clicked.\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n\r\n const dialogContainer = React.useRef<HTMLDivElement>(null);\r\n\r\n const readyToSave = React.useCallback(() => {\r\n const credentialsSet = !!userName && !!password;\r\n return (!!mapUrl && !!mapName)\r\n && !layerAttachPending\r\n && (!serverRequireCredentials || credentialsSet)\r\n && !invalidCredentialsProvided ;\r\n }, [userName, password, mapUrl, mapName, serverRequireCredentials, layerAttachPending, invalidCredentialsProvided]);\r\n\r\n const buttonCluster = React.useMemo(() => [\r\n { type: DialogButtonType.OK, onClick: handleOk, disabled: !readyToSave() },\r\n { type: DialogButtonType.Cancel, onClick: handleCancel },\r\n ], [readyToSave, handleCancel, handleOk]);\r\n\r\n const handleOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n if (event.key === SpecialKey.Enter) {\r\n if (readyToSave())\r\n handleOk();\r\n }\r\n }, [handleOk, readyToSave]);\r\n\r\n //\r\n // Monitors authentication method changes\r\n React.useEffect(() => {\r\n setServerRequireCredentials(layerAuthMethod === MapLayerAuthType.Basic || layerAuthMethod === MapLayerAuthType.EsriToken);\r\n }, [layerAuthMethod]);\r\n\r\n // Utility function to get warning message section\r\n function renderWarningMessage(): React.ReactNode {\r\n let node: React.ReactNode;\r\n let warningMessage: string|undefined;\r\n\r\n // Get the proper warning message\r\n if (invalidCredentialsProvided) {\r\n warningMessage = invalidCredentialsLabel;\r\n } else if (serverRequireCredentials && (!userName || !password)) {\r\n warningMessage = missingCredentialsLabel;\r\n }\r\n\r\n // Sometimes we want to add an extra node, such as a button\r\n let extraNode: React.ReactNode;\r\n if (warningMessage !== undefined) {\r\n return(\r\n <div className=\"map-layer-source-warnMessage\">\r\n <Icon className=\"map-layer-source-warnMessage-icon\" iconSpec=\"icon-status-warning\" />\r\n <span className=\"map-layer-source-warnMessage-label\">{warningMessage}</span >\r\n {extraNode}\r\n </div>);\r\n } else {\r\n return (<span className=\"map-layer-source-placeholder\">&nbsp;</span>);\r\n }\r\n return node;\r\n }\r\n\r\n return (\r\n <div ref={dialogContainer}>\r\n <Dialog\r\n className=\"map-layer-url-dialog\"\r\n title={dialogTitle}\r\n opened={true}\r\n resizable={true}\r\n movable={true}\r\n modal={true}\r\n buttonCluster={buttonCluster}\r\n onClose={handleCancel}\r\n onEscape={handleCancel}\r\n minHeight={120}\r\n maxWidth={600}\r\n titleStyle={{paddingLeft: \"10px\"}}\r\n footerStyle={{paddingBottom: \"10px\", paddingRight: \"10px\"}}\r\n trapFocus={false}\r\n >\r\n <div className=\"map-layer-url-dialog-content\">\r\n <div className=\"map-layer-source-url\">\r\n <span className=\"map-layer-source-label\">{typeLabel}</span>\r\n <Select\r\n className=\"map-layer-source-select\"\r\n options={mapTypes}\r\n value={mapType}\r\n disabled={props.layerRequiringCredentials !== undefined || props.mapLayerSourceToEdit !== undefined || layerAttachPending}\r\n onChange={handleMapTypeSelection}\r\n size=\"small\"/>\r\n <span className=\"map-layer-source-label\">{nameLabel}</span>\r\n <Input className=\"map-layer-source-input\" placeholder={nameInputPlaceHolder} onChange={onNameChange} value={mapName} disabled={props.layerRequiringCredentials !== undefined || layerAttachPending} />\r\n <span className=\"map-layer-source-label\">{urlLabel}</span>\r\n <Input className=\"map-layer-source-input\" placeholder={urlInputPlaceHolder} onKeyPress={handleOnKeyDown} onChange={onUrlChange} disabled={props.mapLayerSourceToEdit !== undefined || layerAttachPending} value={mapUrl} />\r\n {serverRequireCredentials\r\n && (layerAuthMethod === MapLayerAuthType.Basic || layerAuthMethod === MapLayerAuthType.EsriToken)\r\n && props.mapLayerSourceToEdit === undefined &&\r\n <>\r\n <span className=\"map-layer-source-label\">{userNameLabel}</span>\r\n <LabeledInput className=\"map-layer-source-input\"\r\n displayStyle=\"inline\"\r\n placeholder={serverRequireCredentials ? userNameRequiredLabel : userNameLabel}\r\n status={!userName && serverRequireCredentials ? \"warning\" : undefined}\r\n disabled={layerAttachPending}\r\n onChange={onUsernameChange}\r\n size=\"small\" />\r\n\r\n <span className=\"map-layer-source-label\">{passwordLabel}</span>\r\n <LabeledInput className=\"map-layer-source-input\"\r\n\r\n displayStyle=\"inline\"\r\n type=\"password\" placeholder={serverRequireCredentials ? passwordRequiredLabel : passwordLabel}\r\n status={!password && serverRequireCredentials ? \"warning\" : undefined}\r\n disabled={layerAttachPending}\r\n onChange={onPasswordChange}\r\n onKeyPress={handleOnKeyDown}\r\n size=\"small\" />\r\n </>\r\n }\r\n\r\n {/* Store settings options, not shown when editing a layer */}\r\n {isSettingsStorageAvailable && <div title={settingsStorageDisabled ? noSaveSettingsWarning : \"\"}>\r\n <Radio disabled={settingsStorageDisabled}\r\n name=\"settingsStorage\" value=\"iTwin\"\r\n label={iTwinSettingsLabel} checked={settingsStorage === \"iTwin\"}\r\n onChange={onRadioChange} />\r\n <Radio disabled={settingsStorageDisabled}\r\n name=\"settingsStorage\" value=\"Model\"\r\n label={modelSettingsLabel} checked={settingsStorage === \"Model\"}\r\n onChange={onRadioChange} />\r\n </div>}\r\n </div>\r\n </div>\r\n\r\n {/* Warning message */}\r\n {renderWarningMessage()}\r\n\r\n {/* Progress bar */}\r\n {(layerAttachPending) &&\r\n <div className=\"map-layer-source-progressBar\">\r\n <ProgressLinear indeterminate />\r\n </div>\r\n }\r\n </Dialog>\r\n </div >\r\n );\r\n}\r\n"]}
1
+ {"version":3,"file":"MapUrlDialog.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,8BAA8B;AAE9B,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB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,YAAY,EAAC,QAAQ,EACrB,IAAI,EAAC,UAAU,EAAC,WAAW,EAAE,wBAAwB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,aAAa,EAC7F,MAAM,EAAE,CAAC,QAAQ,IAAI,wBAAwB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EACrE,QAAQ,EAAE,kBAAkB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,eAAe,EAC3B,IAAI,EAAC,OAAO,GAAG,CAChB;oBAIJ,0BAA0B;wBAC3B,6BAAK,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,IAC7D,gBAAgB;4BACjB;gCACE,oBAAC,KAAK,IAAC,QAAQ,EAAE,uBAAuB,EACtC,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAC,OAAO,EACpC,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,EAC/D,QAAQ,EAAE,aAAa,GAAI;gCAC7B,oBAAC,KAAK,IAAC,QAAQ,EAAE,uBAAuB,EACtC,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAC,OAAO,EACpC,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,EAC/D,QAAQ,EAAE,aAAa,GAAI,CACzB,CACF,CACF,CACF;YAGL,oBAAoB,EAAE;YAGtB,CAAC,kBAAkB,CAAC;gBACnB,6BAAK,SAAS,EAAC,8BAA8B;oBAC3C,oBAAC,cAAc,IAAC,aAAa,SAAG,CAC5B,CAED,CACJ,CACR,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n// cSpell:ignore Modeless WMTS\r\n\r\nimport { DialogButtonType, SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { ModalDialogManager } from \"@itwin/appui-react\";\r\nimport { Input, LabeledInput, ProgressLinear, Radio, Select, SelectOption } from \"@itwin/itwinui-react\";\r\nimport { ImageMapLayerProps } from \"@itwin/core-common\";\r\nimport {\r\n IModelApp, MapLayerAuthType, MapLayerImageryProviderStatus, MapLayerSource,\r\n MapLayerSourceStatus, MapLayerSourceValidation, NotifyMessageDetails, OutputMessagePriority, ScreenViewport,\r\n} from \"@itwin/core-frontend\";\r\nimport { Dialog, Icon } from \"@itwin/core-react\";\r\nimport * as React from \"react\";\r\nimport { MapLayerPreferences } from \"../../MapLayerPreferences\";\r\nimport { MapLayersUI } from \"../../mapLayers\";\r\nimport { MapTypesOptions } from \"../Interfaces\";\r\nimport \"./MapUrlDialog.scss\";\r\nimport { Guid } from \"@itwin/core-bentley\";\r\n\r\nexport const MAP_TYPES = {\r\n wms: \"WMS\",\r\n arcGis: \"ArcGIS\",\r\n wmts: \"WMTS\",\r\n tileUrl: \"TileURL\",\r\n};\r\n\r\ninterface MapUrlDialogProps {\r\n activeViewport?: ScreenViewport;\r\n isOverlay: boolean;\r\n onOkResult: () => void;\r\n onCancelResult?: () => void;\r\n mapTypesOptions?: MapTypesOptions;\r\n\r\n // An optional layer definition can be provide to enable the edit mode\r\n layerRequiringCredentials?: ImageMapLayerProps;\r\n\r\n mapLayerSourceToEdit?: MapLayerSource;\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function MapUrlDialog(props: MapUrlDialogProps) {\r\n const { isOverlay, onOkResult, mapTypesOptions } = props;\r\n\r\n const getMapUrlFromProps = React.useCallback(() => {\r\n if (props.mapLayerSourceToEdit) {\r\n return props.mapLayerSourceToEdit.url;\r\n } else if (props.layerRequiringCredentials?.url) {\r\n return props.layerRequiringCredentials.url;\r\n }\r\n return \"\";\r\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\r\n\r\n const getMapNameFromProps = React.useCallback(() => {\r\n if (props.mapLayerSourceToEdit) {\r\n return props.mapLayerSourceToEdit.name;\r\n } else if (props.layerRequiringCredentials?.name) {\r\n return props.layerRequiringCredentials.name;\r\n }\r\n return \"\";\r\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\r\n\r\n const getFormatFromProps = React.useCallback(() => {\r\n if (props.mapLayerSourceToEdit) {\r\n return props.mapLayerSourceToEdit.formatId;\r\n } else if (props.layerRequiringCredentials?.formatId) {\r\n return props.layerRequiringCredentials.formatId;\r\n }\r\n return undefined;\r\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\r\n\r\n const [dialogTitle] = React.useState(MapLayersUI.localization.getLocalizedString(props.layerRequiringCredentials || props.mapLayerSourceToEdit ? \"mapLayers:CustomAttach.EditCustomLayer\" : \"mapLayers:CustomAttach.AttachCustomLayer\"));\r\n const [typeLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Type\"));\r\n const [nameLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Name\"));\r\n const [nameInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NameInputPlaceHolder\"));\r\n const [urlLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.URL\"));\r\n const [urlInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.UrlInputPlaceHolder\"));\r\n const [iTwinSettingsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnITwinSettings\"));\r\n const [modelSettingsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnModelSettings\"));\r\n const [missingCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.MissingCredentials\"));\r\n const [invalidCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCredentials\"));\r\n const [serverRequireCredentials, setServerRequireCredentials] = React.useState(false);\r\n const [invalidCredentialsProvided, setInvalidCredentialsProvided] = React.useState(false);\r\n const [layerAttachPending, setLayerAttachPending] = React.useState(false);\r\n const [mapUrl, setMapUrl] = React.useState(getMapUrlFromProps());\r\n const [mapName, setMapName] = React.useState(getMapNameFromProps());\r\n const [userName, setUserName] = React.useState(\"\");\r\n const [password, setPassword] = React.useState(\"\");\r\n const [noSaveSettingsWarning] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NoSaveSettingsWarning\"));\r\n const [passwordLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Password\"));\r\n const [passwordRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.PasswordRequired\"));\r\n const [userNameLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Username\"));\r\n const [userNameRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.UsernameRequired\"));\r\n const [settingsStorage, setSettingsStorageRadio] = React.useState(\"iTwin\");\r\n const [layerAuthMethod, setLayerAuthMethod] = React.useState(MapLayerAuthType.None);\r\n\r\n const [mapType, setMapType] = React.useState(getFormatFromProps() ?? MAP_TYPES.arcGis);\r\n\r\n // 'isMounted' is used to prevent any async operation once the hook has been\r\n // unloaded. Otherwise we get a 'Can't perform a React state update on an unmounted component.' warning in the console.\r\n const isMounted = React.useRef(false);\r\n React.useEffect(() => {\r\n isMounted.current = true;\r\n return () => {\r\n isMounted.current = false;\r\n };\r\n }, []);\r\n\r\n const [mapTypes] = React.useState((): SelectOption<string>[] => {\r\n const types = [\r\n { value: MAP_TYPES.arcGis, label: MAP_TYPES.arcGis },\r\n { value: MAP_TYPES.wms, label: MAP_TYPES.wms },\r\n { value: MAP_TYPES.wmts, label: MAP_TYPES.wmts },\r\n ];\r\n if (mapTypesOptions?.supportTileUrl)\r\n types.push({ value: MAP_TYPES.tileUrl, label: MAP_TYPES.tileUrl });\r\n return types;\r\n });\r\n\r\n const [isSettingsStorageAvailable] = React.useState(MapLayersUI.iTwinConfig && props?.activeViewport?.iModel?.iTwinId);\r\n const [hasImodelContext] = React.useState (\r\n props?.activeViewport?.iModel?.iTwinId !== undefined\r\n && props.activeViewport.iModel.iTwinId !== Guid.empty\r\n && props?.activeViewport?.iModel?.iModelId !== undefined\r\n && props?.activeViewport.iModel.iModelId !== Guid.empty);\r\n\r\n // Even though the settings storage is available,\r\n // we don't always want to enable it in the UI.\r\n const [settingsStorageDisabled] = React.useState(!isSettingsStorageAvailable || props.mapLayerSourceToEdit !== undefined || props.layerRequiringCredentials !== undefined);\r\n\r\n const [layerRequiringCredentialsIdx] = React.useState((): number | undefined => {\r\n if (props.layerRequiringCredentials === undefined || !props.layerRequiringCredentials.name || !props.layerRequiringCredentials.url) {\r\n return undefined;\r\n }\r\n\r\n const indexInDisplayStyle = props.activeViewport?.displayStyle.findMapLayerIndexByNameAndSource(props.layerRequiringCredentials.name, props.layerRequiringCredentials.url, isOverlay);\r\n if (indexInDisplayStyle === undefined || indexInDisplayStyle < 0) {\r\n return undefined;\r\n } else {\r\n return indexInDisplayStyle;\r\n }\r\n });\r\n\r\n // Update warning message based on the dialog state and server response\r\n const handleMapTypeSelection = React.useCallback((newValue: string) => {\r\n setMapType(newValue);\r\n\r\n // Reset few states\r\n if (invalidCredentialsProvided)\r\n setInvalidCredentialsProvided(false);\r\n\r\n if (layerAuthMethod !== MapLayerAuthType.None) {\r\n setLayerAuthMethod(MapLayerAuthType.None);\r\n }\r\n\r\n }, [invalidCredentialsProvided, layerAuthMethod]);\r\n\r\n const handleCancel = React.useCallback(() => {\r\n if (props.onCancelResult) {\r\n props.onCancelResult();\r\n return;\r\n }\r\n ModalDialogManager.closeDialog();\r\n }, [props]);\r\n\r\n const onUsernameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setUserName(event.target.value);\r\n if (invalidCredentialsProvided)\r\n setInvalidCredentialsProvided(false);\r\n }, [setUserName, invalidCredentialsProvided, setInvalidCredentialsProvided]);\r\n\r\n const onPasswordChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setPassword(event.target.value);\r\n if (invalidCredentialsProvided)\r\n setInvalidCredentialsProvided(false);\r\n }, [setPassword, invalidCredentialsProvided, setInvalidCredentialsProvided]);\r\n\r\n // return true if authorization is needed\r\n const updateAuthState = React.useCallback((sourceValidation: MapLayerSourceValidation) => {\r\n const sourceRequireAuth = (sourceValidation.status === MapLayerSourceStatus.RequireAuth);\r\n const invalidCredentials = (sourceValidation.status === MapLayerSourceStatus.InvalidCredentials);\r\n if (sourceRequireAuth && sourceValidation.authInfo?.authMethod !== undefined) {\r\n setLayerAuthMethod(sourceValidation.authInfo?.authMethod);\r\n }\r\n if (invalidCredentials) {\r\n setInvalidCredentialsProvided(true);\r\n } else if (invalidCredentialsProvided) {\r\n setInvalidCredentialsProvided(false); // flag reset\r\n }\r\n\r\n return sourceRequireAuth || invalidCredentials;\r\n }, [invalidCredentialsProvided]);\r\n\r\n const updateAttachedLayer = React.useCallback(async (source: MapLayerSource, validation: MapLayerSourceValidation) => {\r\n const vp = props?.activeViewport;\r\n if (vp === undefined || source === undefined || layerRequiringCredentialsIdx === undefined) {\r\n const error = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachMissingViewOrSource\");\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return true;\r\n }\r\n\r\n // Layer is already attached,\r\n vp.displayStyle.changeMapLayerProps({\r\n subLayers: validation.subLayers,\r\n }, layerRequiringCredentialsIdx, isOverlay);\r\n vp.displayStyle.changeMapLayerCredentials(layerRequiringCredentialsIdx, isOverlay, source.userName, source.password);\r\n\r\n // Reset the provider's status\r\n const provider = vp.getMapLayerImageryProvider(layerRequiringCredentialsIdx, isOverlay);\r\n if (provider && provider.status !== MapLayerImageryProviderStatus.Valid) {\r\n provider.status = MapLayerImageryProviderStatus.Valid;\r\n }\r\n\r\n vp.invalidateRenderPlan();\r\n\r\n // This handler will close the layer source handler, and therefore the MapUrl dialog.\r\n // don't call it if the dialog needs to remains open.\r\n onOkResult();\r\n\r\n return true;\r\n }, [isOverlay, layerRequiringCredentialsIdx, onOkResult, props.activeViewport]);\r\n\r\n // Returns true if no further input is needed from end-user.\r\n const doAttach = React.useCallback(async (source: MapLayerSource, validation: MapLayerSourceValidation): Promise<boolean> => {\r\n const vp = props?.activeViewport;\r\n if (vp === undefined || source === undefined) {\r\n const error = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachMissingViewOrSource\");\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return true;\r\n }\r\n\r\n // Update service settings if storage is available and we are not prompting user for credentials\r\n if (!settingsStorageDisabled && !props.layerRequiringCredentials) {\r\n \tconst storeOnIModel = (hasImodelContext ? \"Model\" === settingsStorage : undefined);\r\n if (vp.iModel.iTwinId && !(await MapLayerPreferences.storeSource(source, vp.iModel.iTwinId, vp.iModel.iModelId, storeOnIModel))) {\r\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerPreferencesStoreFailed\");\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msgError));\r\n\t }\r\n }\r\n const layerSettings = source.toLayerSettings(validation.subLayers);\r\n if (layerSettings) {\r\n vp.displayStyle.attachMapLayerSettings(layerSettings, isOverlay, undefined);\r\n\r\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttached\", { sourceName: source.name, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));\r\n } else {\r\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSettingsConversionError\");\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.MapLayerAttachError\", { error: msgError, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n }\r\n\r\n vp.invalidateRenderPlan();\r\n\r\n // This handler will close the layer source handler, and therefore the MapUrl dialog.\r\n // don't call it if the dialog needs to remains open.\r\n onOkResult();\r\n\r\n return true;\r\n }, [hasImodelContext, isOverlay, onOkResult, props?.activeViewport, props.layerRequiringCredentials, settingsStorage, settingsStorageDisabled]);\r\n\r\n // Validate the layer source and attempt to attach (or update) the layer.\r\n // Returns true if no further input is needed from end-user (i.e. close the dialog)\r\n const attemptAttachSource = React.useCallback(async (source: MapLayerSource): Promise<boolean> => {\r\n try {\r\n const validation = await source.validateSource(true);\r\n\r\n if (validation.status === MapLayerSourceStatus.Valid) {\r\n if (layerRequiringCredentialsIdx === undefined ) {\r\n return await doAttach(source, validation);\r\n } else {\r\n return await updateAttachedLayer(source, validation);\r\n }\r\n } else if (updateAuthState(validation)) {\r\n return false;\r\n } else {\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ValidationError\");\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, `${msg} ${source.url}`));\r\n return true;\r\n }\r\n return false;\r\n } catch (error) {\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return true;\r\n }\r\n\r\n }, [updateAuthState, doAttach, layerRequiringCredentialsIdx, updateAttachedLayer]);\r\n\r\n const onNameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setMapName(event.target.value);\r\n }, [setMapName]);\r\n\r\n const onRadioChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setSettingsStorageRadio(event.target.value);\r\n }, [setSettingsStorageRadio]);\r\n\r\n const onUrlChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setMapUrl(event.target.value);\r\n }, [setMapUrl]);\r\n\r\n const createSource = React.useCallback(() => {\r\n let source: MapLayerSource | undefined;\r\n if (mapUrl && mapName) {\r\n source = MapLayerSource.fromJSON({\r\n url: mapUrl,\r\n name: mapName,\r\n formatId: mapType,\r\n userName: userName||undefined, // When there is no value, empty string is always returned, in this case force it to undefined,\r\n password: password||undefined});\r\n }\r\n return source;\r\n }, [mapName, mapType, mapUrl, password, userName]);\r\n\r\n const handleOk = React.useCallback(() => {\r\n const source = createSource();\r\n if (source === undefined || props.mapLayerSourceToEdit) {\r\n\r\n ModalDialogManager.closeDialog();\r\n\r\n if (source === undefined) {\r\n // Close the dialog and inform end user something went wrong.\r\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSourceCreationFailed\");\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error: msgError, sourceUrl: mapUrl });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return;\r\n }\r\n\r\n // Simply change the source definition in the setting service\r\n if (props.mapLayerSourceToEdit !== undefined) {\r\n const vp = props.activeViewport;\r\n void (async () => {\r\n if (isSettingsStorageAvailable && vp?.iModel?.iTwinId) {\r\n try {\r\n await MapLayerPreferences.replaceSource(props.mapLayerSourceToEdit!, source, vp.iModel.iTwinId, vp?.iModel.iModelId);\r\n } catch (err: any) {\r\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerEditError\", { layerName: props.mapLayerSourceToEdit?.name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\r\n return;\r\n }\r\n }\r\n })();\r\n return;\r\n }\r\n }\r\n\r\n setLayerAttachPending(true);\r\n\r\n // Attach source asynchronously.\r\n void (async () => {\r\n try {\r\n const closeDialog = await attemptAttachSource(source);\r\n if (isMounted.current) {\r\n setLayerAttachPending(false);\r\n }\r\n\r\n // In theory the modal dialog should always get closed by the parent\r\n // AttachLayerPanel's 'onOkResult' handler. We close it here just in case.\r\n if (closeDialog) {\r\n ModalDialogManager.closeDialog();\r\n }\r\n } catch (_error) {\r\n ModalDialogManager.closeDialog();\r\n }\r\n })();\r\n\r\n }, [createSource, props.mapLayerSourceToEdit, props.activeViewport, mapUrl, isSettingsStorageAvailable, attemptAttachSource]);\r\n\r\n // The first time the dialog is loaded and we already know the layer requires auth. (i.e ImageryProvider already made an attempt)\r\n // makes a request to discover the authentification types and adjust UI accordingly (i.e. username/password fields, Oauth popup)\r\n // Without this effect, user would have to manually click the 'OK' button in order to trigger the layer connection.\r\n React.useEffect(() => {\r\n // Attach source asynchronously.\r\n void (async () => {\r\n if (props.layerRequiringCredentials?.url !== undefined && props.layerRequiringCredentials?.name !== undefined) {\r\n try {\r\n const source = MapLayerSource.fromJSON({url: props.layerRequiringCredentials.url, name: props.layerRequiringCredentials.name,formatId: props.layerRequiringCredentials.formatId});\r\n if (source !== undefined) {\r\n setLayerAttachPending(true);\r\n const validation = await source.validateSource(true);\r\n if (isMounted.current) {\r\n setLayerAttachPending(false);\r\n }\r\n updateAuthState(validation);\r\n }\r\n } catch (_error) {}\r\n }\r\n })();\r\n\r\n // Only run this effect when the dialog is initialized, otherwise it will it creates undesirable side-effects when 'OK' button is clicked.\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n\r\n const dialogContainer = React.useRef<HTMLDivElement>(null);\r\n\r\n const readyToSave = React.useCallback(() => {\r\n const credentialsSet = !!userName && !!password;\r\n return (!!mapUrl && !!mapName)\r\n && !layerAttachPending\r\n && (!serverRequireCredentials || credentialsSet)\r\n && !invalidCredentialsProvided ;\r\n }, [userName, password, mapUrl, mapName, serverRequireCredentials, layerAttachPending, invalidCredentialsProvided]);\r\n\r\n const buttonCluster = React.useMemo(() => [\r\n { type: DialogButtonType.OK, onClick: handleOk, disabled: !readyToSave() },\r\n { type: DialogButtonType.Cancel, onClick: handleCancel },\r\n ], [readyToSave, handleCancel, handleOk]);\r\n\r\n const handleOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n if (event.key === SpecialKey.Enter) {\r\n if (readyToSave())\r\n handleOk();\r\n }\r\n }, [handleOk, readyToSave]);\r\n\r\n //\r\n // Monitors authentication method changes\r\n React.useEffect(() => {\r\n setServerRequireCredentials(layerAuthMethod === MapLayerAuthType.Basic || layerAuthMethod === MapLayerAuthType.EsriToken);\r\n }, [layerAuthMethod]);\r\n\r\n // Utility function to get warning message section\r\n function renderWarningMessage(): React.ReactNode {\r\n let node: React.ReactNode;\r\n let warningMessage: string|undefined;\r\n\r\n // Get the proper warning message\r\n if (invalidCredentialsProvided) {\r\n warningMessage = invalidCredentialsLabel;\r\n } else if (serverRequireCredentials && (!userName || !password)) {\r\n warningMessage = missingCredentialsLabel;\r\n }\r\n\r\n // Sometimes we want to add an extra node, such as a button\r\n let extraNode: React.ReactNode;\r\n if (warningMessage !== undefined) {\r\n return(\r\n <div className=\"map-layer-source-warnMessage\">\r\n <Icon className=\"map-layer-source-warnMessage-icon\" iconSpec=\"icon-status-warning\" />\r\n <span className=\"map-layer-source-warnMessage-label\">{warningMessage}</span >\r\n {extraNode}\r\n </div>);\r\n } else {\r\n return (<span className=\"map-layer-source-placeholder\">&nbsp;</span>);\r\n }\r\n return node;\r\n }\r\n\r\n return (\r\n <div ref={dialogContainer}>\r\n <Dialog\r\n className=\"map-layer-url-dialog\"\r\n title={dialogTitle}\r\n opened={true}\r\n resizable={true}\r\n movable={true}\r\n modal={true}\r\n buttonCluster={buttonCluster}\r\n onClose={handleCancel}\r\n onEscape={handleCancel}\r\n minHeight={120}\r\n maxWidth={600}\r\n titleStyle={{paddingLeft: \"10px\"}}\r\n footerStyle={{paddingBottom: \"10px\", paddingRight: \"10px\"}}\r\n trapFocus={false}\r\n >\r\n <div className=\"map-layer-url-dialog-content\">\r\n <div className=\"map-layer-source-url\">\r\n <span className=\"map-layer-source-label\">{typeLabel}</span>\r\n <Select\r\n className=\"map-layer-source-select\"\r\n options={mapTypes}\r\n value={mapType}\r\n disabled={props.layerRequiringCredentials !== undefined || props.mapLayerSourceToEdit !== undefined || layerAttachPending}\r\n onChange={handleMapTypeSelection}\r\n size=\"small\"/>\r\n <span className=\"map-layer-source-label\">{nameLabel}</span>\r\n <Input className=\"map-layer-source-input\" placeholder={nameInputPlaceHolder} onChange={onNameChange} value={mapName} disabled={props.layerRequiringCredentials !== undefined || layerAttachPending} />\r\n <span className=\"map-layer-source-label\">{urlLabel}</span>\r\n <Input className=\"map-layer-source-input\" placeholder={urlInputPlaceHolder} onKeyPress={handleOnKeyDown} onChange={onUrlChange} disabled={props.mapLayerSourceToEdit !== undefined || layerAttachPending} value={mapUrl} />\r\n {serverRequireCredentials\r\n && (layerAuthMethod === MapLayerAuthType.Basic || layerAuthMethod === MapLayerAuthType.EsriToken)\r\n && props.mapLayerSourceToEdit === undefined &&\r\n <>\r\n <span className=\"map-layer-source-label\">{userNameLabel}</span>\r\n <LabeledInput className=\"map-layer-source-input\"\r\n displayStyle=\"inline\"\r\n placeholder={serverRequireCredentials ? userNameRequiredLabel : userNameLabel}\r\n status={!userName && serverRequireCredentials ? \"warning\" : undefined}\r\n disabled={layerAttachPending}\r\n onChange={onUsernameChange}\r\n size=\"small\" />\r\n\r\n <span className=\"map-layer-source-label\">{passwordLabel}</span>\r\n <LabeledInput className=\"map-layer-source-input\"\r\n\r\n displayStyle=\"inline\"\r\n type=\"password\" placeholder={serverRequireCredentials ? passwordRequiredLabel : passwordLabel}\r\n status={!password && serverRequireCredentials ? \"warning\" : undefined}\r\n disabled={layerAttachPending}\r\n onChange={onPasswordChange}\r\n onKeyPress={handleOnKeyDown}\r\n size=\"small\" />\r\n </>\r\n }\r\n\r\n {/* Store settings options, not shown when editing a layer */}\r\n {isSettingsStorageAvailable &&\r\n <div title={settingsStorageDisabled ? noSaveSettingsWarning : \"\"}>\r\n {hasImodelContext &&\r\n <div>\r\n <Radio disabled={settingsStorageDisabled}\r\n name=\"settingsStorage\" value=\"iTwin\"\r\n label={iTwinSettingsLabel} checked={settingsStorage === \"iTwin\"}\r\n onChange={onRadioChange} />\r\n <Radio disabled={settingsStorageDisabled}\r\n name=\"settingsStorage\" value=\"Model\"\r\n label={modelSettingsLabel} checked={settingsStorage === \"Model\"}\r\n onChange={onRadioChange} />\r\n </div> }\r\n </div>}\r\n </div>\r\n </div>\r\n\r\n {/* Warning message */}\r\n {renderWarningMessage()}\r\n\r\n {/* Progress bar */}\r\n {(layerAttachPending) &&\r\n <div className=\"map-layer-source-progressBar\">\r\n <ProgressLinear indeterminate />\r\n </div>\r\n }\r\n </Dialog>\r\n </div >\r\n );\r\n}\r\n"]}