@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,525 @@
|
|
|
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
|
+
$divider-color: $buic-background-toolbutton-stroke;
|
|
9
|
+
$hovered-icon-color: $buic-foreground-primary-tone;
|
|
10
|
+
|
|
11
|
+
button.map-manager-item-visibility {
|
|
12
|
+
background-color: transparent;
|
|
13
|
+
border: none;
|
|
14
|
+
color: $buic-foreground-body;
|
|
15
|
+
background-color: transparent;
|
|
16
|
+
|
|
17
|
+
&:hover {
|
|
18
|
+
color: $hovered-icon-color;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:focus {
|
|
22
|
+
outline: none;
|
|
23
|
+
box-shadow: $uicore-button-focus-boxshadow;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.map-manager-layer-host {
|
|
28
|
+
margin: 0 6px;
|
|
29
|
+
height: 100%;
|
|
30
|
+
overflow-x: hidden;
|
|
31
|
+
overflow-y: auto;
|
|
32
|
+
|
|
33
|
+
.map-expandable-blocks-block {
|
|
34
|
+
width: 100%;
|
|
35
|
+
border: none;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.map-manager-top-header {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
width: 100%;
|
|
43
|
+
padding-top: 5px;
|
|
44
|
+
padding-bottom: 4px;
|
|
45
|
+
margin-bottom: 15px;
|
|
46
|
+
border-bottom-color: #ccc;
|
|
47
|
+
border-bottom-style: solid;
|
|
48
|
+
border-bottom-width: 1px;
|
|
49
|
+
|
|
50
|
+
.map-manager-header-label {
|
|
51
|
+
font-size: $iui-font-size;
|
|
52
|
+
width: auto;
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
flex: 1 1 auto;
|
|
55
|
+
padding-left: 10px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
button.map-manager-item-requireAuthIcon {
|
|
59
|
+
color: $buic-foreground-warning;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.map-manager-header-buttons-group {
|
|
63
|
+
margin-left: auto;
|
|
64
|
+
border: none;
|
|
65
|
+
display: flex;
|
|
66
|
+
padding-right: 5px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.map-manager-toggle {
|
|
70
|
+
height: 24px;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.map-manager-container {
|
|
75
|
+
margin: 10px 6px 0px 6px;
|
|
76
|
+
//border: 1px solid #ccc;
|
|
77
|
+
|
|
78
|
+
* {
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
map-manager-settings-container {
|
|
83
|
+
display: flex;
|
|
84
|
+
margin-top: 8px;
|
|
85
|
+
width: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.map-manager-layer-wrapper {
|
|
89
|
+
border: 1px solid #ccc;
|
|
90
|
+
margin-bottom: 15px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.map-manager-underlays,
|
|
94
|
+
.map-manager-overlays {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-content: center;
|
|
97
|
+
margin-top: 8px;
|
|
98
|
+
padding-left: 10px;
|
|
99
|
+
|
|
100
|
+
.map-manager-attach-layer-button {
|
|
101
|
+
background-color: transparent;
|
|
102
|
+
margin-left: auto;
|
|
103
|
+
width: 40px;
|
|
104
|
+
border: none;
|
|
105
|
+
color: $buic-foreground-body;
|
|
106
|
+
margin-right: 2px;
|
|
107
|
+
|
|
108
|
+
&:hover {
|
|
109
|
+
color: $hovered-icon-color;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&:focus {
|
|
113
|
+
box-shadow: $uicore-button-focus-boxshadow;
|
|
114
|
+
outline: none;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.core-ls {
|
|
120
|
+
position: absolute;
|
|
121
|
+
top: 50%;
|
|
122
|
+
left: 50%;
|
|
123
|
+
padding: 4px, 0;
|
|
124
|
+
transform: translate(-50%, -50%);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.map-manager-source-listbox-header {
|
|
128
|
+
margin-bottom: 4px;
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: row;
|
|
131
|
+
align-items: center;
|
|
132
|
+
column-gap: 6px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.map-manager-source-list-filter {
|
|
136
|
+
padding-top: 3.3px;
|
|
137
|
+
padding-bottom: 3.3px;
|
|
138
|
+
width: calc(100% - 40px);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.map-manager-source-list {
|
|
142
|
+
margin-top: 0;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.map-manager-overlays-label {
|
|
146
|
+
display: block;
|
|
147
|
+
margin-bottom: 4px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.map-manager-underlays-label {
|
|
151
|
+
display: block;
|
|
152
|
+
margin-bottom: 4px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.map-manager-no-layers-container {
|
|
156
|
+
display: flex;
|
|
157
|
+
flex-direction: column;
|
|
158
|
+
justify-content: center;
|
|
159
|
+
align-items: center;
|
|
160
|
+
padding: 10px;
|
|
161
|
+
border-color: $uicore-gray-a;
|
|
162
|
+
background-color: $buic-background-1;
|
|
163
|
+
overflow: hidden;
|
|
164
|
+
text-overflow: ellipsis;
|
|
165
|
+
white-space: nowrap;
|
|
166
|
+
text-align: center;
|
|
167
|
+
color: $buic-foreground-muted;
|
|
168
|
+
font-style: italic;
|
|
169
|
+
border-style: dotted;
|
|
170
|
+
border-width: 2px;
|
|
171
|
+
margin: 6px;
|
|
172
|
+
width: auto;
|
|
173
|
+
height: 6.5em; // Avoid container resize when dragging layer the first time.
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.map-manager-no-layers-label {
|
|
177
|
+
margin-bottom: 10px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.map-manager-item-divider {
|
|
181
|
+
width: 100%;
|
|
182
|
+
height: 2px;
|
|
183
|
+
background: $divider-color;
|
|
184
|
+
margin: 1em 0 1em 0;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.map-manager-header {
|
|
188
|
+
display: flex;
|
|
189
|
+
flex-direction: column;
|
|
190
|
+
height: auto;
|
|
191
|
+
width: 100%;
|
|
192
|
+
align-items: center;
|
|
193
|
+
margin-top: 8px;
|
|
194
|
+
|
|
195
|
+
.map-manager-add-source-button {
|
|
196
|
+
margin-left: 4px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.map-manager-select {
|
|
200
|
+
height: 2em;
|
|
201
|
+
flex: auto;
|
|
202
|
+
width: 100%;
|
|
203
|
+
min-width: 100px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.map-manager-add {
|
|
207
|
+
height: 2em;
|
|
208
|
+
flex: initial;
|
|
209
|
+
width: fit-content;
|
|
210
|
+
margin-left: 6px;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.core-split-button-label {
|
|
214
|
+
line-height: inherit;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.core-split-button {
|
|
218
|
+
height: 2em;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.core-split-button>.core-split-button-arrow>.core-split-button-arrow-icon {
|
|
222
|
+
line-height: 16px;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.map-manager-attachments {
|
|
227
|
+
height: auto;
|
|
228
|
+
max-height: 30%;
|
|
229
|
+
|
|
230
|
+
&.is-dragging-map-over {
|
|
231
|
+
background-color: $buic-background-5;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.map-manager-source-header {
|
|
237
|
+
display: flex;
|
|
238
|
+
justify-content: center;
|
|
239
|
+
align-items: center;
|
|
240
|
+
height: 2em;
|
|
241
|
+
width: 100%;
|
|
242
|
+
padding-left: 10px;
|
|
243
|
+
border-width: 0 0 1px 0;
|
|
244
|
+
border-style: solid;
|
|
245
|
+
border-color: $uicore-gray-a;
|
|
246
|
+
|
|
247
|
+
.map-manager-item-label {
|
|
248
|
+
width: 465px;
|
|
249
|
+
min-width: 3em;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.map-manager-item-visibility {
|
|
253
|
+
width: 40px;
|
|
254
|
+
margin-right: 20px;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.map-manager-item-transparency {
|
|
258
|
+
max-width: 160px;
|
|
259
|
+
width: 160px;
|
|
260
|
+
display: flex;
|
|
261
|
+
justify-content: center;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.map-manager-source-item {
|
|
266
|
+
display: flex;
|
|
267
|
+
justify-content: flex-start;
|
|
268
|
+
align-items: center;
|
|
269
|
+
height: 2.5em;
|
|
270
|
+
width: 100%;
|
|
271
|
+
padding-right: 4px;
|
|
272
|
+
border-width: 0 0 1px 0;
|
|
273
|
+
border-style: solid;
|
|
274
|
+
border-color: $uicore-gray-a;
|
|
275
|
+
background-color: $buic-background-1;
|
|
276
|
+
|
|
277
|
+
.map-manager-item-label {
|
|
278
|
+
flex: 1 1;
|
|
279
|
+
text-overflow: ellipsis;
|
|
280
|
+
/* Required for text-overflow to do anything */
|
|
281
|
+
white-space: nowrap;
|
|
282
|
+
overflow: hidden;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.map-manager-item-settings-button {
|
|
286
|
+
background-color: $buic-background-1;
|
|
287
|
+
color: $buic-foreground-body;
|
|
288
|
+
border: none;
|
|
289
|
+
|
|
290
|
+
&:hover {
|
|
291
|
+
color: $hovered-icon-color;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
&:focus {
|
|
295
|
+
box-shadow: $uicore-button-focus-boxshadow;
|
|
296
|
+
outline: none;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.core-context-menu-container {
|
|
300
|
+
.core-context-menu-item {
|
|
301
|
+
>.core-context-menu-icon {
|
|
302
|
+
flex-shrink: 1;
|
|
303
|
+
flex-grow: 0;
|
|
304
|
+
width: 0;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.core-slider.core-slider-minMax {
|
|
308
|
+
min-width: 100px;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.map-manager-item-transparency {
|
|
315
|
+
margin-right: 6px;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
button.map-manager-item-visibility {
|
|
319
|
+
border: none;
|
|
320
|
+
margin: 0 2px;
|
|
321
|
+
background-color: $buic-background-1;
|
|
322
|
+
color: $buic-foreground-body;
|
|
323
|
+
|
|
324
|
+
&:hover {
|
|
325
|
+
color: $hovered-icon-color;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
&:focus {
|
|
329
|
+
outline: none;
|
|
330
|
+
box-shadow: $uicore-button-focus-boxshadow;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
button.map-manager-item-requireAuth {
|
|
335
|
+
background-color: transparent;
|
|
336
|
+
border: none;
|
|
337
|
+
color: $buic-foreground-warning;
|
|
338
|
+
background-color: transparent;
|
|
339
|
+
|
|
340
|
+
&:hover {
|
|
341
|
+
color: $hovered-icon-color;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
&:focus {
|
|
345
|
+
outline: none;
|
|
346
|
+
box-shadow: $uicore-button-focus-boxshadow;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.map-layer-settings {
|
|
352
|
+
border: none;
|
|
353
|
+
background-color: $buic-background-1;
|
|
354
|
+
color: $buic-foreground-body;
|
|
355
|
+
margin-left: 2px;
|
|
356
|
+
|
|
357
|
+
&:hover {
|
|
358
|
+
color: $hovered-icon-color;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
&:focus {
|
|
362
|
+
box-shadow: $uicore-button-focus-boxshadow;
|
|
363
|
+
outline: none;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.map-manager-item-sub-layer-button {
|
|
368
|
+
border: none;
|
|
369
|
+
background-color: $buic-background-1;
|
|
370
|
+
color: $buic-foreground-body;
|
|
371
|
+
|
|
372
|
+
&:hover {
|
|
373
|
+
color: $hovered-icon-color;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
&:focus {
|
|
377
|
+
box-shadow: $uicore-button-focus-boxshadow;
|
|
378
|
+
outline: none;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.map-manager-item-sub-layer-container {
|
|
383
|
+
@include uicore-z-index(dialog-popup);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.map-manager-sublayer-panel {
|
|
387
|
+
width: 400px;
|
|
388
|
+
height: 400px;
|
|
389
|
+
color: $buic-foreground-body;
|
|
390
|
+
font-size: $iui-font-size;
|
|
391
|
+
padding: 4px;
|
|
392
|
+
display: block;
|
|
393
|
+
box-sizing: border-box;
|
|
394
|
+
border-radius: 4px;
|
|
395
|
+
border: 1px solid $buic-background-panel-stroke;
|
|
396
|
+
background: $buic-background-panel;
|
|
397
|
+
color: $buic-text-color;
|
|
398
|
+
cursor: default;
|
|
399
|
+
@include uicore-z-index(dialog-popup);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.map-manager-sublayer-label {
|
|
403
|
+
width: 100%;
|
|
404
|
+
min-width: 100px;
|
|
405
|
+
text-overflow: ellipsis;
|
|
406
|
+
/* Required for text-overflow to do anything */
|
|
407
|
+
white-space: nowrap;
|
|
408
|
+
overflow: hidden;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.map-layer-settings-popup-panel {
|
|
412
|
+
color: $buic-foreground-body;
|
|
413
|
+
font-size: $iui-font-size;
|
|
414
|
+
display: grid;
|
|
415
|
+
grid-row-gap: 4px;
|
|
416
|
+
padding: 4px;
|
|
417
|
+
|
|
418
|
+
&:hover {
|
|
419
|
+
color: $buic-foreground-activehover;
|
|
420
|
+
cursor: auto;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.core-context-menu-item {
|
|
424
|
+
display: flex;
|
|
425
|
+
cursor: default;
|
|
426
|
+
align-items: center;
|
|
427
|
+
position: relative;
|
|
428
|
+
|
|
429
|
+
&:hover {
|
|
430
|
+
background-color: $buic-row-hover;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.map-manager-no-layers-label {
|
|
435
|
+
display: block;
|
|
436
|
+
justify-content: center;
|
|
437
|
+
align-items: center;
|
|
438
|
+
height: 100%;
|
|
439
|
+
width: 100%;
|
|
440
|
+
padding-left: 4px;
|
|
441
|
+
padding-right: 4px;
|
|
442
|
+
border-width: 1px;
|
|
443
|
+
border-style: solid;
|
|
444
|
+
border-color: $uicore-gray-a;
|
|
445
|
+
border-radius: 3px;
|
|
446
|
+
background-color: $buic-background-1;
|
|
447
|
+
overflow: hidden;
|
|
448
|
+
color: $buic-foreground-muted;
|
|
449
|
+
font-style: italic;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.map-manager-not-geo-located-text {
|
|
454
|
+
width: 90%;
|
|
455
|
+
color: $buic-foreground-muted;
|
|
456
|
+
font-style: italic;
|
|
457
|
+
text-align: center;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.map-sources-delete-confirmation {
|
|
461
|
+
@include uicore-z-index(status-popup);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.map-sources-popup-panel {
|
|
465
|
+
padding: 4px;
|
|
466
|
+
width: 400px;
|
|
467
|
+
|
|
468
|
+
* {
|
|
469
|
+
box-sizing: border-box;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.map-manager-source-listbox-header {
|
|
473
|
+
display: flex;
|
|
474
|
+
margin-left: 1px;
|
|
475
|
+
column-gap: 4px;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
ul.core-listbox {
|
|
479
|
+
background-color: $buic-background-1;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.map-manager-sources {
|
|
483
|
+
height: 250px;
|
|
484
|
+
min-height: 60px;
|
|
485
|
+
|
|
486
|
+
.map-source-list-entry {
|
|
487
|
+
button.map-source-list-entry-button {
|
|
488
|
+
padding: 0 4px 0 4px;
|
|
489
|
+
margin: 0;
|
|
490
|
+
background-color: transparent;
|
|
491
|
+
border: none;
|
|
492
|
+
color: $buic-foreground-body;
|
|
493
|
+
|
|
494
|
+
&:hover {
|
|
495
|
+
color: $hovered-icon-color;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
&:focus {
|
|
499
|
+
outline: none;
|
|
500
|
+
box-shadow: $uicore-button-focus-boxshadow;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.map-source-list-entry-name {
|
|
505
|
+
flex: 1 1 auto;
|
|
506
|
+
text-overflow: ellipsis;
|
|
507
|
+
white-space: nowrap;
|
|
508
|
+
overflow: hidden;
|
|
509
|
+
margin-right: 4px;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.map-source-list-entry-attach {
|
|
513
|
+
margin-right: 10px;
|
|
514
|
+
display: none;
|
|
515
|
+
width: auto;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
&[aria-selected="true"] {
|
|
519
|
+
.map-source-list-entry-attach {
|
|
520
|
+
display: inline-block;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ScreenViewport } from "@itwin/core-frontend";
|
|
3
|
+
import "./MapLayerManager.scss";
|
|
4
|
+
import { StyleMapLayerSettings } from "../Interfaces";
|
|
5
|
+
export declare function MapLayerSettingsMenu({ mapLayerSettings, onMenuItemSelection, activeViewport }: {
|
|
6
|
+
mapLayerSettings: StyleMapLayerSettings;
|
|
7
|
+
onMenuItemSelection: (action: string, mapLayerSettings: StyleMapLayerSettings) => void;
|
|
8
|
+
activeViewport: ScreenViewport;
|
|
9
|
+
}): JSX.Element;
|
|
10
|
+
//# sourceMappingURL=MapLayerSettingsMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapLayerSettingsMenu.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsMenu.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAGtD,wBAAgB,oBAAoB,CAAC,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,cAAc,EAAE,EAAE;IAAE,gBAAgB,EAAE,qBAAqB,CAAC;IAAC,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAAC,cAAc,EAAE,cAAc,CAAA;CAAE,eAgFlQ"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 { ContextMenu, ContextMenuItem } from "@itwin/core-react";
|
|
7
|
+
import { Slider } from "@itwin/itwinui-react";
|
|
8
|
+
import { MapLayersUiItemsProvider } from "../MapLayersUiItemsProvider";
|
|
9
|
+
import "./MapLayerManager.scss";
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11
|
+
export function MapLayerSettingsMenu({ mapLayerSettings, onMenuItemSelection, activeViewport }) {
|
|
12
|
+
const [isSettingsOpen, setIsSettingsOpen] = React.useState(false);
|
|
13
|
+
const settingsRef = React.useRef(null);
|
|
14
|
+
const [labelDetach] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:LayerMenu.Detach"));
|
|
15
|
+
const [labelZoomToLayer] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:LayerMenu.ZoomToLayer"));
|
|
16
|
+
const [hasRangeData, setHasRangeData] = React.useState();
|
|
17
|
+
const [transparency, setTransparency] = React.useState(mapLayerSettings.transparency);
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
async function fetchRangeData() {
|
|
20
|
+
let hasRange = false;
|
|
21
|
+
const indexInDisplayStyle = activeViewport === null || activeViewport === void 0 ? void 0 : activeViewport.displayStyle.findMapLayerIndexByNameAndUrl(mapLayerSettings.name, mapLayerSettings.url, mapLayerSettings.isOverlay);
|
|
22
|
+
if (undefined !== indexInDisplayStyle) {
|
|
23
|
+
hasRange = (undefined !== await activeViewport.displayStyle.getMapLayerRange(indexInDisplayStyle, mapLayerSettings.isOverlay));
|
|
24
|
+
}
|
|
25
|
+
setHasRangeData(hasRange);
|
|
26
|
+
}
|
|
27
|
+
fetchRangeData(); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
28
|
+
}, [activeViewport, mapLayerSettings]);
|
|
29
|
+
const onSettingsClick = React.useCallback(() => {
|
|
30
|
+
setIsSettingsOpen((prev) => !prev);
|
|
31
|
+
}, [setIsSettingsOpen]);
|
|
32
|
+
const handleCloseSetting = React.useCallback(() => {
|
|
33
|
+
setIsSettingsOpen(false);
|
|
34
|
+
}, [setIsSettingsOpen]);
|
|
35
|
+
const handleRemoveLayer = React.useCallback(() => {
|
|
36
|
+
setIsSettingsOpen(false);
|
|
37
|
+
onMenuItemSelection("delete", mapLayerSettings);
|
|
38
|
+
}, [setIsSettingsOpen, onMenuItemSelection, mapLayerSettings]);
|
|
39
|
+
const handleZoomToLayer = React.useCallback(() => {
|
|
40
|
+
setIsSettingsOpen(false);
|
|
41
|
+
onMenuItemSelection("zoom-to-layer", mapLayerSettings);
|
|
42
|
+
}, [setIsSettingsOpen, onMenuItemSelection, mapLayerSettings]);
|
|
43
|
+
const applyTransparencyChange = React.useCallback((value) => {
|
|
44
|
+
var _a;
|
|
45
|
+
if (activeViewport) {
|
|
46
|
+
const newTransparency = value;
|
|
47
|
+
const displayStyle = activeViewport.displayStyle;
|
|
48
|
+
const indexInDisplayStyle = displayStyle.findMapLayerIndexByNameAndUrl(mapLayerSettings.name, mapLayerSettings.url, mapLayerSettings.isOverlay);
|
|
49
|
+
if (-1 !== indexInDisplayStyle) {
|
|
50
|
+
const styleTransparency = (_a = displayStyle.mapLayerAtIndex(indexInDisplayStyle, mapLayerSettings.isOverlay)) === null || _a === void 0 ? void 0 : _a.transparency;
|
|
51
|
+
const styleTransparencyValue = styleTransparency ? styleTransparency : 0;
|
|
52
|
+
if (Math.abs(styleTransparencyValue - newTransparency) > 0.01) {
|
|
53
|
+
// update the display style
|
|
54
|
+
displayStyle.changeMapLayerProps({ transparency: newTransparency }, indexInDisplayStyle, mapLayerSettings.isOverlay);
|
|
55
|
+
activeViewport.invalidateRenderPlan();
|
|
56
|
+
// force UI to update
|
|
57
|
+
// loadMapLayerSettingsFromStyle(activeViewport.displayStyle);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, [activeViewport, mapLayerSettings]);
|
|
62
|
+
const handleTransparencyChange = React.useCallback((values) => {
|
|
63
|
+
if (values.length) {
|
|
64
|
+
const newTransparency = values[0] / 100.0;
|
|
65
|
+
if (newTransparency !== transparency) {
|
|
66
|
+
setTransparency(newTransparency);
|
|
67
|
+
applyTransparencyChange(newTransparency);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, [transparency, applyTransparencyChange]);
|
|
71
|
+
return (React.createElement(React.Fragment, null,
|
|
72
|
+
React.createElement("button", { "data-testid": "map-layer-settings", className: "map-layer-settings icon icon-more-vertical-2", ref: settingsRef, onClick: onSettingsClick }),
|
|
73
|
+
React.createElement(ContextMenu, { opened: isSettingsOpen && (undefined !== hasRangeData), onOutsideClick: handleCloseSetting },
|
|
74
|
+
React.createElement(ContextMenuItem, { hideIconContainer: true, key: 0, className: hasRangeData ? "" : "core-context-menu-disabled", onSelect: handleZoomToLayer }, labelZoomToLayer),
|
|
75
|
+
React.createElement(ContextMenuItem, { hideIconContainer: true, key: 1, onSelect: handleRemoveLayer }, labelDetach),
|
|
76
|
+
React.createElement(ContextMenuItem, { hideIconContainer: true, key: 2 },
|
|
77
|
+
React.createElement(Slider, { min: 0, max: 100, values: [transparency * 100], step: 1, onChange: handleTransparencyChange })))));
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=MapLayerSettingsMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapLayerSettingsMenu.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsMenu.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,wBAAwB,CAAC;AAGhC,gEAAgE;AAChE,MAAM,UAAU,oBAAoB,CAAC,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,cAAc,EAAuK;IACjQ,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAoB,IAAI,CAAC,CAAC;IAC1D,MAAM,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,wBAAwB,CAAC,YAAY,CAAC,kBAAkB,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAC7H,MAAM,CAAC,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,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,YAAY,GAAG,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,wBAAwB,GAAI,CACvF,CACN,CACb,CACJ,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*--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport { ScreenViewport } from \"@itwin/core-frontend\";\nimport { ContextMenu, ContextMenuItem } from \"@itwin/core-react\";\nimport { Slider } from \"@itwin/itwinui-react\";\nimport { MapLayersUiItemsProvider } from \"../MapLayersUiItemsProvider\";\nimport \"./MapLayerManager.scss\";\nimport { StyleMapLayerSettings } from \"../Interfaces\";\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function MapLayerSettingsMenu({ mapLayerSettings, onMenuItemSelection, activeViewport }: { mapLayerSettings: StyleMapLayerSettings, onMenuItemSelection: (action: string, mapLayerSettings: StyleMapLayerSettings) => void, activeViewport: ScreenViewport }) {\n const [isSettingsOpen, setIsSettingsOpen] = React.useState(false);\n const settingsRef = React.useRef<HTMLButtonElement>(null);\n const [labelDetach] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:LayerMenu.Detach\"));\n const [labelZoomToLayer] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:LayerMenu.ZoomToLayer\"));\n const [hasRangeData, setHasRangeData] = React.useState<boolean | undefined>();\n const [transparency, setTransparency] = React.useState(mapLayerSettings.transparency);\n\n React.useEffect(() => {\n async function fetchRangeData() {\n let hasRange = false;\n const indexInDisplayStyle = activeViewport?.displayStyle.findMapLayerIndexByNameAndUrl(mapLayerSettings.name, mapLayerSettings.url, mapLayerSettings.isOverlay);\n if (undefined !== indexInDisplayStyle) {\n hasRange = (undefined !== await activeViewport.displayStyle.getMapLayerRange(indexInDisplayStyle, mapLayerSettings.isOverlay));\n }\n setHasRangeData(hasRange);\n }\n fetchRangeData(); // eslint-disable-line @typescript-eslint/no-floating-promises\n }, [activeViewport, mapLayerSettings]);\n\n const onSettingsClick = React.useCallback(() => {\n setIsSettingsOpen((prev) => !prev);\n }, [setIsSettingsOpen]);\n\n const handleCloseSetting = React.useCallback(() => {\n setIsSettingsOpen(false);\n }, [setIsSettingsOpen]);\n\n const handleRemoveLayer = React.useCallback(() => {\n setIsSettingsOpen(false);\n onMenuItemSelection(\"delete\", mapLayerSettings);\n }, [setIsSettingsOpen, onMenuItemSelection, mapLayerSettings]);\n\n const handleZoomToLayer = React.useCallback(() => {\n setIsSettingsOpen(false);\n onMenuItemSelection(\"zoom-to-layer\", mapLayerSettings);\n }, [setIsSettingsOpen, onMenuItemSelection, mapLayerSettings]);\n\n const applyTransparencyChange = React.useCallback((value: number) => {\n if (activeViewport) {\n const newTransparency = value;\n const displayStyle = activeViewport.displayStyle;\n const indexInDisplayStyle = displayStyle.findMapLayerIndexByNameAndUrl(mapLayerSettings.name, mapLayerSettings.url, mapLayerSettings.isOverlay);\n if (-1 !== indexInDisplayStyle) {\n const styleTransparency = displayStyle.mapLayerAtIndex(indexInDisplayStyle, mapLayerSettings.isOverlay)?.transparency;\n const styleTransparencyValue = styleTransparency ? styleTransparency : 0;\n if (Math.abs(styleTransparencyValue - newTransparency) > 0.01) {\n // update the display style\n displayStyle.changeMapLayerProps({ transparency: newTransparency }, indexInDisplayStyle, mapLayerSettings.isOverlay);\n activeViewport.invalidateRenderPlan();\n\n // force UI to update\n // loadMapLayerSettingsFromStyle(activeViewport.displayStyle);\n }\n }\n }\n }, [activeViewport, mapLayerSettings]);\n\n const handleTransparencyChange = React.useCallback((values: readonly number[]) => {\n if (values.length) {\n const newTransparency = values[0] / 100.0;\n if (newTransparency !== transparency) {\n setTransparency(newTransparency);\n applyTransparencyChange(newTransparency);\n }\n }\n }, [transparency, applyTransparencyChange]);\n\n return (\n <>\n <button data-testid=\"map-layer-settings\" className=\"map-layer-settings icon icon-more-vertical-2\" ref={settingsRef} onClick={onSettingsClick} ></button>\n <ContextMenu opened={isSettingsOpen && (undefined !== hasRangeData)} onOutsideClick={handleCloseSetting} >\n <ContextMenuItem hideIconContainer={true} key={0} className={hasRangeData ? \"\" : \"core-context-menu-disabled\"} onSelect={handleZoomToLayer}>{labelZoomToLayer}</ContextMenuItem>\n <ContextMenuItem hideIconContainer={true} key={1} onSelect={handleRemoveLayer}>{labelDetach}</ContextMenuItem>\n <ContextMenuItem hideIconContainer={true} key={2} >\n <Slider min={0} max={100} values={[transparency * 100]} step={1} onChange={handleTransparencyChange} />\n </ContextMenuItem>\n </ContextMenu>\n </>\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapLayerSettingsPopupButton.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsPopupButton.tsx"],"names":[],"mappings":";AAWA,OAAO,oCAAoC,CAAC;AAE5C,aAAa;AAEb,wBAAgB,2BAA2B,gBA+B1C"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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, WebFontIcon } from "@itwin/core-react";
|
|
8
|
+
import { MapLayersUiItemsProvider } from "../MapLayersUiItemsProvider";
|
|
9
|
+
import { MapManagerSettings } from "./MapManagerSettings";
|
|
10
|
+
import "./MapLayerSettingsPopupButton.scss";
|
|
11
|
+
/** @alpha */
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13
|
+
export function MapLayerSettingsPopupButton() {
|
|
14
|
+
const [isSettingsOpen, setIsSettingsOpen] = React.useState(false);
|
|
15
|
+
const [buttonTooltip] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:Widget.SettingsButtonTooltip"));
|
|
16
|
+
const buttonRef = React.useRef(null);
|
|
17
|
+
const togglePopupDisplay = React.useCallback((event) => {
|
|
18
|
+
event.preventDefault();
|
|
19
|
+
setIsSettingsOpen((prev) => !prev);
|
|
20
|
+
}, [setIsSettingsOpen]);
|
|
21
|
+
const handleCloseSetting = React.useCallback(() => {
|
|
22
|
+
setIsSettingsOpen(false);
|
|
23
|
+
}, [setIsSettingsOpen]);
|
|
24
|
+
return (React.createElement(React.Fragment, null,
|
|
25
|
+
React.createElement("button", { title: buttonTooltip, className: "maplayers-settings-popup-button", onClick: togglePopupDisplay, ref: buttonRef },
|
|
26
|
+
React.createElement(WebFontIcon, { iconName: "icon-settings" })),
|
|
27
|
+
React.createElement(Popup, { isOpen: isSettingsOpen, position: RelativePosition.BottomRight, onClose: handleCloseSetting, target: buttonRef.current },
|
|
28
|
+
React.createElement("div", { className: "maplayers-settings-popup-panel" },
|
|
29
|
+
React.createElement(MapManagerSettings, null)))));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=MapLayerSettingsPopupButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapLayerSettingsPopupButton.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapLayerSettingsPopupButton.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,oCAAoC,CAAC;AAE5C,aAAa;AACb,gEAAgE;AAChE,MAAM,UAAU,2BAA2B;IACzC,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,wBAAwB,CAAC,YAAY,CAAC,kBAAkB,CAAC,wCAAwC,CAAC,CAAC,CAAC;IAE3I,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAoB,IAAI,CAAC,CAAC;IACxD,MAAM,kBAAkB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAAsD,EAAE,EAAE;QACtG,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,iBAAiB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExB,MAAM,kBAAkB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAChD,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExB,OAAO,CACL;QACE,gCAAQ,KAAK,EAAE,aAAa,EAAE,SAAS,EAAC,iCAAiC,EAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,EAAE,SAAS;YACnH,oBAAC,WAAW,IAAC,QAAQ,EAAC,eAAe,GAAG,CACjC;QACT,oBAAC,KAAK,IACJ,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,gBAAgB,CAAC,WAAW,EACtC,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,SAAS,CAAC,OAAO;YAEzB,6BAAK,SAAS,EAAC,gCAAgC;gBAC7C,oBAAC,kBAAkB,OAAG,CAClB,CACC,CACP,CACL,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\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\nimport * as React from \"react\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport { Popup, WebFontIcon } from \"@itwin/core-react\";\nimport { MapLayersUiItemsProvider } from \"../MapLayersUiItemsProvider\";\nimport { MapManagerSettings } from \"./MapManagerSettings\";\n\nimport \"./MapLayerSettingsPopupButton.scss\";\n\n/** @alpha */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function MapLayerSettingsPopupButton() {\n const [isSettingsOpen, setIsSettingsOpen] = React.useState(false);\n const [buttonTooltip] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Widget.SettingsButtonTooltip\"));\n\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const togglePopupDisplay = React.useCallback((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n event.preventDefault();\n setIsSettingsOpen((prev) => !prev);\n }, [setIsSettingsOpen]);\n\n const handleCloseSetting = React.useCallback(() => {\n setIsSettingsOpen(false);\n }, [setIsSettingsOpen]);\n\n return (\n <>\n <button title={buttonTooltip} className=\"maplayers-settings-popup-button\" onClick={togglePopupDisplay} ref={buttonRef}>\n <WebFontIcon iconName=\"icon-settings\" />\n </button>\n <Popup\n isOpen={isSettingsOpen}\n position={RelativePosition.BottomRight}\n onClose={handleCloseSetting}\n target={buttonRef.current}\n >\n <div className=\"maplayers-settings-popup-panel\">\n <MapManagerSettings />\n </div>\n </Popup >\n </ >\n );\n}\n"]}
|