@itwin/map-layers 3.0.0-dev.76 → 3.0.0-dev.80
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 +5 -5
- 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 +1 -1
- 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 +3 -3
- 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,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
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { MapSubLayerProps } from "@itwin/core-common";
|
|
2
|
+
import { MapLayerImageryProvider } from "@itwin/core-frontend";
|
|
3
|
+
export interface StyleMapLayerSettings {
|
|
4
|
+
/** Name */
|
|
5
|
+
name: string;
|
|
6
|
+
/** URL */
|
|
7
|
+
url: string;
|
|
8
|
+
/** Controls visibility of layer */
|
|
9
|
+
visible: boolean;
|
|
10
|
+
/** 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. */
|
|
11
|
+
transparency: number;
|
|
12
|
+
/** Transparent background */
|
|
13
|
+
transparentBackground: boolean;
|
|
14
|
+
/** set map as underlay or overlay */
|
|
15
|
+
isOverlay: boolean;
|
|
16
|
+
/** Available map sub-layer */
|
|
17
|
+
subLayers?: MapSubLayerProps[];
|
|
18
|
+
/** sub-layer panel displayed. */
|
|
19
|
+
showSubLayers: boolean;
|
|
20
|
+
/** Some format can publish only a single layer at a time (i.e WMTS) */
|
|
21
|
+
provider?: MapLayerImageryProvider;
|
|
22
|
+
}
|
|
23
|
+
export interface MapTypesOptions {
|
|
24
|
+
readonly supportTileUrl: boolean;
|
|
25
|
+
readonly supportWmsAuthentication: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface MapLayerOptions {
|
|
28
|
+
hideExternalMapLayers?: boolean;
|
|
29
|
+
fetchPublicMapLayerSources?: boolean;
|
|
30
|
+
mapTypeOptions?: MapTypesOptions;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=Interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AbstractWidgetProps, StagePanelLocation, StagePanelSection, UiItemsProvider } from "@itwin/appui-abstract";
|
|
2
|
+
import { Localization } from "@itwin/core-common";
|
|
3
|
+
import { ConfigurableCreateInfo, WidgetControl } from "@itwin/appui-react";
|
|
4
|
+
import { MapLayerOptions } from "./Interfaces";
|
|
5
|
+
export declare class MapLayersUiItemsProvider implements UiItemsProvider {
|
|
6
|
+
readonly id = "MapLayersUiItemsProvider";
|
|
7
|
+
static localization: Localization;
|
|
8
|
+
constructor(localization: Localization);
|
|
9
|
+
provideWidgets(_stageId: string, stageUsage: string, location: StagePanelLocation, section: StagePanelSection | undefined): ReadonlyArray<AbstractWidgetProps>;
|
|
10
|
+
}
|
|
11
|
+
/** MapLayersWidgetControl provides a widget to attach and remove maps layers from the active view's display style.
|
|
12
|
+
* ``` tsx
|
|
13
|
+
* <Widget id={MapLayersWidgetControl.id} label={MapLayersWidgetControl.label} control={MapLayersWidgetControl}
|
|
14
|
+
* iconSpec={MapLayersWidgetControl.iconSpec} />,
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare class MapLayersWidgetControl extends WidgetControl {
|
|
18
|
+
static id: string;
|
|
19
|
+
static iconSpec: string;
|
|
20
|
+
static get label(): string;
|
|
21
|
+
constructor(info: ConfigurableCreateInfo, mapLayerOptions: MapLayerOptions | undefined);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=MapLayersUiItemsProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { StagePanelLocation, StagePanelSection, StageUsage } from "@itwin/appui-abstract";
|
|
7
|
+
import { MapLayersWidget } from "./widget/MapLayersWidget";
|
|
8
|
+
import { WidgetControl } from "@itwin/appui-react";
|
|
9
|
+
import { IModelApp } from "@itwin/core-frontend";
|
|
10
|
+
export class MapLayersUiItemsProvider {
|
|
11
|
+
constructor(localization) {
|
|
12
|
+
this.id = "MapLayersUiItemsProvider";
|
|
13
|
+
MapLayersUiItemsProvider.localization = localization;
|
|
14
|
+
}
|
|
15
|
+
provideWidgets(_stageId, stageUsage, location, section) {
|
|
16
|
+
const widgets = [];
|
|
17
|
+
const mapLayerOptions = {
|
|
18
|
+
hideExternalMapLayers: false,
|
|
19
|
+
mapTypeOptions: { supportTileUrl: false, supportWmsAuthentication: true },
|
|
20
|
+
fetchPublicMapLayerSources: false,
|
|
21
|
+
};
|
|
22
|
+
if (stageUsage === StageUsage.General && location === StagePanelLocation.Right && section === StagePanelSection.Start) {
|
|
23
|
+
widgets.push({
|
|
24
|
+
id: "map-layers:mapLayersWidget",
|
|
25
|
+
label: MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:Widget.Label"),
|
|
26
|
+
icon: "icon-map",
|
|
27
|
+
getWidgetContent: () => React.createElement(MapLayersWidget, { mapLayerOptions: mapLayerOptions }), // eslint-disable-line react/display-name
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return widgets;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** MapLayersWidgetControl provides a widget to attach and remove maps layers from the active view's display style.
|
|
34
|
+
* ``` tsx
|
|
35
|
+
* <Widget id={MapLayersWidgetControl.id} label={MapLayersWidgetControl.label} control={MapLayersWidgetControl}
|
|
36
|
+
* iconSpec={MapLayersWidgetControl.iconSpec} />,
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export class MapLayersWidgetControl extends WidgetControl {
|
|
40
|
+
constructor(info, mapLayerOptions) {
|
|
41
|
+
super(info, mapLayerOptions);
|
|
42
|
+
this.reactNode = React.createElement(MapLayersWidget, { mapLayerOptions: mapLayerOptions });
|
|
43
|
+
}
|
|
44
|
+
static get label() {
|
|
45
|
+
return IModelApp.localization.getLocalizedString("mapLayers:Widget.Label");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
MapLayersWidgetControl.id = "MapLayersWidget";
|
|
49
|
+
MapLayersWidgetControl.iconSpec = "icon-map";
|
|
50
|
+
//# sourceMappingURL=MapLayersUiItemsProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapLayersUiItemsProvider.js","sourceRoot":"","sources":["../../../src/ui/MapLayersUiItemsProvider.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAuB,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAmB,MAAM,uBAAuB,CAAC;AAEhI,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAA0B,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,MAAM,OAAO,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,UAAU,CAAC,OAAO,IAAI,QAAQ,KAAK,kBAAkB,CAAC,KAAK,IAAI,OAAO,KAAK,iBAAiB,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,eAAe,IAAC,eAAe,EAAE,eAAe,GAAI,EAAE,yCAAyC;aACzH,CAAC,CAAC;SACJ;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,sBAAuB,SAAQ,aAAa;IAQvD,YAAY,IAA4B,EAAE,eAA4C;QACpF,KAAK,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAE7B,IAAI,CAAC,SAAS,GAAG,oBAAC,eAAe,IAAC,eAAe,EAAE,eAAe,GAAI,CAAC;IACzE,CAAC;IARM,MAAM,KAAK,KAAK;QACrB,OAAO,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,CAAC;IAC7E,CAAC;;AALa,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"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare enum AttachLayerButtonType {
|
|
4
|
+
Primary = 0,
|
|
5
|
+
Blue = 1,
|
|
6
|
+
Icon = 2
|
|
7
|
+
}
|
|
8
|
+
export interface AttachLayerPopupButtonProps {
|
|
9
|
+
isOverlay: boolean;
|
|
10
|
+
buttonType?: AttachLayerButtonType;
|
|
11
|
+
}
|
|
12
|
+
/** @internal */
|
|
13
|
+
export declare function AttachLayerPopupButton(props: AttachLayerPopupButtonProps): JSX.Element;
|
|
14
|
+
//# sourceMappingURL=AttachLayerPopupButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,308 @@
|
|
|
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 { IModelApp, MapLayerSettingsService, MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority } from "@itwin/core-frontend";
|
|
7
|
+
import { RelativePosition } from "@itwin/appui-abstract";
|
|
8
|
+
import * as UiCore from "@itwin/core-react";
|
|
9
|
+
import { ModalDialogManager } from "@itwin/appui-react";
|
|
10
|
+
import { useSourceMapContext } from "./MapLayerManager";
|
|
11
|
+
import { MapUrlDialog } from "./MapUrlDialog";
|
|
12
|
+
import { MapLayersUiItemsProvider } from "../MapLayersUiItemsProvider";
|
|
13
|
+
import { ConfirmMessageDialog } from "./ConfirmMessageDialog";
|
|
14
|
+
import { Button, Input } from "@itwin/itwinui-react";
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
16
|
+
function AttachLayerPanel({ isOverlay, onLayerAttached }) {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const [layerNameToAdd, setLayerNameToAdd] = React.useState();
|
|
19
|
+
const [sourceFilterString, setSourceFilterString] = React.useState();
|
|
20
|
+
const [placeholderLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.SearchPlaceholder"));
|
|
21
|
+
const [addCustomLayerLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.Custom"));
|
|
22
|
+
const [addCustomLayerToolTip] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.AttachCustomLayer"));
|
|
23
|
+
const [loadingMapSources] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.LoadingMapSources"));
|
|
24
|
+
const [removeLayerDefButtonTitle] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.RemoveLayerDefButtonTitle"));
|
|
25
|
+
const [editLayerDefButtonTitle] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.EditLayerDefButtonTitle"));
|
|
26
|
+
const [removeLayerDefDialogTitle] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.RemoveLayerDefDialogTitle"));
|
|
27
|
+
const [loading, setLoading] = React.useState(false);
|
|
28
|
+
const [layerNameUnderCursor, setLayerNameUnderCursor] = React.useState();
|
|
29
|
+
// 'isMounted' is used to prevent any async operation once the hook has been
|
|
30
|
+
// unloaded. Otherwise we get a 'Can't perform a React state update on an unmounted component.' warning in the console.
|
|
31
|
+
const isMounted = React.useRef(false);
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
isMounted.current = true;
|
|
34
|
+
return () => {
|
|
35
|
+
isMounted.current = false;
|
|
36
|
+
// We close any open dialogs that we might have opened
|
|
37
|
+
// This was added because the modal dialog remained remained displayed after the session expired.
|
|
38
|
+
ModalDialogManager.closeDialog();
|
|
39
|
+
};
|
|
40
|
+
}, []);
|
|
41
|
+
const handleFilterTextChanged = React.useCallback((event) => {
|
|
42
|
+
setSourceFilterString(event.target.value);
|
|
43
|
+
}, []);
|
|
44
|
+
const { loadingSources, sources, activeViewport, backgroundLayers, overlayLayers, mapTypesOptions } = useSourceMapContext();
|
|
45
|
+
const iTwinId = (_a = activeViewport === null || activeViewport === void 0 ? void 0 : activeViewport.iModel) === null || _a === void 0 ? void 0 : _a.iTwinId;
|
|
46
|
+
const iModelId = (_b = activeViewport === null || activeViewport === void 0 ? void 0 : activeViewport.iModel) === null || _b === void 0 ? void 0 : _b.iModelId;
|
|
47
|
+
const styleContainsLayer = React.useCallback((name) => {
|
|
48
|
+
if (backgroundLayers) {
|
|
49
|
+
if (-1 !== backgroundLayers.findIndex((layer) => layer.name === name))
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
if (overlayLayers) {
|
|
53
|
+
if (-1 !== overlayLayers.findIndex((layer) => layer.name === name))
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
}, [backgroundLayers, overlayLayers]);
|
|
58
|
+
const handleModalUrlDialogOk = React.useCallback(() => {
|
|
59
|
+
// close popup and refresh UI
|
|
60
|
+
onLayerAttached();
|
|
61
|
+
}, [onLayerAttached]);
|
|
62
|
+
const handleModalUrlDialogCancel = React.useCallback(() => {
|
|
63
|
+
// close popup and refresh UI
|
|
64
|
+
setLoading(false);
|
|
65
|
+
ModalDialogManager.closeDialog();
|
|
66
|
+
}, []);
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
async function attemptToAddLayer(layerName) {
|
|
69
|
+
if (layerName && activeViewport) {
|
|
70
|
+
// if the layer is not in the style add it now.
|
|
71
|
+
if (undefined === (backgroundLayers === null || backgroundLayers === void 0 ? void 0 : backgroundLayers.find((layer) => layerName === layer.name)) && undefined === (overlayLayers === null || overlayLayers === void 0 ? void 0 : overlayLayers.find((layer) => layerName === layer.name))) {
|
|
72
|
+
const mapLayerSettings = sources === null || sources === void 0 ? void 0 : sources.find((source) => source.name === layerName);
|
|
73
|
+
if (mapLayerSettings === undefined) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
if (isMounted.current) {
|
|
78
|
+
setLoading(true);
|
|
79
|
+
}
|
|
80
|
+
const { status, subLayers } = await mapLayerSettings.validateSource();
|
|
81
|
+
if (status === MapLayerSourceStatus.Valid || status === MapLayerSourceStatus.RequireAuth) {
|
|
82
|
+
if (status === MapLayerSourceStatus.Valid) {
|
|
83
|
+
const layerSettings = mapLayerSettings.toLayerSettings(subLayers);
|
|
84
|
+
if (layerSettings) {
|
|
85
|
+
activeViewport.displayStyle.attachMapLayerSettings(layerSettings, isOverlay);
|
|
86
|
+
activeViewport.invalidateRenderPlan();
|
|
87
|
+
const msg = IModelApp.localization.getLocalizedString("mapLayers:Messages.MapLayerAttached", { sourceName: layerSettings.name, sourceUrl: layerSettings.url });
|
|
88
|
+
IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));
|
|
89
|
+
}
|
|
90
|
+
if (isMounted.current) {
|
|
91
|
+
setLoading(false);
|
|
92
|
+
}
|
|
93
|
+
if (onLayerAttached) {
|
|
94
|
+
onLayerAttached();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else if (status === MapLayerSourceStatus.RequireAuth && isMounted.current) {
|
|
98
|
+
ModalDialogManager.openDialog(React.createElement(MapUrlDialog, { activeViewport: activeViewport, isOverlay: isOverlay, layerRequiringCredentials: mapLayerSettings.toJSON(), onOkResult: handleModalUrlDialogOk, onCancelResult: handleModalUrlDialogCancel, mapTypesOptions: mapTypesOptions }));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
const msg = IModelApp.localization.getLocalizedString("mapLayers:Messages.MapLayerValidationFailed", { sourceUrl: mapLayerSettings.url });
|
|
103
|
+
IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));
|
|
104
|
+
if (isMounted.current) {
|
|
105
|
+
setLoading(false);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
if (isMounted.current) {
|
|
111
|
+
setLoading(false);
|
|
112
|
+
}
|
|
113
|
+
const msg = IModelApp.localization.getLocalizedString("mapLayers:Messages.MapLayerAttachError", { error: err, sourceUrl: mapLayerSettings.url });
|
|
114
|
+
IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (layerNameToAdd) {
|
|
121
|
+
attemptToAddLayer(layerNameToAdd); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
122
|
+
if (isMounted.current) {
|
|
123
|
+
setLayerNameToAdd(undefined);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}, [setLayerNameToAdd, layerNameToAdd, activeViewport, sources, backgroundLayers, isOverlay, overlayLayers, onLayerAttached, handleModalUrlDialogOk, mapTypesOptions, handleModalUrlDialogCancel]);
|
|
127
|
+
const options = React.useMemo(() => sources === null || sources === void 0 ? void 0 : sources.filter((source) => !styleContainsLayer(source.name)), [sources, styleContainsLayer]);
|
|
128
|
+
const filteredOptions = React.useMemo(() => {
|
|
129
|
+
if (undefined === sourceFilterString || 0 === sourceFilterString.length) {
|
|
130
|
+
return options;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
return options === null || options === void 0 ? void 0 : options.filter((option) => option.name.toLowerCase().includes(sourceFilterString === null || sourceFilterString === void 0 ? void 0 : sourceFilterString.toLowerCase()));
|
|
134
|
+
}
|
|
135
|
+
}, [options, sourceFilterString]);
|
|
136
|
+
const handleAddNewMapSource = React.useCallback(() => {
|
|
137
|
+
ModalDialogManager.openDialog(React.createElement(MapUrlDialog, { activeViewport: activeViewport, isOverlay: isOverlay, onOkResult: handleModalUrlDialogOk, mapTypesOptions: mapTypesOptions }));
|
|
138
|
+
return;
|
|
139
|
+
}, [activeViewport, handleModalUrlDialogOk, isOverlay, mapTypesOptions]);
|
|
140
|
+
const handleAttach = React.useCallback((mapName) => {
|
|
141
|
+
setLayerNameToAdd(mapName);
|
|
142
|
+
}, []);
|
|
143
|
+
const handleKeypressOnSourceList = React.useCallback((event) => {
|
|
144
|
+
var _a, _b;
|
|
145
|
+
const key = event.key;
|
|
146
|
+
if (key === "Enter") {
|
|
147
|
+
event.preventDefault();
|
|
148
|
+
const mapName = (_b = (_a = event.currentTarget) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.value;
|
|
149
|
+
if (mapName && mapName.length) {
|
|
150
|
+
handleAttach(mapName);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}, [handleAttach]);
|
|
154
|
+
const onListboxValueChange = React.useCallback((mapName) => {
|
|
155
|
+
setLayerNameToAdd(mapName);
|
|
156
|
+
}, []);
|
|
157
|
+
const handleNoConfirmation = React.useCallback((_layerName) => {
|
|
158
|
+
ModalDialogManager.closeDialog();
|
|
159
|
+
}, []);
|
|
160
|
+
const handleYesConfirmation = React.useCallback(async (source) => {
|
|
161
|
+
const layerName = source.name;
|
|
162
|
+
if (!!iTwinId && !!iModelId) {
|
|
163
|
+
if (await MapLayerSettingsService.deleteSharedSettings(source, iTwinId, iModelId)) {
|
|
164
|
+
const msg = MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.RemoveLayerDefSuccess", { layerName });
|
|
165
|
+
IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
const msg = MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.RemoveLayerDefError", { layerName });
|
|
169
|
+
IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
ModalDialogManager.closeDialog();
|
|
173
|
+
}, [iTwinId, iModelId]);
|
|
174
|
+
/*
|
|
175
|
+
Handle Remove layer button clicked
|
|
176
|
+
*/
|
|
177
|
+
const onItemRemoveButtonClicked = React.useCallback((source, event) => {
|
|
178
|
+
event.stopPropagation(); // We don't want the owning ListBox to react on mouse click.
|
|
179
|
+
const layerName = source.name;
|
|
180
|
+
const msg = MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.RemoveLayerDefDialogMessage", { layerName });
|
|
181
|
+
ModalDialogManager.openDialog(React.createElement(ConfirmMessageDialog, { className: "map-sources-delete-confirmation", title: removeLayerDefDialogTitle, message: msg, maxWidth: 400, onClose: () => handleNoConfirmation(layerName), onEscape: () => handleNoConfirmation(layerName), onYesResult: async () => handleYesConfirmation(source), onNoResult: () => handleNoConfirmation(layerName) }));
|
|
182
|
+
}, [handleNoConfirmation, handleYesConfirmation, removeLayerDefDialogTitle]);
|
|
183
|
+
/*
|
|
184
|
+
Handle Edit layer button clicked
|
|
185
|
+
*/
|
|
186
|
+
const onItemEditButtonClicked = React.useCallback((event) => {
|
|
187
|
+
var _a, _b, _c;
|
|
188
|
+
event.stopPropagation(); // We don't want the owning ListBox to react on mouse click.
|
|
189
|
+
const targetLayerName = (_c = (_b = (_a = event === null || event === void 0 ? void 0 : event.currentTarget) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.dataset) === null || _c === void 0 ? void 0 : _c.value;
|
|
190
|
+
const matchingSource = sources.find((layerSource) => layerSource.name === targetLayerName);
|
|
191
|
+
// we expect a single layer source matching this name
|
|
192
|
+
if (matchingSource === undefined) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
ModalDialogManager.openDialog(React.createElement(MapUrlDialog, { activeViewport: activeViewport, isOverlay: isOverlay, mapLayerSourceToEdit: matchingSource, onOkResult: handleModalUrlDialogOk, mapTypesOptions: mapTypesOptions }));
|
|
196
|
+
}, [activeViewport, handleModalUrlDialogOk, isOverlay, mapTypesOptions, sources]);
|
|
197
|
+
return (React.createElement("div", { className: "map-manager-header" },
|
|
198
|
+
(loading || loadingSources) && React.createElement(UiCore.LoadingSpinner, { message: loadingMapSources }),
|
|
199
|
+
React.createElement("div", { className: "map-manager-source-listbox-header" },
|
|
200
|
+
React.createElement(Input, { type: "text", className: "map-manager-source-list-filter", placeholder: placeholderLabel, value: sourceFilterString, onChange: handleFilterTextChanged }),
|
|
201
|
+
React.createElement(Button, { className: "map-manager-add-source-button", title: addCustomLayerToolTip, onClick: handleAddNewMapSource }, addCustomLayerLabel)),
|
|
202
|
+
React.createElement("div", { className: "map-manager-sources" },
|
|
203
|
+
React.createElement(UiCore.Listbox, { id: "map-sources", selectedValue: layerNameToAdd, className: "map-manager-source-list", onKeyPress: handleKeypressOnSourceList, onListboxValueChange: onListboxValueChange }, filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.map((source) => React.createElement(UiCore.ListboxItem, { key: source.name, className: "map-source-list-entry", value: source.name, onMouseEnter: () => setLayerNameUnderCursor(source.name), onMouseLeave: () => setLayerNameUnderCursor(undefined) },
|
|
204
|
+
React.createElement("span", { className: "map-source-list-entry-name", title: source.name }, source.name),
|
|
205
|
+
// otherwise list feels cluttered.
|
|
206
|
+
(!!iTwinId && !!iModelId && layerNameUnderCursor && layerNameUnderCursor === source.name) &&
|
|
207
|
+
React.createElement(React.Fragment, null,
|
|
208
|
+
React.createElement(Button, { className: "map-source-list-entry-button", title: editLayerDefButtonTitle, onClick: onItemEditButtonClicked },
|
|
209
|
+
React.createElement(UiCore.Icon, { iconSpec: "icon-edit" })),
|
|
210
|
+
React.createElement(Button, { className: "map-source-list-entry-button", title: removeLayerDefButtonTitle, onClick: (event) => { onItemRemoveButtonClicked(source, event); } },
|
|
211
|
+
React.createElement(UiCore.Icon, { iconSpec: "icon-delete" })))))))));
|
|
212
|
+
}
|
|
213
|
+
/** @internal */
|
|
214
|
+
export var AttachLayerButtonType;
|
|
215
|
+
(function (AttachLayerButtonType) {
|
|
216
|
+
AttachLayerButtonType[AttachLayerButtonType["Primary"] = 0] = "Primary";
|
|
217
|
+
AttachLayerButtonType[AttachLayerButtonType["Blue"] = 1] = "Blue";
|
|
218
|
+
AttachLayerButtonType[AttachLayerButtonType["Icon"] = 2] = "Icon";
|
|
219
|
+
})(AttachLayerButtonType || (AttachLayerButtonType = {}));
|
|
220
|
+
/** @internal */
|
|
221
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
222
|
+
export function AttachLayerPopupButton(props) {
|
|
223
|
+
const [showAttachLayerLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:AttachLayerPopup.Attach"));
|
|
224
|
+
const [hideAttachLayerLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:AttachLayerPopup.Close"));
|
|
225
|
+
const [addCustomLayerButtonLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString("mapLayers:CustomAttach.AddCustomLayerButtonLabel"));
|
|
226
|
+
const [popupOpen, setPopupOpen] = React.useState(false);
|
|
227
|
+
const buttonRef = React.useRef(null);
|
|
228
|
+
const panelRef = React.useRef(null);
|
|
229
|
+
// 'isMounted' is used to prevent any async operation once the hook has been
|
|
230
|
+
// unloaded. Otherwise we get a 'Can't perform a React state update on an unmounted component.' warning in the console.
|
|
231
|
+
const isMounted = React.useRef(false);
|
|
232
|
+
React.useEffect(() => {
|
|
233
|
+
isMounted.current = true;
|
|
234
|
+
return () => {
|
|
235
|
+
isMounted.current = false;
|
|
236
|
+
};
|
|
237
|
+
}, []);
|
|
238
|
+
const togglePopup = React.useCallback(() => {
|
|
239
|
+
setPopupOpen(!popupOpen);
|
|
240
|
+
}, [popupOpen]);
|
|
241
|
+
const handleClosePopup = React.useCallback(() => {
|
|
242
|
+
setPopupOpen(false);
|
|
243
|
+
}, []);
|
|
244
|
+
const isInsideCoreDialog = React.useCallback((element) => {
|
|
245
|
+
if (element.nodeName === "DIV") {
|
|
246
|
+
if (element.classList && element.classList.contains("core-dialog"))
|
|
247
|
+
return true;
|
|
248
|
+
if (element.parentElement && isInsideCoreDialog(element.parentElement))
|
|
249
|
+
return true;
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
// istanbul ignore else
|
|
253
|
+
if (element.parentElement && isInsideCoreDialog(element.parentElement))
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
return false;
|
|
257
|
+
}, []);
|
|
258
|
+
const handleOutsideClick = React.useCallback((event) => {
|
|
259
|
+
if (isInsideCoreDialog(event.target)) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
// If clicking on button that open panel - don't trigger outside click processing
|
|
263
|
+
if ((buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) && (buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current.contains(event.target))) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
// If clicking the panel, this is not an outside clicked
|
|
267
|
+
if (panelRef.current && (panelRef === null || panelRef === void 0 ? void 0 : panelRef.current.contains(event.target))) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
// If we reach this point, we got an outside clicked, no close the popup
|
|
271
|
+
setPopupOpen(false);
|
|
272
|
+
}, [isInsideCoreDialog]);
|
|
273
|
+
const { refreshFromStyle } = useSourceMapContext();
|
|
274
|
+
const handleLayerAttached = React.useCallback(() => {
|
|
275
|
+
if (!isMounted.current) {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
setPopupOpen(false);
|
|
279
|
+
refreshFromStyle();
|
|
280
|
+
}, [refreshFromStyle]);
|
|
281
|
+
function renderButton() {
|
|
282
|
+
let button;
|
|
283
|
+
if (props.buttonType === undefined || props.buttonType === AttachLayerButtonType.Icon) {
|
|
284
|
+
button = (React.createElement("button", { ref: buttonRef, className: "map-manager-attach-layer-button", title: popupOpen ? hideAttachLayerLabel : showAttachLayerLabel, onClick: togglePopup },
|
|
285
|
+
React.createElement(UiCore.WebFontIcon, { iconName: "icon-add" })));
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
const determineStyleType = () => {
|
|
289
|
+
switch (props.buttonType) {
|
|
290
|
+
case AttachLayerButtonType.Blue:
|
|
291
|
+
return "high-visibility";
|
|
292
|
+
case AttachLayerButtonType.Primary:
|
|
293
|
+
default:
|
|
294
|
+
return "cta";
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
const styleType = determineStyleType();
|
|
298
|
+
button = (React.createElement(Button, { ref: buttonRef, styleType: styleType, title: popupOpen ? hideAttachLayerLabel : showAttachLayerLabel, onClick: togglePopup }, addCustomLayerButtonLabel));
|
|
299
|
+
}
|
|
300
|
+
return button;
|
|
301
|
+
}
|
|
302
|
+
return (React.createElement(React.Fragment, null,
|
|
303
|
+
renderButton(),
|
|
304
|
+
React.createElement(UiCore.Popup, { isOpen: popupOpen, position: RelativePosition.BottomRight, onClose: handleClosePopup, onOutsideClick: handleOutsideClick, target: buttonRef.current, closeOnEnter: false },
|
|
305
|
+
React.createElement("div", { ref: panelRef, className: "map-sources-popup-panel" },
|
|
306
|
+
React.createElement(AttachLayerPanel, { isOverlay: props.isOverlay, onLayerAttached: handleLayerAttached })))));
|
|
307
|
+
}
|
|
308
|
+
//# sourceMappingURL=AttachLayerPopupButton.js.map
|