@itwin/map-layers 3.2.0-dev.6 → 3.2.0-dev.60
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.
- package/CHANGELOG.md +45 -1
- package/lib/cjs/mapLayers.d.ts +16 -1
- package/lib/cjs/mapLayers.d.ts.map +1 -1
- package/lib/cjs/mapLayers.js +25 -10
- package/lib/cjs/mapLayers.js.map +1 -1
- package/lib/cjs/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/AttachLayerPopupButton.js +53 -37
- package/lib/cjs/ui/widget/AttachLayerPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/BasemapPanel.js +2 -2
- package/lib/cjs/ui/widget/BasemapPanel.js.map +1 -1
- package/lib/cjs/ui/widget/BasemapPanel.scss +5 -20
- package/lib/cjs/ui/widget/MapLayerDroppable.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerDroppable.js +2 -2
- package/lib/cjs/ui/widget/MapLayerDroppable.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerManager.scss +11 -149
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.js +6 -5
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js +2 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.scss +3 -13
- package/lib/cjs/ui/widget/MapManagerSettings.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapManagerSettings.js +1 -1
- package/lib/cjs/ui/widget/MapManagerSettings.js.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.js +4 -1
- package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SubLayersPopupButton.js +2 -1
- package/lib/cjs/ui/widget/SubLayersPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersTree.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SubLayersTree.js +5 -5
- package/lib/cjs/ui/widget/SubLayersTree.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersTree.scss +6 -0
- package/lib/cjs/ui/widget/TransparencyPopupButton.js +1 -1
- package/lib/cjs/ui/widget/TransparencyPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/TransparencyPopupButton.scss +8 -28
- package/lib/esm/mapLayers.d.ts +16 -1
- package/lib/esm/mapLayers.d.ts.map +1 -1
- package/lib/esm/mapLayers.js +25 -10
- package/lib/esm/mapLayers.js.map +1 -1
- package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/AttachLayerPopupButton.js +53 -37
- package/lib/esm/ui/widget/AttachLayerPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/BasemapPanel.js +3 -3
- package/lib/esm/ui/widget/BasemapPanel.js.map +1 -1
- package/lib/esm/ui/widget/BasemapPanel.scss +5 -20
- package/lib/esm/ui/widget/MapLayerDroppable.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerDroppable.js +2 -2
- package/lib/esm/ui/widget/MapLayerDroppable.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerManager.scss +11 -149
- package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsMenu.js +7 -6
- package/lib/esm/ui/widget/MapLayerSettingsMenu.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js +2 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.scss +3 -13
- package/lib/esm/ui/widget/MapManagerSettings.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapManagerSettings.js +1 -1
- package/lib/esm/ui/widget/MapManagerSettings.js.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.js +4 -1
- package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/SubLayersPopupButton.js +2 -1
- package/lib/esm/ui/widget/SubLayersPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersTree.d.ts.map +1 -1
- package/lib/esm/ui/widget/SubLayersTree.js +7 -7
- package/lib/esm/ui/widget/SubLayersTree.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersTree.scss +6 -0
- package/lib/esm/ui/widget/TransparencyPopupButton.js +2 -2
- package/lib/esm/ui/widget/TransparencyPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/TransparencyPopupButton.scss +8 -28
- package/package.json +28 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapManagerSettings.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapManagerSettings.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,2CAA2C;;;AAE3C,+BAA+B;AAC/B,kDAAgD;AAChD,wDAAkE;AAClE,oDAAkK;AAClK,uDAAwD;AACxD,qCAAmC;AACnC,wDAAkF;AAClF,4EAAqE;AACrE,+CAA8C;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,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CAAC;AACJ,CAAC;AAjND,gDAiNC","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
|
+
{"version":3,"file":"MapManagerSettings.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapManagerSettings.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,2CAA2C;;;AAE3C,+BAA+B;AAC/B,kDAAgD;AAChD,wDAAkE;AAClE,oDAAkK;AAClK,uDAAwD;AACxD,qCAAmC;AACnC,wDAAkF;AAClF,4EAAqE;AACrE,+CAA8C;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,gCAAkB,CAAC,QAAQ,IAAI,qBAAqB,CAAC,cAAc,CAAC,QAAQ,EAAE;QAC9H,IAAI,qBAAqB,CAAC,cAAc,CAAC,QAAQ,IAAI,oCAAsB,CAAC,aAAa,EAAE;YACzF,OAAO,gBAAgB,CAAC,SAAS,CAAC;SACnC;KAEF;IACD,OAAO,gBAAgB,CAAC,IAAI,CAAC;AAC/B,CAAC;AAED,SAAS,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E,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,4BAAY,IAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,GAAI;oBAElE,8BAAM,SAAS,EAAC,4BAA4B,IAAE,gBAAgB,CAAQ;oBACtE,oBAAC,6CAAmB,IAAC,QAAQ,EAAE,CAAC,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,QAAC,YAAY,EAAE,4BAAY,CAAC,iBAAiB,EAAE,QAAQ,EAAE,wBAAwB,EAAE,SAAS,EAAE,SAAS,GAAG;oBAE7L,8BAAM,SAAS,EAAC,4BAA4B,IAAE,iBAAiB,CAAQ;oBAEvE,oBAAC,sBAAM,IAAC,YAAY,EAAE,EAAC,QAAQ,EAAE,QAAQ,EAAC,EAAE,OAAO,EAAE,oBAAoB,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,2BAA2B,EAAE,IAAI,EAAC,OAAO,GAAG;oBAE3L,8BAAM,SAAS,EAAC,4BAA4B,IAAE,iBAAiB,CAAQ;oBACvE,oBAAC,wBAAW,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;AAlND,gDAkNC","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 {/* elevation correction component: 'popoverProps' is needed here otherwise selecting an option closes the menu popup.*/}\r\n <Select popoverProps={{appendTo: \"parent\"}} 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 +1 @@
|
|
|
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,
|
|
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,eAmfpD"}
|
|
@@ -277,6 +277,7 @@ function MapUrlDialog(props) {
|
|
|
277
277
|
const source = createSource();
|
|
278
278
|
if (source === undefined || props.mapLayerSourceToEdit) {
|
|
279
279
|
appui_react_1.ModalDialogManager.closeDialog();
|
|
280
|
+
onOkResult();
|
|
280
281
|
if (source === undefined) {
|
|
281
282
|
// Close the dialog and inform end user something went wrong.
|
|
282
283
|
const msgError = mapLayers_1.MapLayersUI.localization.getLocalizedString("mapLayers:Messages.MapLayerLayerSourceCreationFailed");
|
|
@@ -315,13 +316,15 @@ function MapUrlDialog(props) {
|
|
|
315
316
|
// AttachLayerPanel's 'onOkResult' handler. We close it here just in case.
|
|
316
317
|
if (closeDialog) {
|
|
317
318
|
appui_react_1.ModalDialogManager.closeDialog();
|
|
319
|
+
onOkResult();
|
|
318
320
|
}
|
|
319
321
|
}
|
|
320
322
|
catch (_error) {
|
|
323
|
+
onOkResult();
|
|
321
324
|
appui_react_1.ModalDialogManager.closeDialog();
|
|
322
325
|
}
|
|
323
326
|
})();
|
|
324
|
-
}, [createSource, props.mapLayerSourceToEdit, props.activeViewport, mapUrl, isSettingsStorageAvailable, attemptAttachSource]);
|
|
327
|
+
}, [createSource, props.mapLayerSourceToEdit, props.activeViewport, onOkResult, mapUrl, isSettingsStorageAvailable, attemptAttachSource]);
|
|
325
328
|
// The first time the dialog is loaded and we already know the layer requires auth. (i.e ImageryProvider already made an attempt)
|
|
326
329
|
// makes a request to discover the authentification types and adjust UI accordingly (i.e. username/password fields, Oauth popup)
|
|
327
330
|
// Without this effect, user would have to manually click the 'OK' button in order to trigger the layer connection.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapUrlDialog.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,8BAA8B;;;AAE9B,0DAAqE;AACrE,oDAAwD;AACxD,wDAAwG;AAExG,wDAG8B;AAC9B,kDAAiD;AACjD,+BAA+B;AAC/B,mEAAgE;AAChE,+CAA8C;AAE9C,+BAA6B;AAC7B,sDAA2C;AAE9B,QAAA,SAAS,GAAG;IACvB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACnB,CAAC;AAeF,gEAAgE;AAChE,SAAgB,YAAY,CAAC,KAAwB;;IACnD,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAEzD,MAAM,kBAAkB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;;QAChD,IAAI,KAAK,CAAC,oBAAoB,EAAE;YAC9B,OAAO,KAAK,CAAC,oBAAoB,CAAC,GAAG,CAAC;SACvC;aAAM,IAAI,MAAA,KAAK,CAAC,yBAAyB,0CAAE,GAAG,EAAE;YAC/C,OAAO,KAAK,CAAC,yBAAyB,CAAC,GAAG,CAAC;SAC5C;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,EAAE,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAElE,MAAM,mBAAmB,GAAG,KAAK,C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,EAAC,wBAAwB,EAE9C,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,qBAAK,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,qBAAK,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,8BAAc,IAAC,aAAa,SAAG,CAC5B,CAED,CACJ,CACR,CAAC;AACJ,CAAC;AAhfD,oCAgfC","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\"> </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"]}
|
|
1
|
+
{"version":3,"file":"MapUrlDialog.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,8BAA8B;;;AAE9B,0DAAqE;AACrE,oDAAwD;AACxD,wDAAwG;AAExG,wDAG8B;AAC9B,kDAAiD;AACjD,+BAA+B;AAC/B,mEAAgE;AAChE,+CAA8C;AAE9C,+BAA6B;AAC7B,sDAA2C;AAE9B,QAAA,SAAS,GAAG;IACvB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACnB,CAAC;AAeF,gEAAgE;AAChE,SAAgB,YAAY,CAAC,KAAwB;;IACnD,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAEzD,MAAM,kBAAkB,GAAG,KAAK,CAAC,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,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,8BAAc,IAAC,aAAa,SAAG,CAC5B,CAED,CACJ,CACR,CAAC;AACJ,CAAC;AAnfD,oCAmfC","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 onOkResult();\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 onOkResult();\r\n }\r\n } catch (_error) {\r\n onOkResult();\r\n ModalDialogManager.closeDialog();\r\n }\r\n })();\r\n\r\n }, [createSource, props.mapLayerSourceToEdit, props.activeViewport, onOkResult, 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\"> </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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubLayersPopupButton.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersPopupButton.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"SubLayersPopupButton.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersPopupButton.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAMtD,gBAAgB;AAChB,MAAM,WAAW,yBAAyB;IACxC,gBAAgB,EAAE,qBAAqB,CAAC;IACxC,cAAc,EAAE,cAAc,CAAC;CAChC;AAED,gBAAgB;AAEhB,wBAAgB,oBAAoB,CAAC,EAAE,gBAAgB,EAAE,cAAc,EAAE,EAAE,yBAAyB,eA0CnG"}
|
|
@@ -10,6 +10,7 @@ const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
|
10
10
|
const core_react_1 = require("@itwin/core-react");
|
|
11
11
|
const SubLayersTree_1 = require("./SubLayersTree");
|
|
12
12
|
const mapLayers_1 = require("../../mapLayers");
|
|
13
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
13
14
|
/** @internal */
|
|
14
15
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
15
16
|
function SubLayersPopupButton({ mapLayerSettings, activeViewport }) {
|
|
@@ -29,7 +30,7 @@ function SubLayersPopupButton({ mapLayerSettings, activeViewport }) {
|
|
|
29
30
|
}, []);
|
|
30
31
|
const panelRef = (0, core_react_1.useOnOutsideClick)(onOutsideClick, isOutsideEvent);
|
|
31
32
|
return (React.createElement(React.Fragment, null,
|
|
32
|
-
React.createElement("
|
|
33
|
+
React.createElement(itwinui_react_1.Button, { size: "small", styleType: "borderless", ref: buttonRef, className: "map-manager-item-sub-layer-button", title: popupOpen ? hideSubLayersLabel : showSubLayersLabel, onClick: togglePopup },
|
|
33
34
|
React.createElement(core_react_1.WebFontIcon, { iconName: "icon-layers" })),
|
|
34
35
|
React.createElement(core_react_1.Popup, { isOpen: popupOpen, position: appui_abstract_1.RelativePosition.BottomRight, onClose: onOutsideClick, target: buttonRef.current },
|
|
35
36
|
React.createElement("div", { className: "map-transparency-popup-panel" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubLayersPopupButton.js","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersPopupButton.tsx"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,+BAA+B;AAE/B,0DAAyD;AACzD,kDAA6F;AAC7F,mDAAiD;AAEjD,+CAA8C;AAU9C,gBAAgB;AAChB,gEAAgE;AAChE,SAAgB,oBAAoB,CAAC,EAAE,gBAAgB,EAAE,cAAc,EAA6B;IAElG,MAAM,CAAC,kBAAkB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,uBAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAC,CAAC;IACrH,MAAM,CAAC,kBAAkB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,uBAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAC,CAAC;IACrH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAoB,IAAI,CAAC,CAAC;IAExD,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACzC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAC5C,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC,EAAE,EAAE,CAAC,CAAC;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---------------------------------------------------------------------------------------------\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\nimport * as React from \"react\";\r\nimport { ScreenViewport } from \"@itwin/core-frontend\";\r\nimport { RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { OutsideClickEvent, Popup, useOnOutsideClick, WebFontIcon } from \"@itwin/core-react\";\r\nimport { SubLayersPanel } from \"./SubLayersTree\";\r\nimport { StyleMapLayerSettings } from \"../Interfaces\";\r\nimport { MapLayersUI } from \"../../mapLayers\";\r\nimport { Button } from \"@itwin/itwinui-react\";\r\n\r\n// cSpell:ignore droppable Sublayer\r\n\r\n/** @internal */\r\nexport interface SubLayersPopupButtonProps {\r\n mapLayerSettings: StyleMapLayerSettings;\r\n activeViewport: ScreenViewport;\r\n}\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function SubLayersPopupButton({ mapLayerSettings, activeViewport }: SubLayersPopupButtonProps) {\r\n\r\n const [showSubLayersLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:SubLayers.Show\"));\r\n const [hideSubLayersLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:SubLayers.Hide\"));\r\n const [popupOpen, setPopupOpen] = React.useState(false);\r\n const buttonRef = React.useRef<HTMLButtonElement>(null);\r\n\r\n const togglePopup = React.useCallback(() => {\r\n setPopupOpen(!popupOpen);\r\n }, [popupOpen]);\r\n\r\n const onOutsideClick = React.useCallback(() => {\r\n setPopupOpen(false);\r\n }, []);\r\n\r\n const isOutsideEvent = React.useCallback((e: OutsideClickEvent) => {\r\n // if clicking on button that open panel - don't trigger outside click processing\r\n return !!buttonRef.current && (e.target instanceof Node) && !buttonRef.current.contains(e.target);\r\n }, []);\r\n\r\n const panelRef = useOnOutsideClick<HTMLDivElement>(onOutsideClick, isOutsideEvent);\r\n\r\n return (\r\n <>\r\n <Button size=\"small\" styleType=\"borderless\" ref={buttonRef} className=\"map-manager-item-sub-layer-button\" title={popupOpen ? hideSubLayersLabel : showSubLayersLabel}\r\n onClick={togglePopup}>\r\n <WebFontIcon iconName=\"icon-layers\" />\r\n </Button>\r\n <Popup\r\n isOpen={popupOpen}\r\n position={RelativePosition.BottomRight}\r\n onClose={onOutsideClick}\r\n target={buttonRef.current}\r\n >\r\n <div className=\"map-transparency-popup-panel\">\r\n <div ref={panelRef} className=\"map-manager-sublayer-panel\">\r\n <SubLayersPanel mapLayer={mapLayerSettings} viewport={activeViewport} />\r\n </div>\r\n </div>\r\n </Popup >\r\n </>\r\n );\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubLayersTree.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersTree.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAa,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"SubLayersTree.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersTree.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAa,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAIjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,sBAAsB,CAAC;AAuB9B,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,qBAAqB,CAAC;IAAC,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAA;CAAE,eAW/H;AAoBD;;;GAGG;AAEH,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,qBAAqB,CAAA;CAAE,eAkGvE"}
|
|
@@ -12,7 +12,6 @@ const core_frontend_1 = require("@itwin/core-frontend");
|
|
|
12
12
|
const core_react_1 = require("@itwin/core-react");
|
|
13
13
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
14
14
|
const React = require("react");
|
|
15
|
-
const react_resize_detector_1 = require("react-resize-detector");
|
|
16
15
|
const SubLayersDataProvider_1 = require("./SubLayersDataProvider");
|
|
17
16
|
require("./SubLayersTree.scss");
|
|
18
17
|
const mapLayers_1 = require("../../mapLayers");
|
|
@@ -102,16 +101,17 @@ function SubLayersTree(props) {
|
|
|
102
101
|
const handleFilterTextChanged = React.useCallback((event) => {
|
|
103
102
|
setLayerFilterString(event.target.value);
|
|
104
103
|
}, []);
|
|
105
|
-
const
|
|
104
|
+
const [divRef, divElement] = (0, core_react_1.useRefState)();
|
|
105
|
+
const [width, height] = (0, core_react_1.useLayoutResizeObserver)(divElement !== null && divElement !== void 0 ? divElement : null);
|
|
106
106
|
return React.createElement(React.Fragment, null,
|
|
107
107
|
React.createElement("div", { className: "map-manager-sublayer-tree" },
|
|
108
108
|
React.createElement(Toolbar, { searchField: React.createElement(itwinui_react_1.Input, { type: "text", className: "map-manager-source-list-filter", placeholder: placeholderLabel, value: layerFilterString, onChange: handleFilterTextChanged, size: "small" }) }, ((_a = mapLayer.provider) === null || _a === void 0 ? void 0 : _a.mutualExclusiveSubLayer) ? undefined : [
|
|
109
|
-
React.createElement("
|
|
109
|
+
React.createElement(itwinui_react_1.Button, { size: "small", styleType: "borderless", key: "show-all-btn", title: allOnLabel, onClick: showAll },
|
|
110
110
|
React.createElement(core_react_1.WebFontIcon, { iconName: "icon-visibility" })),
|
|
111
|
-
React.createElement("
|
|
111
|
+
React.createElement(itwinui_react_1.Button, { size: "small", styleType: "borderless", key: "hide-all-btn", title: allOffLabel, onClick: hideAll },
|
|
112
112
|
React.createElement(core_react_1.WebFontIcon, { iconName: "icon-visibility-hide-2" })),
|
|
113
113
|
]),
|
|
114
|
-
React.createElement("div", { ref:
|
|
114
|
+
React.createElement("div", { ref: divRef, className: "map-manager-sublayer-tree-content" }, width && height ? React.createElement(components_react_1.ControlledTree, { nodeLoader: nodeLoader, selectionMode: components_react_1.SelectionMode.None, eventsHandler: eventHandler, model: treeModel, treeRenderer: nodeWithEyeCheckboxTreeRenderer, nodeHighlightingProps: nodeHighlightingProps, width: width, height: height }) : null)));
|
|
115
115
|
}
|
|
116
116
|
exports.SubLayersTree = SubLayersTree;
|
|
117
117
|
/** TreeEventHandler derived class that handler processing changes to subLayer visibility */
|