@itwin/map-layers 5.5.0 → 5.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -2
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts +0 -2
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -1
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.js +0 -2
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.scss +2 -1
- package/lib/cjs/ui/widget/SelectMapFormat.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SelectMapFormat.js +2 -4
- package/lib/cjs/ui/widget/SelectMapFormat.js.map +1 -1
- package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts +0 -2
- package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -1
- package/lib/esm/ui/FeatureInfoUiItemsProvider.js +1 -3
- package/lib/esm/ui/FeatureInfoUiItemsProvider.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.scss +2 -1
- package/lib/esm/ui/widget/SelectMapFormat.d.ts.map +1 -1
- package/lib/esm/ui/widget/SelectMapFormat.js +3 -5
- package/lib/esm/ui/widget/SelectMapFormat.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
# Change Log - @itwin/map-layers
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 22 Oct 2024 14:41:41 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 5.6.1
|
|
8
|
+
|
|
9
|
+
Tue, 22 Oct 2024 14:41:41 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Fix z-index of map layers settings popup ([#1070](https://github.com/iTwin/viewer-components-react/pull/1070))
|
|
14
|
+
|
|
15
|
+
## 5.6.0
|
|
16
|
+
|
|
17
|
+
Fri, 13 Sep 2024 17:50:16 GMT
|
|
18
|
+
|
|
19
|
+
### Minor changes
|
|
20
|
+
|
|
21
|
+
- Remove map layers feature info tech preview badges ([#1043](https://github.com/iTwin/viewer-components-react/pull/1043))
|
|
22
|
+
|
|
7
23
|
## 5.5.0
|
|
8
24
|
|
|
9
|
-
Wed, 11 Sep 2024 19:11:
|
|
25
|
+
Wed, 11 Sep 2024 19:11:54 GMT
|
|
10
26
|
|
|
11
27
|
### Minor changes
|
|
12
28
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BadgeType } from "@itwin/appui-abstract";
|
|
3
2
|
import type { ToolbarItem, UiItemsProvider } from "@itwin/appui-react";
|
|
4
3
|
import { StagePanelLocation, StagePanelSection, ToolbarOrientation, ToolbarUsage, ToolItemDef, WidgetState } from "@itwin/appui-react";
|
|
5
4
|
import type { MapFeatureInfoOptions } from "./Interfaces";
|
|
@@ -16,7 +15,6 @@ export declare class FeatureInfoUiItemsProvider implements UiItemsProvider {
|
|
|
16
15
|
icon: JSX.Element;
|
|
17
16
|
content: JSX.Element;
|
|
18
17
|
defaultState: WidgetState;
|
|
19
|
-
badge: BadgeType;
|
|
20
18
|
}[];
|
|
21
19
|
}
|
|
22
20
|
//# sourceMappingURL=FeatureInfoUiItemsProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureInfoUiItemsProvider.d.ts","sourceRoot":"","sources":["../../../src/ui/FeatureInfoUiItemsProvider.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FeatureInfoUiItemsProvider.d.ts","sourceRoot":"","sources":["../../../src/ui/FeatureInfoUiItemsProvider.tsx"],"names":[],"mappings":";AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EAGjB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAS5B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AA+B1D,eAAO,MAAM,4BAA4B,QAAO,WAa5C,CAAC;AAEL,qBAAa,0BAA2B,YAAW,eAAe;IAK7C,OAAO,CAAC,gBAAgB;IAH3C,SAAgB,EAAE,gCAAgC;IAClD,gBAAuB,QAAQ,qCAAqC;gBAEzC,gBAAgB,EAAE,qBAAqB;IAE3D,mBAAmB,CACxB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,GACrC,aAAa,CAAC,WAAW,CAAC;IAatB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,iBAAiB;;;;;;;CAgBtH"}
|
|
@@ -48,7 +48,6 @@ const getMapFeatureInfoToolItemDef = () => new appui_react_1.ToolItemDef({
|
|
|
48
48
|
execute: async () => {
|
|
49
49
|
await core_frontend_1.IModelApp.tools.run(map_layers_formats_1.MapFeatureInfoTool.toolId);
|
|
50
50
|
},
|
|
51
|
-
badgeType: appui_abstract_1.BadgeType.TechnicalPreview,
|
|
52
51
|
isHidden: new appui_abstract_1.ConditionalBooleanValue(() => {
|
|
53
52
|
// Hide the MapFeatureInfoTool if the Map Layers toggle is off or no ArcGISFeature layers are active
|
|
54
53
|
return !isMapFeatureInfoSupported();
|
|
@@ -80,7 +79,6 @@ class FeatureInfoUiItemsProvider {
|
|
|
80
79
|
icon: (0, jsx_runtime_1.jsx)(itwinui_icons_react_1.SvgMapInfo, {}),
|
|
81
80
|
content: (0, jsx_runtime_1.jsx)(FeatureInfoWidget_1.MapFeatureInfoWidget, { featureInfoOpts: this._featureInfoOpts }),
|
|
82
81
|
defaultState: appui_react_1.WidgetState.Hidden,
|
|
83
|
-
badge: appui_abstract_1.BadgeType.TechnicalPreview,
|
|
84
82
|
});
|
|
85
83
|
}
|
|
86
84
|
return widgets;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureInfoUiItemsProvider.js","sourceRoot":"","sources":["../../../src/ui/FeatureInfoUiItemsProvider.tsx"],"names":[],"mappings":";;;;AAAA;;;gGAGgG;AAEhG,
|
|
1
|
+
{"version":3,"file":"FeatureInfoUiItemsProvider.js","sourceRoot":"","sources":["../../../src/ui/FeatureInfoUiItemsProvider.tsx"],"names":[],"mappings":";;;;AAAA;;;gGAGgG;AAEhG,0DAAgE;AAEhE,oDAS4B;AAC5B,wDAAiD;AAGjD,oEAAwD;AACxD,kEAA+D;AAE/D,4CAA2C;AAC3C,kEAAkE;AAElE,8DAA+D;AAE/D,MAAM,sBAAsB,GAAG,CAAC,EAAkB,EAAE,SAAkB,EAAE,aAA8B,EAAW,EAAE;IACjH,KAAK,IAAI,aAAa,GAAG,CAAC,EAAE,aAAa,GAAG,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE;QACjF,IAAI,aAAa,CAAC,aAAa,CAAC,CAAC,OAAO,IAAI,aAAa,CAAC,aAAa,CAAC,CAAC,YAAY,KAAK,GAAG,EAAE;YAC7F,MAAM,aAAa,GAAG,EAAE,CAAC,0BAA0B,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAC;YACzF,8CAA8C;YAC9C,IAAI,aAAa,EAAE,sBAAsB,EAAE;gBACzC,OAAO,IAAI,CAAC;aACb;SACF;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,GAAY,EAAE;IAC9C,MAAM,EAAE,GAAG,yBAAS,CAAC,WAAW,CAAC,YAAY,CAAC;IAC9C,IAAI,EAAE,EAAE,SAAS,CAAC,aAAa,EAAE;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AAvC,qBAAgB,GAAhB,gBAAgB,CAAuB;QAJlE,8CAA8C;QAC9B,OAAE,GAAG,4BAA4B,CAAC;IAGmB,CAAC;IAE/D,mBAAmB,CACxB,QAAgB,EAChB,UAAkB,EAClB,YAA0B,EAC1B,kBAAsC;QAEtC,IACE,CAAC,IAAI,CAAC,gBAAgB,EAAE,6BAA6B;YACrD,UAAU,KAAK,wBAAU,CAAC,OAAO;YACjC,YAAY,KAAK,0BAAY,CAAC,mBAAmB;YACjD,kBAAkB,KAAK,gCAAkB,CAAC,QAAQ,EAClD;YACA,OAAO,CAAC,2BAAa,CAAC,4BAA4B,CAAC,EAAE,EAAE,IAAA,oCAA4B,GAAE,CAAC,CAAC,CAAC;SACzF;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,cAAc,CAAC,QAAgB,EAAE,UAAkB,EAAE,QAA4B,EAAE,OAA2B;QACnH,MAAM,OAAO,GAAG,EAAE,CAAC;QAEnB,MAAM,UAAU,GAAG,OAAO,IAAI,+BAAiB,CAAC,GAAG,CAAC;QACpD,IAAI,UAAU,KAAK,+BAAiB,CAAC,GAAG,IAAI,UAAU,KAAK,wBAAU,CAAC,OAAO,IAAI,QAAQ,KAAK,gCAAkB,CAAC,KAAK,EAAE;YACtH,OAAO,CAAC,IAAI,CAAC;gBACX,EAAE,EAAE,0BAA0B,CAAC,QAAQ;gBACvC,KAAK,EAAE,uBAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,mCAAmC,CAAC;gBACvF,IAAI,EAAE,uBAAC,gCAAU,KAAG;gBACpB,OAAO,EAAE,uBAAC,wCAAoB,IAAC,eAAe,EAAE,IAAI,CAAC,gBAAgB,GAAI;gBACzE,YAAY,EAAE,yBAAW,CAAC,MAAM;aACjC,CAAC,CAAC;SACJ;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;;AAxCH,gEAyCC;AAtCwB,mCAAQ,GAAG,iCAAiC,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 { ConditionalBooleanValue } from \"@itwin/appui-abstract\";\nimport type { ToolbarItem, UiItemsProvider } from \"@itwin/appui-react\";\nimport {\n StagePanelLocation,\n StagePanelSection,\n StageUsage,\n ToolbarHelper,\n ToolbarOrientation,\n ToolbarUsage,\n ToolItemDef,\n WidgetState,\n} from \"@itwin/appui-react\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\nimport type { MapLayerProps } from \"@itwin/core-common\";\nimport { SvgMapInfo } from \"@itwin/itwinui-icons-react\";\nimport { MapFeatureInfoTool } from \"@itwin/map-layers-formats\";\n\nimport { MapLayersUI } from \"../mapLayers\";\nimport { MapFeatureInfoWidget } from \"./widget/FeatureInfoWidget\";\nimport type { MapFeatureInfoOptions } from \"./Interfaces\";\nimport { MapLayersSyncUiEventId } from \"../MapLayersActionIds\";\n\nconst supportsMapFeatureInfo = (vp: ScreenViewport, isOverlay: boolean, mapLayerProps: MapLayerProps[]): boolean => {\n for (let mapLayerIndex = 0; mapLayerIndex < mapLayerProps.length; mapLayerIndex++) {\n if (mapLayerProps[mapLayerIndex].visible && mapLayerProps[mapLayerIndex].transparency !== 1.0) {\n const layerProvider = vp.getMapLayerImageryProvider({ index: mapLayerIndex, isOverlay });\n // eslint-disable-next-line @itwin/no-internal\n if (layerProvider?.supportsMapFeatureInfo) {\n return true;\n }\n }\n }\n return false;\n};\n\nconst isMapFeatureInfoSupported = (): boolean => {\n const vp = IModelApp.viewManager.selectedView;\n if (vp?.viewFlags.backgroundMap) {\n const backgroundLayers = vp.displayStyle.settings.mapImagery.backgroundLayers.map((value) => value.toJSON());\n if (supportsMapFeatureInfo(vp, false, backgroundLayers)) {\n return true;\n }\n const overlayLayers = vp.displayStyle.settings.mapImagery.overlayLayers.map((value) => value.toJSON());\n if (supportsMapFeatureInfo(vp, true, overlayLayers)) {\n return true;\n }\n }\n return false;\n};\n\nexport const getMapFeatureInfoToolItemDef = (): ToolItemDef =>\n new ToolItemDef({\n toolId: MapFeatureInfoTool.toolId,\n iconSpec: <SvgMapInfo />,\n label: MapLayersUI.localization.getLocalizedString(\"mapLayers:FeatureInfoWidget.Label\"),\n description: () => MapFeatureInfoTool.description,\n execute: async () => {\n await IModelApp.tools.run(MapFeatureInfoTool.toolId);\n },\n isHidden: new ConditionalBooleanValue(() => {\n // Hide the MapFeatureInfoTool if the Map Layers toggle is off or no ArcGISFeature layers are active\n return !isMapFeatureInfoSupported();\n }, [MapLayersSyncUiEventId.MapImageryChanged]),\n });\n\nexport class FeatureInfoUiItemsProvider implements UiItemsProvider {\n // eslint-disable-line deprecation/deprecation\n public readonly id = \"FeatureInfoUiItemsProvider\";\n public static readonly widgetId = \"map-layers:mapFeatureInfoWidget\";\n\n public constructor(private _featureInfoOpts: MapFeatureInfoOptions) {}\n\n public provideToolbarItems(\n _stageId: string,\n stageUsage: string,\n toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation,\n ): ReadonlyArray<ToolbarItem> {\n if (\n !this._featureInfoOpts?.disableDefaultFeatureInfoTool &&\n stageUsage === StageUsage.General &&\n toolbarUsage === ToolbarUsage.ContentManipulation &&\n toolbarOrientation === ToolbarOrientation.Vertical\n ) {\n return [ToolbarHelper.createToolbarItemFromItemDef(60, getMapFeatureInfoToolItemDef())];\n }\n\n return [];\n }\n\n public provideWidgets(_stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection) {\n const widgets = [];\n\n const tmpSection = section ?? StagePanelSection.End;\n if (tmpSection === StagePanelSection.End && stageUsage === StageUsage.General && location === StagePanelLocation.Right) {\n widgets.push({\n id: FeatureInfoUiItemsProvider.widgetId,\n label: MapLayersUI.localization.getLocalizedString(\"mapLayers:FeatureInfoWidget.Label\"),\n icon: <SvgMapInfo />,\n content: <MapFeatureInfoWidget featureInfoOpts={this._featureInfoOpts} />,\n defaultState: WidgetState.Hidden,\n });\n }\n\n return widgets;\n }\n}\n"]}
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
$hovered-icon-color: $buic-foreground-primary;
|
|
8
8
|
|
|
9
9
|
.maplayers-settings-popup {
|
|
10
|
-
z-index
|
|
10
|
+
/* TODO: z-index workaround while map-layers-react is using the deprecated Popup component from core-react */
|
|
11
|
+
z-index: 6001; /* one more than floating widget */
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
.maplayers-settings-popup-panel {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMapFormat.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMapFormat.tsx"],"names":[],"mappings":"AAMA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectMapFormat.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMapFormat.tsx"],"names":[],"mappings":"AAMA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMrD,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC;AAEF,UAAU,oBAAoB;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;CAC9C;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eAyC1D"}
|
|
@@ -33,9 +33,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
33
33
|
require("./MapUrlDialog.scss");
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
35
|
const core_frontend_1 = require("@itwin/core-frontend");
|
|
36
|
-
const itwinui_icons_color_react_1 = require("@itwin/itwinui-icons-color-react");
|
|
37
36
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
38
|
-
const mapLayers_1 = require("../../mapLayers");
|
|
39
37
|
// TODO:
|
|
40
38
|
// Remove this structure and iterate over the registry's active formats.
|
|
41
39
|
// Still need a proper way to exclude some format, like we currently do with
|
|
@@ -60,7 +58,7 @@ function SelectMapFormat(props) {
|
|
|
60
58
|
formats.push({ value: exports.MAP_TYPES.tileUrl, label: exports.MAP_TYPES.tileUrl });
|
|
61
59
|
}
|
|
62
60
|
if (core_frontend_1.IModelApp.mapLayerFormatRegistry.isRegistered(exports.MAP_TYPES.arcGisFeature)) {
|
|
63
|
-
formats.push({ value: exports.MAP_TYPES.arcGisFeature, label: exports.MAP_TYPES.arcGisFeature
|
|
61
|
+
formats.push({ value: exports.MAP_TYPES.arcGisFeature, label: exports.MAP_TYPES.arcGisFeature });
|
|
64
62
|
}
|
|
65
63
|
return formats;
|
|
66
64
|
});
|
|
@@ -70,7 +68,7 @@ function SelectMapFormat(props) {
|
|
|
70
68
|
props.onChange(value);
|
|
71
69
|
}
|
|
72
70
|
}, [props]);
|
|
73
|
-
return ((0, jsx_runtime_1.jsx)(itwinui_react_1.LabeledSelect, { className: "map-layer-source-select", options: mapFormats, value: mapFormat, disabled: props.disabled, onChange: handleOnChange, size: "small", itemRenderer: (option) => (
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)(itwinui_react_1.LabeledSelect, { className: "map-layer-source-select", options: mapFormats, value: mapFormat, disabled: props.disabled, onChange: handleOnChange, size: "small", itemRenderer: (option) => (0, jsx_runtime_1.jsx)(itwinui_react_1.MenuItem, { children: option.label }) }));
|
|
74
72
|
}
|
|
75
73
|
exports.SelectMapFormat = SelectMapFormat;
|
|
76
74
|
//# sourceMappingURL=SelectMapFormat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMapFormat.js","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMapFormat.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,8BAA8B;AAE9B,+BAA6B;AAC7B,6CAA+B;AAC/B,wDAAiD;
|
|
1
|
+
{"version":3,"file":"SelectMapFormat.js","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMapFormat.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,8BAA8B;AAE9B,+BAA6B;AAC7B,6CAA+B;AAC/B,wDAAiD;AAEjD,wDAA+D;AAG/D,QAAQ;AACR,wEAAwE;AACxE,4EAA4E;AAC5E,wDAAwD;AAC3C,QAAA,SAAS,GAAG;IACvB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,eAAe;CAC/B,CAAC;AAkBF,gEAAgE;AAChE,SAAgB,eAAe,CAAC,KAA2B;IACzD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,IAAI,iBAAS,CAAC,MAAM,CAAC,CAAC;IAElF,MAAM,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAA2B,EAAE;QAC/D,MAAM,OAAO,GAA2B;YACtC,EAAE,KAAK,EAAE,iBAAS,CAAC,MAAM,EAAE,KAAK,EAAE,iBAAS,CAAC,MAAM,EAAE;YACpD,EAAE,KAAK,EAAE,iBAAS,CAAC,GAAG,EAAE,KAAK,EAAE,iBAAS,CAAC,GAAG,EAAE;YAC9C,EAAE,KAAK,EAAE,iBAAS,CAAC,IAAI,EAAE,KAAK,EAAE,iBAAS,CAAC,IAAI,EAAE;SACjD,CAAC;QACF,IAAI,KAAK,CAAC,eAAe,EAAE,cAAc,EAAE;YACzC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,iBAAS,CAAC,OAAO,EAAE,KAAK,EAAE,iBAAS,CAAC,OAAO,EAAE,CAAC,CAAC;SACtE;QAED,IAAI,yBAAS,CAAC,sBAAsB,CAAC,YAAY,CAAC,iBAAS,CAAC,aAAa,CAAC,EAAE;YAC1E,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,iBAAS,CAAC,aAAa,EAAE,KAAK,EAAE,iBAAS,CAAC,aAAa,EAAE,CAAC,CAAC;SAClF;QAED,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CACtC,CAAC,KAAa,EAAE,EAAE;QAChB,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,IAAI,KAAK,CAAC,QAAQ,EAAE;YAClB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SACvB;IACH,CAAC,EACD,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,CACL,uBAAC,6BAAa,IACZ,SAAS,EAAC,yBAAyB,EACnC,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,EACZ,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,uBAAC,wBAAQ,cAAE,MAAM,CAAC,KAAK,GAAY,GAC7D,CACH,CAAC;AACJ,CAAC;AAzCD,0CAyCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n// cSpell:ignore Modeless WMTS\n\nimport \"./MapUrlDialog.scss\";\nimport * as React from \"react\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { LabeledSelect, MenuItem } from \"@itwin/itwinui-react\";\nimport type { MapTypesOptions } from \"../Interfaces\";\n\n// TODO:\n// Remove this structure and iterate over the registry's active formats.\n// Still need a proper way to exclude some format, like we currently do with\n// 'TileUrl' without the need to hardcode any format Id.\nexport const MAP_TYPES = {\n wms: \"WMS\",\n arcGis: \"ArcGIS\",\n wmts: \"WMTS\",\n tileUrl: \"TileURL\",\n arcGisFeature: \"ArcGISFeature\",\n};\n\ninterface SelectMapFormatProps {\n value?: string;\n disabled?: boolean;\n mapTypesOptions?: MapTypesOptions;\n onChange?: (mapType: string) => void;\n /**\n * Message below the select. Does not apply to 'inline' select.\n */\n message?: React.ReactNode;\n /**\n * Status of the select.\n * @default ''\n */\n status?: \"positive\" | \"warning\" | \"negative\";\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function SelectMapFormat(props: SelectMapFormatProps) {\n const [mapFormat, setMapFormat] = React.useState(props.value ?? MAP_TYPES.arcGis);\n\n const [mapFormats] = React.useState((): SelectOption<string>[] => {\n const formats: SelectOption<string>[] = [\n { value: MAP_TYPES.arcGis, label: MAP_TYPES.arcGis },\n { value: MAP_TYPES.wms, label: MAP_TYPES.wms },\n { value: MAP_TYPES.wmts, label: MAP_TYPES.wmts },\n ];\n if (props.mapTypesOptions?.supportTileUrl) {\n formats.push({ value: MAP_TYPES.tileUrl, label: MAP_TYPES.tileUrl });\n }\n\n if (IModelApp.mapLayerFormatRegistry.isRegistered(MAP_TYPES.arcGisFeature)) {\n formats.push({ value: MAP_TYPES.arcGisFeature, label: MAP_TYPES.arcGisFeature });\n }\n\n return formats;\n });\n\n const handleOnChange = React.useCallback(\n (value: string) => {\n setMapFormat(value);\n if (props.onChange) {\n props.onChange(value);\n }\n },\n [props],\n );\n\n return (\n <LabeledSelect\n className=\"map-layer-source-select\"\n options={mapFormats}\n value={mapFormat}\n disabled={props.disabled}\n onChange={handleOnChange}\n size=\"small\"\n itemRenderer={(option) => <MenuItem>{option.label}</MenuItem>}\n />\n );\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BadgeType } from "@itwin/appui-abstract";
|
|
3
2
|
import type { ToolbarItem, UiItemsProvider } from "@itwin/appui-react";
|
|
4
3
|
import { StagePanelLocation, StagePanelSection, ToolbarOrientation, ToolbarUsage, ToolItemDef, WidgetState } from "@itwin/appui-react";
|
|
5
4
|
import type { MapFeatureInfoOptions } from "./Interfaces";
|
|
@@ -16,7 +15,6 @@ export declare class FeatureInfoUiItemsProvider implements UiItemsProvider {
|
|
|
16
15
|
icon: JSX.Element;
|
|
17
16
|
content: JSX.Element;
|
|
18
17
|
defaultState: WidgetState;
|
|
19
|
-
badge: BadgeType;
|
|
20
18
|
}[];
|
|
21
19
|
}
|
|
22
20
|
//# sourceMappingURL=FeatureInfoUiItemsProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureInfoUiItemsProvider.d.ts","sourceRoot":"","sources":["../../../src/ui/FeatureInfoUiItemsProvider.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FeatureInfoUiItemsProvider.d.ts","sourceRoot":"","sources":["../../../src/ui/FeatureInfoUiItemsProvider.tsx"],"names":[],"mappings":";AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EAGjB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAS5B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AA+B1D,eAAO,MAAM,4BAA4B,QAAO,WAa5C,CAAC;AAEL,qBAAa,0BAA2B,YAAW,eAAe;IAK7C,OAAO,CAAC,gBAAgB;IAH3C,SAAgB,EAAE,gCAAgC;IAClD,gBAAuB,QAAQ,qCAAqC;gBAEzC,gBAAgB,EAAE,qBAAqB;IAE3D,mBAAmB,CACxB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,GACrC,aAAa,CAAC,WAAW,CAAC;IAatB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,iBAAiB;;;;;;;CAgBtH"}
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
import {
|
|
6
|
+
import { ConditionalBooleanValue } from "@itwin/appui-abstract";
|
|
7
7
|
import { StagePanelLocation, StagePanelSection, StageUsage, ToolbarHelper, ToolbarOrientation, ToolbarUsage, ToolItemDef, WidgetState, } from "@itwin/appui-react";
|
|
8
8
|
import { IModelApp } from "@itwin/core-frontend";
|
|
9
9
|
import { SvgMapInfo } from "@itwin/itwinui-icons-react";
|
|
@@ -45,7 +45,6 @@ export const getMapFeatureInfoToolItemDef = () => new ToolItemDef({
|
|
|
45
45
|
execute: async () => {
|
|
46
46
|
await IModelApp.tools.run(MapFeatureInfoTool.toolId);
|
|
47
47
|
},
|
|
48
|
-
badgeType: BadgeType.TechnicalPreview,
|
|
49
48
|
isHidden: new ConditionalBooleanValue(() => {
|
|
50
49
|
// Hide the MapFeatureInfoTool if the Map Layers toggle is off or no ArcGISFeature layers are active
|
|
51
50
|
return !isMapFeatureInfoSupported();
|
|
@@ -76,7 +75,6 @@ export class FeatureInfoUiItemsProvider {
|
|
|
76
75
|
icon: _jsx(SvgMapInfo, {}),
|
|
77
76
|
content: _jsx(MapFeatureInfoWidget, { featureInfoOpts: this._featureInfoOpts }),
|
|
78
77
|
defaultState: WidgetState.Hidden,
|
|
79
|
-
badge: BadgeType.TechnicalPreview,
|
|
80
78
|
});
|
|
81
79
|
}
|
|
82
80
|
return widgets;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureInfoUiItemsProvider.js","sourceRoot":"","sources":["../../../src/ui/FeatureInfoUiItemsProvider.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"FeatureInfoUiItemsProvider.js","sourceRoot":"","sources":["../../../src/ui/FeatureInfoUiItemsProvider.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,MAAM,sBAAsB,GAAG,CAAC,EAAkB,EAAE,SAAkB,EAAE,aAA8B,EAAW,EAAE;IACjH,KAAK,IAAI,aAAa,GAAG,CAAC,EAAE,aAAa,GAAG,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE;QACjF,IAAI,aAAa,CAAC,aAAa,CAAC,CAAC,OAAO,IAAI,aAAa,CAAC,aAAa,CAAC,CAAC,YAAY,KAAK,GAAG,EAA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AW,CAAC,YAAY,CAAC,kBAAkB,CAAC,mCAAmC,CAAC;gBACvF,IAAI,EAAE,KAAC,UAAU,KAAG;gBACpB,OAAO,EAAE,KAAC,oBAAoB,IAAC,eAAe,EAAE,IAAI,CAAC,gBAAgB,GAAI;gBACzE,YAAY,EAAE,WAAW,CAAC,MAAM;aACjC,CAAC,CAAC;SACJ;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;;AArCsB,mCAAQ,GAAG,iCAAiC,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 { ConditionalBooleanValue } from \"@itwin/appui-abstract\";\nimport type { ToolbarItem, UiItemsProvider } from \"@itwin/appui-react\";\nimport {\n StagePanelLocation,\n StagePanelSection,\n StageUsage,\n ToolbarHelper,\n ToolbarOrientation,\n ToolbarUsage,\n ToolItemDef,\n WidgetState,\n} from \"@itwin/appui-react\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\nimport type { MapLayerProps } from \"@itwin/core-common\";\nimport { SvgMapInfo } from \"@itwin/itwinui-icons-react\";\nimport { MapFeatureInfoTool } from \"@itwin/map-layers-formats\";\n\nimport { MapLayersUI } from \"../mapLayers\";\nimport { MapFeatureInfoWidget } from \"./widget/FeatureInfoWidget\";\nimport type { MapFeatureInfoOptions } from \"./Interfaces\";\nimport { MapLayersSyncUiEventId } from \"../MapLayersActionIds\";\n\nconst supportsMapFeatureInfo = (vp: ScreenViewport, isOverlay: boolean, mapLayerProps: MapLayerProps[]): boolean => {\n for (let mapLayerIndex = 0; mapLayerIndex < mapLayerProps.length; mapLayerIndex++) {\n if (mapLayerProps[mapLayerIndex].visible && mapLayerProps[mapLayerIndex].transparency !== 1.0) {\n const layerProvider = vp.getMapLayerImageryProvider({ index: mapLayerIndex, isOverlay });\n // eslint-disable-next-line @itwin/no-internal\n if (layerProvider?.supportsMapFeatureInfo) {\n return true;\n }\n }\n }\n return false;\n};\n\nconst isMapFeatureInfoSupported = (): boolean => {\n const vp = IModelApp.viewManager.selectedView;\n if (vp?.viewFlags.backgroundMap) {\n const backgroundLayers = vp.displayStyle.settings.mapImagery.backgroundLayers.map((value) => value.toJSON());\n if (supportsMapFeatureInfo(vp, false, backgroundLayers)) {\n return true;\n }\n const overlayLayers = vp.displayStyle.settings.mapImagery.overlayLayers.map((value) => value.toJSON());\n if (supportsMapFeatureInfo(vp, true, overlayLayers)) {\n return true;\n }\n }\n return false;\n};\n\nexport const getMapFeatureInfoToolItemDef = (): ToolItemDef =>\n new ToolItemDef({\n toolId: MapFeatureInfoTool.toolId,\n iconSpec: <SvgMapInfo />,\n label: MapLayersUI.localization.getLocalizedString(\"mapLayers:FeatureInfoWidget.Label\"),\n description: () => MapFeatureInfoTool.description,\n execute: async () => {\n await IModelApp.tools.run(MapFeatureInfoTool.toolId);\n },\n isHidden: new ConditionalBooleanValue(() => {\n // Hide the MapFeatureInfoTool if the Map Layers toggle is off or no ArcGISFeature layers are active\n return !isMapFeatureInfoSupported();\n }, [MapLayersSyncUiEventId.MapImageryChanged]),\n });\n\nexport class FeatureInfoUiItemsProvider implements UiItemsProvider {\n // eslint-disable-line deprecation/deprecation\n public readonly id = \"FeatureInfoUiItemsProvider\";\n public static readonly widgetId = \"map-layers:mapFeatureInfoWidget\";\n\n public constructor(private _featureInfoOpts: MapFeatureInfoOptions) {}\n\n public provideToolbarItems(\n _stageId: string,\n stageUsage: string,\n toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation,\n ): ReadonlyArray<ToolbarItem> {\n if (\n !this._featureInfoOpts?.disableDefaultFeatureInfoTool &&\n stageUsage === StageUsage.General &&\n toolbarUsage === ToolbarUsage.ContentManipulation &&\n toolbarOrientation === ToolbarOrientation.Vertical\n ) {\n return [ToolbarHelper.createToolbarItemFromItemDef(60, getMapFeatureInfoToolItemDef())];\n }\n\n return [];\n }\n\n public provideWidgets(_stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection) {\n const widgets = [];\n\n const tmpSection = section ?? StagePanelSection.End;\n if (tmpSection === StagePanelSection.End && stageUsage === StageUsage.General && location === StagePanelLocation.Right) {\n widgets.push({\n id: FeatureInfoUiItemsProvider.widgetId,\n label: MapLayersUI.localization.getLocalizedString(\"mapLayers:FeatureInfoWidget.Label\"),\n icon: <SvgMapInfo />,\n content: <MapFeatureInfoWidget featureInfoOpts={this._featureInfoOpts} />,\n defaultState: WidgetState.Hidden,\n });\n }\n\n return widgets;\n }\n}\n"]}
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
$hovered-icon-color: $buic-foreground-primary;
|
|
8
8
|
|
|
9
9
|
.maplayers-settings-popup {
|
|
10
|
-
z-index
|
|
10
|
+
/* TODO: z-index workaround while map-layers-react is using the deprecated Popup component from core-react */
|
|
11
|
+
z-index: 6001; /* one more than floating widget */
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
.maplayers-settings-popup-panel {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMapFormat.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMapFormat.tsx"],"names":[],"mappings":"AAMA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectMapFormat.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMapFormat.tsx"],"names":[],"mappings":"AAMA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMrD,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC;AAEF,UAAU,oBAAoB;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;CAC9C;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eAyC1D"}
|
|
@@ -7,9 +7,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import "./MapUrlDialog.scss";
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import { IModelApp } from "@itwin/core-frontend";
|
|
10
|
-
import {
|
|
11
|
-
import { Icon, LabeledSelect, MenuItem } from "@itwin/itwinui-react";
|
|
12
|
-
import { MapLayersUI } from "../../mapLayers";
|
|
10
|
+
import { LabeledSelect, MenuItem } from "@itwin/itwinui-react";
|
|
13
11
|
// TODO:
|
|
14
12
|
// Remove this structure and iterate over the registry's active formats.
|
|
15
13
|
// Still need a proper way to exclude some format, like we currently do with
|
|
@@ -34,7 +32,7 @@ export function SelectMapFormat(props) {
|
|
|
34
32
|
formats.push({ value: MAP_TYPES.tileUrl, label: MAP_TYPES.tileUrl });
|
|
35
33
|
}
|
|
36
34
|
if (IModelApp.mapLayerFormatRegistry.isRegistered(MAP_TYPES.arcGisFeature)) {
|
|
37
|
-
formats.push({ value: MAP_TYPES.arcGisFeature, label: MAP_TYPES.arcGisFeature
|
|
35
|
+
formats.push({ value: MAP_TYPES.arcGisFeature, label: MAP_TYPES.arcGisFeature });
|
|
38
36
|
}
|
|
39
37
|
return formats;
|
|
40
38
|
});
|
|
@@ -44,6 +42,6 @@ export function SelectMapFormat(props) {
|
|
|
44
42
|
props.onChange(value);
|
|
45
43
|
}
|
|
46
44
|
}, [props]);
|
|
47
|
-
return (_jsx(LabeledSelect, { className: "map-layer-source-select", options: mapFormats, value: mapFormat, disabled: props.disabled, onChange: handleOnChange, size: "small", itemRenderer: (option) =>
|
|
45
|
+
return (_jsx(LabeledSelect, { className: "map-layer-source-select", options: mapFormats, value: mapFormat, disabled: props.disabled, onChange: handleOnChange, size: "small", itemRenderer: (option) => _jsx(MenuItem, { children: option.label }) }));
|
|
48
46
|
}
|
|
49
47
|
//# sourceMappingURL=SelectMapFormat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMapFormat.js","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMapFormat.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,8BAA8B;AAE9B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectMapFormat.js","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMapFormat.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,8BAA8B;AAE9B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAG/D,QAAQ;AACR,wEAAwE;AACxE,4EAA4E;AAC5E,wDAAwD;AACxD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,eAAe;CAC/B,CAAC;AAkBF,gEAAgE;AAChE,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC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EACZ,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,KAAC,QAAQ,cAAE,MAAM,CAAC,KAAK,GAAY,GAC7D,CACH,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n// cSpell:ignore Modeless WMTS\n\nimport \"./MapUrlDialog.scss\";\nimport * as React from \"react\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { LabeledSelect, MenuItem } from \"@itwin/itwinui-react\";\nimport type { MapTypesOptions } from \"../Interfaces\";\n\n// TODO:\n// Remove this structure and iterate over the registry's active formats.\n// Still need a proper way to exclude some format, like we currently do with\n// 'TileUrl' without the need to hardcode any format Id.\nexport const MAP_TYPES = {\n wms: \"WMS\",\n arcGis: \"ArcGIS\",\n wmts: \"WMTS\",\n tileUrl: \"TileURL\",\n arcGisFeature: \"ArcGISFeature\",\n};\n\ninterface SelectMapFormatProps {\n value?: string;\n disabled?: boolean;\n mapTypesOptions?: MapTypesOptions;\n onChange?: (mapType: string) => void;\n /**\n * Message below the select. Does not apply to 'inline' select.\n */\n message?: React.ReactNode;\n /**\n * Status of the select.\n * @default ''\n */\n status?: \"positive\" | \"warning\" | \"negative\";\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function SelectMapFormat(props: SelectMapFormatProps) {\n const [mapFormat, setMapFormat] = React.useState(props.value ?? MAP_TYPES.arcGis);\n\n const [mapFormats] = React.useState((): SelectOption<string>[] => {\n const formats: SelectOption<string>[] = [\n { value: MAP_TYPES.arcGis, label: MAP_TYPES.arcGis },\n { value: MAP_TYPES.wms, label: MAP_TYPES.wms },\n { value: MAP_TYPES.wmts, label: MAP_TYPES.wmts },\n ];\n if (props.mapTypesOptions?.supportTileUrl) {\n formats.push({ value: MAP_TYPES.tileUrl, label: MAP_TYPES.tileUrl });\n }\n\n if (IModelApp.mapLayerFormatRegistry.isRegistered(MAP_TYPES.arcGisFeature)) {\n formats.push({ value: MAP_TYPES.arcGisFeature, label: MAP_TYPES.arcGisFeature });\n }\n\n return formats;\n });\n\n const handleOnChange = React.useCallback(\n (value: string) => {\n setMapFormat(value);\n if (props.onChange) {\n props.onChange(value);\n }\n },\n [props],\n );\n\n return (\n <LabeledSelect\n className=\"map-layer-source-select\"\n options={mapFormats}\n value={mapFormat}\n disabled={props.disabled}\n onChange={handleOnChange}\n size=\"small\"\n itemRenderer={(option) => <MenuItem>{option.label}</MenuItem>}\n />\n );\n}\n"]}
|