@itwin/map-layers 3.0.0-dev.78 → 3.0.0-dev.82
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/lib/{map-layers.d.ts → cjs/map-layers.d.ts} +0 -0
- package/lib/cjs/map-layers.d.ts.map +1 -0
- package/lib/{map-layers.js → cjs/map-layers.js} +0 -0
- package/lib/cjs/map-layers.js.map +1 -0
- package/lib/{mapLayers.d.ts → cjs/mapLayers.d.ts} +0 -0
- package/lib/cjs/mapLayers.d.ts.map +1 -0
- package/lib/{mapLayers.js → cjs/mapLayers.js} +0 -0
- package/lib/cjs/mapLayers.js.map +1 -0
- package/lib/{public → cjs/public}/locales/en/mapLayers.json +0 -0
- package/lib/{ui → cjs/ui}/Interfaces.d.ts +0 -0
- package/lib/cjs/ui/Interfaces.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/Interfaces.js +0 -0
- package/lib/cjs/ui/Interfaces.js.map +1 -0
- package/lib/{ui → cjs/ui}/MapLayersUiItemsProvider.d.ts +0 -0
- package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/MapLayersUiItemsProvider.js +0 -0
- package/lib/cjs/ui/MapLayersUiItemsProvider.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/AttachLayerPopupButton.d.ts +0 -0
- package/lib/cjs/ui/widget/AttachLayerPopupButton.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/widget/AttachLayerPopupButton.js +0 -0
- package/lib/cjs/ui/widget/AttachLayerPopupButton.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/BasemapPanel.d.ts +0 -0
- package/lib/cjs/ui/widget/BasemapPanel.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/widget/BasemapPanel.js +0 -0
- package/lib/cjs/ui/widget/BasemapPanel.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/BasemapPanel.scss +1 -1
- package/lib/{ui → cjs/ui}/widget/ConfirmMessageDialog.d.ts +0 -0
- package/lib/cjs/ui/widget/ConfirmMessageDialog.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/widget/ConfirmMessageDialog.js +0 -0
- package/lib/cjs/ui/widget/ConfirmMessageDialog.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapLayerDroppable.d.ts +0 -0
- package/lib/cjs/ui/widget/MapLayerDroppable.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapLayerDroppable.js +0 -0
- package/lib/cjs/ui/widget/MapLayerDroppable.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapLayerManager.d.ts +0 -0
- package/lib/cjs/ui/widget/MapLayerManager.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapLayerManager.js +0 -0
- package/lib/cjs/ui/widget/MapLayerManager.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapLayerManager.scss +1 -1
- package/lib/{ui → cjs/ui}/widget/MapLayerSettingsMenu.d.ts +0 -0
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapLayerSettingsMenu.js +0 -0
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapLayerSettingsPopupButton.d.ts +0 -0
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapLayerSettingsPopupButton.js +0 -0
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapLayerSettingsPopupButton.scss +1 -1
- package/lib/{ui → cjs/ui}/widget/MapLayersWidget.d.ts +0 -0
- package/lib/cjs/ui/widget/MapLayersWidget.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapLayersWidget.js +0 -0
- package/lib/cjs/ui/widget/MapLayersWidget.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapManagerSettings.d.ts +0 -0
- package/lib/cjs/ui/widget/MapManagerSettings.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapManagerSettings.js +0 -0
- package/lib/cjs/ui/widget/MapManagerSettings.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapManagerSettings.scss +1 -1
- package/lib/{ui → cjs/ui}/widget/MapUrlDialog.d.ts +0 -0
- package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapUrlDialog.js +0 -0
- package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/MapUrlDialog.scss +1 -1
- package/lib/{ui → cjs/ui}/widget/SubLayersDataProvider.d.ts +0 -0
- package/lib/cjs/ui/widget/SubLayersDataProvider.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/widget/SubLayersDataProvider.js +0 -0
- package/lib/cjs/ui/widget/SubLayersDataProvider.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/SubLayersPopupButton.d.ts +0 -0
- package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/widget/SubLayersPopupButton.js +0 -0
- package/lib/cjs/ui/widget/SubLayersPopupButton.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/SubLayersTree.d.ts +0 -0
- package/lib/cjs/ui/widget/SubLayersTree.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/widget/SubLayersTree.js +0 -0
- package/lib/cjs/ui/widget/SubLayersTree.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/SubLayersTree.scss +1 -1
- package/lib/{ui → cjs/ui}/widget/TransparencyPopupButton.d.ts +0 -0
- package/lib/cjs/ui/widget/TransparencyPopupButton.d.ts.map +1 -0
- package/lib/{ui → cjs/ui}/widget/TransparencyPopupButton.js +0 -0
- package/lib/cjs/ui/widget/TransparencyPopupButton.js.map +1 -0
- package/lib/{ui → cjs/ui}/widget/TransparencyPopupButton.scss +1 -1
- package/lib/esm/map-layers.d.ts +5 -0
- package/lib/esm/map-layers.d.ts.map +1 -0
- package/lib/esm/map-layers.js +9 -0
- package/lib/esm/map-layers.js.map +1 -0
- package/lib/esm/mapLayers.d.ts +29 -0
- package/lib/esm/mapLayers.d.ts.map +1 -0
- package/lib/esm/mapLayers.js +50 -0
- package/lib/esm/mapLayers.js.map +1 -0
- package/lib/esm/public/locales/en/mapLayers.json +113 -0
- package/lib/esm/ui/Interfaces.d.ts +32 -0
- package/lib/esm/ui/Interfaces.d.ts.map +1 -0
- package/lib/esm/ui/Interfaces.js +2 -0
- package/lib/esm/ui/Interfaces.js.map +1 -0
- package/lib/esm/ui/MapLayersUiItemsProvider.d.ts +23 -0
- package/lib/esm/ui/MapLayersUiItemsProvider.d.ts.map +1 -0
- package/lib/esm/ui/MapLayersUiItemsProvider.js +50 -0
- package/lib/esm/ui/MapLayersUiItemsProvider.js.map +1 -0
- package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts +14 -0
- package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts.map +1 -0
- package/lib/esm/ui/widget/AttachLayerPopupButton.js +308 -0
- package/lib/esm/ui/widget/AttachLayerPopupButton.js.map +1 -0
- package/lib/esm/ui/widget/BasemapPanel.d.ts +5 -0
- package/lib/esm/ui/widget/BasemapPanel.d.ts.map +1 -0
- package/lib/esm/ui/widget/BasemapPanel.js +141 -0
- package/lib/esm/ui/widget/BasemapPanel.js.map +1 -0
- package/lib/esm/ui/widget/BasemapPanel.scss +98 -0
- package/lib/esm/ui/widget/ConfirmMessageDialog.d.ts +22 -0
- package/lib/esm/ui/widget/ConfirmMessageDialog.d.ts.map +1 -0
- package/lib/esm/ui/widget/ConfirmMessageDialog.js +22 -0
- package/lib/esm/ui/widget/ConfirmMessageDialog.js.map +1 -0
- package/lib/esm/ui/widget/MapLayerDroppable.d.ts +19 -0
- package/lib/esm/ui/widget/MapLayerDroppable.d.ts.map +1 -0
- package/lib/esm/ui/widget/MapLayerDroppable.js +80 -0
- package/lib/esm/ui/widget/MapLayerDroppable.js.map +1 -0
- package/lib/esm/ui/widget/MapLayerManager.d.ts +27 -0
- package/lib/esm/ui/widget/MapLayerManager.d.ts.map +1 -0
- package/lib/esm/ui/widget/MapLayerManager.js +347 -0
- package/lib/esm/ui/widget/MapLayerManager.js.map +1 -0
- package/lib/esm/ui/widget/MapLayerManager.scss +525 -0
- package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts +10 -0
- package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -0
- package/lib/esm/ui/widget/MapLayerSettingsMenu.js +79 -0
- package/lib/esm/ui/widget/MapLayerSettingsMenu.js.map +1 -0
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts +5 -0
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -0
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js +31 -0
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js.map +1 -0
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.scss +31 -0
- package/lib/esm/ui/widget/MapLayersWidget.d.ts +12 -0
- package/lib/esm/ui/widget/MapLayersWidget.d.ts.map +1 -0
- package/lib/esm/ui/widget/MapLayersWidget.js +23 -0
- package/lib/esm/ui/widget/MapLayersWidget.js.map +1 -0
- package/lib/esm/ui/widget/MapManagerSettings.d.ts +4 -0
- package/lib/esm/ui/widget/MapManagerSettings.d.ts.map +1 -0
- package/lib/esm/ui/widget/MapManagerSettings.js +168 -0
- package/lib/esm/ui/widget/MapManagerSettings.js.map +1 -0
- package/lib/esm/ui/widget/MapManagerSettings.scss +23 -0
- package/lib/esm/ui/widget/MapUrlDialog.d.ts +23 -0
- package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -0
- package/lib/esm/ui/widget/MapUrlDialog.js +346 -0
- package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -0
- package/lib/esm/ui/widget/MapUrlDialog.scss +85 -0
- package/lib/esm/ui/widget/SubLayersDataProvider.d.ts +21 -0
- package/lib/esm/ui/widget/SubLayersDataProvider.d.ts.map +1 -0
- package/lib/esm/ui/widget/SubLayersDataProvider.js +73 -0
- package/lib/esm/ui/widget/SubLayersDataProvider.js.map +1 -0
- package/lib/esm/ui/widget/SubLayersPopupButton.d.ts +11 -0
- package/lib/esm/ui/widget/SubLayersPopupButton.d.ts.map +1 -0
- package/lib/esm/ui/widget/SubLayersPopupButton.js +36 -0
- package/lib/esm/ui/widget/SubLayersPopupButton.js.map +1 -0
- package/lib/esm/ui/widget/SubLayersTree.d.ts +16 -0
- package/lib/esm/ui/widget/SubLayersTree.d.ts.map +1 -0
- package/lib/esm/ui/widget/SubLayersTree.js +374 -0
- package/lib/esm/ui/widget/SubLayersTree.js.map +1 -0
- package/lib/esm/ui/widget/SubLayersTree.scss +64 -0
- package/lib/esm/ui/widget/TransparencyPopupButton.d.ts +14 -0
- package/lib/esm/ui/widget/TransparencyPopupButton.d.ts.map +1 -0
- package/lib/esm/ui/widget/TransparencyPopupButton.js +44 -0
- package/lib/esm/ui/widget/TransparencyPopupButton.js.map +1 -0
- package/lib/esm/ui/widget/TransparencyPopupButton.scss +53 -0
- package/lib/public/en/mapLayers.json +113 -0
- package/package.json +45 -39
- package/lib/map-layers.d.ts.map +0 -1
- package/lib/map-layers.js.map +0 -1
- package/lib/mapLayers.d.ts.map +0 -1
- package/lib/mapLayers.js.map +0 -1
- package/lib/ui/Interfaces.d.ts.map +0 -1
- package/lib/ui/Interfaces.js.map +0 -1
- package/lib/ui/MapLayersUiItemsProvider.d.ts.map +0 -1
- package/lib/ui/MapLayersUiItemsProvider.js.map +0 -1
- package/lib/ui/widget/AttachLayerPopupButton.d.ts.map +0 -1
- package/lib/ui/widget/AttachLayerPopupButton.js.map +0 -1
- package/lib/ui/widget/BasemapPanel.d.ts.map +0 -1
- package/lib/ui/widget/BasemapPanel.js.map +0 -1
- package/lib/ui/widget/ConfirmMessageDialog.d.ts.map +0 -1
- package/lib/ui/widget/ConfirmMessageDialog.js.map +0 -1
- package/lib/ui/widget/MapLayerDroppable.d.ts.map +0 -1
- package/lib/ui/widget/MapLayerDroppable.js.map +0 -1
- package/lib/ui/widget/MapLayerManager.d.ts.map +0 -1
- package/lib/ui/widget/MapLayerManager.js.map +0 -1
- package/lib/ui/widget/MapLayerSettingsMenu.d.ts.map +0 -1
- package/lib/ui/widget/MapLayerSettingsMenu.js.map +0 -1
- package/lib/ui/widget/MapLayerSettingsPopupButton.d.ts.map +0 -1
- package/lib/ui/widget/MapLayerSettingsPopupButton.js.map +0 -1
- package/lib/ui/widget/MapLayersWidget.d.ts.map +0 -1
- package/lib/ui/widget/MapLayersWidget.js.map +0 -1
- package/lib/ui/widget/MapManagerSettings.d.ts.map +0 -1
- package/lib/ui/widget/MapManagerSettings.js.map +0 -1
- package/lib/ui/widget/MapUrlDialog.d.ts.map +0 -1
- package/lib/ui/widget/MapUrlDialog.js.map +0 -1
- package/lib/ui/widget/SubLayersDataProvider.d.ts.map +0 -1
- package/lib/ui/widget/SubLayersDataProvider.js.map +0 -1
- package/lib/ui/widget/SubLayersPopupButton.d.ts.map +0 -1
- package/lib/ui/widget/SubLayersPopupButton.js.map +0 -1
- package/lib/ui/widget/SubLayersTree.d.ts.map +0 -1
- package/lib/ui/widget/SubLayersTree.js.map +0 -1
- package/lib/ui/widget/TransparencyPopupButton.d.ts.map +0 -1
- package/lib/ui/widget/TransparencyPopupButton.js.map +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./TransparencyPopupButton.scss";
|
|
3
|
+
/** @alpha */
|
|
4
|
+
export interface TransparencyPopupButtonProps {
|
|
5
|
+
/** initialValue range 0-1 */
|
|
6
|
+
transparency: number;
|
|
7
|
+
/** function called when value changes. Returned value range 0-1 */
|
|
8
|
+
onTransparencyChange(value: number): void;
|
|
9
|
+
/** optional tooltip */
|
|
10
|
+
buttonToolTip?: string;
|
|
11
|
+
}
|
|
12
|
+
/** @alpha */
|
|
13
|
+
export declare function TransparencyPopupButton({ transparency, onTransparencyChange, buttonToolTip }: TransparencyPopupButtonProps): JSX.Element;
|
|
14
|
+
//# sourceMappingURL=TransparencyPopupButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransparencyPopupButton.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/TransparencyPopupButton.tsx"],"names":[],"mappings":";AAWA,OAAO,gCAAgC,CAAC;AAExC,aAAa;AACb,MAAM,WAAW,4BAA4B;IAC3C,6BAA6B;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,uBAAuB;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,aAAa;AAEb,wBAAgB,uBAAuB,CAAC,EAAE,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,EAAE,4BAA4B,eAgD1H"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { RelativePosition } from "@itwin/appui-abstract";
|
|
7
|
+
import { Popup } from "@itwin/core-react";
|
|
8
|
+
import { Slider } from "@itwin/itwinui-react";
|
|
9
|
+
import { MapLayersUiItemsProvider } from "../MapLayersUiItemsProvider";
|
|
10
|
+
import "./TransparencyPopupButton.scss";
|
|
11
|
+
/** @alpha */
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13
|
+
export function TransparencyPopupButton({ transparency, onTransparencyChange, buttonToolTip }) {
|
|
14
|
+
const [isSettingsOpen, setIsSettingsOpen] = React.useState(false);
|
|
15
|
+
const [defaultTransparencyLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:TransparencyPopup.SetTransparency"));
|
|
16
|
+
const toolTipLabel = React.useMemo(() => buttonToolTip ? buttonToolTip : defaultTransparencyLabel, [buttonToolTip, defaultTransparencyLabel]);
|
|
17
|
+
const buttonRef = React.useRef(null);
|
|
18
|
+
const togglePopupDisplay = React.useCallback((event) => {
|
|
19
|
+
event.preventDefault();
|
|
20
|
+
setIsSettingsOpen((prev) => !prev);
|
|
21
|
+
}, [setIsSettingsOpen]);
|
|
22
|
+
const handleCloseSetting = React.useCallback(() => {
|
|
23
|
+
setIsSettingsOpen(false);
|
|
24
|
+
}, [setIsSettingsOpen]);
|
|
25
|
+
const handleTransparencyChange = React.useCallback((values) => {
|
|
26
|
+
if (values.length) {
|
|
27
|
+
const newTransparency = values[0];
|
|
28
|
+
if (newTransparency !== transparency) {
|
|
29
|
+
if (onTransparencyChange)
|
|
30
|
+
onTransparencyChange(newTransparency / 100);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}, [onTransparencyChange, transparency]);
|
|
34
|
+
return (React.createElement(React.Fragment, null,
|
|
35
|
+
React.createElement("button", { title: toolTipLabel, className: "map-transparency-popup-button", onClick: togglePopupDisplay, ref: buttonRef },
|
|
36
|
+
React.createElement("div", { className: "transparent-button" },
|
|
37
|
+
React.createElement("svg", { className: "checkered", viewBox: "0 0 24 24" },
|
|
38
|
+
React.createElement("path", { d: "m21.00427 0h-18.00854a2.9957 2.9957 0 0 0 -2.99573 2.99567v18.0086a2.99575 2.99575 0 0 0 2.99573 2.99573h18.00854a2.99575 2.99575 0 0 0 2.99573-2.99573v-18.0086a2.9957 2.9957 0 0 0 -2.99573-2.99567zm-20.00427 21.00427v-9.00427h11v-11h9.00427a1.998 1.998 0 0 1 1.99573 1.99567v9.00433h-11v11h-9.00427a1.998 1.998 0 0 1 -1.99573-1.99573z" })))),
|
|
39
|
+
React.createElement(Popup, { isOpen: isSettingsOpen, position: RelativePosition.BottomRight, onClose: handleCloseSetting, target: buttonRef.current },
|
|
40
|
+
React.createElement("div", { className: "map-transparency-popup-panel" },
|
|
41
|
+
React.createElement("div", { className: "map-transparency-slider-container" },
|
|
42
|
+
React.createElement(Slider, { min: 0, max: 100, values: [transparency * 100], step: 1, onChange: handleTransparencyChange }))))));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=TransparencyPopupButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransparencyPopupButton.js","sourceRoot":"","sources":["../../../../src/ui/widget/TransparencyPopupButton.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,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,gCAAgC,CAAC;AAYxC,aAAa;AACb,gEAAgE;AAChE,MAAM,UAAU,uBAAuB,CAAC,EAAE,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAgC;IACzH,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,CAAC,wBAAwB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,wBAAwB,CAAC,YAAY,CAAC,kBAAkB,CAAC,6CAA6C,CAAC,CAAC,CAAC;IAC3J,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAC,aAAa,EAAE,wBAAwB,CAAC,CAAC,CAAC;IAE9I,MAAM,SAAS,GAAG,KAAK,CAAC,M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,6BAAK,SAAS,EAAC,mCAAmC;oBAChD,oBAAC,MAAM,IAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,YAAY,GAAG,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,wBAAwB,GAAI,CACnG,CACF,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 } from \"@itwin/core-react\";\r\nimport { Slider } from \"@itwin/itwinui-react\";\r\n\r\nimport { MapLayersUiItemsProvider } from \"../MapLayersUiItemsProvider\";\r\nimport \"./TransparencyPopupButton.scss\";\r\n\r\n/** @alpha */\r\nexport interface TransparencyPopupButtonProps {\r\n /** initialValue range 0-1 */\r\n transparency: number;\r\n /** function called when value changes. Returned value range 0-1 */\r\n onTransparencyChange(value: number): void;\r\n /** optional tooltip */\r\n buttonToolTip?: string;\r\n}\r\n\r\n/** @alpha */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function TransparencyPopupButton({ transparency, onTransparencyChange, buttonToolTip }: TransparencyPopupButtonProps) {\r\n const [isSettingsOpen, setIsSettingsOpen] = React.useState(false);\r\n const [defaultTransparencyLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:TransparencyPopup.SetTransparency\"));\r\n const toolTipLabel = React.useMemo(() => buttonToolTip ? buttonToolTip : defaultTransparencyLabel, [buttonToolTip, defaultTransparencyLabel]);\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 const handleTransparencyChange = React.useCallback((values: readonly number[]) => {\r\n if (values.length) {\r\n const newTransparency = values[0];\r\n if (newTransparency !== transparency) {\r\n if (onTransparencyChange)\r\n onTransparencyChange(newTransparency / 100);\r\n }\r\n }\r\n }, [onTransparencyChange, transparency]);\r\n\r\n return (\r\n <>\r\n <button title={toolTipLabel} className=\"map-transparency-popup-button\" onClick={togglePopupDisplay} ref={buttonRef}>\r\n <div className=\"transparent-button\">\r\n <svg className=\"checkered\" viewBox=\"0 0 24 24\">\r\n <path d=\"m21.00427 0h-18.00854a2.9957 2.9957 0 0 0 -2.99573 2.99567v18.0086a2.99575 2.99575 0 0 0 2.99573 2.99573h18.00854a2.99575 2.99575 0 0 0 2.99573-2.99573v-18.0086a2.9957 2.9957 0 0 0 -2.99573-2.99567zm-20.00427 21.00427v-9.00427h11v-11h9.00427a1.998 1.998 0 0 1 1.99573 1.99567v9.00433h-11v11h-9.00427a1.998 1.998 0 0 1 -1.99573-1.99573z\" />\r\n </svg>\r\n </div>\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=\"map-transparency-popup-panel\">\r\n <div className=\"map-transparency-slider-container\">\r\n <Slider min={0} max={100} values={[transparency * 100]} step={1} onChange={handleTransparencyChange} />\r\n </div>\r\n </div>\r\n </Popup >\r\n </ >\r\n );\r\n}\r\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
@import "~@itwin/core-react/lib/cjs/core-react/index";
|
|
6
|
+
@import "~@itwin/itwinui-css/scss/style/typography";
|
|
7
|
+
|
|
8
|
+
.map-transparency-popup-panel {
|
|
9
|
+
z-index: 14000;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
|
|
13
|
+
.map-transparency-slider-container {
|
|
14
|
+
display: block;
|
|
15
|
+
width: 160px;
|
|
16
|
+
height: 2.5em;
|
|
17
|
+
margin-left: 1em;
|
|
18
|
+
margin-right: 1em;
|
|
19
|
+
margin-top: 6px;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.map-transparency-popup-button {
|
|
24
|
+
color: $buic-foreground-body;
|
|
25
|
+
font-size: $iui-font-size;
|
|
26
|
+
background-color: transparent;
|
|
27
|
+
height: 2.2em;
|
|
28
|
+
border: none;
|
|
29
|
+
margin-right: 2px;
|
|
30
|
+
|
|
31
|
+
.transparent-button {
|
|
32
|
+
width: 16px;
|
|
33
|
+
height: 16px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
svg.checkered {
|
|
37
|
+
fill: $buic-foreground-body;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:hover {
|
|
41
|
+
color: $buic-foreground-primary-tone;
|
|
42
|
+
cursor: auto;
|
|
43
|
+
|
|
44
|
+
svg.checkered {
|
|
45
|
+
fill: $buic-foreground-primary-tone;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:focus {
|
|
50
|
+
box-shadow: $uicore-button-focus-boxshadow;
|
|
51
|
+
outline: none;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
{
|
|
2
|
+
"AttachLayerPopup": {
|
|
3
|
+
"Attach": "Attach map layer",
|
|
4
|
+
"Close": "Close source map layers pop-up"
|
|
5
|
+
},
|
|
6
|
+
"Basemap": {
|
|
7
|
+
"BaseLayer": "Base:",
|
|
8
|
+
"BaseMapPanelTitle": "Map Layers",
|
|
9
|
+
"ColorFill": "Solid Fill Color",
|
|
10
|
+
"SelectBaseMap": "Select Map for base layer"
|
|
11
|
+
},
|
|
12
|
+
"ColorDialog": {
|
|
13
|
+
"Title": "Specify Base Color"
|
|
14
|
+
},
|
|
15
|
+
"CustomAttach": {
|
|
16
|
+
"LayerWithUrlExistsOverwriting": "Map layer with URL: {{url}} already exists. Updating name from {{oldName}} to {{newName}}.",
|
|
17
|
+
"LayerWithUrlExistsAsITwinSetting": "Map Layer with URL: {{url}} already exists as a iTwin setting under name {{name}}. Cannot overwrite with a model setting!",
|
|
18
|
+
"LayerExistsOverwriting": "Map layer {{layer}} already exists, overwriting info for that layer.",
|
|
19
|
+
"LayerExistsAsITwinSetting": "Map layer {{layer}} already exists as a iTwin setting. Cannot overwrite with a model setting!",
|
|
20
|
+
"AddCustomLayerButtonLabel": "Add Layer",
|
|
21
|
+
"AttachCustomLayer": "Attach New Layer",
|
|
22
|
+
"AttacheInfo": "Map layer attached from URL:",
|
|
23
|
+
"Custom": "New",
|
|
24
|
+
"LoadingMapSources": "Loading Map Sources",
|
|
25
|
+
"EditCustomLayer": "Edit Layer",
|
|
26
|
+
"EditLayerDefButtonTitle": "Edit Layer Definition",
|
|
27
|
+
"ErrorLoadingLayers": "Error retrieving map layers stored in the settings service",
|
|
28
|
+
"ErrorRetrieveUserModel": "Could not get saved Map Layers for user by model: {{errorMessage}}",
|
|
29
|
+
"ErrorRetrieveUserITwin": "Could not get saved Map Layers for user by iTwin: {{errorMessage}}",
|
|
30
|
+
"ErrorRetrieveSharedModel": "Could not get shared Map Layers by model: {{errorMessage}}",
|
|
31
|
+
"ErrorRetrieveSharedITwin": "Could not get shared Map Layers by iTwin: {{errorMessage}}",
|
|
32
|
+
"InvalidCredentials": "Invalid credentials provided",
|
|
33
|
+
"MissingCredentials": "This layer requires credentials to be provided",
|
|
34
|
+
"Name": "Name",
|
|
35
|
+
"NameInputPlaceHolder": "Enter Map Name",
|
|
36
|
+
"RemoveLayerDefButtonTitle": "Delete layer definition",
|
|
37
|
+
"RemoveLayerDefDialogMessage": "Are you sure you want to delete {{layerName}} ?",
|
|
38
|
+
"RemoveLayerDefDialogTitle": "Delete layer definition",
|
|
39
|
+
"RemoveLayerDefError": "Could not delete map layer definition: {{layerName}}",
|
|
40
|
+
"RemoveLayerDefSuccess": "Successfully deleted map layer definition: {{layerName}}",
|
|
41
|
+
"SearchPlaceholder": "Search...",
|
|
42
|
+
"StoreOnModelSettings": "Store on Model Settings",
|
|
43
|
+
"StoreOnITwinSettings": "Store on iTwin Settings",
|
|
44
|
+
"Type": "Type",
|
|
45
|
+
"URL": "URL",
|
|
46
|
+
"UrlInputPlaceHolder": "Enter Map Source URL",
|
|
47
|
+
"ValidationError": "Map layer validation failed for URL:",
|
|
48
|
+
"NoSaveSettingsWarning": "Layer settings cannot saved in the actual configuration"
|
|
49
|
+
},
|
|
50
|
+
"AuthenticationInputs": {
|
|
51
|
+
"Password": "Password",
|
|
52
|
+
"PasswordRequired": "Password required",
|
|
53
|
+
"Username": "Username",
|
|
54
|
+
"UsernameRequired": "Username required"
|
|
55
|
+
},
|
|
56
|
+
"Messages": {
|
|
57
|
+
"NotSupported": "No active viewport or geo-located iModel available.",
|
|
58
|
+
"NoRangeDefined": "No range is defined for Map Layer",
|
|
59
|
+
"Start": "Map Layers Extension Loaded",
|
|
60
|
+
"MapLayerAttached": "Map layer {{sourceName}} attached from URL: {{sourceUrl}}",
|
|
61
|
+
"MapLayerAttachedRequiresAuth": "Map layer {{sourceName}} attached, but requires credentials to be provided",
|
|
62
|
+
"MapLayerAttachError": "Error '{{error}}' occurred attaching MapLayer from URL: {{sourceUrl}}",
|
|
63
|
+
"MapLayerEditError": "Failed to edit '{{layerName}}'",
|
|
64
|
+
"MapLayerLayerSettingsConversionError": "Conversion to layer settings failed",
|
|
65
|
+
"MapLayerLayerSourceCreationFailed": "Map Layer Source creation failed",
|
|
66
|
+
"MapLayerValidationFailed": "Map layer validation failed for URL: {{sourceUrl}}"
|
|
67
|
+
},
|
|
68
|
+
"Widget": {
|
|
69
|
+
"BackgroundLayers": "Background",
|
|
70
|
+
"DropLayerLabel": "Drop layer here",
|
|
71
|
+
"Label": "Map Layers",
|
|
72
|
+
"NoOverlayLayers": "No Overlay layers specified",
|
|
73
|
+
"NoBackgroundLayers": "No Background layers specified",
|
|
74
|
+
"OverlayLayers": "Overlay",
|
|
75
|
+
"RequireAuthTooltip": "Authentication required",
|
|
76
|
+
"ToggleVisibility": "Toggle Visibility",
|
|
77
|
+
"SettingsButtonTooltip": "Settings"
|
|
78
|
+
},
|
|
79
|
+
"LayerMenu": {
|
|
80
|
+
"Detach": "Detach",
|
|
81
|
+
"ZoomToLayer": "Zoom to layer"
|
|
82
|
+
},
|
|
83
|
+
"Settings": {
|
|
84
|
+
"ElevationOffset": "Elevation Offset (m)",
|
|
85
|
+
"ElevationTypeGeodetic": "None",
|
|
86
|
+
"ElevationTypeGeoid": "Geoid Separation",
|
|
87
|
+
"ElevationTypeGround": "Terrain Elevation",
|
|
88
|
+
"Enable": "Enable",
|
|
89
|
+
"Exaggeration": "Exaggeration",
|
|
90
|
+
"HeightOrigin": "Apply Elevation Correction",
|
|
91
|
+
"InvalidElevationError": "Invalid Elevation",
|
|
92
|
+
"InvalidElevationDetails": "Please enter a valid number for elevation.",
|
|
93
|
+
"Mask": "Mask by Models",
|
|
94
|
+
"ModelHeight": "Model Height (m)",
|
|
95
|
+
"Settings": "Settings",
|
|
96
|
+
"ShowMapLayers": "Show Map Layers",
|
|
97
|
+
"Terrain": "Terrain",
|
|
98
|
+
"Transparency": "Transparency",
|
|
99
|
+
"UseDepthBuffer": "Allow Model Under Map",
|
|
100
|
+
"Locatable": "Locatable"
|
|
101
|
+
},
|
|
102
|
+
"SubLayers": {
|
|
103
|
+
"AllOn": "Turn on all Sub-layers",
|
|
104
|
+
"AllOff": "Turn off all Sub-layers",
|
|
105
|
+
"Hide": "Hide Sub-layers",
|
|
106
|
+
"NoSubLayers": "No Sub-layers Available",
|
|
107
|
+
"SearchPlaceholder": "Search...",
|
|
108
|
+
"Show": "Show Sub-layers"
|
|
109
|
+
},
|
|
110
|
+
"TransparencyPopup": {
|
|
111
|
+
"SetTransparency": "Set transparency"
|
|
112
|
+
}
|
|
113
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/map-layers",
|
|
3
|
-
"version": "3.0.0-dev.
|
|
3
|
+
"version": "3.0.0-dev.82",
|
|
4
4
|
"description": "Extension that adds a Map Layers Widget",
|
|
5
|
-
"main": "lib/map-layers.js",
|
|
6
|
-
"
|
|
5
|
+
"main": "lib/cjs/map-layers.js",
|
|
6
|
+
"module": "lib/esm/map-layers.js",
|
|
7
|
+
"typings": "lib/cjs/map-layers",
|
|
7
8
|
"license": "MIT",
|
|
8
9
|
"repository": {
|
|
9
10
|
"type": "git",
|
|
@@ -20,23 +21,23 @@
|
|
|
20
21
|
"url": "http://www.bentley.com"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
|
-
"@itwin/core-bentley": "3.0.0-dev.
|
|
24
|
-
"@itwin/build-tools": "3.0.0-dev.
|
|
25
|
-
"@itwin/eslint-plugin": "3.0.0-dev.
|
|
26
|
-
"@itwin/core-geometry": "3.0.0-dev.
|
|
27
|
-
"@itwin/core-common": "3.0.0-dev.
|
|
28
|
-
"@itwin/core-frontend": "3.0.0-dev.
|
|
29
|
-
"@itwin/core-i18n": "3.0.0-dev.
|
|
30
|
-
"@itwin/core-quantity": "3.0.0-dev.
|
|
31
|
-
"@bentley/itwin-client": "3.0.0-dev.
|
|
32
|
-
"@itwin/presentation-common": "3.0.0-dev.
|
|
24
|
+
"@itwin/core-bentley": "3.0.0-dev.82",
|
|
25
|
+
"@itwin/build-tools": "3.0.0-dev.82",
|
|
26
|
+
"@itwin/eslint-plugin": "3.0.0-dev.82",
|
|
27
|
+
"@itwin/core-geometry": "3.0.0-dev.82",
|
|
28
|
+
"@itwin/core-common": "3.0.0-dev.82",
|
|
29
|
+
"@itwin/core-frontend": "3.0.0-dev.82",
|
|
30
|
+
"@itwin/core-i18n": "3.0.0-dev.82",
|
|
31
|
+
"@itwin/core-quantity": "3.0.0-dev.82",
|
|
32
|
+
"@bentley/itwin-client": "3.0.0-dev.82",
|
|
33
|
+
"@itwin/presentation-common": "3.0.0-dev.82",
|
|
33
34
|
"@bentley/react-scripts": "4.0.3",
|
|
34
|
-
"@itwin/appui-abstract": "3.0.0-dev.
|
|
35
|
-
"@itwin/components-react": "3.0.0-dev.
|
|
36
|
-
"@itwin/core-react": "3.0.0-dev.
|
|
37
|
-
"@itwin/imodel-components-react": "3.0.0-dev.
|
|
38
|
-
"@itwin/appui-react": "3.0.0-dev.
|
|
39
|
-
"@itwin/appui-layout-react": "3.0.0-dev.
|
|
35
|
+
"@itwin/appui-abstract": "3.0.0-dev.82",
|
|
36
|
+
"@itwin/components-react": "3.0.0-dev.82",
|
|
37
|
+
"@itwin/core-react": "3.0.0-dev.82",
|
|
38
|
+
"@itwin/imodel-components-react": "3.0.0-dev.82",
|
|
39
|
+
"@itwin/appui-react": "3.0.0-dev.82",
|
|
40
|
+
"@itwin/appui-layout-react": "3.0.0-dev.82",
|
|
40
41
|
"@itwin/itwinui-css": "^0.27.0",
|
|
41
42
|
"@itwin/itwinui-react": "^1.16.2",
|
|
42
43
|
"@testing-library/react": "^12.0.0",
|
|
@@ -51,13 +52,13 @@
|
|
|
51
52
|
"@types/react-select": "3.0.26",
|
|
52
53
|
"@types/sinon": "^9.0.0",
|
|
53
54
|
"@types/sinon-chai": "^3.2.0",
|
|
55
|
+
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.3",
|
|
54
56
|
"chai": "^4.1.2",
|
|
55
57
|
"chai-as-promised": "^7",
|
|
56
58
|
"chai-jest-snapshot": "^2.0.0",
|
|
57
59
|
"chai-spies": "1.0.0",
|
|
58
60
|
"cpx": "^1.5.0",
|
|
59
61
|
"enzyme": "^3.4.0",
|
|
60
|
-
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.3",
|
|
61
62
|
"enzyme-to-json": "^3.3.4",
|
|
62
63
|
"eslint": "^7.11.0",
|
|
63
64
|
"jsdom": "^17.0.0",
|
|
@@ -68,6 +69,7 @@
|
|
|
68
69
|
"rimraf": "^3.0.2",
|
|
69
70
|
"sinon": "^9.0.2",
|
|
70
71
|
"sinon-chai": "^3.2.0",
|
|
72
|
+
"typemoq": "^2.1.0",
|
|
71
73
|
"typescript": "~4.4.0",
|
|
72
74
|
"xmlhttprequest": "^1.8.0"
|
|
73
75
|
},
|
|
@@ -78,19 +80,19 @@
|
|
|
78
80
|
"react-resize-detector": "^6.7.6"
|
|
79
81
|
},
|
|
80
82
|
"peerDependencies": {
|
|
81
|
-
"@itwin/core-bentley": "3.0.0-dev.
|
|
82
|
-
"@itwin/core-geometry": "3.0.0-dev.
|
|
83
|
-
"@itwin/core-common": "3.0.0-dev.
|
|
84
|
-
"@itwin/core-frontend": "3.0.0-dev.
|
|
85
|
-
"@itwin/core-i18n": "3.0.0-dev.
|
|
86
|
-
"@itwin/core-quantity": "3.0.0-dev.
|
|
87
|
-
"@bentley/itwin-client": "3.0.0-dev.
|
|
88
|
-
"@itwin/appui-abstract": "3.0.0-dev.
|
|
89
|
-
"@itwin/components-react": "3.0.0-dev.
|
|
90
|
-
"@itwin/core-react": "3.0.0-dev.
|
|
91
|
-
"@itwin/appui-react": "3.0.0-dev.
|
|
92
|
-
"@itwin/imodel-components-react": "3.0.0-dev.
|
|
93
|
-
"@itwin/appui-layout-react": "3.0.0-dev.
|
|
83
|
+
"@itwin/core-bentley": "3.0.0-dev.82",
|
|
84
|
+
"@itwin/core-geometry": "3.0.0-dev.82",
|
|
85
|
+
"@itwin/core-common": "3.0.0-dev.82",
|
|
86
|
+
"@itwin/core-frontend": "3.0.0-dev.82",
|
|
87
|
+
"@itwin/core-i18n": "3.0.0-dev.82",
|
|
88
|
+
"@itwin/core-quantity": "3.0.0-dev.82",
|
|
89
|
+
"@bentley/itwin-client": "3.0.0-dev.82",
|
|
90
|
+
"@itwin/appui-abstract": "3.0.0-dev.82",
|
|
91
|
+
"@itwin/components-react": "3.0.0-dev.82",
|
|
92
|
+
"@itwin/core-react": "3.0.0-dev.82",
|
|
93
|
+
"@itwin/appui-react": "3.0.0-dev.82",
|
|
94
|
+
"@itwin/imodel-components-react": "3.0.0-dev.82",
|
|
95
|
+
"@itwin/appui-layout-react": "3.0.0-dev.82",
|
|
94
96
|
"react": "^17.0.0",
|
|
95
97
|
"react-dom": "^17.0.0"
|
|
96
98
|
},
|
|
@@ -115,10 +117,10 @@
|
|
|
115
117
|
"checkLeaks": true,
|
|
116
118
|
"timeout": 60000,
|
|
117
119
|
"file": [
|
|
118
|
-
"lib/test/setup.js"
|
|
120
|
+
"lib/cjs/test/setup.js"
|
|
119
121
|
],
|
|
120
122
|
"exclude": [
|
|
121
|
-
"lib/test/coverage/**/*"
|
|
123
|
+
"lib/cjs/test/coverage/**/*"
|
|
122
124
|
],
|
|
123
125
|
"reporter": [
|
|
124
126
|
"node_modules/@itwin/build-tools/mocha-reporter"
|
|
@@ -129,13 +131,17 @@
|
|
|
129
131
|
},
|
|
130
132
|
"scripts": {
|
|
131
133
|
"compile": "npm run -s build",
|
|
132
|
-
"
|
|
133
|
-
"build": "tsc 1>&2 && npm run -s
|
|
134
|
+
"build": "npm run -s build:cjs && npm run -s build:esm && npm run -s copy:locale",
|
|
135
|
+
"build:cjs": "tsc 1>&2 --outDir lib/cjs && npm run -s copy:cjs",
|
|
136
|
+
"build:esm": "tsc 1>&2 --module ES2020 --outDir lib/esm && npm run -s copy:esm",
|
|
134
137
|
"clean": "rimraf lib .rush/temp/package-deps*.json",
|
|
135
|
-
"copy:
|
|
138
|
+
"copy:locale": "cpx \"./src/public/locales/**/*\" ./lib/public",
|
|
139
|
+
"copy:cjs": "cpx \"./src/**/*.{*css,json,svg}\" \"./lib/cjs\"",
|
|
140
|
+
"copy:esm": "cpx \"./src/**/*.{*css,json,svg}\" \"./lib/esm\"",
|
|
136
141
|
"cover": "nyc npm -s test",
|
|
137
142
|
"docs": "",
|
|
138
143
|
"lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
|
|
139
|
-
"
|
|
144
|
+
"pseudolocalize": "betools pseudolocalize --englishDir=./src/public/locales/en --out=./src/public/locales/en-PSEUDO",
|
|
145
|
+
"test": "mocha \"./lib/cjs/test/**/*.test.js\""
|
|
140
146
|
}
|
|
141
147
|
}
|
package/lib/map-layers.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map-layers.d.ts","sourceRoot":"","sources":["../src/map-layers.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC"}
|
package/lib/map-layers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map-layers.js","sourceRoot":"","sources":["../src/map-layers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,8CAA4B;AAC5B,kDAAgC;AAChC,gEAA8C;AAC9C,8DAA4C","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\nexport * from \"./mapLayers\";\r\nexport * from \"./ui/Interfaces\";\r\nexport * from \"./ui/MapLayersUiItemsProvider\";\r\nexport * from \"./ui/widget/MapLayersWidget\";\r\n"]}
|
package/lib/mapLayers.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapLayers.d.ts","sourceRoot":"","sources":["../src/mapLayers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKlD;;;;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AC,SAAS;QACrB,IAAI,WAAW,CAAC,aAAa;YAC3B,WAAW,CAAC,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAC5E,WAAW,CAAC,aAAa,GAAG,SAAS,CAAC;IACxC,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;;AApCH,kCAqCC;AAnCgB,sBAAU,GAAG,WAAW,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 { IModelApp } from \"@itwin/core-frontend\";\r\nimport { Localization } from \"@itwin/core-common\";\r\nimport { MapLayersUiItemsProvider, MapLayersWidgetControl } from \"./ui/MapLayersUiItemsProvider\";\r\nimport { UiItemsManager } from \"@itwin/appui-abstract\";\r\nimport { ConfigurableUiManager } from \"@itwin/appui-react\";\r\n\r\n/**\r\n * MapLayersApi is use when the package is used as a dependency to another app and not used as an extension.\r\n * '''ts\r\n * // if registerItemsProvider is false the MapLayersWidgetControl control will be registered with appui-react's ConfigurableUiManager\r\n * // so it can be explicitly added to a stage via a FrontstageDef.\r\n * await MapLayersUI.initialize (registerItemsProvider);\r\n * '''\r\n * @beta\r\n */\r\nexport class MapLayersUI {\r\n private static _localization?: Localization;\r\n private static _defaultNs = \"mapLayers\";\r\n private static _uiItemsProvider: MapLayersUiItemsProvider;\r\n\r\n /** Used to initialize the MapLayersAPI when used as a package. If `registerItemsProvider` is true then the\r\n * UiItemsProvider will automatically insert the UI items into the host applications UI. If it is false then\r\n * explicitly add widget definition to a specific FrontStage definition using the following syntax.\r\n * ``` tsx\r\n * <Widget id={MapLayersWidgetControl.id} label={MapLayersWidgetControl.label} control={MapLayersWidgetControl}\r\n * iconSpec={MapLayersWidgetControl.iconSpec} />,\r\n * ```\r\n */\r\n public static async initialize(registerItemsProvider = true, localization?: Localization): Promise<void> {\r\n // register namespace containing localized strings for this package\r\n this._localization = (localization ? localization : IModelApp.localization);\r\n await this._localization.registerNamespace(this.localizationNamespace);\r\n\r\n // _uiItemsProvider always created to provide access to localization.\r\n MapLayersUI._uiItemsProvider = new MapLayersUiItemsProvider(this._localization);\r\n if (registerItemsProvider)\r\n UiItemsManager.register(MapLayersUI._uiItemsProvider);\r\n else\r\n ConfigurableUiManager.registerControl(MapLayersWidgetControl.id, MapLayersWidgetControl);\r\n }\r\n\r\n /** Unregisters the GeoTools internationalization service namespace */\r\n public static terminate() {\r\n if (MapLayersUI._localization)\r\n MapLayersUI._localization.unregisterNamespace(this.localizationNamespace);\r\n MapLayersUI._localization = undefined;\r\n }\r\n\r\n /** The internationalization service namespace. */\r\n public static get localizationNamespace(): string {\r\n return this._defaultNs;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Interfaces.d.ts","sourceRoot":"","sources":["../../src/ui/Interfaces.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,WAAW,qBAAqB;IACpC,WAAW;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,mCAAmC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,2MAA2M;IAC3M,YAAY,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qCAAqC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,iCAAiC;IACjC,aAAa,EAAE,OAAO,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,uBAAuB,CAAC;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,wBAAwB,EAAE,OAAO,CAAC;CAC5C;AAED,MAAM,WAAW,eAAe;IAC9B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,cAAc,CAAC,EAAE,eAAe,CAAC;CAClC"}
|
package/lib/ui/Interfaces.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Interfaces.js","sourceRoot":"","sources":["../../src/ui/Interfaces.ts"],"names":[],"mappings":"","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { MapSubLayerProps } from \"@itwin/core-common\";\nimport { MapLayerImageryProvider } from \"@itwin/core-frontend\";\n\nexport interface StyleMapLayerSettings {\n /** Name */\n name: string;\n /** URL */\n url: string;\n /** Controls visibility of layer */\n visible: boolean;\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden. Default value: false. */\n transparency: number;\n /** Transparent background */\n transparentBackground: boolean;\n /** set map as underlay or overlay */\n isOverlay: boolean;\n /** Available map sub-layer */\n subLayers?: MapSubLayerProps[];\n /** sub-layer panel displayed. */\n showSubLayers: boolean;\n /** Some format can publish only a single layer at a time (i.e WMTS) */\n provider?: MapLayerImageryProvider;\n}\n\nexport interface MapTypesOptions {\n readonly supportTileUrl: boolean;\n readonly supportWmsAuthentication: boolean;\n}\n\nexport interface MapLayerOptions {\n hideExternalMapLayers?: boolean;\n fetchPublicMapLayerSources?: boolean;\n mapTypeOptions?: MapTypesOptions;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayersUiItemsProvider.d.ts","sourceRoot":"","sources":["../../src/ui/MapLayersUiItemsProvider.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAc,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAChI,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,qBAAa,wBAAyB,YAAW,eAAe;IAC9D,SAAgB,EAAE,8BAA8B;IAChD,OAAc,YAAY,EAAE,YAAY,CAAC;gBAEtB,YAAY,EAAE,YAAY;IAItC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,OAAO,EAAE,iBAAiB,GAAG,SAAS,GAAG,aAAa,CAAC,mBAAmB,CAAC;CAmBtK;AAED;;;;;GAKG;AACH,qBAAa,sBAAuB,SAAQ,aAAa;IACvD,OAAc,EAAE,SAAqB;IACrC,OAAc,QAAQ,SAAc;IAEpC,WAAkB,KAAK,IAAI,MAAM,CAEhC;gBAEW,IAAI,EAAE,sBAAsB,EAAE,eAAe,EAAE,eAAe,GAAG,SAAS;CAKvF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayersUiItemsProvider.js","sourceRoot":"","sources":["../../src/ui/MapLayersUiItemsProvider.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,+BAA+B;AAC/B,0DAAgI;AAEhI,8DAA2D;AAC3D,oDAA2E;AAC3E,wDAAiD;AAGjD,MAAa,wBAAwB;IAInC,YAAmB,YAA0B;QAH7B,OAAE,GAAG,0BAA0B,CAAC;QAI9C,wBAAwB,CAAC,YAAY,GAAG,YAAY,CAAC;IACvD,CAAC;IAEM,cAAc,CAAC,QAAgB,EAAE,UAAkB,EAAE,QAA4B,EAAE,OAAsC;QAC9H,MAAM,OAAO,GAA0B,EAAE,CAAC;QAC1C,MAAM,eAAe,GAAoB;YACvC,qBAAqB,EAAE,KAAK;YAC5B,cAAc,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,wBAAwB,EAAE,IAAI,EAAE;YACzE,0BAA0B,EAAE,KAAK;SAClC,CAAC;QAEF,IAAI,UAAU,KAAK,2BAAU,CAAC,OAAO,IAAI,QAAQ,KAAK,mCAAkB,CAAC,KAAK,IAAI,OAAO,KAAK,kCAAiB,CAAC,KAAK,EAAE;YACrH,OAAO,CAAC,IAAI,CAAC;gBACX,EAAE,EAAE,4BAA4B;gBAChC,KAAK,EAAE,wBAAwB,CAAC,YAAY,CAAC,kBAAkB,CAAC,wBAAwB,CAAC;gBACzF,IAAI,EAAE,UAAU;gBAChB,gBAAgB,EAAE,GAAG,EAAE,CAAC,oBAAC,iCAAe,IAAC,eAAe,EAAE,eAAe,GAAI,EAAE,yCAAyC;aACzH,CAAC,CAAC;SACJ;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AA3BD,4DA2BC;AAED;;;;;GAKG;AACH,MAAa,sBAAuB,SAAQ,2BAAa;IAQvD,YAAY,IAA4B,EAAE,eAA4C;QACpF,KAAK,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAE7B,IAAI,CAAC,SAAS,GAAG,oBAAC,iCAAe,IAAC,eAAe,EAAE,eAAe,GAAI,CAAC;IACzE,CAAC;IARM,MAAM,KAAK,KAAK;QACrB,OAAO,yBAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,CAAC;IAC7E,CAAC;;AANH,wDAaC;AAZe,yBAAE,GAAG,iBAAiB,CAAC;AACvB,+BAAQ,GAAG,UAAU,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 { AbstractWidgetProps, StagePanelLocation, StagePanelSection, StageUsage, UiItemsProvider } from \"@itwin/appui-abstract\";\r\nimport { Localization } from \"@itwin/core-common\";\r\nimport { MapLayersWidget } from \"./widget/MapLayersWidget\";\r\nimport { ConfigurableCreateInfo, WidgetControl } from \"@itwin/appui-react\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { MapLayerOptions } from \"./Interfaces\";\r\n\r\nexport class MapLayersUiItemsProvider implements UiItemsProvider {\r\n public readonly id = \"MapLayersUiItemsProvider\";\r\n public static localization: Localization;\r\n\r\n public constructor(localization: Localization) {\r\n MapLayersUiItemsProvider.localization = localization;\r\n }\r\n\r\n public provideWidgets(_stageId: string, stageUsage: string, location: StagePanelLocation, section: StagePanelSection | undefined): ReadonlyArray<AbstractWidgetProps> {\r\n const widgets: AbstractWidgetProps[] = [];\r\n const mapLayerOptions: MapLayerOptions = {\r\n hideExternalMapLayers: false,\r\n mapTypeOptions: { supportTileUrl: false, supportWmsAuthentication: true },\r\n fetchPublicMapLayerSources: false,\r\n };\r\n\r\n if (stageUsage === StageUsage.General && location === StagePanelLocation.Right && section === StagePanelSection.Start) {\r\n widgets.push({\r\n id: \"map-layers:mapLayersWidget\",\r\n label: MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Widget.Label\"),\r\n icon: \"icon-map\",\r\n getWidgetContent: () => <MapLayersWidget mapLayerOptions={mapLayerOptions} />, // eslint-disable-line react/display-name\r\n });\r\n }\r\n\r\n return widgets;\r\n }\r\n}\r\n\r\n/** MapLayersWidgetControl provides a widget to attach and remove maps layers from the active view's display style.\r\n * ``` tsx\r\n * <Widget id={MapLayersWidgetControl.id} label={MapLayersWidgetControl.label} control={MapLayersWidgetControl}\r\n * iconSpec={MapLayersWidgetControl.iconSpec} />,\r\n * ```\r\n */\r\nexport class MapLayersWidgetControl extends WidgetControl {\r\n public static id = \"MapLayersWidget\";\r\n public static iconSpec = \"icon-map\";\r\n\r\n public static get label(): string {\r\n return IModelApp.localization.getLocalizedString(\"mapLayers:Widget.Label\");\r\n }\r\n\r\n constructor(info: ConfigurableCreateInfo, mapLayerOptions: MapLayerOptions | undefined) {\r\n super(info, mapLayerOptions);\r\n\r\n this.reactNode = <MapLayersWidget mapLayerOptions={mapLayerOptions} />;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttachLayerPopupButton.d.ts","sourceRoot":"","sources":["../../../src/ui/widget/AttachLayerPopupButton.tsx"],"names":[],"mappings":";AAwTA,gBAAgB;AAChB,oBAAY,qBAAqB;IAC/B,OAAO,IAAA;IACP,IAAI,IAAA;IACJ,IAAI,IAAA;CACL;AACD,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC;AAED,gBAAgB;AAEhB,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,eAqHxE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttachLayerPopupButton.js","sourceRoot":"","sources":["../../../src/ui/widget/AttachLayerPopupButton.tsx"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,+BAA+B;AAC/B,wDAA6J;AAC7J,0DAAyD;AACzD,4CAA4C;AAC5C,oDAAwD;AACxD,uDAAwD;AACxD,iDAA8C;AAC9C,0EAAuE;AACvE,iEAA8D;AAC9D,wDAAqD;AASrD,gEAAgE;AAChE,SAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,eAAe,EAAyB;;IAC7E,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAsB,CAAC;IACjF,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAsB,CAAC;IACzF,MAAM,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,mDAAwB,C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yBAAyB;gBACrD,oBAAC,gBAAgB,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,eAAe,EAAE,mBAAmB,GAAI,CAClF,CACQ,CACf,CACJ,CAAC;AACJ,CAAC;AArHD,wDAqHC","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 { IModelApp, MapLayerSettingsService, MapLayerSource, MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority } from \"@itwin/core-frontend\";\r\nimport { RelativePosition } from \"@itwin/appui-abstract\";\r\nimport * as UiCore from \"@itwin/core-react\";\r\nimport { ModalDialogManager } from \"@itwin/appui-react\";\r\nimport { useSourceMapContext } from \"./MapLayerManager\";\r\nimport { MapUrlDialog } from \"./MapUrlDialog\";\r\nimport { MapLayersUiItemsProvider } from \"../MapLayersUiItemsProvider\";\r\nimport { ConfirmMessageDialog } from \"./ConfirmMessageDialog\";\r\nimport { Button, Input } from \"@itwin/itwinui-react\";\r\n\r\n// cSpell:ignore droppable Sublayer\r\n\r\ninterface AttachLayerPanelProps {\r\n isOverlay: boolean;\r\n onLayerAttached: () => void;\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nfunction AttachLayerPanel({ isOverlay, onLayerAttached }: AttachLayerPanelProps) {\r\n const [layerNameToAdd, setLayerNameToAdd] = React.useState<string | undefined>();\r\n const [sourceFilterString, setSourceFilterString] = React.useState<string | undefined>();\r\n const [placeholderLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.SearchPlaceholder\"));\r\n const [addCustomLayerLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.Custom\"));\r\n const [addCustomLayerToolTip] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.AttachCustomLayer\"));\r\n const [loadingMapSources] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.LoadingMapSources\"));\r\n const [removeLayerDefButtonTitle] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefButtonTitle\"));\r\n const [editLayerDefButtonTitle] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.EditLayerDefButtonTitle\"));\r\n const [removeLayerDefDialogTitle] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefDialogTitle\"));\r\n const [loading, setLoading] = React.useState(false);\r\n const [layerNameUnderCursor, setLayerNameUnderCursor] = React.useState<string | undefined>();\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 // We close any open dialogs that we might have opened\r\n // This was added because the modal dialog remained remained displayed after the session expired.\r\n ModalDialogManager.closeDialog();\r\n };\r\n }, []);\r\n\r\n const handleFilterTextChanged = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setSourceFilterString(event.target.value);\r\n }, []);\r\n\r\n const { loadingSources, sources, activeViewport, backgroundLayers, overlayLayers, mapTypesOptions } = useSourceMapContext();\r\n const iTwinId = activeViewport?.iModel?.iTwinId;\r\n const iModelId = activeViewport?.iModel?.iModelId;\r\n\r\n const styleContainsLayer = React.useCallback((name: string) => {\r\n if (backgroundLayers) {\r\n if (-1 !== backgroundLayers.findIndex((layer) => layer.name === name))\r\n return true;\r\n }\r\n if (overlayLayers) {\r\n if (-1 !== overlayLayers.findIndex((layer) => layer.name === name))\r\n return true;\r\n }\r\n return false;\r\n }, [backgroundLayers, overlayLayers]);\r\n\r\n const handleModalUrlDialogOk = React.useCallback(() => {\r\n // close popup and refresh UI\r\n onLayerAttached();\r\n }, [onLayerAttached]);\r\n\r\n const handleModalUrlDialogCancel = React.useCallback(() => {\r\n // close popup and refresh UI\r\n setLoading(false);\r\n ModalDialogManager.closeDialog();\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n async function attemptToAddLayer(layerName: string) {\r\n if (layerName && activeViewport) {\r\n // if the layer is not in the style add it now.\r\n if (undefined === backgroundLayers?.find((layer) => layerName === layer.name) && undefined === overlayLayers?.find((layer) => layerName === layer.name)) {\r\n const mapLayerSettings = sources?.find((source) => source.name === layerName);\r\n if (mapLayerSettings === undefined) {\r\n return;\r\n }\r\n\r\n try {\r\n if (isMounted.current) {\r\n setLoading(true);\r\n }\r\n\r\n const { status, subLayers } = await mapLayerSettings.validateSource();\r\n if (status === MapLayerSourceStatus.Valid || status === MapLayerSourceStatus.RequireAuth) {\r\n\r\n if (status === MapLayerSourceStatus.Valid) {\r\n const layerSettings = mapLayerSettings.toLayerSettings(subLayers);\r\n\r\n if (layerSettings) {\r\n activeViewport.displayStyle.attachMapLayerSettings(layerSettings, isOverlay);\r\n\r\n activeViewport.invalidateRenderPlan();\r\n\r\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttached\", { sourceName: layerSettings.name, sourceUrl: layerSettings.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));\r\n }\r\n\r\n if (isMounted.current) {\r\n setLoading(false);\r\n }\r\n if (onLayerAttached) {\r\n onLayerAttached();\r\n }\r\n\r\n } else if (status === MapLayerSourceStatus.RequireAuth && isMounted.current) {\r\n ModalDialogManager.openDialog(\r\n <MapUrlDialog\r\n activeViewport={activeViewport}\r\n isOverlay={isOverlay}\r\n layerRequiringCredentials={mapLayerSettings.toJSON()}\r\n onOkResult={handleModalUrlDialogOk}\r\n onCancelResult={handleModalUrlDialogCancel}\r\n mapTypesOptions={mapTypesOptions} />\r\n );\r\n }\r\n\r\n } else {\r\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerValidationFailed\", { sourceUrl: mapLayerSettings.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n if (isMounted.current) {\r\n setLoading(false);\r\n }\r\n }\r\n } catch (err) {\r\n if (isMounted.current) {\r\n setLoading(false);\r\n }\r\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error: err, sourceUrl: mapLayerSettings.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n }\r\n }\r\n\r\n }\r\n return;\r\n }\r\n\r\n if (layerNameToAdd) {\r\n attemptToAddLayer(layerNameToAdd); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n\r\n if (isMounted.current) {\r\n setLayerNameToAdd(undefined);\r\n }\r\n }\r\n }, [setLayerNameToAdd, layerNameToAdd, activeViewport, sources, backgroundLayers, isOverlay, overlayLayers, onLayerAttached, handleModalUrlDialogOk, mapTypesOptions, handleModalUrlDialogCancel]);\r\n\r\n const options = React.useMemo(() => sources?.filter((source) => !styleContainsLayer(source.name)), [sources, styleContainsLayer]);\r\n const filteredOptions = React.useMemo(() => {\r\n if (undefined === sourceFilterString || 0 === sourceFilterString.length) {\r\n return options;\r\n } else {\r\n return options?.filter((option) => option.name.toLowerCase().includes(sourceFilterString?.toLowerCase()));\r\n }\r\n }, [options, sourceFilterString]);\r\n\r\n const handleAddNewMapSource = React.useCallback(() => {\r\n ModalDialogManager.openDialog(<MapUrlDialog activeViewport={activeViewport} isOverlay={isOverlay} onOkResult={handleModalUrlDialogOk} mapTypesOptions={mapTypesOptions} />);\r\n return;\r\n }, [activeViewport, handleModalUrlDialogOk, isOverlay, mapTypesOptions]);\r\n\r\n const handleAttach = React.useCallback((mapName: string) => {\r\n setLayerNameToAdd(mapName);\r\n }, []);\r\n\r\n const handleKeypressOnSourceList = React.useCallback((event: React.KeyboardEvent<HTMLUListElement>) => {\r\n const key = event.key;\r\n if (key === \"Enter\") {\r\n event.preventDefault();\r\n const mapName = event.currentTarget?.dataset?.value;\r\n if (mapName && mapName.length) {\r\n handleAttach(mapName);\r\n }\r\n }\r\n }, [handleAttach]);\r\n\r\n const onListboxValueChange = React.useCallback((mapName: string) => {\r\n setLayerNameToAdd(mapName);\r\n }, []);\r\n\r\n const handleNoConfirmation = React.useCallback((_layerName: string) => {\r\n ModalDialogManager.closeDialog();\r\n }, []);\r\n\r\n const handleYesConfirmation = React.useCallback(async (source: MapLayerSource) => {\r\n\r\n const layerName = source.name;\r\n if (!!iTwinId && !!iModelId) {\r\n if (await MapLayerSettingsService.deleteSharedSettings(source, iTwinId, iModelId)) {\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefSuccess\", { layerName });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));\r\n } else {\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefError\", { layerName });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n }\r\n }\r\n\r\n ModalDialogManager.closeDialog();\r\n }, [iTwinId, iModelId]);\r\n\r\n /*\r\n Handle Remove layer button clicked\r\n */\r\n const onItemRemoveButtonClicked = React.useCallback((source, event) => {\r\n event.stopPropagation(); // We don't want the owning ListBox to react on mouse click.\r\n\r\n const layerName = source.name;\r\n\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.RemoveLayerDefDialogMessage\", { layerName });\r\n ModalDialogManager.openDialog(\r\n <ConfirmMessageDialog\r\n className=\"map-sources-delete-confirmation\"\r\n title={removeLayerDefDialogTitle}\r\n message={msg}\r\n maxWidth={400}\r\n onClose={() => handleNoConfirmation(layerName)}\r\n onEscape={() => handleNoConfirmation(layerName)}\r\n onYesResult={async () => handleYesConfirmation(source)}\r\n onNoResult={() => handleNoConfirmation(layerName)}\r\n />\r\n );\r\n }, [handleNoConfirmation, handleYesConfirmation, removeLayerDefDialogTitle]);\r\n\r\n /*\r\n Handle Edit layer button clicked\r\n */\r\n const onItemEditButtonClicked = React.useCallback((event) => {\r\n event.stopPropagation(); // We don't want the owning ListBox to react on mouse click.\r\n\r\n const targetLayerName = event?.currentTarget?.parentNode?.dataset?.value;\r\n const matchingSource = sources.find((layerSource) => layerSource.name === targetLayerName);\r\n\r\n // we expect a single layer source matching this name\r\n if (matchingSource === undefined) {\r\n return;\r\n }\r\n ModalDialogManager.openDialog(<MapUrlDialog\r\n activeViewport={activeViewport}\r\n isOverlay={isOverlay}\r\n mapLayerSourceToEdit={matchingSource}\r\n onOkResult={handleModalUrlDialogOk}\r\n mapTypesOptions={mapTypesOptions} />);\r\n }, [activeViewport, handleModalUrlDialogOk, isOverlay, mapTypesOptions, sources]);\r\n\r\n return (\r\n <div className=\"map-manager-header\">\r\n {(loading || loadingSources) && <UiCore.LoadingSpinner message={loadingMapSources} />}\r\n <div className=\"map-manager-source-listbox-header\">\r\n <Input type=\"text\" className=\"map-manager-source-list-filter\"\r\n placeholder={placeholderLabel}\r\n value={sourceFilterString}\r\n onChange={handleFilterTextChanged} />\r\n <Button className=\"map-manager-add-source-button\" title={addCustomLayerToolTip} onClick={handleAddNewMapSource}>\r\n {addCustomLayerLabel}</Button>\r\n </div>\r\n <div className=\"map-manager-sources\">\r\n <UiCore.Listbox\r\n id=\"map-sources\"\r\n selectedValue={layerNameToAdd}\r\n className=\"map-manager-source-list\"\r\n onKeyPress={handleKeypressOnSourceList}\r\n onListboxValueChange={onListboxValueChange} >\r\n {\r\n filteredOptions?.map((source) =>\r\n <UiCore.ListboxItem\r\n key={source.name}\r\n className=\"map-source-list-entry\"\r\n value={source.name}\r\n onMouseEnter={() => setLayerNameUnderCursor(source.name)}\r\n onMouseLeave={() => setLayerNameUnderCursor(undefined)}>\r\n <span className=\"map-source-list-entry-name\" title={source.name}>{source.name}</span>\r\n\r\n { // Display the delete icon only when the mouse over a specific item\r\n // otherwise list feels cluttered.\r\n (!!iTwinId && !!iModelId && layerNameUnderCursor && layerNameUnderCursor === source.name) &&\r\n <>\r\n <Button\r\n className=\"map-source-list-entry-button\"\r\n title={editLayerDefButtonTitle}\r\n onClick={onItemEditButtonClicked}>\r\n <UiCore.Icon iconSpec=\"icon-edit\" />\r\n </Button>\r\n <Button\r\n className=\"map-source-list-entry-button\"\r\n title={removeLayerDefButtonTitle}\r\n onClick={(event: React.MouseEvent) => { onItemRemoveButtonClicked(source, event); }}>\r\n <UiCore.Icon iconSpec=\"icon-delete\" />\r\n </Button>\r\n </>}\r\n\r\n </UiCore.ListboxItem>\r\n )\r\n }\r\n </UiCore.Listbox>\r\n </div>\r\n </div>\r\n\r\n );\r\n}\r\n\r\n/** @internal */\r\nexport enum AttachLayerButtonType {\r\n Primary,\r\n Blue,\r\n Icon\r\n}\r\nexport interface AttachLayerPopupButtonProps {\r\n isOverlay: boolean;\r\n buttonType?: AttachLayerButtonType;\r\n}\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function AttachLayerPopupButton(props: AttachLayerPopupButtonProps) {\r\n const [showAttachLayerLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AttachLayerPopup.Attach\"));\r\n const [hideAttachLayerLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AttachLayerPopup.Close\"));\r\n const [addCustomLayerButtonLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.AddCustomLayerButtonLabel\"));\r\n const [popupOpen, setPopupOpen] = React.useState(false);\r\n const buttonRef = React.useRef<HTMLButtonElement>(null);\r\n const panelRef = React.useRef<HTMLDivElement>(null);\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 togglePopup = React.useCallback(() => {\r\n setPopupOpen(!popupOpen);\r\n }, [popupOpen]);\r\n\r\n const handleClosePopup = React.useCallback(() => {\r\n setPopupOpen(false);\r\n }, []);\r\n\r\n const isInsideCoreDialog = React.useCallback((element: HTMLElement) => {\r\n if (element.nodeName === \"DIV\") {\r\n if (element.classList && element.classList.contains(\"core-dialog\"))\r\n return true;\r\n if (element.parentElement && isInsideCoreDialog(element.parentElement))\r\n return true;\r\n } else {\r\n // istanbul ignore else\r\n if (element.parentElement && isInsideCoreDialog(element.parentElement))\r\n return true;\r\n }\r\n return false;\r\n }, []);\r\n\r\n const handleOutsideClick = React.useCallback((event: MouseEvent) => {\r\n if (isInsideCoreDialog(event.target as HTMLElement)) {\r\n return;\r\n }\r\n\r\n // If clicking on button that open panel - don't trigger outside click processing\r\n if (buttonRef?.current && buttonRef?.current.contains(event.target as Node)) {\r\n return;\r\n }\r\n\r\n // If clicking the panel, this is not an outside clicked\r\n if (panelRef.current && panelRef?.current.contains(event.target as Node)) {\r\n return;\r\n }\r\n\r\n // If we reach this point, we got an outside clicked, no close the popup\r\n setPopupOpen(false);\r\n\r\n }, [isInsideCoreDialog]);\r\n\r\n const { refreshFromStyle } = useSourceMapContext();\r\n\r\n const handleLayerAttached = React.useCallback(() => {\r\n if (!isMounted.current) {\r\n return;\r\n }\r\n setPopupOpen(false);\r\n refreshFromStyle();\r\n }, [refreshFromStyle]);\r\n\r\n function renderButton(): React.ReactNode {\r\n let button: React.ReactNode;\r\n\r\n if (props.buttonType === undefined || props.buttonType === AttachLayerButtonType.Icon) {\r\n button = (\r\n <button ref={buttonRef} className=\"map-manager-attach-layer-button\" title={popupOpen ? hideAttachLayerLabel : showAttachLayerLabel}\r\n onClick={togglePopup}>\r\n <UiCore.WebFontIcon iconName=\"icon-add\" />\r\n </button>\r\n );\r\n } else {\r\n const determineStyleType = () => {\r\n switch (props.buttonType) {\r\n case AttachLayerButtonType.Blue:\r\n return \"high-visibility\";\r\n case AttachLayerButtonType.Primary:\r\n default:\r\n return \"cta\";\r\n }\r\n };\r\n const styleType = determineStyleType();\r\n button = (\r\n <Button ref={buttonRef} styleType={styleType} title={popupOpen ? hideAttachLayerLabel : showAttachLayerLabel}\r\n onClick={togglePopup}>{addCustomLayerButtonLabel}</Button>\r\n );\r\n }\r\n\r\n return button;\r\n }\r\n\r\n return (\r\n <>\r\n {renderButton()}\r\n <UiCore.Popup\r\n isOpen={popupOpen}\r\n position={RelativePosition.BottomRight}\r\n onClose={handleClosePopup}\r\n onOutsideClick={handleOutsideClick}\r\n target={buttonRef.current}\r\n closeOnEnter={false}\r\n >\r\n <div ref={panelRef} className=\"map-sources-popup-panel\" >\r\n <AttachLayerPanel isOverlay={props.isOverlay} onLayerAttached={handleLayerAttached} />\r\n </div>\r\n </UiCore.Popup >\r\n </>\r\n );\r\n}\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BasemapPanel.d.ts","sourceRoot":"","sources":["../../../src/ui/widget/BasemapPanel.tsx"],"names":[],"mappings":";AAgBA,OAAO,qBAAqB,CAAC;AAiB7B,gBAAgB;AAEhB,wBAAgB,YAAY,gBAwI3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BasemapPanel.js","sourceRoot":"","sources":["../../../src/ui/widget/BasemapPanel.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C,2CAA2C;;;AAE3C,+BAA+B;AAC/B,oDAAkH;AAElH,4EAAgF;AAChF,kDAA0E;AAE1E,oDAAwD;AACxD,uEAAoE;AACpE,uDAAwD;AACxD,+BAA6B;AAC7B,0EAAuE;AAEvE,SAAS,mBAAmB,CAAC,YAA2C;IACtE,IAAI,CAAC,YAAY;QACf,OAAO,SAAS,CAAC;IAEnB,IAAI,YAAY,CAAC,Q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,EAAE,kBAAkB,GAAI;YAE9I,oBAAC,iDAAuB,IAAC,YAAY,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,+BAA+B,GAAI,CACtH,CACL,CACJ,CAAC;AACJ,CAAC;AAxID,oCAwIC","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/* eslint-disable deprecation/deprecation */\r\n// cSpell:ignore droppable Sublayer Basemap\r\n\r\nimport * as React from \"react\";\r\nimport { BaseMapLayerSettings, ColorByName, ColorDef, MapLayerProps, MapLayerSettings } from \"@itwin/core-common\";\r\nimport { DisplayStyleState } from \"@itwin/core-frontend\";\r\nimport { ColorPickerDialog, ColorSwatch } from \"@itwin/imodel-components-react\";\r\nimport { OptionType, ThemedSelect, WebFontIcon } from \"@itwin/core-react\";\r\nimport { ActionMeta, ValueType } from \"react-select/src/types\";\r\nimport { ModalDialogManager } from \"@itwin/appui-react\";\r\nimport { TransparencyPopupButton } from \"./TransparencyPopupButton\";\r\nimport { useSourceMapContext } from \"./MapLayerManager\";\r\nimport \"./BasemapPanel.scss\";\r\nimport { MapLayersUiItemsProvider } from \"../MapLayersUiItemsProvider\";\r\n\r\nfunction getBaseMapFromStyle(displayStyle: DisplayStyleState | undefined) {\r\n if (!displayStyle)\r\n return undefined;\r\n\r\n if (displayStyle.settings.mapImagery.backgroundBase instanceof MapLayerSettings || displayStyle.settings.mapImagery.backgroundBase instanceof ColorDef)\r\n return displayStyle.settings.mapImagery.backgroundBase.toJSON();\r\n\r\n return undefined;\r\n}\r\n\r\ninterface BaseOption extends OptionType {\r\n color?: string;\r\n}\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function BasemapPanel() {\r\n const [useColorLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Basemap.ColorFill\"));\r\n const { activeViewport, bases } = useSourceMapContext();\r\n\r\n const [baseMapTransparencyValue, setBaseMapTransparencyValue] = React.useState(() => {\r\n if (activeViewport)\r\n return activeViewport.displayStyle.baseMapTransparency;\r\n return 0;\r\n });\r\n\r\n const handleBasemapTransparencyChange = React.useCallback((transparency: number) => {\r\n if (activeViewport) {\r\n activeViewport.displayStyle.changeBaseMapTransparency(transparency);\r\n activeViewport.invalidateRenderPlan();\r\n setBaseMapTransparencyValue(transparency);\r\n }\r\n }, [activeViewport]);\r\n\r\n const baseMapOptions = React.useMemo<BaseOption[]>(() => {\r\n const baseOptions: BaseOption[] = [];\r\n\r\n baseOptions.push({ value: useColorLabel, label: useColorLabel });\r\n\r\n if (bases)\r\n baseOptions.push(...bases.map((value) => ({ value: value.name, label: value.name })));\r\n return baseOptions;\r\n }, [bases, useColorLabel]);\r\n\r\n const [presetColors] = React.useState([\r\n ColorDef.create(ColorByName.grey),\r\n ColorDef.create(ColorByName.lightGrey),\r\n ColorDef.create(ColorByName.darkGrey),\r\n ColorDef.create(ColorByName.lightBlue),\r\n ColorDef.create(ColorByName.lightGreen),\r\n ColorDef.create(ColorByName.darkGreen),\r\n ColorDef.create(ColorByName.tan),\r\n ColorDef.create(ColorByName.darkBrown),\r\n ]);\r\n\r\n const [selectedBaseMap, setSelectedBaseMap] = React.useState<MapLayerProps | number | undefined>(getBaseMapFromStyle(activeViewport?.displayStyle));\r\n const baseIsColor = React.useMemo(() => typeof selectedBaseMap === \"number\", [selectedBaseMap]);\r\n const baseIsMap = React.useMemo(() => !baseIsColor && (selectedBaseMap !== undefined), [baseIsColor, selectedBaseMap]);\r\n const bgColor = React.useMemo(() => baseIsColor ? selectedBaseMap as number : presetColors[0].toJSON(), [baseIsColor, selectedBaseMap, presetColors]);\r\n const [colorDialogTitle] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:ColorDialog.Title\"));\r\n const selectedBaseMapValue = React.useMemo(() => {\r\n if (baseIsMap) {\r\n const mapName = (selectedBaseMap! as MapLayerProps).name;\r\n const foundItem = baseMapOptions.find((value) => value.label === mapName);\r\n if (foundItem)\r\n return foundItem;\r\n }\r\n return baseMapOptions[0];\r\n }, [selectedBaseMap, baseMapOptions, baseIsMap]);\r\n\r\n const handleBackgroundColorDialogOk = React.useCallback((bgColorDef: ColorDef) => {\r\n ModalDialogManager.closeDialog();\r\n if (activeViewport) {\r\n // change color and make sure previously set transparency is not lost.\r\n const curTransparency = activeViewport.displayStyle.backgroundMapBase instanceof ColorDef ? activeViewport.displayStyle.backgroundMapBase.getTransparency() : 0;\r\n activeViewport.displayStyle.backgroundMapBase = bgColorDef.withTransparency(curTransparency);\r\n activeViewport.invalidateRenderPlan();\r\n setSelectedBaseMap(bgColorDef.toJSON());\r\n }\r\n }, [activeViewport]);\r\n\r\n const handleBackgroundColorDialogCancel = React.useCallback(() => {\r\n ModalDialogManager.closeDialog();\r\n }, []);\r\n\r\n const handleBgColorClick = React.useCallback((newColor: ColorDef, e: React.MouseEvent<Element, MouseEvent>) => {\r\n e.preventDefault();\r\n ModalDialogManager.openDialog(<ColorPickerDialog dialogTitle={colorDialogTitle} color={newColor} colorPresets={presetColors}\r\n onOkResult={handleBackgroundColorDialogOk} onCancelResult={handleBackgroundColorDialogCancel} />);\r\n }, [presetColors, handleBackgroundColorDialogOk]); // eslint-disable-line react-hooks/exhaustive-deps\r\n\r\n const handleBaseMapSelection = React.useCallback((value: ValueType<BaseOption>, action: ActionMeta<BaseOption>) => {\r\n if (bases && activeViewport && action.action === \"select-option\" && value) {\r\n const baseMap = bases.find((map) => map.name === (value as BaseOption).label);\r\n if (baseMap) {\r\n const baseProps: MapLayerProps = baseMap.toJSON();\r\n if (activeViewport.displayStyle.backgroundMapBase instanceof BaseMapLayerSettings) {\r\n activeViewport.displayStyle.backgroundMapBase = activeViewport.displayStyle.backgroundMapBase.clone(baseProps);\r\n } else {\r\n activeViewport.displayStyle.backgroundMapBase = BaseMapLayerSettings.fromJSON(baseProps);\r\n }\r\n activeViewport.invalidateRenderPlan();\r\n setSelectedBaseMap(baseProps);\r\n } else {\r\n const bgColorDef = ColorDef.fromJSON(bgColor);\r\n const curTransparency = activeViewport.displayStyle.backgroundMapBase instanceof ColorDef ? activeViewport.displayStyle.backgroundMapBase.getTransparency() : 0;\r\n activeViewport.displayStyle.backgroundMapBase = bgColorDef.withTransparency(curTransparency);\r\n activeViewport.invalidateRenderPlan();\r\n setSelectedBaseMap(bgColorDef.toJSON());\r\n }\r\n }\r\n }, [bases, activeViewport, bgColor]);\r\n\r\n const [baseMapVisible, setBaseMapVisible] = React.useState(() => {\r\n if (activeViewport && activeViewport.displayStyle.backgroundMapBase instanceof MapLayerSettings) {\r\n return activeViewport.displayStyle.backgroundMapBase.visible;\r\n }\r\n return false;\r\n });\r\n\r\n const handleVisibilityChange = React.useCallback(() => {\r\n if (activeViewport) {\r\n const newState = !baseMapVisible;\r\n // BaseMap visibility is only support when backgroundBase is an instance of BaseMapLayerSettings (i.e not a color)...\r\n if (activeViewport.displayStyle.backgroundMapBase instanceof BaseMapLayerSettings) {\r\n activeViewport.displayStyle.backgroundMapBase = activeViewport.displayStyle.backgroundMapBase.clone({ visible: newState });\r\n activeViewport.invalidateRenderPlan();\r\n }\r\n setBaseMapVisible(newState);\r\n }\r\n }, [baseMapVisible, activeViewport]);\r\n\r\n const [baseLayerLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Basemap.BaseLayer\"));\r\n const [selectBaseMapLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Basemap.SelectBaseMap\"));\r\n const [toggleVisibility] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Widget.ToggleVisibility\"));\r\n\r\n return (\r\n <>\r\n <div className=\"map-manager-base-item\" >\r\n <button className=\"map-manager-item-visibility\" title={toggleVisibility} onClick={handleVisibilityChange}>\r\n <WebFontIcon iconName={baseMapVisible ? \"icon-visibility\" : \"icon-visibility-hide-2\"} />\r\n </button>\r\n <span className=\"map-manager-base-label\">{baseLayerLabel}</span>\r\n <ThemedSelect options={baseMapOptions} closeMenuOnSelect placeholder={selectBaseMapLabel} value={selectedBaseMapValue} onChange={handleBaseMapSelection} />\r\n {\r\n baseIsColor &&\r\n <ColorSwatch className=\"map-manager-base-item-color\" colorDef={ColorDef.fromJSON(bgColor)} round={false} onColorPick={handleBgColorClick} />\r\n }\r\n <TransparencyPopupButton transparency={baseMapTransparencyValue} onTransparencyChange={handleBasemapTransparencyChange} />\r\n </div>\r\n </>\r\n );\r\n}\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmMessageDialog.d.ts","sourceRoot":"","sources":["../../../src/ui/widget/ConfirmMessageDialog.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,WAAW,EAAU,MAAM,mBAAmB,CAAC;AAExD,OAAO,qBAAqB,CAAC;AAG7B,UAAU,yBAA0B,SAAQ,WAAW;IAErD,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,yJAAyJ;IACzJ,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,yIAAyI;IACzI,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,0IAA0I;IAC1I,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B;AAGD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,eA2BpE"}
|
|
@@ -1 +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,CAAC;AA3BD,oDA2BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n// cSpell:ignore Modeless WMTS\n\nimport * as React from \"react\";\nimport { CommonProps, Dialog } from \"@itwin/core-react\";\n\nimport \"./MapUrlDialog.scss\";\nimport { DialogButtonType } from \"@itwin/appui-abstract\";\n\ninterface ConfirmMessageDialogProps extends CommonProps {\n\n /** Title to show in title bar of dialog */\n title?: string | JSX.Element;\n message?: string | JSX.Element;\n onYesResult?: () => void;\n onNoResult?: () => void;\n onClose?: () => void;\n onEscape?: () => void;\n minWidth?: string | number;\n /** Minimum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: 100px */\n minHeight?: string | number;\n /** Maximum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n maxWidth?: string | number;\n /** Maximum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n maxHeight?: string | number;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function ConfirmMessageDialog(props: ConfirmMessageDialogProps) {\n\n const buttonCluster = React.useMemo(() => [\n { type: DialogButtonType.Yes, onClick: props.onYesResult ?? (() => { }) },\n { type: DialogButtonType.No, onClick: props.onNoResult ?? (() => { }) },\n ], [props.onYesResult, props.onNoResult]);\n\n return (\n <Dialog\n className={props.className}\n title={props.title}\n opened={true}\n resizable={false}\n movable={true}\n modal={true}\n buttonCluster={buttonCluster}\n onClose={props.onClose}\n onEscape={props.onEscape}\n minHeight={props.minHeight}\n maxHeight={props.maxHeight}\n minWidth={props.minWidth}\n maxWidth={props.maxWidth}\n trapFocus={false}\n >\n <div>{props.message}</div>\n </Dialog>\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerDroppable.d.ts","sourceRoot":"","sources":["../../../src/ui/widget/MapLayerDroppable.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAiC,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAQrF,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAGvE,OAAO,wBAAwB,CAAC;AAEhC,gBAAgB;AAChB,UAAU,sBAAsB;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACrC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,oBAAoB,EAAE,MAAM,WAAW,CAAC;IACxC,cAAc,EAAE,cAAc,CAAC;IAC/B,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACtF,6BAA6B,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACjF,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,gBAAgB;AAEhB,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eAqG9D"}
|