@itwin/map-layers 3.2.0-dev.5 → 3.2.0-dev.52
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":"MapLayerDroppable.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerDroppable.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,2CAA2C;AAE3C,oEAAoE;AACpE,sDAAsD;AAEtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAuB,SAAS,EAA6C,MAAM,qBAAqB,CAAC;AAC3H,OAAO,EAAE,6BAA6B,EAAkB,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO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AI,EAAE,KAAK,EAAE,CAAC,IAChF,UAAU,CACD,CAAC,CAAC,CAAC;SAClB;aAAM;YACL,iDAAiD;YACjD,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,8BAA8B,CAAC;YAC3F,IAAI;gBACF,6BAAK,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,iCAAiC,IAC3D,QAAQ,CAAC,cAAc,CAAC,CAAC;oBACxB,8BAAM,SAAS,EAAC,6BAA6B,IAAE,cAAc,CAAQ;oBACrE,CAAC;wBACD;4BACE,8BAAM,SAAS,EAAC,6BAA6B,IAAE,KAAK,CAAQ;4BAC5D,oBAAC,sBAAsB,IAAC,UAAU,EAAE,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAI,CAC7F,CAED,CAAC;SACV;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,eAAe,CAAC,YAA+B,EAAE,YAAoC;QAC5F,OAAO,CACL,6BAAK,SAAS,EAAE,0BAA0B,YAAY,CAAC,cAAc,IAAI,aAAa,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,YAAY,CAAC,QAAQ,KAAM,YAAY,CAAC,cAAc;YAEjL,sBAAsB,CAAC,YAAY,CAAC;YAOrC,6BAAK,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAG,YAAY,CAAC,WAAW,CAAO,CACzF,CAAC,CAAC;IACZ,CAAC;IAED,OAAO,CACL,oBAAC,SAAS,IACR,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,UAAU,EACvB,oBAAoB,EAAE,KAAK,CAAC,oBAA2B,IAEtD,eAAe,CACN,CACb,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n// cSpell:ignore droppable Sublayer Basemap\r\n\r\n// the following quiet warning caused by react-beautiful-dnd package\r\n/* eslint-disable @typescript-eslint/unbound-method */\r\n\r\nimport * as React from \"react\";\r\nimport { Draggable, DraggableChildrenFn, Droppable, DroppableProvided, DroppableStateSnapshot } from \"react-beautiful-dnd\";\r\nimport { MapLayerImageryProviderStatus, ScreenViewport } from \"@itwin/core-frontend\";\r\nimport { Icon } from \"@itwin/core-react\";\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { ModalDialogManager } from \"@itwin/appui-react\";\r\nimport { Button } from \"@itwin/itwinui-react\";\r\nimport { SubLayersPopupButton } from \"./SubLayersPopupButton\";\r\nimport { AttachLayerButtonType, AttachLayerPopupButton } from \"./AttachLayerPopupButton\";\r\nimport { MapTypesOptions, StyleMapLayerSettings } from \"../Interfaces\";\r\nimport { MapLayerSettingsMenu } from \"./MapLayerSettingsMenu\";\r\nimport { MapUrlDialog } from \"./MapUrlDialog\";\r\nimport \"./MapLayerManager.scss\";\r\nimport { MapLayersUI } from \"../../mapLayers\";\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\n\r\n/** @internal */\r\ninterface MapLayerDroppableProps {\r\n isOverlay: boolean;\r\n layersList?: StyleMapLayerSettings[];\r\n mapTypesOptions?: MapTypesOptions;\r\n getContainerForClone: () => HTMLElement;\r\n activeViewport: ScreenViewport;\r\n onMenuItemSelected: (action: string, mapLayerSettings: StyleMapLayerSettings) => void;\r\n onItemVisibilityToggleClicked: (mapLayerSettings: StyleMapLayerSettings) => void;\r\n onItemEdited: () => void;\r\n}\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function MapLayerDroppable(props: MapLayerDroppableProps) {\r\n const containsLayer = props.layersList && props.layersList.length > 0;\r\n const droppableId = props.isOverlay ? \"overlayMapLayers\" : \"backgroundMapLayers\";\r\n const [toggleVisibility] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.ToggleVisibility\"));\r\n const [requireAuthTooltip] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.RequireAuthTooltip\"));\r\n const [noBackgroundMapsSpecifiedLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.NoBackgroundLayers\"));\r\n const [noUnderlaysSpecifiedLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.NoOverlayLayers\"));\r\n const [dropLayerLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.DropLayerLabel\"));\r\n\r\n const renderItem: DraggableChildrenFn = (dragProvided, _, rubric) => {\r\n assert(props.layersList !== undefined);\r\n const activeLayer = props.layersList[rubric.source.index];\r\n\r\n return (\r\n <div className=\"map-manager-source-item\" data-id={rubric.source.index} key={activeLayer.name}\r\n {...dragProvided.draggableProps}\r\n ref={dragProvided.innerRef} >\r\n <button className=\"map-manager-item-visibility\" title={toggleVisibility} onClick={() => { props.onItemVisibilityToggleClicked(activeLayer); }}>\r\n <Icon iconSpec={activeLayer.visible ? \"icon-visibility\" : \"icon-visibility-hide-2\"} /></button>\r\n <span className=\"map-manager-item-label\" {...dragProvided.dragHandleProps}>{activeLayer.name}</span>\r\n <div className=\"map-manager-item-sub-layer-container\">\r\n {activeLayer.subLayers && activeLayer.subLayers.length > 1 &&\r\n <SubLayersPopupButton mapLayerSettings={activeLayer} activeViewport={props.activeViewport} />\r\n }\r\n </div>\r\n {activeLayer.provider?.status === MapLayerImageryProviderStatus.RequireAuth &&\r\n <Button\r\n className=\"map-manager-item-requireAuth\"\r\n onClick={() => {\r\n const indexInDisplayStyle = props.activeViewport?.displayStyle.findMapLayerIndexByNameAndSource(activeLayer.name, activeLayer.source, activeLayer.isOverlay);\r\n if (indexInDisplayStyle !== undefined && indexInDisplayStyle >= 0) {\r\n const layerSettings = props.activeViewport.displayStyle.mapLayerAtIndex(indexInDisplayStyle, activeLayer.isOverlay);\r\n if (layerSettings instanceof ImageMapLayerSettings) {\r\n ModalDialogManager.openDialog(<MapUrlDialog activeViewport={props.activeViewport}\r\n isOverlay={props.isOverlay}\r\n layerRequiringCredentials={layerSettings?.toJSON()}\r\n onOkResult={props.onItemEdited}\r\n mapTypesOptions={props.mapTypesOptions}></MapUrlDialog>);\r\n }\r\n }\r\n\r\n }}\r\n title={requireAuthTooltip}\r\n >\r\n <Icon iconSpec=\"icon-status-warning\" />\r\n </Button>\r\n }\r\n <MapLayerSettingsMenu activeViewport={props.activeViewport} mapLayerSettings={activeLayer} onMenuItemSelection={props.onMenuItemSelected} />\r\n </div>\r\n );\r\n };\r\n\r\n function renderDraggableContent(snapshot: DroppableStateSnapshot): React.ReactNode {\r\n let node: React.ReactNode;\r\n if (containsLayer) {\r\n // Render a <Draggable>\r\n node = (props.layersList?.map((mapLayerSettings, i) =>\r\n <Draggable key={mapLayerSettings.name} draggableId={mapLayerSettings.name} index={i}>\r\n {renderItem}\r\n </Draggable>));\r\n } else {\r\n // Render a label that provide a 'Drop here' hint\r\n const label = props.isOverlay ? noUnderlaysSpecifiedLabel : noBackgroundMapsSpecifiedLabel;\r\n node =\r\n <div title={label} className=\"map-manager-no-layers-container\">\r\n {snapshot.isDraggingOver ?\r\n <span className=\"map-manager-no-layers-label\">{dropLayerLabel}</span>\r\n :\r\n <>\r\n <span className=\"map-manager-no-layers-label\">{label}</span>\r\n <AttachLayerPopupButton buttonType={AttachLayerButtonType.Blue} isOverlay={props.isOverlay} />\r\n </>\r\n }\r\n </div>;\r\n }\r\n return node;\r\n }\r\n\r\n function renderDraggable(dropProvided: DroppableProvided, dropSnapshot: DroppableStateSnapshot): React.ReactElement<HTMLElement> {\r\n return (\r\n <div className={`map-manager-attachments${dropSnapshot.isDraggingOver && containsLayer ? \" is-dragging-map-over\" : \"\"}`} ref={dropProvided.innerRef} {...dropProvided.droppableProps} >\r\n\r\n {renderDraggableContent(dropSnapshot)}\r\n\r\n {\r\n /* We don't want a placeholder when displaying the 'Drop here' message\r\n Unfortunately, if don't add it, 'react-beautiful-dnd' show an error message in the console.\r\n So I simply make it hidden. See https://github.com/atlassian/react-beautiful-dnd/issues/518 */\r\n }\r\n <div style={containsLayer ? undefined : { display: \"none\" }}>{dropProvided.placeholder}</div>\r\n </div>);\r\n }\r\n\r\n return (\r\n <Droppable\r\n droppableId={droppableId}\r\n renderClone={renderItem}\r\n getContainerForClone={props.getContainerForClone as any}\r\n >\r\n {renderDraggable}\r\n </Droppable>\r\n );\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"MapLayerDroppable.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerDroppable.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,2CAA2C;AAE3C,oEAAoE;AACpE,sDAAsD;AAEtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAuB,SAAS,EAA6C,MAAM,qBAAqB,CAAC;AAC3H,OAAO,EAAE,6BAA6B,EAAkB,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,qB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AAC,CAAC;oBACxB,8BAAM,SAAS,EAAC,6BAA6B,IAAE,cAAc,CAAQ;oBACrE,CAAC;wBACD;4BACE,8BAAM,SAAS,EAAC,6BAA6B,IAAE,KAAK,CAAQ;4BAC5D,oBAAC,sBAAsB,IAAC,UAAU,EAAE,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAI,CAC7F,CAED,CAAC;SACV;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,eAAe,CAAC,YAA+B,EAAE,YAAoC;QAC5F,OAAO,CACL,6BAAK,SAAS,EAAE,0BAA0B,YAAY,CAAC,cAAc,IAAI,aAAa,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,YAAY,CAAC,QAAQ,KAAM,YAAY,CAAC,cAAc;YAEjL,sBAAsB,CAAC,YAAY,CAAC;YAOrC,6BAAK,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAG,YAAY,CAAC,WAAW,CAAO,CACzF,CAAC,CAAC;IACZ,CAAC;IAED,OAAO,CACL,oBAAC,SAAS,IACR,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,UAAU,EACvB,oBAAoB,EAAE,KAAK,CAAC,oBAA2B,IAEtD,eAAe,CACN,CACb,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n// cSpell:ignore droppable Sublayer Basemap\r\n\r\n// the following quiet warning caused by react-beautiful-dnd package\r\n/* eslint-disable @typescript-eslint/unbound-method */\r\n\r\nimport * as React from \"react\";\r\nimport { Draggable, DraggableChildrenFn, Droppable, DroppableProvided, DroppableStateSnapshot } from \"react-beautiful-dnd\";\r\nimport { MapLayerImageryProviderStatus, ScreenViewport } from \"@itwin/core-frontend\";\r\nimport { Icon } from \"@itwin/core-react\";\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { ModalDialogManager } from \"@itwin/appui-react\";\r\nimport { Button } from \"@itwin/itwinui-react\";\r\nimport { SubLayersPopupButton } from \"./SubLayersPopupButton\";\r\nimport { AttachLayerButtonType, AttachLayerPopupButton } from \"./AttachLayerPopupButton\";\r\nimport { MapTypesOptions, StyleMapLayerSettings } from \"../Interfaces\";\r\nimport { MapLayerSettingsMenu } from \"./MapLayerSettingsMenu\";\r\nimport { MapUrlDialog } from \"./MapUrlDialog\";\r\nimport \"./MapLayerManager.scss\";\r\nimport { MapLayersUI } from \"../../mapLayers\";\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\n\r\n/** @internal */\r\ninterface MapLayerDroppableProps {\r\n isOverlay: boolean;\r\n layersList?: StyleMapLayerSettings[];\r\n mapTypesOptions?: MapTypesOptions;\r\n getContainerForClone: () => HTMLElement;\r\n activeViewport: ScreenViewport;\r\n onMenuItemSelected: (action: string, mapLayerSettings: StyleMapLayerSettings) => void;\r\n onItemVisibilityToggleClicked: (mapLayerSettings: StyleMapLayerSettings) => void;\r\n onItemEdited: () => void;\r\n}\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function MapLayerDroppable(props: MapLayerDroppableProps) {\r\n const containsLayer = props.layersList && props.layersList.length > 0;\r\n const droppableId = props.isOverlay ? \"overlayMapLayers\" : \"backgroundMapLayers\";\r\n const [toggleVisibility] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.ToggleVisibility\"));\r\n const [requireAuthTooltip] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.RequireAuthTooltip\"));\r\n const [noBackgroundMapsSpecifiedLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.NoBackgroundLayers\"));\r\n const [noUnderlaysSpecifiedLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.NoOverlayLayers\"));\r\n const [dropLayerLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.DropLayerLabel\"));\r\n\r\n const renderItem: DraggableChildrenFn = (dragProvided, _, rubric) => {\r\n assert(props.layersList !== undefined);\r\n const activeLayer = props.layersList[rubric.source.index];\r\n\r\n return (\r\n <div className=\"map-manager-source-item\" data-id={rubric.source.index} key={activeLayer.name}\r\n {...dragProvided.draggableProps}\r\n ref={dragProvided.innerRef} >\r\n <Button size=\"small\" styleType=\"borderless\" className=\"map-manager-item-visibility\" title={toggleVisibility} onClick={() => { props.onItemVisibilityToggleClicked(activeLayer); }}>\r\n <Icon iconSpec={activeLayer.visible ? \"icon-visibility\" : \"icon-visibility-hide-2\"} />\r\n </Button>\r\n <span className=\"map-manager-item-label\" {...dragProvided.dragHandleProps}>{activeLayer.name}</span>\r\n <div className=\"map-manager-item-sub-layer-container\">\r\n {activeLayer.subLayers && activeLayer.subLayers.length > 1 &&\r\n <SubLayersPopupButton mapLayerSettings={activeLayer} activeViewport={props.activeViewport} />\r\n }\r\n </div>\r\n {activeLayer.provider?.status === MapLayerImageryProviderStatus.RequireAuth &&\r\n <Button\r\n size=\"small\"\r\n styleType=\"borderless\"\r\n onClick={() => {\r\n const indexInDisplayStyle = props.activeViewport?.displayStyle.findMapLayerIndexByNameAndSource(activeLayer.name, activeLayer.source, activeLayer.isOverlay);\r\n if (indexInDisplayStyle !== undefined && indexInDisplayStyle >= 0) {\r\n const layerSettings = props.activeViewport.displayStyle.mapLayerAtIndex(indexInDisplayStyle, activeLayer.isOverlay);\r\n if (layerSettings instanceof ImageMapLayerSettings) {\r\n ModalDialogManager.openDialog(<MapUrlDialog activeViewport={props.activeViewport}\r\n isOverlay={props.isOverlay}\r\n layerRequiringCredentials={layerSettings?.toJSON()}\r\n onOkResult={props.onItemEdited}\r\n mapTypesOptions={props.mapTypesOptions}></MapUrlDialog>);\r\n }\r\n }\r\n\r\n }}\r\n title={requireAuthTooltip}\r\n >\r\n <Icon iconSpec=\"icon-status-warning\" />\r\n </Button>\r\n }\r\n <MapLayerSettingsMenu activeViewport={props.activeViewport} mapLayerSettings={activeLayer} onMenuItemSelection={props.onMenuItemSelected} />\r\n </div>\r\n );\r\n };\r\n\r\n function renderDraggableContent(snapshot: DroppableStateSnapshot): React.ReactNode {\r\n let node: React.ReactNode;\r\n if (containsLayer) {\r\n // Render a <Draggable>\r\n node = (props.layersList?.map((mapLayerSettings, i) =>\r\n <Draggable key={mapLayerSettings.name} draggableId={mapLayerSettings.name} index={i}>\r\n {renderItem}\r\n </Draggable>));\r\n } else {\r\n // Render a label that provide a 'Drop here' hint\r\n const label = props.isOverlay ? noUnderlaysSpecifiedLabel : noBackgroundMapsSpecifiedLabel;\r\n node =\r\n <div title={label} className=\"map-manager-no-layers-container\">\r\n {snapshot.isDraggingOver ?\r\n <span className=\"map-manager-no-layers-label\">{dropLayerLabel}</span>\r\n :\r\n <>\r\n <span className=\"map-manager-no-layers-label\">{label}</span>\r\n <AttachLayerPopupButton buttonType={AttachLayerButtonType.Blue} isOverlay={props.isOverlay} />\r\n </>\r\n }\r\n </div>;\r\n }\r\n return node;\r\n }\r\n\r\n function renderDraggable(dropProvided: DroppableProvided, dropSnapshot: DroppableStateSnapshot): React.ReactElement<HTMLElement> {\r\n return (\r\n <div className={`map-manager-attachments${dropSnapshot.isDraggingOver && containsLayer ? \" is-dragging-map-over\" : \"\"}`} ref={dropProvided.innerRef} {...dropProvided.droppableProps} >\r\n\r\n {renderDraggableContent(dropSnapshot)}\r\n\r\n {\r\n /* We don't want a placeholder when displaying the 'Drop here' message\r\n Unfortunately, if don't add it, 'react-beautiful-dnd' show an error message in the console.\r\n So I simply make it hidden. See https://github.com/atlassian/react-beautiful-dnd/issues/518 */\r\n }\r\n <div style={containsLayer ? undefined : { display: \"none\" }}>{dropProvided.placeholder}</div>\r\n </div>);\r\n }\r\n\r\n return (\r\n <Droppable\r\n droppableId={droppableId}\r\n renderClone={renderItem}\r\n getContainerForClone={props.getContainerForClone as any}\r\n >\r\n {renderDraggable}\r\n </Droppable>\r\n );\r\n}\r\n"]}
|
|
@@ -6,24 +6,8 @@
|
|
|
6
6
|
@import "~@itwin/itwinui-css/scss/style/typography";
|
|
7
7
|
|
|
8
8
|
$divider-color: $buic-background-toolbutton-stroke;
|
|
9
|
-
$hovered-icon-color: $buic-foreground-primary
|
|
10
|
-
|
|
11
|
-
button.map-manager-item-visibility {
|
|
12
|
-
background-color: transparent;
|
|
13
|
-
border: none;
|
|
14
|
-
color: $buic-foreground-body;
|
|
15
|
-
background-color: transparent;
|
|
16
|
-
|
|
17
|
-
&:hover {
|
|
18
|
-
color: $hovered-icon-color;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&:focus {
|
|
22
|
-
outline: none;
|
|
23
|
-
box-shadow: $uicore-button-focus-boxshadow;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
9
|
+
$hovered-icon-color: $buic-foreground-primary;
|
|
10
|
+
$default-icon-height: 20px;
|
|
27
11
|
.map-manager-layer-host {
|
|
28
12
|
margin: 0 6px;
|
|
29
13
|
height: 100%;
|
|
@@ -55,20 +39,12 @@ button.map-manager-item-visibility {
|
|
|
55
39
|
padding-left: 10px;
|
|
56
40
|
}
|
|
57
41
|
|
|
58
|
-
button.map-manager-item-requireAuthIcon {
|
|
59
|
-
color: $buic-foreground-warning;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
42
|
.map-manager-header-buttons-group {
|
|
63
43
|
margin-left: auto;
|
|
64
44
|
border: none;
|
|
65
45
|
display: flex;
|
|
66
46
|
padding-right: 5px;
|
|
67
47
|
}
|
|
68
|
-
|
|
69
|
-
.map-manager-toggle {
|
|
70
|
-
height: 24px;
|
|
71
|
-
}
|
|
72
48
|
}
|
|
73
49
|
|
|
74
50
|
.map-manager-container {
|
|
@@ -88,31 +64,15 @@ button.map-manager-item-visibility {
|
|
|
88
64
|
.map-manager-layer-wrapper {
|
|
89
65
|
border: 1px solid #ccc;
|
|
90
66
|
margin-bottom: 15px;
|
|
67
|
+
padding: 10px;
|
|
91
68
|
}
|
|
92
69
|
|
|
93
70
|
.map-manager-underlays,
|
|
94
71
|
.map-manager-overlays {
|
|
95
72
|
display: flex;
|
|
96
73
|
align-content: center;
|
|
97
|
-
margin-top: 8px;
|
|
98
|
-
padding-left: 10px;
|
|
99
|
-
|
|
100
74
|
.map-manager-attach-layer-button {
|
|
101
|
-
background-color: transparent;
|
|
102
75
|
margin-left: auto;
|
|
103
|
-
width: 40px;
|
|
104
|
-
border: none;
|
|
105
|
-
color: $buic-foreground-body;
|
|
106
|
-
margin-right: 2px;
|
|
107
|
-
|
|
108
|
-
&:hover {
|
|
109
|
-
color: $hovered-icon-color;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
&:focus {
|
|
113
|
-
box-shadow: $uicore-button-focus-boxshadow;
|
|
114
|
-
outline: none;
|
|
115
|
-
}
|
|
116
76
|
}
|
|
117
77
|
}
|
|
118
78
|
|
|
@@ -184,6 +144,10 @@ button.map-manager-item-visibility {
|
|
|
184
144
|
margin: 1em 0 1em 0;
|
|
185
145
|
}
|
|
186
146
|
|
|
147
|
+
.map-manager-item-menu {
|
|
148
|
+
padding: 5px;
|
|
149
|
+
}
|
|
150
|
+
|
|
187
151
|
.map-manager-header {
|
|
188
152
|
display: flex;
|
|
189
153
|
flex-direction: column;
|
|
@@ -241,12 +205,6 @@ button.map-manager-item-visibility {
|
|
|
241
205
|
width: 465px;
|
|
242
206
|
min-width: 3em;
|
|
243
207
|
}
|
|
244
|
-
|
|
245
|
-
.map-manager-item-visibility {
|
|
246
|
-
width: 40px;
|
|
247
|
-
margin-right: 20px;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
208
|
.map-manager-item-transparency {
|
|
251
209
|
max-width: 160px;
|
|
252
210
|
width: 160px;
|
|
@@ -273,104 +231,21 @@ button.map-manager-item-visibility {
|
|
|
273
231
|
/* Required for text-overflow to do anything */
|
|
274
232
|
white-space: nowrap;
|
|
275
233
|
overflow: hidden;
|
|
234
|
+
margin-left: 2px;
|
|
276
235
|
}
|
|
277
|
-
|
|
278
|
-
.map-manager-item-settings-button {
|
|
279
|
-
background-color: $buic-background-1;
|
|
280
|
-
color: $buic-foreground-body;
|
|
281
|
-
border: none;
|
|
282
|
-
|
|
283
|
-
&:hover {
|
|
284
|
-
color: $hovered-icon-color;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
&:focus {
|
|
288
|
-
box-shadow: $uicore-button-focus-boxshadow;
|
|
289
|
-
outline: none;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
.core-context-menu-container {
|
|
293
|
-
.core-context-menu-item {
|
|
294
|
-
>.core-context-menu-icon {
|
|
295
|
-
flex-shrink: 1;
|
|
296
|
-
flex-grow: 0;
|
|
297
|
-
width: 0;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.core-slider.core-slider-minMax {
|
|
301
|
-
min-width: 100px;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
236
|
.map-manager-item-transparency {
|
|
308
237
|
margin-right: 6px;
|
|
309
238
|
}
|
|
310
239
|
|
|
311
|
-
|
|
312
|
-
border: none;
|
|
240
|
+
.map-manager-item-visibility {
|
|
313
241
|
margin: 0 2px;
|
|
314
|
-
background-color: $buic-background-1;
|
|
315
|
-
color: $buic-foreground-body;
|
|
316
|
-
|
|
317
|
-
&:hover {
|
|
318
|
-
color: $hovered-icon-color;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
&:focus {
|
|
322
|
-
outline: none;
|
|
323
|
-
box-shadow: $uicore-button-focus-boxshadow;
|
|
324
|
-
}
|
|
325
242
|
}
|
|
326
243
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
border: none;
|
|
330
|
-
color: $buic-foreground-warning;
|
|
331
|
-
background-color: transparent;
|
|
332
|
-
|
|
333
|
-
&:hover {
|
|
334
|
-
color: $hovered-icon-color;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
&:focus {
|
|
338
|
-
outline: none;
|
|
339
|
-
box-shadow: $uicore-button-focus-boxshadow;
|
|
340
|
-
}
|
|
244
|
+
.map-layer-settings {
|
|
245
|
+
margin-left: 2px;
|
|
341
246
|
}
|
|
342
247
|
}
|
|
343
248
|
|
|
344
|
-
.map-layer-settings {
|
|
345
|
-
border: none;
|
|
346
|
-
background-color: $buic-background-1;
|
|
347
|
-
color: $buic-foreground-body;
|
|
348
|
-
margin-left: 2px;
|
|
349
|
-
|
|
350
|
-
&:hover {
|
|
351
|
-
color: $hovered-icon-color;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
&:focus {
|
|
355
|
-
box-shadow: $uicore-button-focus-boxshadow;
|
|
356
|
-
outline: none;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.map-manager-item-sub-layer-button {
|
|
361
|
-
border: none;
|
|
362
|
-
background-color: $buic-background-1;
|
|
363
|
-
color: $buic-foreground-body;
|
|
364
|
-
|
|
365
|
-
&:hover {
|
|
366
|
-
color: $hovered-icon-color;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
&:focus {
|
|
370
|
-
box-shadow: $uicore-button-focus-boxshadow;
|
|
371
|
-
outline: none;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
249
|
|
|
375
250
|
.map-manager-item-sub-layer-container {
|
|
376
251
|
@include uicore-z-index(dialog-popup);
|
|
@@ -481,19 +356,6 @@ button.map-manager-item-visibility {
|
|
|
481
356
|
button.map-source-list-entry-button {
|
|
482
357
|
height: auto;
|
|
483
358
|
padding: 0 4px 0 4px;
|
|
484
|
-
margin: 0;
|
|
485
|
-
background-color: transparent;
|
|
486
|
-
border: none;
|
|
487
|
-
color: $buic-foreground-body;
|
|
488
|
-
|
|
489
|
-
&:hover {
|
|
490
|
-
color: $hovered-icon-color;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
&:focus {
|
|
494
|
-
outline: none;
|
|
495
|
-
box-shadow: $uicore-button-focus-boxshadow;
|
|
496
|
-
}
|
|
497
359
|
}
|
|
498
360
|
|
|
499
361
|
.map-source-list-entry-name {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerSettingsMenu.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsMenu.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAItD,wBAAgB,oBAAoB,CAAC,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,cAAc,EAAE,EAAE;IAAE,gBAAgB,EAAE,qBAAqB,CAAC;IAAC,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAAC,cAAc,EAAE,cAAc,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"MapLayerSettingsMenu.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsMenu.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAItD,wBAAgB,oBAAoB,CAAC,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,cAAc,EAAE,EAAE;IAAE,gBAAgB,EAAE,qBAAqB,CAAC;IAAC,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAAC,cAAc,EAAE,cAAc,CAAA;CAAE,eAkFlQ"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { ContextMenu, ContextMenuItem } from "@itwin/core-react";
|
|
7
|
-
import { Slider } from "@itwin/itwinui-react";
|
|
7
|
+
import { Button, Slider } from "@itwin/itwinui-react";
|
|
8
8
|
import "./MapLayerManager.scss";
|
|
9
9
|
import { MapLayersUI } from "../../mapLayers";
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -69,11 +69,12 @@ export function MapLayerSettingsMenu({ mapLayerSettings, onMenuItemSelection, ac
|
|
|
69
69
|
}
|
|
70
70
|
}, [transparency, applyTransparencyChange]);
|
|
71
71
|
return (React.createElement(React.Fragment, null,
|
|
72
|
-
React.createElement("
|
|
72
|
+
React.createElement(Button, { size: "small", styleType: "borderless", "data-testid": "map-layer-settings", className: "map-layer-settings icon icon-more-vertical-2", ref: settingsRef, onClick: onSettingsClick }),
|
|
73
73
|
React.createElement(ContextMenu, { opened: isSettingsOpen && (undefined !== hasRangeData), onOutsideClick: handleCloseSetting },
|
|
74
|
-
React.createElement(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
React.createElement(
|
|
74
|
+
React.createElement("div", { className: "map-manager-item-menu" },
|
|
75
|
+
React.createElement(ContextMenuItem, { hideIconContainer: true, key: 0, className: hasRangeData ? "" : "core-context-menu-disabled", onSelect: handleZoomToLayer }, labelZoomToLayer),
|
|
76
|
+
React.createElement(ContextMenuItem, { hideIconContainer: true, key: 1, onSelect: handleRemoveLayer }, labelDetach),
|
|
77
|
+
React.createElement(ContextMenuItem, { hideIconContainer: true, key: 2 },
|
|
78
|
+
React.createElement(Slider, { min: 0, max: 100, values: [transparency * 100], step: 1, onChange: handleTransparencyChange }))))));
|
|
78
79
|
}
|
|
79
80
|
//# sourceMappingURL=MapLayerSettingsMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerSettingsMenu.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsMenu.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ACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport * as React from \"react\";\r\nimport { ScreenViewport } from \"@itwin/core-frontend\";\r\nimport { ContextMenu, ContextMenuItem } from \"@itwin/core-react\";\r\nimport { Button, Slider } from \"@itwin/itwinui-react\";\r\nimport \"./MapLayerManager.scss\";\r\nimport { StyleMapLayerSettings } from \"../Interfaces\";\r\nimport { MapLayersUI } from \"../../mapLayers\";\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function MapLayerSettingsMenu({ mapLayerSettings, onMenuItemSelection, activeViewport }: { mapLayerSettings: StyleMapLayerSettings, onMenuItemSelection: (action: string, mapLayerSettings: StyleMapLayerSettings) => void, activeViewport: ScreenViewport }) {\r\n const [isSettingsOpen, setIsSettingsOpen] = React.useState(false);\r\n const settingsRef = React.useRef<HTMLButtonElement>(null);\r\n const [labelDetach] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:LayerMenu.Detach\"));\r\n const [labelZoomToLayer] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:LayerMenu.ZoomToLayer\"));\r\n const [hasRangeData, setHasRangeData] = React.useState<boolean | undefined>();\r\n const [transparency, setTransparency] = React.useState(mapLayerSettings.transparency);\r\n\r\n React.useEffect(() => {\r\n async function fetchRangeData() {\r\n let hasRange = false;\r\n const indexInDisplayStyle = activeViewport?.displayStyle.findMapLayerIndexByNameAndSource(mapLayerSettings.name, mapLayerSettings.source, mapLayerSettings.isOverlay);\r\n if (undefined !== indexInDisplayStyle) {\r\n hasRange = (undefined !== await activeViewport.displayStyle.getMapLayerRange(indexInDisplayStyle, mapLayerSettings.isOverlay));\r\n }\r\n setHasRangeData(hasRange);\r\n }\r\n fetchRangeData(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }, [activeViewport, mapLayerSettings]);\r\n\r\n const onSettingsClick = React.useCallback(() => {\r\n setIsSettingsOpen((prev) => !prev);\r\n }, [setIsSettingsOpen]);\r\n\r\n const handleCloseSetting = React.useCallback(() => {\r\n setIsSettingsOpen(false);\r\n }, [setIsSettingsOpen]);\r\n\r\n const handleRemoveLayer = React.useCallback(() => {\r\n setIsSettingsOpen(false);\r\n onMenuItemSelection(\"delete\", mapLayerSettings);\r\n }, [setIsSettingsOpen, onMenuItemSelection, mapLayerSettings]);\r\n\r\n const handleZoomToLayer = React.useCallback(() => {\r\n setIsSettingsOpen(false);\r\n onMenuItemSelection(\"zoom-to-layer\", mapLayerSettings);\r\n }, [setIsSettingsOpen, onMenuItemSelection, mapLayerSettings]);\r\n\r\n const applyTransparencyChange = React.useCallback((value: number) => {\r\n if (activeViewport) {\r\n const newTransparency = value;\r\n const displayStyle = activeViewport.displayStyle;\r\n const indexInDisplayStyle = displayStyle.findMapLayerIndexByNameAndSource(mapLayerSettings.name, mapLayerSettings.source, mapLayerSettings.isOverlay);\r\n if (-1 !== indexInDisplayStyle) {\r\n const styleTransparency = displayStyle.mapLayerAtIndex(indexInDisplayStyle, mapLayerSettings.isOverlay)?.transparency;\r\n const styleTransparencyValue = styleTransparency ? styleTransparency : 0;\r\n if (Math.abs(styleTransparencyValue - newTransparency) > 0.01) {\r\n // update the display style\r\n displayStyle.changeMapLayerProps({ transparency: newTransparency }, indexInDisplayStyle, mapLayerSettings.isOverlay);\r\n activeViewport.invalidateRenderPlan();\r\n\r\n // force UI to update\r\n // loadMapLayerSettingsFromStyle(activeViewport.displayStyle);\r\n }\r\n }\r\n }\r\n }, [activeViewport, mapLayerSettings]);\r\n\r\n const handleTransparencyChange = React.useCallback((values: readonly number[]) => {\r\n if (values.length) {\r\n const newTransparency = values[0] / 100.0;\r\n if (newTransparency !== transparency) {\r\n setTransparency(newTransparency);\r\n applyTransparencyChange(newTransparency);\r\n }\r\n }\r\n }, [transparency, applyTransparencyChange]);\r\n\r\n return (\r\n <>\r\n <Button size=\"small\" styleType=\"borderless\" data-testid=\"map-layer-settings\" className=\"map-layer-settings icon icon-more-vertical-2\" ref={settingsRef} onClick={onSettingsClick} ></Button>\r\n <ContextMenu opened={isSettingsOpen && (undefined !== hasRangeData)} onOutsideClick={handleCloseSetting} >\r\n <div className=\"map-manager-item-menu\" >\r\n <ContextMenuItem hideIconContainer={true} key={0} className={hasRangeData ? \"\" : \"core-context-menu-disabled\"} onSelect={handleZoomToLayer}>{labelZoomToLayer}</ContextMenuItem>\r\n <ContextMenuItem hideIconContainer={true} key={1} onSelect={handleRemoveLayer}>{labelDetach}</ContextMenuItem>\r\n <ContextMenuItem hideIconContainer={true} key={2} >\r\n <Slider min={0} max={100} values={[transparency * 100]} step={1} onChange={handleTransparencyChange} />\r\n </ContextMenuItem>\r\n </div>\r\n </ContextMenu>\r\n </>\r\n );\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerSettingsPopupButton.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsPopupButton.tsx"],"names":[],"mappings":";AAUA,OAAO,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"MapLayerSettingsPopupButton.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsPopupButton.tsx"],"names":[],"mappings":";AAUA,OAAO,oCAAoC,CAAC;AAI5C,aAAa;AAEb,wBAAgB,2BAA2B,gBA+B1C"}
|
|
@@ -8,6 +8,7 @@ import { Popup, WebFontIcon } from "@itwin/core-react";
|
|
|
8
8
|
import { MapManagerSettings } from "./MapManagerSettings";
|
|
9
9
|
import "./MapLayerSettingsPopupButton.scss";
|
|
10
10
|
import { MapLayersUI } from "../../mapLayers";
|
|
11
|
+
import { Button } from "@itwin/itwinui-react";
|
|
11
12
|
/** @alpha */
|
|
12
13
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13
14
|
export function MapLayerSettingsPopupButton() {
|
|
@@ -22,7 +23,7 @@ export function MapLayerSettingsPopupButton() {
|
|
|
22
23
|
setIsSettingsOpen(false);
|
|
23
24
|
}, [setIsSettingsOpen]);
|
|
24
25
|
return (React.createElement(React.Fragment, null,
|
|
25
|
-
React.createElement("
|
|
26
|
+
React.createElement(Button, { styleType: "borderless", title: buttonTooltip, className: "maplayers-settings-popup-button", onClick: togglePopupDisplay, ref: buttonRef },
|
|
26
27
|
React.createElement(WebFontIcon, { iconName: "icon-settings" })),
|
|
27
28
|
React.createElement(Popup, { isOpen: isSettingsOpen, position: RelativePosition.BottomRight, onClose: handleCloseSetting, target: buttonRef.current },
|
|
28
29
|
React.createElement("div", { className: "maplayers-settings-popup-panel" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerSettingsPopupButton.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsPopupButton.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,oCAAoC,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,aAAa;AACb,gEAAgE;AAChE,MAAM,UAAU,2BAA2B;IACzC,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,wCAAwC,CAAC,CAAC,CAAC;IAE9H,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAoB,IAAI,CAAC,CAAC;IACxD,MAAM,kBAAkB,GAAG,KA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AAC,WAAW,CAAC,CAAC,KAAsD,EAAE,EAAE;QACtG,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,iBAAiB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExB,MAAM,kBAAkB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAChD,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExB,OAAO,CACL;QACE,oBAAC,MAAM,IAAC,SAAS,EAAC,YAAY,EAAC,KAAK,EAAE,aAAa,EAAE,SAAS,EAAC,iCAAiC,EAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,EAAE,SAAS;YAC1I,oBAAC,WAAW,IAAC,QAAQ,EAAC,eAAe,GAAG,CACjC;QACT,oBAAC,KAAK,IACJ,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,gBAAgB,CAAC,WAAW,EACtC,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,SAAS,CAAC,OAAO;YAEzB,6BAAK,SAAS,EAAC,gCAAgC;gBAC7C,oBAAC,kBAAkB,OAAG,CAClB,CACC,CACP,CACL,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as React from \"react\";\r\nimport { RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { Popup, WebFontIcon } from \"@itwin/core-react\";\r\nimport { MapManagerSettings } from \"./MapManagerSettings\";\r\n\r\nimport \"./MapLayerSettingsPopupButton.scss\";\r\nimport { MapLayersUI } from \"../../mapLayers\";\r\nimport { Button } from \"@itwin/itwinui-react\";\r\n\r\n/** @alpha */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function MapLayerSettingsPopupButton() {\r\n const [isSettingsOpen, setIsSettingsOpen] = React.useState(false);\r\n const [buttonTooltip] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.SettingsButtonTooltip\"));\r\n\r\n const buttonRef = React.useRef<HTMLButtonElement>(null);\r\n const togglePopupDisplay = React.useCallback((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\r\n event.preventDefault();\r\n setIsSettingsOpen((prev) => !prev);\r\n }, [setIsSettingsOpen]);\r\n\r\n const handleCloseSetting = React.useCallback(() => {\r\n setIsSettingsOpen(false);\r\n }, [setIsSettingsOpen]);\r\n\r\n return (\r\n <>\r\n <Button styleType=\"borderless\" title={buttonTooltip} className=\"maplayers-settings-popup-button\" onClick={togglePopupDisplay} ref={buttonRef}>\r\n <WebFontIcon iconName=\"icon-settings\" />\r\n </Button>\r\n <Popup\r\n isOpen={isSettingsOpen}\r\n position={RelativePosition.BottomRight}\r\n onClose={handleCloseSetting}\r\n target={buttonRef.current}\r\n >\r\n <div className=\"maplayers-settings-popup-panel\">\r\n <MapManagerSettings />\r\n </div>\r\n </Popup >\r\n </ >\r\n );\r\n}\r\n"]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
@import "~@itwin/core-react/lib/cjs/core-react/index";
|
|
6
6
|
|
|
7
|
-
$hovered-icon-color: $buic-foreground-primary
|
|
7
|
+
$hovered-icon-color: $buic-foreground-primary;
|
|
8
8
|
|
|
9
9
|
.maplayers-settings-popup-panel {
|
|
10
10
|
z-index: 14000;
|
|
@@ -13,19 +13,9 @@ $hovered-icon-color: $buic-foreground-primary-tone;
|
|
|
13
13
|
width: 340px;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.map-manager-header-buttons-group {
|
|
16
17
|
.maplayers-settings-popup-button {
|
|
17
|
-
color: $buic-foreground-body;
|
|
18
|
-
font-size: 20px;
|
|
19
|
-
background-color: transparent;
|
|
20
|
-
border: none;
|
|
21
18
|
position: relative;
|
|
22
19
|
top: 1px;
|
|
23
|
-
|
|
24
|
-
&:hover {
|
|
25
|
-
color: $hovered-icon-color;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&:focus {
|
|
29
|
-
outline: none;
|
|
30
|
-
}
|
|
20
|
+
}
|
|
31
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapManagerSettings.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapManagerSettings.tsx"],"names":[],"mappings":";AAWA,OAAO,2BAA2B,CAAC;AAuCnC,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"MapManagerSettings.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapManagerSettings.tsx"],"names":[],"mappings":";AAWA,OAAO,2BAA2B,CAAC;AAuCnC,wBAAgB,kBAAkB,gBAkNjC"}
|
|
@@ -190,7 +190,7 @@ export function MapManagerSettings() {
|
|
|
190
190
|
React.createElement("span", { className: "map-manager-settings-label" }, modelHeightLabel),
|
|
191
191
|
React.createElement(QuantityNumberInput, { disabled: !applyTerrain, persistenceValue: terrainOrigin, snap: true, quantityType: QuantityType.LengthEngineering, onChange: handleHeightOriginChange, onKeyDown: onKeyDown }),
|
|
192
192
|
React.createElement("span", { className: "map-manager-settings-label" }, heightOriginLabel),
|
|
193
|
-
React.createElement(Select, { options: terrainHeightOptions.current, disabled: !applyTerrain, value: heightOriginMode, onChange: handleElevationTypeSelected, size: "small" }),
|
|
193
|
+
React.createElement(Select, { popoverProps: { appendTo: "parent" }, options: terrainHeightOptions.current, disabled: !applyTerrain, value: heightOriginMode, onChange: handleElevationTypeSelected, size: "small" }),
|
|
194
194
|
React.createElement("span", { className: "map-manager-settings-label" }, exaggerationLabel),
|
|
195
195
|
React.createElement(NumberInput, { value: exaggeration, disabled: !applyTerrain, onChange: handleExaggerationChange, onKeyDown: onKeyDown }))))));
|
|
196
196
|
}
|
|
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;oBAE3C,8BAAM,SAAS,EAAC,4BAA4B,IAAE,WAAW,CAAQ;oBAEjE,oBAAC,YAAY,IAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,GAAI;oBAElE,8BAAM,SAAS,EAAC,4BAA4B,IAAE,gBAAgB,CAAQ;oBACtE,oBAAC,mBAAmB,IAAC,QAAQ,EAAE,CAAC,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,QAAC,YAAY,EAAE,YAAY,CAAC,iBAAiB,EAAE,QAAQ,EAAE,wBAAwB,EAAE,SAAS,EAAE,SAAS,GAAG;oBAE7L,8BAAM,SAAS,EAAC,4BAA4B,IAAE,iBAAiB,CAAQ;oBACvE,oBAAC,MAAM,IAAC,OAAO,EAAE,oBAAoB,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,2BAA2B,EAAE,IAAI,EAAC,OAAO,GAAG;oBAEvJ,8BAAM,SAAS,EAAC,4BAA4B,IAAE,iBAAiB,CAAQ;oBACvE,oBAAC,WAAW,IAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,wBAAwB,EAAE,SAAS,EAAE,SAAS,GAAI,CACnH,CAEG,CACP,CACL,CACJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n// cSpell:ignore droppable Sublayer Basemap\r\n\r\nimport * as React from \"react\";\r\nimport { NumberInput } from \"@itwin/core-react\";\r\nimport { QuantityType, ViewState3d } from \"@itwin/core-frontend\";\r\nimport { BackgroundMapProps, BackgroundMapSettings, PlanarClipMaskMode, PlanarClipMaskPriority, TerrainHeightOriginMode, TerrainProps } from \"@itwin/core-common\";\r\nimport { useSourceMapContext } from \"./MapLayerManager\";\r\nimport \"./MapManagerSettings.scss\";\r\nimport { Select, SelectOption, Slider, ToggleSwitch } from \"@itwin/itwinui-react\";\r\nimport { QuantityNumberInput } from \"@itwin/imodel-components-react\";\r\nimport { MapLayersUI } from \"../../mapLayers\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\nenum MapMaskingOption {\r\n None,\r\n AllModels\r\n}\r\n\r\nfunction getMapMaskingFromBackgroundMapSetting(backgroundMapSettings: BackgroundMapSettings): MapMaskingOption {\r\n if (backgroundMapSettings.planarClipMask.mode === PlanarClipMaskMode.Priority && backgroundMapSettings.planarClipMask.priority) {\r\n if (backgroundMapSettings.planarClipMask.priority >= PlanarClipMaskPriority.BackgroundMap) {\r\n return MapMaskingOption.AllModels;\r\n }\r\n\r\n }\r\n return MapMaskingOption.None;\r\n}\r\n\r\nfunction getHeightOriginModeKey(mode: TerrainHeightOriginMode): string {\r\n if (TerrainHeightOriginMode.Geodetic === mode)\r\n return \"geodetic\";\r\n if (TerrainHeightOriginMode.Geoid === mode)\r\n return \"geoid\";\r\n return \"ground\";\r\n}\r\n\r\nfunction getHeightOriginModeFromKey(mode: string): TerrainHeightOriginMode {\r\n if (\"geodetic\" === mode)\r\n return TerrainHeightOriginMode.Geodetic;\r\n if (\"geoid\" === mode)\r\n return TerrainHeightOriginMode.Geoid;\r\n return TerrainHeightOriginMode.Ground;\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function MapManagerSettings() {\r\n const { activeViewport } = useSourceMapContext();\r\n const backgroundMapSettings = (activeViewport!.view as ViewState3d).getDisplayStyle3d().settings.backgroundMap;\r\n\r\n const [transparency, setTransparency] = React.useState(() =>\r\n typeof backgroundMapSettings.transparency === \"boolean\"\r\n ? 0\r\n : Math.round((backgroundMapSettings.transparency) * 100) / 100);\r\n\r\n const terrainSettings = backgroundMapSettings.terrainSettings;\r\n const [groundBias, setGroundBias] = React.useState(() => backgroundMapSettings.groundBias);\r\n\r\n const terrainHeightOptions = React.useRef<SelectOption<string>[]>([\r\n { value: \"geodetic\", label: MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ElevationTypeGeodetic\") },\r\n { value: \"geoid\", label: MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ElevationTypeGeoid\") },\r\n { value: \"ground\", label: MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ElevationTypeGround\") },\r\n ]);\r\n\r\n const updateTerrainSettings = React.useCallback((props: TerrainProps) => {\r\n activeViewport!.changeBackgroundMapProps({ terrainSettings: props });\r\n activeViewport!.invalidateRenderPlan();\r\n }, [activeViewport]);\r\n\r\n const updateBackgroundMap = React.useCallback((props: BackgroundMapProps) => {\r\n activeViewport!.changeBackgroundMapProps(props);\r\n activeViewport!.invalidateRenderPlan();\r\n }, [activeViewport]);\r\n\r\n const [heightOriginMode, setHeightOriginMode] = React.useState(() => getHeightOriginModeKey(terrainSettings.heightOriginMode));\r\n const handleElevationTypeSelected = React.useCallback((newValue: string): void => {\r\n if (newValue) {\r\n const newHeightOriginMode = getHeightOriginModeFromKey(newValue);\r\n updateTerrainSettings({ heightOriginMode: newHeightOriginMode });\r\n setHeightOriginMode(newValue);\r\n }\r\n }, [updateTerrainSettings]);\r\n\r\n const [maskTransparency, setMaskTransparency] = React.useState(() =>\r\n backgroundMapSettings.planarClipMask.transparency === undefined\r\n ? undefined\r\n : Math.round((backgroundMapSettings.planarClipMask.transparency) * 100) / 100);\r\n\r\n const getNormalizedMaskTransparency = React.useCallback(() => { return (maskTransparency === undefined ? 0 : maskTransparency); }, [maskTransparency]);\r\n\r\n const updateMaskingSettings = React.useCallback((option: MapMaskingOption) => {\r\n if (option === MapMaskingOption.AllModels) {\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.Priority, priority: PlanarClipMaskPriority.BackgroundMap, transparency: maskTransparency } });\r\n }\r\n if (option === MapMaskingOption.None) {\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.None } });\r\n }\r\n\r\n activeViewport!.invalidateRenderPlan();\r\n }, [activeViewport, maskTransparency]);\r\n\r\n const [masking, setMasking] = React.useState(() => getMapMaskingFromBackgroundMapSetting(backgroundMapSettings));\r\n\r\n const onMaskingToggle = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n const maskingOption = checked ? MapMaskingOption.AllModels : MapMaskingOption.None;\r\n updateMaskingSettings(maskingOption);\r\n setMasking(maskingOption);\r\n }, [updateMaskingSettings]);\r\n\r\n const [overrideMaskTransparency, setOverrideMaskTransparency] = React.useState(() => backgroundMapSettings.planarClipMask.transparency !== undefined);\r\n\r\n const onOverrideMaskTransparencyToggle = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n const trans = checked ? getNormalizedMaskTransparency() : undefined;\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.Priority, priority: PlanarClipMaskPriority.BackgroundMap, transparency: trans } });\r\n\r\n setOverrideMaskTransparency(checked);\r\n }, [activeViewport, getNormalizedMaskTransparency]);\r\n\r\n const handleElevationChange = React.useCallback((value: number) => {\r\n if (value !== undefined) {\r\n updateBackgroundMap({ groundBias: value });\r\n setGroundBias(value);\r\n }\r\n }, [updateBackgroundMap]);\r\n\r\n const handleAlphaChange = React.useCallback((values: readonly number[]) => {\r\n const newTransparency = values[0] / 100;\r\n activeViewport!.changeBackgroundMapProps({ transparency: newTransparency });\r\n activeViewport!.invalidateRenderPlan();\r\n setTransparency(newTransparency);\r\n }, [activeViewport]);\r\n\r\n const handleMaskTransparencyChange = React.useCallback((values: readonly number[]) => {\r\n const newTransparency = values[0] / 100;\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.Priority, priority: PlanarClipMaskPriority.BackgroundMap, transparency: newTransparency } });\r\n activeViewport!.invalidateRenderPlan();\r\n setMaskTransparency(newTransparency);\r\n }, [activeViewport]);\r\n\r\n const [applyTerrain, setApplyTerrain] = React.useState(() => backgroundMapSettings.applyTerrain);\r\n\r\n const onToggleTerrain = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n updateBackgroundMap({ applyTerrain: checked });\r\n setApplyTerrain(checked);\r\n }, [updateBackgroundMap]);\r\n\r\n const [exaggeration, setExaggeration] = React.useState(() => terrainSettings.exaggeration);\r\n\r\n const handleExaggerationChange = React.useCallback((value: number | undefined, _stringValue: string) => {\r\n if (undefined !== value) {\r\n updateTerrainSettings({ exaggeration: value });\r\n setExaggeration(value);\r\n }\r\n }, [updateTerrainSettings]);\r\n\r\n const [terrainOrigin, setTerrainOrigin] = React.useState(() => terrainSettings.heightOrigin);\r\n\r\n const handleHeightOriginChange = React.useCallback((value: number) => {\r\n if (undefined !== value) {\r\n updateTerrainSettings({ heightOrigin: value });\r\n setTerrainOrigin(value);\r\n }\r\n }, [updateTerrainSettings]);\r\n\r\n const [useDepthBuffer, setUseDepthBuffer] = React.useState(() => backgroundMapSettings.useDepthBuffer);\r\n const onToggleUseDepthBuffer = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n updateBackgroundMap({ useDepthBuffer: checked });\r\n setUseDepthBuffer(checked);\r\n }, [updateBackgroundMap]);\r\n\r\n /** Disable commas and letters */\r\n const onKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n if (event.keyCode === 188 || (event.keyCode >= 65 && event.keyCode <= 90))\r\n event.preventDefault();\r\n }, []);\r\n\r\n const [isLocatable, setIsLocatable] = React.useState(() => backgroundMapSettings.locatable);\r\n const onLocatableToggle = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n updateBackgroundMap({ nonLocatable: !checked });\r\n setIsLocatable(checked);\r\n }, [updateBackgroundMap]);\r\n\r\n const [transparencyLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Transparency\"));\r\n const [terrainLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Terrain\"));\r\n const [enableLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Enable\"));\r\n const [elevationOffsetLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ElevationOffset\"));\r\n const [useDepthBufferLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.UseDepthBuffer\"));\r\n const [modelHeightLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ModelHeight\"));\r\n const [heightOriginLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.HeightOrigin\"));\r\n const [exaggerationLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Exaggeration\"));\r\n const [locatableLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Locatable\"));\r\n const [maskingLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Mask\"));\r\n const [overrideMaskTransparencyLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.OverrideMaskTransparency\"));\r\n const [maskTransparencyLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.MaskTransparency\"));\r\n\r\n return (\r\n <>\r\n <div className=\"maplayers-settings-container\">\r\n\r\n <span className=\"map-manager-settings-label\">{transparencyLabel}</span>\r\n <Slider min={0} max={100} values={[transparency * 100]} onChange={handleAlphaChange} step={1} />\r\n\r\n <span className=\"map-manager-settings-label\">{locatableLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch onChange={onLocatableToggle} checked={isLocatable} />\r\n\r\n <span className=\"map-manager-settings-label\">{maskingLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch onChange={onMaskingToggle} checked={masking !== MapMaskingOption.None} />\r\n\r\n <span className=\"map-manager-settings-label\">{overrideMaskTransparencyLabel}</span>\r\n <ToggleSwitch disabled={masking === MapMaskingOption.None} onChange={onOverrideMaskTransparencyToggle} checked={overrideMaskTransparency} />\r\n\r\n <span className=\"map-manager-settings-label\">{maskTransparencyLabel}</span>\r\n <Slider disabled={masking === MapMaskingOption.None || !overrideMaskTransparency} min={0} max={100} values={[getNormalizedMaskTransparency() * 100]} onChange={handleMaskTransparencyChange} step={1} />\r\n\r\n <>\r\n <span className=\"map-manager-settings-label\">{elevationOffsetLabel}</span>\r\n <QuantityNumberInput disabled={applyTerrain} persistenceValue={groundBias} step={1} snap quantityType={QuantityType.LengthEngineering} onChange={handleElevationChange} onKeyDown={onKeyDown}/>\r\n\r\n <span className=\"map-manager-settings-label\">{useDepthBufferLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch disabled={applyTerrain} onChange={onToggleUseDepthBuffer} checked={useDepthBuffer} />\r\n </>\r\n\r\n </div>\r\n <div className=\"map-manager-settings-terrain-container\">\r\n <fieldset>\r\n <legend>{terrainLabel}</legend>\r\n\r\n <div className=\"maplayers-settings-container\">\r\n\r\n <span className=\"map-manager-settings-label\">{enableLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch onChange={onToggleTerrain} checked={applyTerrain} />\r\n\r\n <span className=\"map-manager-settings-label\">{modelHeightLabel}</span>\r\n <QuantityNumberInput disabled={!applyTerrain} persistenceValue={terrainOrigin} snap quantityType={QuantityType.LengthEngineering} onChange={handleHeightOriginChange} onKeyDown={onKeyDown}/>\r\n\r\n <span className=\"map-manager-settings-label\">{heightOriginLabel}</span>\r\n <Select options={terrainHeightOptions.current} disabled={!applyTerrain} value={heightOriginMode} onChange={handleElevationTypeSelected} size=\"small\" />\r\n\r\n <span className=\"map-manager-settings-label\">{exaggerationLabel}</span>\r\n <NumberInput value={exaggeration} disabled={!applyTerrain} onChange={handleExaggerationChange} onKeyDown={onKeyDown} />\r\n </div>\r\n\r\n </fieldset>\r\n </div>\r\n </>\r\n );\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"MapManagerSettings.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapManagerSettings.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,2CAA2C;AAE3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAG,YAAY,EAAe,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAA6C,kBAAkB,EAAE,sBAAsB,EAAE,uBAAuB,EAAgB,MAAM,oBAAoB,CAAC;AAClK,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAgB,MAAM,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,4CAA4C;AAE5C,IAAK,gBAGJ;AAHD,WAAK,gBAAgB;IACnB,uDAAI,CAAA;IACJ,iEAAS,CAAA;AACX,CAAC,EAHI,gBAAgB,KAAhB,gBAAgB,QAGpB;AAED,SAAS,qCAAqC,CAAC,qBAA4C;IACzF,IAAI,qBAAqB,CAAC,cAAc,CAAC,IAAI,KAAK,kBAAkB,CAAC,QAAQ,IAAI,qBAAqB,CAAC,cAAc,CAAC,QAAQ,EAAE;QAC9H,IAAI,qBAAqB,CAAC,cAAc,CAAC,QAAQ,IAAI,sBAAsB,CAAC,aAAa,EAAE;YACzF,OAAO,gBAAgB,CAAC,SAAS,CAAC;SACnC;KAEF;IACD,OAAO,gBAAgB,CAAC,IAAI,CAAC;AAC/B,CAAC;AAED,SAAS,sBAAsB,CAAC,IAA6B;IAC3D,IAAI,uBAAuB,CAAC,QAAQ,KAAK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,YAAY,CAAU;gBAE/B,6BAAK,SAAS,EAAC,8BAA8B;oBAE3C,8BAAM,SAAS,EAAC,4BAA4B,IAAE,WAAW,CAAQ;oBAEjE,oBAAC,YAAY,IAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,GAAI;oBAElE,8BAAM,SAAS,EAAC,4BAA4B,IAAE,gBAAgB,CAAQ;oBACtE,oBAAC,mBAAmB,IAAC,QAAQ,EAAE,CAAC,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,QAAC,YAAY,EAAE,YAAY,CAAC,iBAAiB,EAAE,QAAQ,EAAE,wBAAwB,EAAE,SAAS,EAAE,SAAS,GAAG;oBAE7L,8BAAM,SAAS,EAAC,4BAA4B,IAAE,iBAAiB,CAAQ;oBAEvE,oBAAC,MAAM,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,WAAW,IAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,wBAAwB,EAAE,SAAS,EAAE,SAAS,GAAI,CACnH,CAEG,CACP,CACL,CACJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n// cSpell:ignore droppable Sublayer Basemap\r\n\r\nimport * as React from \"react\";\r\nimport { NumberInput } from \"@itwin/core-react\";\r\nimport { QuantityType, ViewState3d } from \"@itwin/core-frontend\";\r\nimport { BackgroundMapProps, BackgroundMapSettings, PlanarClipMaskMode, PlanarClipMaskPriority, TerrainHeightOriginMode, TerrainProps } from \"@itwin/core-common\";\r\nimport { useSourceMapContext } from \"./MapLayerManager\";\r\nimport \"./MapManagerSettings.scss\";\r\nimport { Select, SelectOption, Slider, ToggleSwitch } from \"@itwin/itwinui-react\";\r\nimport { QuantityNumberInput } from \"@itwin/imodel-components-react\";\r\nimport { MapLayersUI } from \"../../mapLayers\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\nenum MapMaskingOption {\r\n None,\r\n AllModels\r\n}\r\n\r\nfunction getMapMaskingFromBackgroundMapSetting(backgroundMapSettings: BackgroundMapSettings): MapMaskingOption {\r\n if (backgroundMapSettings.planarClipMask.mode === PlanarClipMaskMode.Priority && backgroundMapSettings.planarClipMask.priority) {\r\n if (backgroundMapSettings.planarClipMask.priority >= PlanarClipMaskPriority.BackgroundMap) {\r\n return MapMaskingOption.AllModels;\r\n }\r\n\r\n }\r\n return MapMaskingOption.None;\r\n}\r\n\r\nfunction getHeightOriginModeKey(mode: TerrainHeightOriginMode): string {\r\n if (TerrainHeightOriginMode.Geodetic === mode)\r\n return \"geodetic\";\r\n if (TerrainHeightOriginMode.Geoid === mode)\r\n return \"geoid\";\r\n return \"ground\";\r\n}\r\n\r\nfunction getHeightOriginModeFromKey(mode: string): TerrainHeightOriginMode {\r\n if (\"geodetic\" === mode)\r\n return TerrainHeightOriginMode.Geodetic;\r\n if (\"geoid\" === mode)\r\n return TerrainHeightOriginMode.Geoid;\r\n return TerrainHeightOriginMode.Ground;\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function MapManagerSettings() {\r\n const { activeViewport } = useSourceMapContext();\r\n const backgroundMapSettings = (activeViewport!.view as ViewState3d).getDisplayStyle3d().settings.backgroundMap;\r\n\r\n const [transparency, setTransparency] = React.useState(() =>\r\n typeof backgroundMapSettings.transparency === \"boolean\"\r\n ? 0\r\n : Math.round((backgroundMapSettings.transparency) * 100) / 100);\r\n\r\n const terrainSettings = backgroundMapSettings.terrainSettings;\r\n const [groundBias, setGroundBias] = React.useState(() => backgroundMapSettings.groundBias);\r\n\r\n const terrainHeightOptions = React.useRef<SelectOption<string>[]>([\r\n { value: \"geodetic\", label: MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ElevationTypeGeodetic\") },\r\n { value: \"geoid\", label: MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ElevationTypeGeoid\") },\r\n { value: \"ground\", label: MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ElevationTypeGround\") },\r\n ]);\r\n\r\n const updateTerrainSettings = React.useCallback((props: TerrainProps) => {\r\n activeViewport!.changeBackgroundMapProps({ terrainSettings: props });\r\n activeViewport!.invalidateRenderPlan();\r\n }, [activeViewport]);\r\n\r\n const updateBackgroundMap = React.useCallback((props: BackgroundMapProps) => {\r\n activeViewport!.changeBackgroundMapProps(props);\r\n activeViewport!.invalidateRenderPlan();\r\n }, [activeViewport]);\r\n\r\n const [heightOriginMode, setHeightOriginMode] = React.useState(() => getHeightOriginModeKey(terrainSettings.heightOriginMode));\r\n const handleElevationTypeSelected = React.useCallback((newValue: string): void => {\r\n if (newValue) {\r\n const newHeightOriginMode = getHeightOriginModeFromKey(newValue);\r\n updateTerrainSettings({ heightOriginMode: newHeightOriginMode });\r\n setHeightOriginMode(newValue);\r\n }\r\n }, [updateTerrainSettings]);\r\n\r\n const [maskTransparency, setMaskTransparency] = React.useState(() =>\r\n backgroundMapSettings.planarClipMask.transparency === undefined\r\n ? undefined\r\n : Math.round((backgroundMapSettings.planarClipMask.transparency) * 100) / 100);\r\n\r\n const getNormalizedMaskTransparency = React.useCallback(() => { return (maskTransparency === undefined ? 0 : maskTransparency); }, [maskTransparency]);\r\n\r\n const updateMaskingSettings = React.useCallback((option: MapMaskingOption) => {\r\n if (option === MapMaskingOption.AllModels) {\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.Priority, priority: PlanarClipMaskPriority.BackgroundMap, transparency: maskTransparency } });\r\n }\r\n if (option === MapMaskingOption.None) {\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.None } });\r\n }\r\n\r\n activeViewport!.invalidateRenderPlan();\r\n }, [activeViewport, maskTransparency]);\r\n\r\n const [masking, setMasking] = React.useState(() => getMapMaskingFromBackgroundMapSetting(backgroundMapSettings));\r\n\r\n const onMaskingToggle = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n const maskingOption = checked ? MapMaskingOption.AllModels : MapMaskingOption.None;\r\n updateMaskingSettings(maskingOption);\r\n setMasking(maskingOption);\r\n }, [updateMaskingSettings]);\r\n\r\n const [overrideMaskTransparency, setOverrideMaskTransparency] = React.useState(() => backgroundMapSettings.planarClipMask.transparency !== undefined);\r\n\r\n const onOverrideMaskTransparencyToggle = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n const trans = checked ? getNormalizedMaskTransparency() : undefined;\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.Priority, priority: PlanarClipMaskPriority.BackgroundMap, transparency: trans } });\r\n\r\n setOverrideMaskTransparency(checked);\r\n }, [activeViewport, getNormalizedMaskTransparency]);\r\n\r\n const handleElevationChange = React.useCallback((value: number) => {\r\n if (value !== undefined) {\r\n updateBackgroundMap({ groundBias: value });\r\n setGroundBias(value);\r\n }\r\n }, [updateBackgroundMap]);\r\n\r\n const handleAlphaChange = React.useCallback((values: readonly number[]) => {\r\n const newTransparency = values[0] / 100;\r\n activeViewport!.changeBackgroundMapProps({ transparency: newTransparency });\r\n activeViewport!.invalidateRenderPlan();\r\n setTransparency(newTransparency);\r\n }, [activeViewport]);\r\n\r\n const handleMaskTransparencyChange = React.useCallback((values: readonly number[]) => {\r\n const newTransparency = values[0] / 100;\r\n activeViewport!.changeBackgroundMapProps({ planarClipMask: { mode: PlanarClipMaskMode.Priority, priority: PlanarClipMaskPriority.BackgroundMap, transparency: newTransparency } });\r\n activeViewport!.invalidateRenderPlan();\r\n setMaskTransparency(newTransparency);\r\n }, [activeViewport]);\r\n\r\n const [applyTerrain, setApplyTerrain] = React.useState(() => backgroundMapSettings.applyTerrain);\r\n\r\n const onToggleTerrain = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n updateBackgroundMap({ applyTerrain: checked });\r\n setApplyTerrain(checked);\r\n }, [updateBackgroundMap]);\r\n\r\n const [exaggeration, setExaggeration] = React.useState(() => terrainSettings.exaggeration);\r\n\r\n const handleExaggerationChange = React.useCallback((value: number | undefined, _stringValue: string) => {\r\n if (undefined !== value) {\r\n updateTerrainSettings({ exaggeration: value });\r\n setExaggeration(value);\r\n }\r\n }, [updateTerrainSettings]);\r\n\r\n const [terrainOrigin, setTerrainOrigin] = React.useState(() => terrainSettings.heightOrigin);\r\n\r\n const handleHeightOriginChange = React.useCallback((value: number) => {\r\n if (undefined !== value) {\r\n updateTerrainSettings({ heightOrigin: value });\r\n setTerrainOrigin(value);\r\n }\r\n }, [updateTerrainSettings]);\r\n\r\n const [useDepthBuffer, setUseDepthBuffer] = React.useState(() => backgroundMapSettings.useDepthBuffer);\r\n const onToggleUseDepthBuffer = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n updateBackgroundMap({ useDepthBuffer: checked });\r\n setUseDepthBuffer(checked);\r\n }, [updateBackgroundMap]);\r\n\r\n /** Disable commas and letters */\r\n const onKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n if (event.keyCode === 188 || (event.keyCode >= 65 && event.keyCode <= 90))\r\n event.preventDefault();\r\n }, []);\r\n\r\n const [isLocatable, setIsLocatable] = React.useState(() => backgroundMapSettings.locatable);\r\n const onLocatableToggle = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n const checked = e.target.checked;\r\n updateBackgroundMap({ nonLocatable: !checked });\r\n setIsLocatable(checked);\r\n }, [updateBackgroundMap]);\r\n\r\n const [transparencyLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Transparency\"));\r\n const [terrainLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Terrain\"));\r\n const [enableLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Enable\"));\r\n const [elevationOffsetLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ElevationOffset\"));\r\n const [useDepthBufferLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.UseDepthBuffer\"));\r\n const [modelHeightLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.ModelHeight\"));\r\n const [heightOriginLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.HeightOrigin\"));\r\n const [exaggerationLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Exaggeration\"));\r\n const [locatableLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Locatable\"));\r\n const [maskingLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.Mask\"));\r\n const [overrideMaskTransparencyLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.OverrideMaskTransparency\"));\r\n const [maskTransparencyLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Settings.MaskTransparency\"));\r\n\r\n return (\r\n <>\r\n <div className=\"maplayers-settings-container\">\r\n\r\n <span className=\"map-manager-settings-label\">{transparencyLabel}</span>\r\n <Slider min={0} max={100} values={[transparency * 100]} onChange={handleAlphaChange} step={1} />\r\n\r\n <span className=\"map-manager-settings-label\">{locatableLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch onChange={onLocatableToggle} checked={isLocatable} />\r\n\r\n <span className=\"map-manager-settings-label\">{maskingLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch onChange={onMaskingToggle} checked={masking !== MapMaskingOption.None} />\r\n\r\n <span className=\"map-manager-settings-label\">{overrideMaskTransparencyLabel}</span>\r\n <ToggleSwitch disabled={masking === MapMaskingOption.None} onChange={onOverrideMaskTransparencyToggle} checked={overrideMaskTransparency} />\r\n\r\n <span className=\"map-manager-settings-label\">{maskTransparencyLabel}</span>\r\n <Slider disabled={masking === MapMaskingOption.None || !overrideMaskTransparency} min={0} max={100} values={[getNormalizedMaskTransparency() * 100]} onChange={handleMaskTransparencyChange} step={1} />\r\n\r\n <>\r\n <span className=\"map-manager-settings-label\">{elevationOffsetLabel}</span>\r\n <QuantityNumberInput disabled={applyTerrain} persistenceValue={groundBias} step={1} snap quantityType={QuantityType.LengthEngineering} onChange={handleElevationChange} onKeyDown={onKeyDown}/>\r\n\r\n <span className=\"map-manager-settings-label\">{useDepthBufferLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch disabled={applyTerrain} onChange={onToggleUseDepthBuffer} checked={useDepthBuffer} />\r\n </>\r\n\r\n </div>\r\n <div className=\"map-manager-settings-terrain-container\">\r\n <fieldset>\r\n <legend>{terrainLabel}</legend>\r\n\r\n <div className=\"maplayers-settings-container\">\r\n\r\n <span className=\"map-manager-settings-label\">{enableLabel}</span>\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n <ToggleSwitch onChange={onToggleTerrain} checked={applyTerrain} />\r\n\r\n <span className=\"map-manager-settings-label\">{modelHeightLabel}</span>\r\n <QuantityNumberInput disabled={!applyTerrain} persistenceValue={terrainOrigin} snap quantityType={QuantityType.LengthEngineering} onChange={handleHeightOriginChange} onKeyDown={onKeyDown}/>\r\n\r\n <span className=\"map-manager-settings-label\">{heightOriginLabel}</span>\r\n {/* 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"}
|
|
@@ -274,6 +274,7 @@ export function MapUrlDialog(props) {
|
|
|
274
274
|
const source = createSource();
|
|
275
275
|
if (source === undefined || props.mapLayerSourceToEdit) {
|
|
276
276
|
ModalDialogManager.closeDialog();
|
|
277
|
+
onOkResult();
|
|
277
278
|
if (source === undefined) {
|
|
278
279
|
// Close the dialog and inform end user something went wrong.
|
|
279
280
|
const msgError = MapLayersUI.localization.getLocalizedString("mapLayers:Messages.MapLayerLayerSourceCreationFailed");
|
|
@@ -312,13 +313,15 @@ export function MapUrlDialog(props) {
|
|
|
312
313
|
// AttachLayerPanel's 'onOkResult' handler. We close it here just in case.
|
|
313
314
|
if (closeDialog) {
|
|
314
315
|
ModalDialogManager.closeDialog();
|
|
316
|
+
onOkResult();
|
|
315
317
|
}
|
|
316
318
|
}
|
|
317
319
|
catch (_error) {
|
|
320
|
+
onOkResult();
|
|
318
321
|
ModalDialogManager.closeDialog();
|
|
319
322
|
}
|
|
320
323
|
})();
|
|
321
|
-
}, [createSource, props.mapLayerSourceToEdit, props.activeViewport, mapUrl, isSettingsStorageAvailable, attemptAttachSource]);
|
|
324
|
+
}, [createSource, props.mapLayerSourceToEdit, props.activeViewport, onOkResult, mapUrl, isSettingsStorageAvailable, attemptAttachSource]);
|
|
322
325
|
// The first time the dialog is loaded and we already know the layer requires auth. (i.e ImageryProvider already made an attempt)
|
|
323
326
|
// makes a request to discover the authentification types and adjust UI accordingly (i.e. username/password fields, Oauth popup)
|
|
324
327
|
// Without this effect, user would have to manually click the 'OK' button in order to trigger the layer connection.
|