@itwin/map-layers 4.0.0-dev.8 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +746 -848
- package/README.md +32 -32
- package/lib/cjs/MapLayerPreferences.d.ts +88 -88
- package/lib/cjs/MapLayerPreferences.js +312 -312
- package/lib/cjs/MapLayerPreferences.js.map +1 -1
- package/lib/cjs/map-layers.d.ts +6 -6
- package/lib/cjs/map-layers.js +22 -22
- package/lib/cjs/mapLayers.d.ts +26 -44
- package/lib/cjs/mapLayers.d.ts.map +1 -1
- package/lib/cjs/mapLayers.js +34 -63
- package/lib/cjs/mapLayers.js.map +1 -1
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts +16 -11
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -1
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.js +47 -52
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.js.map +1 -1
- package/lib/cjs/ui/Interfaces.d.ts +50 -50
- package/lib/cjs/ui/Interfaces.js +2 -2
- package/lib/cjs/ui/Interfaces.js.map +1 -1
- package/lib/cjs/ui/MapFeatureInfoTool.d.ts +13 -13
- package/lib/cjs/ui/MapFeatureInfoTool.d.ts.map +1 -1
- package/lib/cjs/ui/MapFeatureInfoTool.js +50 -50
- package/lib/cjs/ui/MapFeatureInfoTool.js.map +1 -1
- package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts +8 -8
- package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts.map +1 -1
- package/lib/cjs/ui/MapLayersUiItemsProvider.js +35 -38
- package/lib/cjs/ui/MapLayersUiItemsProvider.js.map +1 -1
- package/lib/cjs/ui/widget/AttachLayerPopupButton.d.ts +13 -14
- package/lib/cjs/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/AttachLayerPopupButton.js +338 -338
- package/lib/cjs/ui/widget/AttachLayerPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/BasemapPanel.d.ts +7 -8
- package/lib/cjs/ui/widget/BasemapPanel.d.ts.map +1 -1
- package/lib/cjs/ui/widget/BasemapPanel.js +156 -156
- package/lib/cjs/ui/widget/BasemapPanel.js.map +1 -1
- package/lib/cjs/ui/widget/BasemapPanel.scss +87 -87
- package/lib/cjs/ui/widget/ConfirmMessageDialog.d.ts +20 -21
- package/lib/cjs/ui/widget/ConfirmMessageDialog.d.ts.map +1 -1
- package/lib/cjs/ui/widget/ConfirmMessageDialog.js +25 -25
- package/lib/cjs/ui/widget/ConfirmMessageDialog.js.map +1 -1
- package/lib/cjs/ui/widget/FeatureInfoDataProvider.d.ts +35 -40
- package/lib/cjs/ui/widget/FeatureInfoDataProvider.d.ts.map +1 -1
- package/lib/cjs/ui/widget/FeatureInfoDataProvider.js +140 -139
- package/lib/cjs/ui/widget/FeatureInfoDataProvider.js.map +1 -1
- package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts +6 -7
- package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
- package/lib/cjs/ui/widget/FeatureInfoWidget.js +76 -71
- package/lib/cjs/ui/widget/FeatureInfoWidget.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerDroppable.d.ts +18 -19
- package/lib/cjs/ui/widget/MapLayerDroppable.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerDroppable.js +88 -88
- package/lib/cjs/ui/widget/MapLayerDroppable.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerManager.d.ts +26 -26
- package/lib/cjs/ui/widget/MapLayerManager.js +403 -403
- package/lib/cjs/ui/widget/MapLayerManager.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerManager.scss +409 -409
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts +11 -12
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.js +83 -83
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts +6 -7
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js +65 -65
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.scss +20 -20
- package/lib/cjs/ui/widget/MapLayersWidget.d.ts +10 -11
- package/lib/cjs/ui/widget/MapLayersWidget.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayersWidget.js +31 -31
- package/lib/cjs/ui/widget/MapLayersWidget.js.map +1 -1
- package/lib/cjs/ui/widget/MapManagerSettings.d.ts +2 -3
- package/lib/cjs/ui/widget/MapManagerSettings.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapManagerSettings.js +200 -200
- package/lib/cjs/ui/widget/MapManagerSettings.js.map +1 -1
- package/lib/cjs/ui/widget/MapManagerSettings.scss +29 -29
- package/lib/cjs/ui/widget/MapUrlDialog.d.ts +22 -23
- package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.js +533 -527
- package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.scss +99 -100
- package/lib/cjs/ui/widget/SelectMapFormat.d.ts +17 -18
- package/lib/cjs/ui/widget/SelectMapFormat.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SelectMapFormat.js +59 -59
- package/lib/cjs/ui/widget/SelectMapFormat.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersDataProvider.d.ts +18 -20
- package/lib/cjs/ui/widget/SubLayersDataProvider.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SubLayersDataProvider.js +75 -76
- package/lib/cjs/ui/widget/SubLayersDataProvider.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts +9 -10
- package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SubLayersPopupButton.js +40 -40
- package/lib/cjs/ui/widget/SubLayersPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersTree.d.ts +14 -15
- package/lib/cjs/ui/widget/SubLayersTree.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SubLayersTree.js +419 -419
- package/lib/cjs/ui/widget/SubLayersTree.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersTree.scss +70 -69
- package/lib/cjs/ui/widget/TransparencyPopupButton.d.ts +13 -14
- package/lib/cjs/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/TransparencyPopupButton.js +47 -47
- package/lib/cjs/ui/widget/TransparencyPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/TransparencyPopupButton.scss +35 -36
- package/lib/esm/MapLayerPreferences.d.ts +88 -88
- package/lib/esm/MapLayerPreferences.js +308 -308
- package/lib/esm/MapLayerPreferences.js.map +1 -1
- package/lib/esm/map-layers.d.ts +6 -6
- package/lib/esm/map-layers.js +10 -10
- package/lib/esm/mapLayers.d.ts +26 -44
- package/lib/esm/mapLayers.d.ts.map +1 -1
- package/lib/esm/mapLayers.js +30 -59
- package/lib/esm/mapLayers.js.map +1 -1
- package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts +16 -11
- package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -1
- package/lib/esm/ui/FeatureInfoUiItemsProvider.js +43 -48
- package/lib/esm/ui/FeatureInfoUiItemsProvider.js.map +1 -1
- package/lib/esm/ui/Interfaces.d.ts +50 -50
- package/lib/esm/ui/Interfaces.js +1 -1
- package/lib/esm/ui/Interfaces.js.map +1 -1
- package/lib/esm/ui/MapFeatureInfoTool.d.ts +13 -13
- package/lib/esm/ui/MapFeatureInfoTool.d.ts.map +1 -1
- package/lib/esm/ui/MapFeatureInfoTool.js +45 -45
- package/lib/esm/ui/MapFeatureInfoTool.js.map +1 -1
- package/lib/esm/ui/MapLayersUiItemsProvider.d.ts +8 -8
- package/lib/esm/ui/MapLayersUiItemsProvider.d.ts.map +1 -1
- package/lib/esm/ui/MapLayersUiItemsProvider.js +31 -34
- package/lib/esm/ui/MapLayersUiItemsProvider.js.map +1 -1
- package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts +13 -14
- package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/AttachLayerPopupButton.js +334 -334
- package/lib/esm/ui/widget/AttachLayerPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/BasemapPanel.d.ts +7 -8
- package/lib/esm/ui/widget/BasemapPanel.d.ts.map +1 -1
- package/lib/esm/ui/widget/BasemapPanel.js +152 -152
- package/lib/esm/ui/widget/BasemapPanel.js.map +1 -1
- package/lib/esm/ui/widget/BasemapPanel.scss +87 -87
- package/lib/esm/ui/widget/ConfirmMessageDialog.d.ts +20 -21
- package/lib/esm/ui/widget/ConfirmMessageDialog.d.ts.map +1 -1
- package/lib/esm/ui/widget/ConfirmMessageDialog.js +21 -21
- package/lib/esm/ui/widget/ConfirmMessageDialog.js.map +1 -1
- package/lib/esm/ui/widget/FeatureInfoDataProvider.d.ts +35 -40
- package/lib/esm/ui/widget/FeatureInfoDataProvider.d.ts.map +1 -1
- package/lib/esm/ui/widget/FeatureInfoDataProvider.js +136 -135
- package/lib/esm/ui/widget/FeatureInfoDataProvider.js.map +1 -1
- package/lib/esm/ui/widget/FeatureInfoWidget.d.ts +6 -7
- package/lib/esm/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
- package/lib/esm/ui/widget/FeatureInfoWidget.js +72 -67
- package/lib/esm/ui/widget/FeatureInfoWidget.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerDroppable.d.ts +18 -19
- package/lib/esm/ui/widget/MapLayerDroppable.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerDroppable.js +84 -84
- package/lib/esm/ui/widget/MapLayerDroppable.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerManager.d.ts +26 -26
- package/lib/esm/ui/widget/MapLayerManager.js +398 -398
- package/lib/esm/ui/widget/MapLayerManager.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerManager.scss +409 -409
- package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts +11 -12
- package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsMenu.js +79 -79
- package/lib/esm/ui/widget/MapLayerSettingsMenu.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts +6 -7
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js +61 -61
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.scss +20 -20
- package/lib/esm/ui/widget/MapLayersWidget.d.ts +10 -11
- package/lib/esm/ui/widget/MapLayersWidget.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayersWidget.js +27 -27
- package/lib/esm/ui/widget/MapLayersWidget.js.map +1 -1
- package/lib/esm/ui/widget/MapManagerSettings.d.ts +2 -3
- package/lib/esm/ui/widget/MapManagerSettings.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapManagerSettings.js +196 -196
- package/lib/esm/ui/widget/MapManagerSettings.js.map +1 -1
- package/lib/esm/ui/widget/MapManagerSettings.scss +29 -29
- package/lib/esm/ui/widget/MapUrlDialog.d.ts +22 -23
- package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.js +529 -523
- package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.scss +99 -100
- package/lib/esm/ui/widget/SelectMapFormat.d.ts +17 -18
- package/lib/esm/ui/widget/SelectMapFormat.d.ts.map +1 -1
- package/lib/esm/ui/widget/SelectMapFormat.js +55 -55
- package/lib/esm/ui/widget/SelectMapFormat.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersDataProvider.d.ts +18 -20
- package/lib/esm/ui/widget/SubLayersDataProvider.d.ts.map +1 -1
- package/lib/esm/ui/widget/SubLayersDataProvider.js +71 -72
- package/lib/esm/ui/widget/SubLayersDataProvider.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersPopupButton.d.ts +9 -10
- package/lib/esm/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/SubLayersPopupButton.js +36 -36
- package/lib/esm/ui/widget/SubLayersPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersTree.d.ts +14 -15
- package/lib/esm/ui/widget/SubLayersTree.d.ts.map +1 -1
- package/lib/esm/ui/widget/SubLayersTree.js +414 -414
- package/lib/esm/ui/widget/SubLayersTree.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersTree.scss +70 -69
- package/lib/esm/ui/widget/TransparencyPopupButton.d.ts +13 -14
- package/lib/esm/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/TransparencyPopupButton.js +43 -43
- package/lib/esm/ui/widget/TransparencyPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/TransparencyPopupButton.scss +35 -36
- package/package.json +39 -38
|
@@ -1,85 +1,85 @@
|
|
|
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
|
-
// cSpell:ignore droppable Sublayer Basemap
|
|
6
|
-
// the following quiet warning caused by react-beautiful-dnd package
|
|
7
|
-
/* eslint-disable @typescript-eslint/unbound-method */
|
|
8
|
-
import * as React from "react";
|
|
9
|
-
import { Draggable, Droppable } from "react-beautiful-dnd";
|
|
10
|
-
import { MapLayerImageryProviderStatus, MapTileTreeScaleRangeVisibility } from "@itwin/core-frontend";
|
|
11
|
-
import { Icon } from "@itwin/core-react";
|
|
12
|
-
import { assert } from "@itwin/core-bentley";
|
|
13
|
-
import {
|
|
14
|
-
import { Button } from "@itwin/itwinui-react";
|
|
15
|
-
import { SubLayersPopupButton } from "./SubLayersPopupButton";
|
|
16
|
-
import { AttachLayerButtonType, AttachLayerPopupButton } from "./AttachLayerPopupButton";
|
|
17
|
-
import { MapLayerSettingsMenu } from "./MapLayerSettingsMenu";
|
|
18
|
-
import { MapUrlDialog } from "./MapUrlDialog";
|
|
19
|
-
import "./MapLayerManager.scss";
|
|
20
|
-
import { MapLayersUI } from "../../mapLayers";
|
|
21
|
-
import { ImageMapLayerSettings } from "@itwin/core-common";
|
|
22
|
-
/** @internal */
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
24
|
-
export function MapLayerDroppable(props) {
|
|
25
|
-
const containsLayer = props.layersList && props.layersList.length > 0;
|
|
26
|
-
const droppableId = props.isOverlay ? "overlayMapLayers" : "backgroundMapLayers";
|
|
27
|
-
const [toggleVisibility] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Widget.ToggleVisibility"));
|
|
28
|
-
const [requireAuthTooltip] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Widget.RequireAuthTooltip"));
|
|
29
|
-
const [noBackgroundMapsSpecifiedLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Widget.NoBackgroundLayers"));
|
|
30
|
-
const [noUnderlaysSpecifiedLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Widget.NoOverlayLayers"));
|
|
31
|
-
const [dropLayerLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Widget.DropLayerLabel"));
|
|
32
|
-
const [outOfRangeTitle] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Widget.layerOutOfRange"));
|
|
33
|
-
const renderItem = (dragProvided, _, rubric) => {
|
|
34
|
-
var _a;
|
|
35
|
-
assert(props.layersList !== undefined);
|
|
36
|
-
const activeLayer = props.layersList[rubric.source.index];
|
|
37
|
-
const outOfRange = activeLayer.treeVisibility === MapTileTreeScaleRangeVisibility.Hidden;
|
|
38
|
-
return (React.createElement("div", { className: "map-manager-source-item", "data-id": rubric.source.index, key: activeLayer.name, ...dragProvided.draggableProps, ref: dragProvided.innerRef },
|
|
39
|
-
React.createElement(Button, { disabled: props.disabled, size: "small", styleType: "borderless", className: "map-manager-item-visibility", title: toggleVisibility, onClick: () => { props.onItemVisibilityToggleClicked(activeLayer); } },
|
|
40
|
-
React.createElement(Icon, { iconSpec: activeLayer.visible ? "icon-visibility" : "icon-visibility-hide-2" })),
|
|
41
|
-
React.createElement("span", { className: props.disabled || outOfRange ? "map-manager-item-label-disabled" : "map-manager-item-label", title: outOfRange ? outOfRangeTitle : undefined, ...dragProvided.dragHandleProps }, activeLayer.name),
|
|
42
|
-
React.createElement("div", { className: "map-manager-item-sub-layer-container" }, activeLayer.subLayers && activeLayer.subLayers.length > 1 &&
|
|
43
|
-
React.createElement(SubLayersPopupButton, { mapLayerSettings: activeLayer, activeViewport: props.activeViewport })),
|
|
44
|
-
((_a = activeLayer.provider) === null || _a === void 0 ? void 0 : _a.status) === MapLayerImageryProviderStatus.RequireAuth &&
|
|
45
|
-
React.createElement(Button, { disabled: props.disabled, size: "small", styleType: "borderless", onClick: () => {
|
|
46
|
-
var _a;
|
|
47
|
-
const indexInDisplayStyle = (_a = props.activeViewport) === null || _a === void 0 ? void 0 : _a.displayStyle.findMapLayerIndexByNameAndSource(activeLayer.name, activeLayer.source, activeLayer.isOverlay);
|
|
48
|
-
if (indexInDisplayStyle !== undefined && indexInDisplayStyle >= 0) {
|
|
49
|
-
const layerSettings = props.activeViewport.displayStyle.mapLayerAtIndex(indexInDisplayStyle, activeLayer.isOverlay);
|
|
50
|
-
if (layerSettings instanceof ImageMapLayerSettings) {
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}, title: requireAuthTooltip },
|
|
55
|
-
React.createElement(Icon, { className: "map-layer-source-item-warnMessage-icon", iconSpec: "icon-status-warning" })),
|
|
56
|
-
React.createElement(MapLayerSettingsMenu, { activeViewport: props.activeViewport, mapLayerSettings: activeLayer, onMenuItemSelection: props.onMenuItemSelected, disabled: props.disabled })));
|
|
57
|
-
};
|
|
58
|
-
function renderDraggableContent(snapshot) {
|
|
59
|
-
var _a;
|
|
60
|
-
let node;
|
|
61
|
-
if (containsLayer) {
|
|
62
|
-
// Render a <Draggable>
|
|
63
|
-
node = ((_a = props.layersList) === null || _a === void 0 ? void 0 : _a.map((mapLayerSettings, i) => React.createElement(Draggable, { isDragDisabled: props.disabled, key: mapLayerSettings.name, draggableId: mapLayerSettings.name, index: i }, renderItem)));
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
// Render a label that provide a 'Drop here' hint
|
|
67
|
-
const label = props.isOverlay ? noUnderlaysSpecifiedLabel : noBackgroundMapsSpecifiedLabel;
|
|
68
|
-
node =
|
|
69
|
-
React.createElement("div", { title: label, className: "map-manager-no-layers-container" }, snapshot.isDraggingOver ?
|
|
70
|
-
React.createElement("span", { className: "map-manager-no-layers-label" }, dropLayerLabel)
|
|
71
|
-
:
|
|
72
|
-
React.createElement(React.Fragment, null,
|
|
73
|
-
React.createElement("span", { className: "map-manager-no-layers-label" }, label),
|
|
74
|
-
React.createElement(AttachLayerPopupButton, { disabled: props.disabled, buttonType: AttachLayerButtonType.Blue, isOverlay: props.isOverlay })));
|
|
75
|
-
}
|
|
76
|
-
return node;
|
|
77
|
-
}
|
|
78
|
-
function renderDraggable(dropProvided, dropSnapshot) {
|
|
79
|
-
return (React.createElement("div", { className: `map-manager-attachments${dropSnapshot.isDraggingOver && containsLayer ? " is-dragging-map-over" : ""}`, ref: dropProvided.innerRef, ...dropProvided.droppableProps },
|
|
80
|
-
renderDraggableContent(dropSnapshot),
|
|
81
|
-
React.createElement("div", { style: containsLayer ? undefined : { display: "none" } }, dropProvided.placeholder)));
|
|
82
|
-
}
|
|
83
|
-
return (React.createElement(Droppable, { droppableId: droppableId, renderClone: renderItem, getContainerForClone: props.getContainerForClone }, renderDraggable));
|
|
84
|
-
}
|
|
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
|
+
// cSpell:ignore droppable Sublayer Basemap
|
|
6
|
+
// the following quiet warning caused by react-beautiful-dnd package
|
|
7
|
+
/* eslint-disable @typescript-eslint/unbound-method */
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { Draggable, Droppable } from "react-beautiful-dnd";
|
|
10
|
+
import { MapLayerImageryProviderStatus, MapTileTreeScaleRangeVisibility } from "@itwin/core-frontend";
|
|
11
|
+
import { Icon } from "@itwin/core-react";
|
|
12
|
+
import { assert } from "@itwin/core-bentley";
|
|
13
|
+
import { UiFramework } from "@itwin/appui-react";
|
|
14
|
+
import { Button } from "@itwin/itwinui-react";
|
|
15
|
+
import { SubLayersPopupButton } from "./SubLayersPopupButton";
|
|
16
|
+
import { AttachLayerButtonType, AttachLayerPopupButton } from "./AttachLayerPopupButton";
|
|
17
|
+
import { MapLayerSettingsMenu } from "./MapLayerSettingsMenu";
|
|
18
|
+
import { MapUrlDialog } from "./MapUrlDialog";
|
|
19
|
+
import "./MapLayerManager.scss";
|
|
20
|
+
import { MapLayersUI } from "../../mapLayers";
|
|
21
|
+
import { ImageMapLayerSettings } from "@itwin/core-common";
|
|
22
|
+
/** @internal */
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
24
|
+
export function MapLayerDroppable(props) {
|
|
25
|
+
const containsLayer = props.layersList && props.layersList.length > 0;
|
|
26
|
+
const droppableId = props.isOverlay ? "overlayMapLayers" : "backgroundMapLayers";
|
|
27
|
+
const [toggleVisibility] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Widget.ToggleVisibility"));
|
|
28
|
+
const [requireAuthTooltip] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Widget.RequireAuthTooltip"));
|
|
29
|
+
const [noBackgroundMapsSpecifiedLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Widget.NoBackgroundLayers"));
|
|
30
|
+
const [noUnderlaysSpecifiedLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Widget.NoOverlayLayers"));
|
|
31
|
+
const [dropLayerLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Widget.DropLayerLabel"));
|
|
32
|
+
const [outOfRangeTitle] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Widget.layerOutOfRange"));
|
|
33
|
+
const renderItem = (dragProvided, _, rubric) => {
|
|
34
|
+
var _a;
|
|
35
|
+
assert(props.layersList !== undefined);
|
|
36
|
+
const activeLayer = props.layersList[rubric.source.index];
|
|
37
|
+
const outOfRange = activeLayer.treeVisibility === MapTileTreeScaleRangeVisibility.Hidden;
|
|
38
|
+
return (React.createElement("div", { className: "map-manager-source-item", "data-id": rubric.source.index, key: activeLayer.name, ...dragProvided.draggableProps, ref: dragProvided.innerRef },
|
|
39
|
+
React.createElement(Button, { disabled: props.disabled, size: "small", styleType: "borderless", className: "map-manager-item-visibility", title: toggleVisibility, onClick: () => { props.onItemVisibilityToggleClicked(activeLayer); } },
|
|
40
|
+
React.createElement(Icon, { iconSpec: activeLayer.visible ? "icon-visibility" : "icon-visibility-hide-2" })),
|
|
41
|
+
React.createElement("span", { className: props.disabled || outOfRange ? "map-manager-item-label-disabled" : "map-manager-item-label", title: outOfRange ? outOfRangeTitle : undefined, ...dragProvided.dragHandleProps }, activeLayer.name),
|
|
42
|
+
React.createElement("div", { className: "map-manager-item-sub-layer-container" }, activeLayer.subLayers && activeLayer.subLayers.length > 1 &&
|
|
43
|
+
React.createElement(SubLayersPopupButton, { mapLayerSettings: activeLayer, activeViewport: props.activeViewport })),
|
|
44
|
+
((_a = activeLayer.provider) === null || _a === void 0 ? void 0 : _a.status) === MapLayerImageryProviderStatus.RequireAuth &&
|
|
45
|
+
React.createElement(Button, { disabled: props.disabled, size: "small", styleType: "borderless", onClick: () => {
|
|
46
|
+
var _a;
|
|
47
|
+
const indexInDisplayStyle = (_a = props.activeViewport) === null || _a === void 0 ? void 0 : _a.displayStyle.findMapLayerIndexByNameAndSource(activeLayer.name, activeLayer.source, activeLayer.isOverlay);
|
|
48
|
+
if (indexInDisplayStyle !== undefined && indexInDisplayStyle >= 0) {
|
|
49
|
+
const layerSettings = props.activeViewport.displayStyle.mapLayerAtIndex(indexInDisplayStyle, activeLayer.isOverlay);
|
|
50
|
+
if (layerSettings instanceof ImageMapLayerSettings) {
|
|
51
|
+
UiFramework.dialogs.modal.open(React.createElement(MapUrlDialog, { activeViewport: props.activeViewport, isOverlay: props.isOverlay, layerRequiringCredentials: layerSettings === null || layerSettings === void 0 ? void 0 : layerSettings.toJSON(), onOkResult: props.onItemEdited, mapTypesOptions: props.mapTypesOptions }));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}, title: requireAuthTooltip },
|
|
55
|
+
React.createElement(Icon, { className: "map-layer-source-item-warnMessage-icon", iconSpec: "icon-status-warning" })),
|
|
56
|
+
React.createElement(MapLayerSettingsMenu, { activeViewport: props.activeViewport, mapLayerSettings: activeLayer, onMenuItemSelection: props.onMenuItemSelected, disabled: props.disabled })));
|
|
57
|
+
};
|
|
58
|
+
function renderDraggableContent(snapshot) {
|
|
59
|
+
var _a;
|
|
60
|
+
let node;
|
|
61
|
+
if (containsLayer) {
|
|
62
|
+
// Render a <Draggable>
|
|
63
|
+
node = ((_a = props.layersList) === null || _a === void 0 ? void 0 : _a.map((mapLayerSettings, i) => React.createElement(Draggable, { isDragDisabled: props.disabled, key: mapLayerSettings.name, draggableId: mapLayerSettings.name, index: i }, renderItem)));
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
// Render a label that provide a 'Drop here' hint
|
|
67
|
+
const label = props.isOverlay ? noUnderlaysSpecifiedLabel : noBackgroundMapsSpecifiedLabel;
|
|
68
|
+
node =
|
|
69
|
+
React.createElement("div", { title: label, className: "map-manager-no-layers-container" }, snapshot.isDraggingOver ?
|
|
70
|
+
React.createElement("span", { className: "map-manager-no-layers-label" }, dropLayerLabel)
|
|
71
|
+
:
|
|
72
|
+
React.createElement(React.Fragment, null,
|
|
73
|
+
React.createElement("span", { className: "map-manager-no-layers-label" }, label),
|
|
74
|
+
React.createElement(AttachLayerPopupButton, { disabled: props.disabled, buttonType: AttachLayerButtonType.Blue, isOverlay: props.isOverlay })));
|
|
75
|
+
}
|
|
76
|
+
return node;
|
|
77
|
+
}
|
|
78
|
+
function renderDraggable(dropProvided, dropSnapshot) {
|
|
79
|
+
return (React.createElement("div", { className: `map-manager-attachments${dropSnapshot.isDraggingOver && containsLayer ? " is-dragging-map-over" : ""}`, ref: dropProvided.innerRef, ...dropProvided.droppableProps },
|
|
80
|
+
renderDraggableContent(dropSnapshot),
|
|
81
|
+
React.createElement("div", { style: containsLayer ? undefined : { display: "none" } }, dropProvided.placeholder)));
|
|
82
|
+
}
|
|
83
|
+
return (React.createElement(Droppable, { droppableId: droppableId, renderClone: renderItem, getContainerForClone: props.getContainerForClone }, renderDraggable));
|
|
84
|
+
}
|
|
85
85
|
//# sourceMappingURL=MapLayerDroppable.js.map
|
|
@@ -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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AAK,CAAQ;4BAC5D,oBAAC,sBAAsB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAI,CACvH,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, MapTileTreeScaleRangeVisibility, 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 disabled?: boolean;\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 const [outOfRangeTitle] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.layerOutOfRange\"));\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 const outOfRange = activeLayer.treeVisibility === MapTileTreeScaleRangeVisibility.Hidden;\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 {/* Visibility icon */}\r\n <Button disabled={props.disabled} 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 {/* Label */}\r\n <span className={props.disabled||outOfRange ? \"map-manager-item-label-disabled\" : \"map-manager-item-label\"}\r\n title = {outOfRange ? outOfRangeTitle : undefined }\r\n {...dragProvided.dragHandleProps}\r\n\r\n >\r\n {activeLayer.name}\r\n </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 disabled={props.disabled}\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 className=\"map-layer-source-item-warnMessage-icon\" iconSpec=\"icon-status-warning\" />\r\n </Button>\r\n }\r\n <MapLayerSettingsMenu activeViewport={props.activeViewport} mapLayerSettings={activeLayer} onMenuItemSelection={props.onMenuItemSelected} disabled={props.disabled} />\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 isDragDisabled={props.disabled} 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 disabled={props.disabled} 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,EAAE,+BAA+B,EAAkB,MAAM,sBAAsB,CAAC;AACtH,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,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,O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AAK,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":["/*---------------------------------------------------------------------------------------------\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 droppable Sublayer Basemap\n\n// the following quiet warning caused by react-beautiful-dnd package\n/* eslint-disable @typescript-eslint/unbound-method */\n\nimport * as React from \"react\";\nimport { Draggable, DraggableChildrenFn, Droppable, DroppableProvided, DroppableStateSnapshot } from \"react-beautiful-dnd\";\nimport { MapLayerImageryProviderStatus, MapTileTreeScaleRangeVisibility, ScreenViewport } from \"@itwin/core-frontend\";\nimport { Icon } from \"@itwin/core-react\";\nimport { assert } from \"@itwin/core-bentley\";\nimport { UiFramework } from \"@itwin/appui-react\";\nimport { Button } from \"@itwin/itwinui-react\";\nimport { SubLayersPopupButton } from \"./SubLayersPopupButton\";\nimport { AttachLayerButtonType, AttachLayerPopupButton } from \"./AttachLayerPopupButton\";\nimport { MapTypesOptions, StyleMapLayerSettings } from \"../Interfaces\";\nimport { MapLayerSettingsMenu } from \"./MapLayerSettingsMenu\";\nimport { MapUrlDialog } from \"./MapUrlDialog\";\nimport \"./MapLayerManager.scss\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\n\n/** @internal */\ninterface MapLayerDroppableProps {\n isOverlay: boolean;\n layersList?: StyleMapLayerSettings[];\n mapTypesOptions?: MapTypesOptions;\n getContainerForClone: () => HTMLElement;\n activeViewport: ScreenViewport;\n onMenuItemSelected: (action: string, mapLayerSettings: StyleMapLayerSettings) => void;\n onItemVisibilityToggleClicked: (mapLayerSettings: StyleMapLayerSettings) => void;\n onItemEdited: () => void;\n disabled?: boolean;\n}\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function MapLayerDroppable(props: MapLayerDroppableProps) {\n const containsLayer = props.layersList && props.layersList.length > 0;\n const droppableId = props.isOverlay ? \"overlayMapLayers\" : \"backgroundMapLayers\";\n const [toggleVisibility] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.ToggleVisibility\"));\n const [requireAuthTooltip] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.RequireAuthTooltip\"));\n const [noBackgroundMapsSpecifiedLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.NoBackgroundLayers\"));\n const [noUnderlaysSpecifiedLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.NoOverlayLayers\"));\n const [dropLayerLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.DropLayerLabel\"));\n const [outOfRangeTitle] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:Widget.layerOutOfRange\"));\n\n const renderItem: DraggableChildrenFn = (dragProvided, _, rubric) => {\n assert(props.layersList !== undefined);\n const activeLayer = props.layersList[rubric.source.index];\n const outOfRange = activeLayer.treeVisibility === MapTileTreeScaleRangeVisibility.Hidden;\n\n return (\n <div className=\"map-manager-source-item\" data-id={rubric.source.index} key={activeLayer.name}\n {...dragProvided.draggableProps}\n ref={dragProvided.innerRef} >\n {/* Visibility icon */}\n <Button disabled={props.disabled} size=\"small\" styleType=\"borderless\" className=\"map-manager-item-visibility\" title={toggleVisibility} onClick={() => { props.onItemVisibilityToggleClicked(activeLayer); }}>\n <Icon iconSpec={activeLayer.visible ? \"icon-visibility\" : \"icon-visibility-hide-2\"} />\n </Button>\n {/* Label */}\n <span className={props.disabled||outOfRange ? \"map-manager-item-label-disabled\" : \"map-manager-item-label\"}\n title = {outOfRange ? outOfRangeTitle : undefined }\n {...dragProvided.dragHandleProps}\n\n >\n {activeLayer.name}\n </span>\n <div className=\"map-manager-item-sub-layer-container\">\n {activeLayer.subLayers && activeLayer.subLayers.length > 1 &&\n <SubLayersPopupButton mapLayerSettings={activeLayer} activeViewport={props.activeViewport} />\n }\n </div>\n {activeLayer.provider?.status === MapLayerImageryProviderStatus.RequireAuth &&\n <Button\n disabled={props.disabled}\n size=\"small\"\n styleType=\"borderless\"\n onClick={() => {\n const indexInDisplayStyle = props.activeViewport?.displayStyle.findMapLayerIndexByNameAndSource(activeLayer.name, activeLayer.source, activeLayer.isOverlay);\n if (indexInDisplayStyle !== undefined && indexInDisplayStyle >= 0) {\n const layerSettings = props.activeViewport.displayStyle.mapLayerAtIndex(indexInDisplayStyle, activeLayer.isOverlay);\n if (layerSettings instanceof ImageMapLayerSettings) {\n UiFramework.dialogs.modal.open(<MapUrlDialog activeViewport={props.activeViewport}\n isOverlay={props.isOverlay}\n layerRequiringCredentials={layerSettings?.toJSON()}\n onOkResult={props.onItemEdited}\n mapTypesOptions={props.mapTypesOptions}></MapUrlDialog>);\n }\n }\n\n }}\n title={requireAuthTooltip}\n >\n <Icon className=\"map-layer-source-item-warnMessage-icon\" iconSpec=\"icon-status-warning\" />\n </Button>\n }\n <MapLayerSettingsMenu activeViewport={props.activeViewport} mapLayerSettings={activeLayer} onMenuItemSelection={props.onMenuItemSelected} disabled={props.disabled} />\n </div>\n );\n };\n\n function renderDraggableContent(snapshot: DroppableStateSnapshot): React.ReactNode {\n let node: React.ReactNode;\n if (containsLayer) {\n // Render a <Draggable>\n node = (props.layersList?.map((mapLayerSettings, i) =>\n <Draggable isDragDisabled={props.disabled} key={mapLayerSettings.name} draggableId={mapLayerSettings.name} index={i}>\n {renderItem}\n </Draggable>));\n } else {\n // Render a label that provide a 'Drop here' hint\n const label = props.isOverlay ? noUnderlaysSpecifiedLabel : noBackgroundMapsSpecifiedLabel;\n node =\n <div title={label} className=\"map-manager-no-layers-container\">\n {snapshot.isDraggingOver ?\n <span className=\"map-manager-no-layers-label\">{dropLayerLabel}</span>\n :\n <>\n <span className=\"map-manager-no-layers-label\">{label}</span>\n <AttachLayerPopupButton disabled={props.disabled} buttonType={AttachLayerButtonType.Blue} isOverlay={props.isOverlay} />\n </>\n }\n </div>;\n }\n return node;\n }\n\n function renderDraggable(dropProvided: DroppableProvided, dropSnapshot: DroppableStateSnapshot): React.ReactElement<HTMLElement> {\n return (\n <div className={`map-manager-attachments${dropSnapshot.isDraggingOver && containsLayer ? \" is-dragging-map-over\" : \"\"}`} ref={dropProvided.innerRef} {...dropProvided.droppableProps} >\n\n {renderDraggableContent(dropSnapshot)}\n\n {\n /* We don't want a placeholder when displaying the 'Drop here' message\n Unfortunately, if don't add it, 'react-beautiful-dnd' show an error message in the console.\n So I simply make it hidden. See https://github.com/atlassian/react-beautiful-dnd/issues/518 */\n }\n <div style={containsLayer ? undefined : { display: \"none\" }}>{dropProvided.placeholder}</div>\n </div>);\n }\n\n return (\n <Droppable\n droppableId={droppableId}\n renderClone={renderItem}\n getContainerForClone={props.getContainerForClone as any}\n >\n {renderDraggable}\n </Droppable>\n );\n}\n"]}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { MapLayerSource, ScreenViewport } from "@itwin/core-frontend";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { MapLayerOptions, StyleMapLayerSettings } from "../Interfaces";
|
|
4
|
-
import "./MapLayerManager.scss";
|
|
5
|
-
/** @internal */
|
|
6
|
-
export interface SourceMapContextProps {
|
|
7
|
-
readonly sources: MapLayerSource[];
|
|
8
|
-
readonly loadingSources: boolean;
|
|
9
|
-
readonly bases: MapLayerSource[];
|
|
10
|
-
readonly refreshFromStyle: () => void;
|
|
11
|
-
readonly activeViewport?: ScreenViewport;
|
|
12
|
-
readonly backgroundLayers?: StyleMapLayerSettings[];
|
|
13
|
-
readonly overlayLayers?: StyleMapLayerSettings[];
|
|
14
|
-
readonly mapLayerOptions?: MapLayerOptions;
|
|
15
|
-
}
|
|
16
|
-
/** @internal */
|
|
17
|
-
export declare const SourceMapContext: React.Context<SourceMapContextProps>;
|
|
18
|
-
/** @internal */
|
|
19
|
-
export declare function useSourceMapContext(): SourceMapContextProps;
|
|
20
|
-
interface MapLayerManagerProps {
|
|
21
|
-
getContainerForClone: () => HTMLElement;
|
|
22
|
-
activeViewport: ScreenViewport;
|
|
23
|
-
mapLayerOptions?: MapLayerOptions;
|
|
24
|
-
}
|
|
25
|
-
export declare function MapLayerManager(props: MapLayerManagerProps): JSX.Element;
|
|
26
|
-
export {};
|
|
1
|
+
import { MapLayerSource, ScreenViewport } from "@itwin/core-frontend";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { MapLayerOptions, StyleMapLayerSettings } from "../Interfaces";
|
|
4
|
+
import "./MapLayerManager.scss";
|
|
5
|
+
/** @internal */
|
|
6
|
+
export interface SourceMapContextProps {
|
|
7
|
+
readonly sources: MapLayerSource[];
|
|
8
|
+
readonly loadingSources: boolean;
|
|
9
|
+
readonly bases: MapLayerSource[];
|
|
10
|
+
readonly refreshFromStyle: () => void;
|
|
11
|
+
readonly activeViewport?: ScreenViewport;
|
|
12
|
+
readonly backgroundLayers?: StyleMapLayerSettings[];
|
|
13
|
+
readonly overlayLayers?: StyleMapLayerSettings[];
|
|
14
|
+
readonly mapLayerOptions?: MapLayerOptions;
|
|
15
|
+
}
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare const SourceMapContext: React.Context<SourceMapContextProps>;
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare function useSourceMapContext(): SourceMapContextProps;
|
|
20
|
+
interface MapLayerManagerProps {
|
|
21
|
+
getContainerForClone: () => HTMLElement;
|
|
22
|
+
activeViewport: ScreenViewport;
|
|
23
|
+
mapLayerOptions?: MapLayerOptions;
|
|
24
|
+
}
|
|
25
|
+
export declare function MapLayerManager(props: MapLayerManagerProps): JSX.Element;
|
|
26
|
+
export {};
|
|
27
27
|
//# sourceMappingURL=MapLayerManager.d.ts.map
|