@itwin/map-layers 4.0.0-dev.41 → 4.0.0-dev.47
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 +864 -864
- package/README.md +32 -32
- package/lib/cjs/MapLayerPreferences.d.ts +88 -88
- package/lib/cjs/MapLayerPreferences.js +311 -311
- package/lib/cjs/MapLayerPreferences.js.map +1 -1
- package/lib/cjs/map-layers.d.ts +6 -6
- package/lib/cjs/map-layers.js +22 -22
- package/lib/cjs/mapLayers.d.ts +26 -44
- package/lib/cjs/mapLayers.d.ts.map +1 -1
- package/lib/cjs/mapLayers.js +33 -61
- package/lib/cjs/mapLayers.js.map +1 -1
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts +16 -11
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -1
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.js +46 -51
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.js.map +1 -1
- package/lib/cjs/ui/Interfaces.d.ts +50 -50
- package/lib/cjs/ui/Interfaces.js +2 -2
- package/lib/cjs/ui/Interfaces.js.map +1 -1
- package/lib/cjs/ui/MapFeatureInfoTool.d.ts +13 -13
- package/lib/cjs/ui/MapFeatureInfoTool.js +50 -50
- package/lib/cjs/ui/MapFeatureInfoTool.js.map +1 -1
- package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts +8 -8
- package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts.map +1 -1
- package/lib/cjs/ui/MapLayersUiItemsProvider.js +35 -38
- package/lib/cjs/ui/MapLayersUiItemsProvider.js.map +1 -1
- package/lib/cjs/ui/widget/AttachLayerPopupButton.d.ts +13 -14
- package/lib/cjs/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/AttachLayerPopupButton.js +335 -335
- package/lib/cjs/ui/widget/BasemapPanel.d.ts +7 -8
- package/lib/cjs/ui/widget/BasemapPanel.d.ts.map +1 -1
- package/lib/cjs/ui/widget/BasemapPanel.js +156 -156
- package/lib/cjs/ui/widget/BasemapPanel.js.map +1 -1
- package/lib/cjs/ui/widget/BasemapPanel.scss +87 -87
- package/lib/cjs/ui/widget/ConfirmMessageDialog.d.ts +20 -21
- package/lib/cjs/ui/widget/ConfirmMessageDialog.d.ts.map +1 -1
- package/lib/cjs/ui/widget/ConfirmMessageDialog.js +22 -22
- package/lib/cjs/ui/widget/ConfirmMessageDialog.js.map +1 -1
- package/lib/cjs/ui/widget/FeatureInfoDataProvider.d.ts +40 -40
- package/lib/cjs/ui/widget/FeatureInfoDataProvider.js +138 -138
- package/lib/cjs/ui/widget/FeatureInfoDataProvider.js.map +1 -1
- package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts +6 -7
- package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
- package/lib/cjs/ui/widget/FeatureInfoWidget.js +65 -65
- package/lib/cjs/ui/widget/FeatureInfoWidget.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerDroppable.d.ts +18 -19
- package/lib/cjs/ui/widget/MapLayerDroppable.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerDroppable.js +85 -85
- package/lib/cjs/ui/widget/MapLayerDroppable.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerManager.d.ts +26 -26
- package/lib/cjs/ui/widget/MapLayerManager.js +401 -401
- package/lib/cjs/ui/widget/MapLayerManager.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerManager.scss +409 -409
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts +11 -12
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.js +82 -82
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts +6 -7
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js +65 -65
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.scss +20 -20
- package/lib/cjs/ui/widget/MapLayersWidget.d.ts +10 -11
- package/lib/cjs/ui/widget/MapLayersWidget.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayersWidget.js +31 -31
- package/lib/cjs/ui/widget/MapLayersWidget.js.map +1 -1
- package/lib/cjs/ui/widget/MapManagerSettings.d.ts +2 -3
- package/lib/cjs/ui/widget/MapManagerSettings.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapManagerSettings.js +200 -200
- package/lib/cjs/ui/widget/MapManagerSettings.js.map +1 -1
- package/lib/cjs/ui/widget/MapManagerSettings.scss +29 -29
- package/lib/cjs/ui/widget/MapUrlDialog.d.ts +22 -23
- package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.js +530 -530
- package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.scss +99 -100
- package/lib/cjs/ui/widget/SelectMapFormat.d.ts +17 -18
- package/lib/cjs/ui/widget/SelectMapFormat.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SelectMapFormat.js +54 -54
- package/lib/cjs/ui/widget/SelectMapFormat.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersDataProvider.d.ts +18 -20
- package/lib/cjs/ui/widget/SubLayersDataProvider.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SubLayersDataProvider.js +74 -75
- package/lib/cjs/ui/widget/SubLayersDataProvider.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts +9 -10
- package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SubLayersPopupButton.js +40 -40
- package/lib/cjs/ui/widget/SubLayersPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersTree.d.ts +14 -15
- package/lib/cjs/ui/widget/SubLayersTree.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SubLayersTree.js +413 -413
- package/lib/cjs/ui/widget/SubLayersTree.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersTree.scss +69 -69
- package/lib/cjs/ui/widget/TransparencyPopupButton.d.ts +13 -14
- package/lib/cjs/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/TransparencyPopupButton.js +47 -47
- package/lib/cjs/ui/widget/TransparencyPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/TransparencyPopupButton.scss +35 -36
- package/lib/esm/MapLayerPreferences.d.ts +88 -88
- package/lib/esm/MapLayerPreferences.js +307 -307
- package/lib/esm/MapLayerPreferences.js.map +1 -1
- package/lib/esm/map-layers.d.ts +6 -6
- package/lib/esm/map-layers.js +10 -10
- package/lib/esm/mapLayers.d.ts +26 -44
- package/lib/esm/mapLayers.d.ts.map +1 -1
- package/lib/esm/mapLayers.js +29 -57
- package/lib/esm/mapLayers.js.map +1 -1
- package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts +16 -11
- package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -1
- package/lib/esm/ui/FeatureInfoUiItemsProvider.js +42 -47
- package/lib/esm/ui/FeatureInfoUiItemsProvider.js.map +1 -1
- package/lib/esm/ui/Interfaces.d.ts +50 -50
- package/lib/esm/ui/Interfaces.js +1 -1
- package/lib/esm/ui/Interfaces.js.map +1 -1
- package/lib/esm/ui/MapFeatureInfoTool.d.ts +13 -13
- package/lib/esm/ui/MapFeatureInfoTool.js +45 -45
- package/lib/esm/ui/MapFeatureInfoTool.js.map +1 -1
- package/lib/esm/ui/MapLayersUiItemsProvider.d.ts +8 -8
- package/lib/esm/ui/MapLayersUiItemsProvider.d.ts.map +1 -1
- package/lib/esm/ui/MapLayersUiItemsProvider.js +31 -34
- package/lib/esm/ui/MapLayersUiItemsProvider.js.map +1 -1
- package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts +13 -14
- package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/AttachLayerPopupButton.js +331 -331
- package/lib/esm/ui/widget/BasemapPanel.d.ts +7 -8
- package/lib/esm/ui/widget/BasemapPanel.d.ts.map +1 -1
- package/lib/esm/ui/widget/BasemapPanel.js +152 -152
- package/lib/esm/ui/widget/BasemapPanel.js.map +1 -1
- package/lib/esm/ui/widget/BasemapPanel.scss +87 -87
- package/lib/esm/ui/widget/ConfirmMessageDialog.d.ts +20 -21
- package/lib/esm/ui/widget/ConfirmMessageDialog.d.ts.map +1 -1
- package/lib/esm/ui/widget/ConfirmMessageDialog.js +18 -18
- package/lib/esm/ui/widget/ConfirmMessageDialog.js.map +1 -1
- package/lib/esm/ui/widget/FeatureInfoDataProvider.d.ts +40 -40
- package/lib/esm/ui/widget/FeatureInfoDataProvider.js +134 -134
- package/lib/esm/ui/widget/FeatureInfoDataProvider.js.map +1 -1
- package/lib/esm/ui/widget/FeatureInfoWidget.d.ts +6 -7
- package/lib/esm/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
- package/lib/esm/ui/widget/FeatureInfoWidget.js +61 -61
- package/lib/esm/ui/widget/FeatureInfoWidget.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerDroppable.d.ts +18 -19
- package/lib/esm/ui/widget/MapLayerDroppable.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerDroppable.js +81 -81
- package/lib/esm/ui/widget/MapLayerDroppable.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerManager.d.ts +26 -26
- package/lib/esm/ui/widget/MapLayerManager.js +396 -396
- package/lib/esm/ui/widget/MapLayerManager.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerManager.scss +409 -409
- package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts +11 -12
- package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsMenu.js +78 -78
- package/lib/esm/ui/widget/MapLayerSettingsMenu.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts +6 -7
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js +61 -61
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.scss +20 -20
- package/lib/esm/ui/widget/MapLayersWidget.d.ts +10 -11
- package/lib/esm/ui/widget/MapLayersWidget.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayersWidget.js +27 -27
- package/lib/esm/ui/widget/MapLayersWidget.js.map +1 -1
- package/lib/esm/ui/widget/MapManagerSettings.d.ts +2 -3
- package/lib/esm/ui/widget/MapManagerSettings.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapManagerSettings.js +196 -196
- package/lib/esm/ui/widget/MapManagerSettings.js.map +1 -1
- package/lib/esm/ui/widget/MapManagerSettings.scss +29 -29
- package/lib/esm/ui/widget/MapUrlDialog.d.ts +22 -23
- package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.js +526 -526
- package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.scss +99 -100
- package/lib/esm/ui/widget/SelectMapFormat.d.ts +17 -18
- package/lib/esm/ui/widget/SelectMapFormat.d.ts.map +1 -1
- package/lib/esm/ui/widget/SelectMapFormat.js +50 -50
- package/lib/esm/ui/widget/SelectMapFormat.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersDataProvider.d.ts +18 -20
- package/lib/esm/ui/widget/SubLayersDataProvider.d.ts.map +1 -1
- package/lib/esm/ui/widget/SubLayersDataProvider.js +70 -71
- package/lib/esm/ui/widget/SubLayersDataProvider.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersPopupButton.d.ts +9 -10
- package/lib/esm/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/SubLayersPopupButton.js +36 -36
- package/lib/esm/ui/widget/SubLayersPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersTree.d.ts +14 -15
- package/lib/esm/ui/widget/SubLayersTree.d.ts.map +1 -1
- package/lib/esm/ui/widget/SubLayersTree.js +408 -408
- package/lib/esm/ui/widget/SubLayersTree.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersTree.scss +69 -69
- package/lib/esm/ui/widget/TransparencyPopupButton.d.ts +13 -14
- package/lib/esm/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/TransparencyPopupButton.js +43 -43
- package/lib/esm/ui/widget/TransparencyPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/TransparencyPopupButton.scss +35 -36
- package/package.json +31 -37
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerPreferences.js","sourceRoot":"","sources":["../../src/MapLayerPreferences.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC9G,OAAO,EAAE,OAAO,EAAc,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAU1C,gBAAgB;AAChB,MAAM,CAAN,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,yEAAS,CAAA;IACT,6EAAW,CAAA;IACX,+EAAY,CAAA;AACd,CAAC,EAJW,wBAAwB,KAAxB,wBAAwB,QAInC;AASD;;;;;GAKG;AACH,MAAM,OAAO,mBAAmB;IAU9B;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,MAAsB,EAAE,OAAmB,EAAE,QAAqB,EAAE,aAAuB;QACzH,IA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W,CAAC,GAAG,CAAC;gBAC3D,WAAW;gBACX,SAAS,EAAE,mBAAmB,CAAC,oBAAoB;gBACnD,GAAG,EAAE,EAAE;gBACP,OAAO;gBACP,QAAQ;aACT,CAAC,CAAC;YACH,IAAI,SAAS,KAAK,kBAAkB;gBAClC,YAAY,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;SACzC;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,iDAAiD,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;SACtI;QAED,MAAM,oBAAoB,GAAqB,EAAE,CAAC;QAClD,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE;YACnC,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAe,EAAE,EAAE;gBACnC,MAAM,cAAc,GAAG,cAAc,CAAC,QAAQ,CAAC,UAAwC,CAAC,CAAC;gBACzF,IAAI,cAAc;oBAChB,oBAAoB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;SACJ;QACD,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IAEO,MAAM,KAAK,oBAAoB;QACrC,OAAO,gCAAgC,CAAC;IAC1C,CAAC;;AAhTD;;;;;;GAMG;AACoB,wCAAoB,GAAG,IAAI,OAAO,EAA0G,CAAC,CAAC,mFAAmF","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 { IModelApp, MapLayerSource, NotifyMessageDetails, OutputMessagePriority } from \"@itwin/core-frontend\";\r\nimport { BeEvent, GuidString } from \"@itwin/core-bentley\";\r\nimport { MapLayersUI } from \"./mapLayers\";\r\n\r\n/** @internal */\r\nexport interface MapLayerPreferencesContent {\r\n url: string;\r\n name: string;\r\n formatId: string;\r\n transparentBackground: boolean | undefined;\r\n}\r\n\r\n/** @internal */\r\nexport enum MapLayerSourceChangeType {\r\n Added = 0,\r\n Removed = 1,\r\n Replaced = 2,\r\n}\r\n\r\n/** @internal */\r\nexport interface MapLayerSourceArg {\r\n readonly source: MapLayerSource;\r\n readonly iTwinId: GuidString;\r\n readonly iModelId: GuidString;\r\n}\r\n\r\n/** A wrapper around user preferences to provide a way to store [[MapLayerSettings]].\r\n *\r\n * Note: This is currently internal only and used directly by the MapLayersExtension. It makes use of the IModelApp.authorizationClient if it exists.\r\n *\r\n * @internal\r\n */\r\nexport class MapLayerPreferences {\r\n /** Event raised whenever a source is added, replaced or removed:\r\n * changeType : Type of changed occurred.\r\n * oldSource : Source that was removed or replaced.\r\n * newSource : Source that was added or replacement of oldSource.\r\n *\r\n * @see [[MapLayerSourceChangeType]]\r\n */\r\n public static readonly onLayerSourceChanged = new BeEvent<(changeType: MapLayerSourceChangeType, oldSource?: MapLayerSource, newSource?: MapLayerSource) => void>(); // Used to notify the frontend that it needs to update its list of available layers\r\n\r\n /** Store the Map Layer source preference. If the same setting exists at a higher level, an error will be thrown and the setting will not be updated.\r\n *\r\n * Returns false if the settings object would override some other settings object in a larger scope i.e. storing settings on model when\r\n * a project setting exists with same name or map layer url.\r\n * @param source source to be stored on the setting service\r\n * @param storeOnIModel if true store the settings object on the model, if false store it on the project\r\n */\r\n public static async storeSource(source: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString, storeOnIModel?: boolean): Promise<boolean> {\r\n if (!MapLayersUI.iTwinConfig)\r\n return false;\r\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\r\n\r\n const sourceJSON = source.toJSON();\r\n const mapLayerSetting: MapLayerPreferencesContent = {\r\n url: sourceJSON.url,\r\n name: sourceJSON.name,\r\n formatId: sourceJSON.formatId,\r\n transparentBackground: sourceJSON.transparentBackground,\r\n };\r\n\r\n const result: boolean = await MapLayerPreferences.delete(sourceJSON.url, sourceJSON.name, iTwinId, iModelId, storeOnIModel);\r\n if (result) {\r\n await MapLayersUI.iTwinConfig.save({\r\n accessToken,\r\n content: mapLayerSetting,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: sourceJSON.name,\r\n iTwinId,\r\n iModelId: storeOnIModel ? iModelId : undefined,\r\n });\r\n MapLayerPreferences.onLayerSourceChanged.raiseEvent(MapLayerSourceChangeType.Added, undefined, MapLayerSource.fromJSON(mapLayerSetting));\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n /** Replace the old map layer source with a new map layer source.\r\n *\r\n * The source is replaced at the same level that the original source is defined. (i.e. if the old source is defined at a project level, the new source will also be defined there.)\r\n *\r\n * @param oldSource\r\n * @param newSource\r\n * @param iTwinId\r\n * @param iModelId\r\n */\r\n public static async replaceSource(oldSource: MapLayerSource, newSource: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString): Promise<void> {\r\n if (!MapLayersUI.iTwinConfig)\r\n return;\r\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\r\n\r\n let storeOnIModel = false;\r\n try {\r\n await MapLayersUI.iTwinConfig.delete({\r\n accessToken,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: oldSource.name,\r\n iTwinId,\r\n iModelId,\r\n });\r\n } catch (_err) {\r\n await MapLayersUI.iTwinConfig.delete({\r\n accessToken,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: oldSource.name,\r\n iTwinId,\r\n });\r\n storeOnIModel = true;\r\n }\r\n\r\n const mapLayerSetting: MapLayerPreferencesContent = {\r\n url: newSource.url,\r\n name: newSource.name,\r\n formatId: newSource.formatId,\r\n transparentBackground: newSource.transparentBackground,\r\n };\r\n\r\n await MapLayersUI.iTwinConfig.save({\r\n accessToken,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: `${MapLayerPreferences._preferenceNamespace}.${newSource.name}`,\r\n iTwinId,\r\n iModelId: storeOnIModel ? iModelId : undefined,\r\n content: mapLayerSetting,\r\n });\r\n\r\n MapLayerPreferences.onLayerSourceChanged.raiseEvent(MapLayerSourceChangeType.Replaced, oldSource, newSource);\r\n }\r\n\r\n /** Deletes the provided MapLayerSource by name from both the iTwin or iModel level.\r\n *\r\n * @param source The source to delete. The name is used to identify the source.\r\n * @param iTwinId\r\n * @param iModelId\r\n */\r\n public static async deleteByName(source: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString): Promise<void> {\r\n if (!MapLayersUI.iTwinConfig)\r\n return;\r\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\r\n\r\n try {\r\n await MapLayersUI.iTwinConfig.delete({\r\n accessToken,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: source.name,\r\n iTwinId,\r\n iModelId,\r\n });\r\n } catch (_err) {\r\n // failed to store based on iModelId, attempt using iTwinId\r\n await MapLayersUI.iTwinConfig.delete({\r\n accessToken,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: source.name,\r\n iTwinId,\r\n });\r\n }\r\n\r\n MapLayerPreferences.onLayerSourceChanged.raiseEvent(MapLayerSourceChangeType.Removed, source, undefined);\r\n }\r\n\r\n /** Deletes the current setting with the provided key if it is defined at the same preference level.\r\n *\r\n * If the preference is defined within a different level, false will be returned indicating the setting should not be overriden.\r\n *\r\n * The two potential preference levels are iTwin and iModel.\r\n *\r\n * @param url\r\n * @param name\r\n * @param iTwinId\r\n * @param iModelId\r\n * @param storeOnIModel\r\n */\r\n private static async delete(url: string, name: string, iTwinId: GuidString, iModelId?: GuidString, storeOnIModel?: boolean): Promise<boolean> {\r\n if (!MapLayersUI.iTwinConfig)\r\n return true;\r\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\r\n\r\n const iTwinPreferenceByName = await MapLayersUI.iTwinConfig.get({\r\n accessToken,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: name,\r\n iTwinId,\r\n });\r\n\r\n if (undefined !== iTwinPreferenceByName && storeOnIModel) {\r\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerExistsAsProjectSetting\", { layer: iTwinPreferenceByName.name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\r\n return false;\r\n } else if (iTwinPreferenceByName) {\r\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerExistsOverwriting\", { layer: iTwinPreferenceByName.name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\r\n await MapLayersUI.iTwinConfig.delete({\r\n accessToken,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: iTwinPreferenceByName.name,\r\n iTwinId,\r\n });\r\n }\r\n\r\n // check if setting with url already exists, if it does, delete it\r\n const settingFromUrl = await MapLayerPreferences.getByUrl(url, iTwinId, undefined);\r\n if (settingFromUrl && storeOnIModel) {\r\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerWithUrlExistsAsProjectSetting\", { url: settingFromUrl.url, name: settingFromUrl.name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\r\n return false;\r\n } else if (settingFromUrl) {\r\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerWithUrlExistsOverwriting\", { url: settingFromUrl.url, oldName: settingFromUrl.name, newName: name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\r\n await MapLayersUI.iTwinConfig.delete({\r\n accessToken,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: settingFromUrl.name,\r\n iTwinId,\r\n });\r\n }\r\n\r\n if (iModelId) { // delete any settings on model so user can update them if theres collisions\r\n const settingOnIModelFromName = await MapLayersUI.iTwinConfig.get({\r\n accessToken,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: name,\r\n iTwinId,\r\n iModelId,\r\n });\r\n const settingFromUrlOnIModel = await MapLayerPreferences.getByUrl(url, iTwinId, iModelId);\r\n if (settingOnIModelFromName) {\r\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerExistsOverwriting\", { layer: settingOnIModelFromName.name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\r\n await MapLayersUI.iTwinConfig.delete({\r\n accessToken,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: settingOnIModelFromName.name,\r\n iTwinId,\r\n iModelId,\r\n });\r\n }\r\n if (settingFromUrlOnIModel) {\r\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerWithUrlExistsOverwriting\", { url: settingFromUrlOnIModel.url, oldName: settingFromUrlOnIModel.name, newName: name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\r\n await MapLayersUI.iTwinConfig.delete({\r\n accessToken,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: settingFromUrlOnIModel.name,\r\n iTwinId,\r\n iModelId,\r\n });\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n /** Attempts to get a map layer based off a specific url.\r\n * @param url\r\n * @param iTwinId\r\n * @param iModelId\r\n */\r\n public static async getByUrl(url: string, iTwinId: string, iModelId?: string): Promise<MapLayerPreferencesContent | undefined> {\r\n if (!MapLayersUI.iTwinConfig)\r\n return undefined;\r\n\r\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\r\n\r\n const settingResponse = await MapLayersUI.iTwinConfig.get({\r\n accessToken,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: \"\",\r\n iTwinId,\r\n iModelId,\r\n });\r\n\r\n if (undefined === settingResponse || 0 === settingResponse.length)\r\n return undefined;\r\n\r\n let savedMapLayer;\r\n settingResponse.settingsMap?.forEach((savedLayer: any) => {\r\n if (savedLayer.url === url) {\r\n savedMapLayer = savedLayer;\r\n }\r\n });\r\n return savedMapLayer;\r\n }\r\n\r\n /** Get all MapLayerSources from the user's preferences, iTwin setting and iModel settings.\r\n * @param iTwinId id of the iTwin\r\n * @param iModelId id of the iModel\r\n * @throws if any of the calls to grab settings fail.\r\n */\r\n public static async getSources(iTwinId: GuidString, iModelId?: GuidString): Promise<MapLayerSource[]> {\r\n if (!MapLayersUI.iTwinConfig)\r\n return [];\r\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\r\n\r\n const mapLayerList = [];\r\n\r\n try {\r\n const userResultByProject = await MapLayersUI.iTwinConfig.get({\r\n accessToken,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: \"\",\r\n iTwinId,\r\n });\r\n if (undefined !== userResultByProject)\r\n mapLayerList.push(userResultByProject);\r\n } catch (err: any) {\r\n throw new Error(IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.ErrorRetrieveUserProject\", { errorMessage: err }));\r\n }\r\n\r\n try {\r\n const userResultByIModel = await MapLayersUI.iTwinConfig.get({\r\n accessToken,\r\n namespace: MapLayerPreferences._preferenceNamespace,\r\n key: \"\",\r\n iTwinId,\r\n iModelId,\r\n });\r\n if (undefined !== userResultByIModel)\r\n mapLayerList.push(userResultByIModel);\r\n } catch (err: any) {\r\n throw new Error(IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.ErrorRetrieveUserProject\", { errorMessage: err }));\r\n }\r\n\r\n const savedMapLayerSources: MapLayerSource[] = [];\r\n for (const mapLayer of mapLayerList) {\r\n mapLayer.forEach((savedLayer: any) => {\r\n const mapLayerSource = MapLayerSource.fromJSON(savedLayer as MapLayerPreferencesContent);\r\n if (mapLayerSource)\r\n savedMapLayerSources.push(mapLayerSource);\r\n });\r\n }\r\n return savedMapLayerSources;\r\n }\r\n\r\n private static get _preferenceNamespace() {\r\n return \"MapLayerSource-SettingsService\";\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"MapLayerPreferences.js","sourceRoot":"","sources":["../../src/MapLayerPreferences.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC9G,OAAO,EAAE,OAAO,EAAc,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAU1C,gBAAgB;AAChB,MAAM,CAAN,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,yEAAS,CAAA;IACT,6EAAW,CAAA;IACX,+EAAY,CAAA;AACd,CAAC,EAJW,wBAAwB,KAAxB,wBAAwB,QAInC;AASD;;;;;GAKG;AACH,MAAM,OAAO,mBAAmB;IAU9B;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,MAAsB,EAAE,OAAmB,EAAE,QAAqB,EAAE,aAAuB;QACzH,IAAI,CAAC,WAAW,CAAC,WAAW;YAC1B,OAAO,KAAK,CAAC;QACf,MAAM,WAAW,GAAG,SAAS,KAAK,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,MAAM,SAAS,CAAC,mBAAmB,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAErI,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QACnC,MAAM,eAAe,GAA+B;YAClD,GAAG,EAAE,UAAU,CAAC,GAAG;YACnB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,qBAAqB,EAAE,UAAU,CAAC,qBAAqB;SACxD,CAAC;QAEF,MAAM,MAAM,GAAY,MAAM,mBAAmB,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,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,cAAc,GAAG,cAAc,CAAC,QAAQ,CAAC,UAAwC,CAAC,CAAC;gBACzF,IAAI,cAAc;oBAChB,oBAAoB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;SACJ;QACD,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IAEO,MAAM,KAAK,oBAAoB;QACrC,OAAO,gCAAgC,CAAC;IAC1C,CAAC;;AAhTD;;;;;;GAMG;AACoB,wCAAoB,GAAG,IAAI,OAAO,EAA0G,CAAC,CAAC,mFAAmF","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 { IModelApp, MapLayerSource, NotifyMessageDetails, OutputMessagePriority } from \"@itwin/core-frontend\";\nimport { BeEvent, GuidString } from \"@itwin/core-bentley\";\nimport { MapLayersUI } from \"./mapLayers\";\n\n/** @internal */\nexport interface MapLayerPreferencesContent {\n url: string;\n name: string;\n formatId: string;\n transparentBackground: boolean | undefined;\n}\n\n/** @internal */\nexport enum MapLayerSourceChangeType {\n Added = 0,\n Removed = 1,\n Replaced = 2,\n}\n\n/** @internal */\nexport interface MapLayerSourceArg {\n readonly source: MapLayerSource;\n readonly iTwinId: GuidString;\n readonly iModelId: GuidString;\n}\n\n/** A wrapper around user preferences to provide a way to store [[MapLayerSettings]].\n *\n * Note: This is currently internal only and used directly by the MapLayersExtension. It makes use of the IModelApp.authorizationClient if it exists.\n *\n * @internal\n */\nexport class MapLayerPreferences {\n /** Event raised whenever a source is added, replaced or removed:\n * changeType : Type of changed occurred.\n * oldSource : Source that was removed or replaced.\n * newSource : Source that was added or replacement of oldSource.\n *\n * @see [[MapLayerSourceChangeType]]\n */\n public static readonly onLayerSourceChanged = new BeEvent<(changeType: MapLayerSourceChangeType, oldSource?: MapLayerSource, newSource?: MapLayerSource) => void>(); // Used to notify the frontend that it needs to update its list of available layers\n\n /** Store the Map Layer source preference. If the same setting exists at a higher level, an error will be thrown and the setting will not be updated.\n *\n * Returns false if the settings object would override some other settings object in a larger scope i.e. storing settings on model when\n * a project setting exists with same name or map layer url.\n * @param source source to be stored on the setting service\n * @param storeOnIModel if true store the settings object on the model, if false store it on the project\n */\n public static async storeSource(source: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString, storeOnIModel?: boolean): Promise<boolean> {\n if (!MapLayersUI.iTwinConfig)\n return false;\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\n\n const sourceJSON = source.toJSON();\n const mapLayerSetting: MapLayerPreferencesContent = {\n url: sourceJSON.url,\n name: sourceJSON.name,\n formatId: sourceJSON.formatId,\n transparentBackground: sourceJSON.transparentBackground,\n };\n\n const result: boolean = await MapLayerPreferences.delete(sourceJSON.url, sourceJSON.name, iTwinId, iModelId, storeOnIModel);\n if (result) {\n await MapLayersUI.iTwinConfig.save({\n accessToken,\n content: mapLayerSetting,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: sourceJSON.name,\n iTwinId,\n iModelId: storeOnIModel ? iModelId : undefined,\n });\n MapLayerPreferences.onLayerSourceChanged.raiseEvent(MapLayerSourceChangeType.Added, undefined, MapLayerSource.fromJSON(mapLayerSetting));\n return true;\n } else {\n return false;\n }\n }\n\n /** Replace the old map layer source with a new map layer source.\n *\n * The source is replaced at the same level that the original source is defined. (i.e. if the old source is defined at a project level, the new source will also be defined there.)\n *\n * @param oldSource\n * @param newSource\n * @param iTwinId\n * @param iModelId\n */\n public static async replaceSource(oldSource: MapLayerSource, newSource: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString): Promise<void> {\n if (!MapLayersUI.iTwinConfig)\n return;\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\n\n let storeOnIModel = false;\n try {\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: oldSource.name,\n iTwinId,\n iModelId,\n });\n } catch (_err) {\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: oldSource.name,\n iTwinId,\n });\n storeOnIModel = true;\n }\n\n const mapLayerSetting: MapLayerPreferencesContent = {\n url: newSource.url,\n name: newSource.name,\n formatId: newSource.formatId,\n transparentBackground: newSource.transparentBackground,\n };\n\n await MapLayersUI.iTwinConfig.save({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: `${MapLayerPreferences._preferenceNamespace}.${newSource.name}`,\n iTwinId,\n iModelId: storeOnIModel ? iModelId : undefined,\n content: mapLayerSetting,\n });\n\n MapLayerPreferences.onLayerSourceChanged.raiseEvent(MapLayerSourceChangeType.Replaced, oldSource, newSource);\n }\n\n /** Deletes the provided MapLayerSource by name from both the iTwin or iModel level.\n *\n * @param source The source to delete. The name is used to identify the source.\n * @param iTwinId\n * @param iModelId\n */\n public static async deleteByName(source: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString): Promise<void> {\n if (!MapLayersUI.iTwinConfig)\n return;\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\n\n try {\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: source.name,\n iTwinId,\n iModelId,\n });\n } catch (_err) {\n // failed to store based on iModelId, attempt using iTwinId\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: source.name,\n iTwinId,\n });\n }\n\n MapLayerPreferences.onLayerSourceChanged.raiseEvent(MapLayerSourceChangeType.Removed, source, undefined);\n }\n\n /** Deletes the current setting with the provided key if it is defined at the same preference level.\n *\n * If the preference is defined within a different level, false will be returned indicating the setting should not be overriden.\n *\n * The two potential preference levels are iTwin and iModel.\n *\n * @param url\n * @param name\n * @param iTwinId\n * @param iModelId\n * @param storeOnIModel\n */\n private static async delete(url: string, name: string, iTwinId: GuidString, iModelId?: GuidString, storeOnIModel?: boolean): Promise<boolean> {\n if (!MapLayersUI.iTwinConfig)\n return true;\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\n\n const iTwinPreferenceByName = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: name,\n iTwinId,\n });\n\n if (undefined !== iTwinPreferenceByName && storeOnIModel) {\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerExistsAsProjectSetting\", { layer: iTwinPreferenceByName.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\n return false;\n } else if (iTwinPreferenceByName) {\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerExistsOverwriting\", { layer: iTwinPreferenceByName.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: iTwinPreferenceByName.name,\n iTwinId,\n });\n }\n\n // check if setting with url already exists, if it does, delete it\n const settingFromUrl = await MapLayerPreferences.getByUrl(url, iTwinId, undefined);\n if (settingFromUrl && storeOnIModel) {\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerWithUrlExistsAsProjectSetting\", { url: settingFromUrl.url, name: settingFromUrl.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\n return false;\n } else if (settingFromUrl) {\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerWithUrlExistsOverwriting\", { url: settingFromUrl.url, oldName: settingFromUrl.name, newName: name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: settingFromUrl.name,\n iTwinId,\n });\n }\n\n if (iModelId) { // delete any settings on model so user can update them if theres collisions\n const settingOnIModelFromName = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: name,\n iTwinId,\n iModelId,\n });\n const settingFromUrlOnIModel = await MapLayerPreferences.getByUrl(url, iTwinId, iModelId);\n if (settingOnIModelFromName) {\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerExistsOverwriting\", { layer: settingOnIModelFromName.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: settingOnIModelFromName.name,\n iTwinId,\n iModelId,\n });\n }\n if (settingFromUrlOnIModel) {\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerWithUrlExistsOverwriting\", { url: settingFromUrlOnIModel.url, oldName: settingFromUrlOnIModel.name, newName: name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: settingFromUrlOnIModel.name,\n iTwinId,\n iModelId,\n });\n }\n }\n return true;\n }\n\n /** Attempts to get a map layer based off a specific url.\n * @param url\n * @param iTwinId\n * @param iModelId\n */\n public static async getByUrl(url: string, iTwinId: string, iModelId?: string): Promise<MapLayerPreferencesContent | undefined> {\n if (!MapLayersUI.iTwinConfig)\n return undefined;\n\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\n\n const settingResponse = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: \"\",\n iTwinId,\n iModelId,\n });\n\n if (undefined === settingResponse || 0 === settingResponse.length)\n return undefined;\n\n let savedMapLayer;\n settingResponse.settingsMap?.forEach((savedLayer: any) => {\n if (savedLayer.url === url) {\n savedMapLayer = savedLayer;\n }\n });\n return savedMapLayer;\n }\n\n /** Get all MapLayerSources from the user's preferences, iTwin setting and iModel settings.\n * @param iTwinId id of the iTwin\n * @param iModelId id of the iModel\n * @throws if any of the calls to grab settings fail.\n */\n public static async getSources(iTwinId: GuidString, iModelId?: GuidString): Promise<MapLayerSource[]> {\n if (!MapLayersUI.iTwinConfig)\n return [];\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\n\n const mapLayerList = [];\n\n try {\n const userResultByProject = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: \"\",\n iTwinId,\n });\n if (undefined !== userResultByProject)\n mapLayerList.push(userResultByProject);\n } catch (err: any) {\n throw new Error(IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.ErrorRetrieveUserProject\", { errorMessage: err }));\n }\n\n try {\n const userResultByIModel = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: \"\",\n iTwinId,\n iModelId,\n });\n if (undefined !== userResultByIModel)\n mapLayerList.push(userResultByIModel);\n } catch (err: any) {\n throw new Error(IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.ErrorRetrieveUserProject\", { errorMessage: err }));\n }\n\n const savedMapLayerSources: MapLayerSource[] = [];\n for (const mapLayer of mapLayerList) {\n mapLayer.forEach((savedLayer: any) => {\n const mapLayerSource = MapLayerSource.fromJSON(savedLayer as MapLayerPreferencesContent);\n if (mapLayerSource)\n savedMapLayerSources.push(mapLayerSource);\n });\n }\n return savedMapLayerSources;\n }\n\n private static get _preferenceNamespace() {\n return \"MapLayerSource-SettingsService\";\n }\n}\n"]}
|
package/lib/esm/map-layers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from "./mapLayers";
|
|
2
|
-
export * from "./ui/Interfaces";
|
|
3
|
-
export * from "./ui/MapLayersUiItemsProvider";
|
|
4
|
-
export * from "./ui/FeatureInfoUiItemsProvider";
|
|
5
|
-
export * from "./ui/MapFeatureInfoTool";
|
|
6
|
-
export * from "./ui/widget/MapLayersWidget";
|
|
1
|
+
export * from "./mapLayers";
|
|
2
|
+
export * from "./ui/Interfaces";
|
|
3
|
+
export * from "./ui/MapLayersUiItemsProvider";
|
|
4
|
+
export * from "./ui/FeatureInfoUiItemsProvider";
|
|
5
|
+
export * from "./ui/MapFeatureInfoTool";
|
|
6
|
+
export * from "./ui/widget/MapLayersWidget";
|
|
7
7
|
//# sourceMappingURL=map-layers.d.ts.map
|
package/lib/esm/map-layers.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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
|
-
export * from "./mapLayers";
|
|
6
|
-
export * from "./ui/Interfaces";
|
|
7
|
-
export * from "./ui/MapLayersUiItemsProvider";
|
|
8
|
-
export * from "./ui/FeatureInfoUiItemsProvider";
|
|
9
|
-
export * from "./ui/MapFeatureInfoTool";
|
|
10
|
-
export * from "./ui/widget/MapLayersWidget";
|
|
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
|
+
export * from "./mapLayers";
|
|
6
|
+
export * from "./ui/Interfaces";
|
|
7
|
+
export * from "./ui/MapLayersUiItemsProvider";
|
|
8
|
+
export * from "./ui/FeatureInfoUiItemsProvider";
|
|
9
|
+
export * from "./ui/MapFeatureInfoTool";
|
|
10
|
+
export * from "./ui/widget/MapLayersWidget";
|
|
11
11
|
//# sourceMappingURL=map-layers.js.map
|
package/lib/esm/mapLayers.d.ts
CHANGED
|
@@ -1,45 +1,27 @@
|
|
|
1
|
-
import { Localization } from "@itwin/core-common";
|
|
2
|
-
import { UserPreferencesAccess } from "@itwin/core-frontend";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
private static _uiItemsProvidersId;
|
|
28
|
-
private static _iTwinConfig?;
|
|
29
|
-
private static _featureInfoOpts?;
|
|
30
|
-
private static _mapLayerOptions?;
|
|
31
|
-
static get iTwinConfig(): UserPreferencesAccess | undefined;
|
|
32
|
-
/** Used to initialize the Map Layers */
|
|
33
|
-
static initialize(config?: MapLayersConfig): Promise<void>;
|
|
34
|
-
/** Registers the UiItemsProviders for MapLayers with optional overrides
|
|
35
|
-
* This is useful for an app that wants to defer UiItemsProvider registration so that it
|
|
36
|
-
* may limit the MapLayers widgets to a specific workflow
|
|
37
|
-
* @beta
|
|
38
|
-
*/
|
|
39
|
-
static registerUiItemsProviders(config?: MapLayersUiProviderConfig): void;
|
|
40
|
-
/** Unregisters internationalization service namespace and UiItemManager */
|
|
41
|
-
static terminate(): void;
|
|
42
|
-
/** The internationalization service namespace. */
|
|
43
|
-
static get localizationNamespace(): string;
|
|
44
|
-
}
|
|
1
|
+
import { Localization } from "@itwin/core-common";
|
|
2
|
+
import { UserPreferencesAccess } from "@itwin/core-frontend";
|
|
3
|
+
export interface MapLayersConfig {
|
|
4
|
+
localization?: Localization;
|
|
5
|
+
/** If an iTwinConfig is provided, it will be used to load the MapLayerSources that are stored. */
|
|
6
|
+
iTwinConfig?: UserPreferencesAccess;
|
|
7
|
+
}
|
|
8
|
+
/** MapLayersUI is use when the package is used as a dependency to another app.
|
|
9
|
+
* '''ts
|
|
10
|
+
* await MapLayersUI.initialize({...MapLayersInitProps});
|
|
11
|
+
* '''
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
export declare class MapLayersUI {
|
|
15
|
+
private static _defaultNs;
|
|
16
|
+
static localization: Localization;
|
|
17
|
+
private static _uiItemsProvidersId;
|
|
18
|
+
private static _iTwinConfig?;
|
|
19
|
+
static get iTwinConfig(): UserPreferencesAccess | undefined;
|
|
20
|
+
/** Used to initialize the Map Layers */
|
|
21
|
+
static initialize(config?: MapLayersConfig): Promise<void>;
|
|
22
|
+
/** Unregisters internationalization service namespace and UiItemManager */
|
|
23
|
+
static terminate(): void;
|
|
24
|
+
/** The internationalization service namespace. */
|
|
25
|
+
static get localizationNamespace(): string;
|
|
26
|
+
}
|
|
45
27
|
//# sourceMappingURL=mapLayers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapLayers.d.ts","sourceRoot":"","sources":["../../src/mapLayers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAa,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"mapLayers.d.ts","sourceRoot":"","sources":["../../src/mapLayers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAa,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAIxE,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,kGAAkG;IAClG,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC;AAED;;;;;GAKG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAC,UAAU,CAAe;IACxC,OAAc,YAAY,EAAE,YAAY,CAAC;IACzC,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAgB;IAClD,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAwB;IAEpD,WAAkB,WAAW,IAAI,qBAAqB,GAAG,SAAS,CAEjE;IAED,wCAAwC;WACpB,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAUvE,4EAA4E;WAC9D,SAAS;IAIvB,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;CACF"}
|
package/lib/esm/mapLayers.js
CHANGED
|
@@ -1,58 +1,30 @@
|
|
|
1
|
-
import { IModelApp } from "@itwin/core-frontend";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
MapLayersUI.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*/
|
|
31
|
-
static registerUiItemsProviders(config) {
|
|
32
|
-
const mlProvider = new MapLayersUiItemsProvider({ ...MapLayersUI._mapLayerOptions });
|
|
33
|
-
const mlProviderId = config?.mapLayerProviderOverrides?.providerId ?? mlProvider.id;
|
|
34
|
-
MapLayersUI._uiItemsProvidersId.push(mlProviderId);
|
|
35
|
-
UiItemsManager.register(mlProvider, config?.mapLayerProviderOverrides); // eslint-disable-line deprecation/deprecation
|
|
36
|
-
// Register the FeatureInfo widget only if MapHit was provided.
|
|
37
|
-
if (MapLayersUI._featureInfoOpts?.onMapHit) {
|
|
38
|
-
const fiProvider = new FeatureInfoUiItemsProvider({ ...MapLayersUI._featureInfoOpts });
|
|
39
|
-
const fiProviderId = config?.featureInfoProviderOverrides?.providerId ?? fiProvider.id;
|
|
40
|
-
MapLayersUI._uiItemsProvidersId.push(fiProviderId);
|
|
41
|
-
UiItemsManager.register(fiProvider, config?.featureInfoProviderOverrides); // eslint-disable-line deprecation/deprecation
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/** Unregisters internationalization service namespace and UiItemManager */
|
|
45
|
-
static terminate() {
|
|
46
|
-
IModelApp.localization.unregisterNamespace(MapLayersUI.localizationNamespace);
|
|
47
|
-
MapLayersUI._uiItemsProvidersId.forEach((uiProviderId) => {
|
|
48
|
-
UiItemsManager.unregister(uiProviderId); // eslint-disable-line deprecation/deprecation
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
/** The internationalization service namespace. */
|
|
52
|
-
static get localizationNamespace() {
|
|
53
|
-
return MapLayersUI._defaultNs;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
MapLayersUI._defaultNs = "mapLayers";
|
|
57
|
-
MapLayersUI._uiItemsProvidersId = [];
|
|
1
|
+
import { IModelApp } from "@itwin/core-frontend";
|
|
2
|
+
/** MapLayersUI is use when the package is used as a dependency to another app.
|
|
3
|
+
* '''ts
|
|
4
|
+
* await MapLayersUI.initialize({...MapLayersInitProps});
|
|
5
|
+
* '''
|
|
6
|
+
* @beta
|
|
7
|
+
*/
|
|
8
|
+
export class MapLayersUI {
|
|
9
|
+
static get iTwinConfig() {
|
|
10
|
+
return this._iTwinConfig;
|
|
11
|
+
}
|
|
12
|
+
/** Used to initialize the Map Layers */
|
|
13
|
+
static async initialize(config) {
|
|
14
|
+
// register namespace containing localized strings for this package
|
|
15
|
+
MapLayersUI.localization = config?.localization ?? IModelApp.localization;
|
|
16
|
+
await MapLayersUI.localization.registerNamespace(MapLayersUI.localizationNamespace);
|
|
17
|
+
MapLayersUI._iTwinConfig = config?.iTwinConfig;
|
|
18
|
+
}
|
|
19
|
+
/** Unregisters internationalization service namespace and UiItemManager */
|
|
20
|
+
static terminate() {
|
|
21
|
+
IModelApp.localization.unregisterNamespace(MapLayersUI.localizationNamespace);
|
|
22
|
+
}
|
|
23
|
+
/** The internationalization service namespace. */
|
|
24
|
+
static get localizationNamespace() {
|
|
25
|
+
return MapLayersUI._defaultNs;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
MapLayersUI._defaultNs = "mapLayers";
|
|
29
|
+
MapLayersUI._uiItemsProvidersId = [];
|
|
58
30
|
//# sourceMappingURL=mapLayers.js.map
|
package/lib/esm/mapLayers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapLayers.js","sourceRoot":"","sources":["../../src/mapLayers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAyB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"mapLayers.js","sourceRoot":"","sources":["../../src/mapLayers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAyB,MAAM,sBAAsB,CAAC;AAUxE;;;;;GAKG;AACH,MAAM,OAAO,WAAW;IAMf,MAAM,KAAK,WAAW;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,wCAAwC;IACjC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAwB;QACrD,mEAAmE;QACnE,WAAW,CAAC,YAAY,GAAG,MAAM,EAAE,YAAY,IAAI,SAAS,CAAC,YAAY,CAAC;QAC1E,MAAM,WAAW,CAAC,YAAY,CAAC,iBAAiB,CAC9C,WAAW,CAAC,qBAAqB,CAClC,CAAC;QAEF,WAAW,CAAC,YAAY,GAAG,MAAM,EAAE,WAAW,CAAC;IACjD,CAAC;IAED,4EAA4E;IACrE,MAAM,CAAC,SAAS;QACrB,SAAS,CAAC,YAAY,CAAC,mBAAmB,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAChF,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,WAAW,CAAC,UAAU,CAAC;IAChC,CAAC;;AA5Bc,sBAAU,GAAG,WAAW,CAAC;AAEzB,+BAAmB,GAAa,EAAE,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 { Localization } from \"@itwin/core-common\";\nimport { IModelApp, UserPreferencesAccess } from \"@itwin/core-frontend\";\n// import { MapLayersUiItemsProvider } from \"./ui/MapLayersUiItemsProvider\";\n// import { FeatureInfoUiItemsProvider } from \"./ui/FeatureInfoUiItemsProvider\";\n\nexport interface MapLayersConfig {\n localization?: Localization;\n /** If an iTwinConfig is provided, it will be used to load the MapLayerSources that are stored. */\n iTwinConfig?: UserPreferencesAccess;\n}\n\n/** MapLayersUI is use when the package is used as a dependency to another app.\n * '''ts\n * await MapLayersUI.initialize({...MapLayersInitProps});\n * '''\n * @beta\n */\nexport class MapLayersUI {\n private static _defaultNs = \"mapLayers\";\n public static localization: Localization;\n private static _uiItemsProvidersId: string[] = [];\n private static _iTwinConfig?: UserPreferencesAccess;\n\n public static get iTwinConfig(): UserPreferencesAccess | undefined {\n return this._iTwinConfig;\n }\n\n /** Used to initialize the Map Layers */\n public static async initialize(config?: MapLayersConfig): Promise<void> {\n // register namespace containing localized strings for this package\n MapLayersUI.localization = config?.localization ?? IModelApp.localization;\n await MapLayersUI.localization.registerNamespace(\n MapLayersUI.localizationNamespace\n );\n\n MapLayersUI._iTwinConfig = config?.iTwinConfig;\n }\n\n /** Unregisters internationalization service namespace and UiItemManager */\n public static terminate() {\n IModelApp.localization.unregisterNamespace(MapLayersUI.localizationNamespace);\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return MapLayersUI._defaultNs;\n }\n}\n"]}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MapFeatureInfoOptions } from "./Interfaces";
|
|
3
|
-
export declare class FeatureInfoUiItemsProvider implements UiItemsProvider {
|
|
4
|
-
private _featureInfoOpts;
|
|
5
|
-
readonly id = "FeatureInfoUiItemsProvider";
|
|
6
|
-
static readonly widgetId = "map-layers:mapFeatureInfoWidget";
|
|
7
|
-
constructor(_featureInfoOpts: MapFeatureInfoOptions);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { StagePanelLocation, StagePanelSection, ToolbarItem, ToolbarOrientation, ToolbarUsage, UiItemsProvider, WidgetState } from "@itwin/appui-react";
|
|
2
|
+
import { MapFeatureInfoOptions } from "./Interfaces";
|
|
3
|
+
export declare class FeatureInfoUiItemsProvider implements UiItemsProvider {
|
|
4
|
+
private _featureInfoOpts;
|
|
5
|
+
readonly id = "FeatureInfoUiItemsProvider";
|
|
6
|
+
static readonly widgetId = "map-layers:mapFeatureInfoWidget";
|
|
7
|
+
constructor(_featureInfoOpts: MapFeatureInfoOptions);
|
|
8
|
+
provideToolbarItems(_stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation): ReadonlyArray<ToolbarItem>;
|
|
9
|
+
provideWidgets(_stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection): {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
icon: string;
|
|
13
|
+
content: JSX.Element;
|
|
14
|
+
defaultState: WidgetState;
|
|
15
|
+
}[];
|
|
16
|
+
}
|
|
12
17
|
//# sourceMappingURL=FeatureInfoUiItemsProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureInfoUiItemsProvider.d.ts","sourceRoot":"","sources":["../../../src/ui/FeatureInfoUiItemsProvider.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"FeatureInfoUiItemsProvider.d.ts","sourceRoot":"","sources":["../../../src/ui/FeatureInfoUiItemsProvider.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAA6B,WAAW,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEnL,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAIrD,qBAAa,0BAA2B,YAAW,eAAe;IAI7C,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;IAgBtB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,iBAAiB;;;;;;;CAgBtH"}
|
|
@@ -1,48 +1,43 @@
|
|
|
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 {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
this.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
return widgets;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
FeatureInfoUiItemsProvider.widgetId = "map-layers:mapFeatureInfoWidget";
|
|
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, ToolbarHelper, ToolbarOrientation, ToolbarUsage, WidgetState } from "@itwin/appui-react";
|
|
7
|
+
import { MapFeatureInfoWidget } from "./widget/FeatureInfoWidget";
|
|
8
|
+
import { MapLayersUI } from "../mapLayers";
|
|
9
|
+
import { DefaultMapFeatureInfoTool, getDefaultMapFeatureInfoToolItemDef } from "./MapFeatureInfoTool";
|
|
10
|
+
export class FeatureInfoUiItemsProvider {
|
|
11
|
+
constructor(_featureInfoOpts) {
|
|
12
|
+
this._featureInfoOpts = _featureInfoOpts;
|
|
13
|
+
this.id = "FeatureInfoUiItemsProvider";
|
|
14
|
+
}
|
|
15
|
+
provideToolbarItems(_stageId, stageUsage, toolbarUsage, toolbarOrientation) {
|
|
16
|
+
if (!this._featureInfoOpts?.disableDefaultFeatureInfoTool &&
|
|
17
|
+
stageUsage === StageUsage.General &&
|
|
18
|
+
toolbarUsage === ToolbarUsage.ContentManipulation &&
|
|
19
|
+
toolbarOrientation === ToolbarOrientation.Vertical) {
|
|
20
|
+
DefaultMapFeatureInfoTool.register(MapLayersUI.localizationNamespace);
|
|
21
|
+
return [
|
|
22
|
+
ToolbarHelper.createToolbarItemFromItemDef(60, getDefaultMapFeatureInfoToolItemDef()),
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
provideWidgets(_stageId, stageUsage, location, section) {
|
|
28
|
+
const widgets = [];
|
|
29
|
+
const tmpSection = section ?? StagePanelSection.End;
|
|
30
|
+
if (tmpSection === StagePanelSection.End && stageUsage === StageUsage.General && location === StagePanelLocation.Right) {
|
|
31
|
+
widgets.push({
|
|
32
|
+
id: FeatureInfoUiItemsProvider.widgetId,
|
|
33
|
+
label: MapLayersUI.localization.getLocalizedString("mapLayers:FeatureInfoWidget.Label"),
|
|
34
|
+
icon: "icon-map",
|
|
35
|
+
content: React.createElement(MapFeatureInfoWidget, { featureInfoOpts: this._featureInfoOpts }),
|
|
36
|
+
defaultState: WidgetState.Closed,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return widgets;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
FeatureInfoUiItemsProvider.widgetId = "map-layers:mapFeatureInfoWidget";
|
|
48
43
|
//# sourceMappingURL=FeatureInfoUiItemsProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureInfoUiItemsProvider.js","sourceRoot":"","sources":["../../../src/ui/FeatureInfoUiItemsProvider.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,
|
|
1
|
+
{"version":3,"file":"FeatureInfoUiItemsProvider.js","sourceRoot":"","sources":["../../../src/ui/FeatureInfoUiItemsProvider.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,aAAa,EAAe,kBAAkB,EAAE,YAAY,EAAmB,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACnL,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CA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AC,CAAC;SACJ;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;;AAxCsB,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 * as React from \"react\";\nimport { StagePanelLocation, StagePanelSection, StageUsage, ToolbarHelper, ToolbarItem, ToolbarOrientation, ToolbarUsage, UiItemsProvider, WidgetState } from \"@itwin/appui-react\";\nimport { MapFeatureInfoWidget } from \"./widget/FeatureInfoWidget\";\nimport { MapFeatureInfoOptions } from \"./Interfaces\";\nimport { MapLayersUI } from \"../mapLayers\";\nimport { DefaultMapFeatureInfoTool, getDefaultMapFeatureInfoToolItemDef } from \"./MapFeatureInfoTool\";\n\nexport class FeatureInfoUiItemsProvider implements UiItemsProvider { // 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 DefaultMapFeatureInfoTool.register(MapLayersUI.localizationNamespace);\n return [\n ToolbarHelper.createToolbarItemFromItemDef(60, getDefaultMapFeatureInfoToolItemDef()),\n ];\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: \"icon-map\",\n content: <MapFeatureInfoWidget featureInfoOpts={this._featureInfoOpts} />,\n defaultState: WidgetState.Closed,\n });\n }\n\n return widgets;\n }\n}\n"]}
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { BeEvent } from "@itwin/core-bentley";
|
|
2
|
-
import { MapSubLayerProps } from "@itwin/core-common";
|
|
3
|
-
import { HitDetail, MapLayerImageryProvider, MapTileTreeScaleRangeVisibility } from "@itwin/core-frontend";
|
|
4
|
-
export interface StyleMapLayerSettings {
|
|
5
|
-
/** Name */
|
|
6
|
-
name: string;
|
|
7
|
-
/** source (i.URL for ImageMapLayerSettings or modelId for ModelMapLayerSettings) */
|
|
8
|
-
source: string;
|
|
9
|
-
/** Controls visibility of layer */
|
|
10
|
-
visible: boolean;
|
|
11
|
-
treeVisibility: MapTileTreeScaleRangeVisibility;
|
|
12
|
-
/** 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. */
|
|
13
|
-
transparency: number;
|
|
14
|
-
/** Transparent background */
|
|
15
|
-
transparentBackground: boolean;
|
|
16
|
-
/** set map as underlay or overlay */
|
|
17
|
-
isOverlay: boolean;
|
|
18
|
-
/** layer index in the viewport */
|
|
19
|
-
layerIndex: number;
|
|
20
|
-
/** Available map sub-layer */
|
|
21
|
-
subLayers?: MapSubLayerProps[];
|
|
22
|
-
/** sub-layer panel displayed. */
|
|
23
|
-
showSubLayers: boolean;
|
|
24
|
-
/** Some format can publish only a single layer at a time (i.e WMTS) */
|
|
25
|
-
provider?: MapLayerImageryProvider;
|
|
26
|
-
}
|
|
27
|
-
export interface MapTypesOptions {
|
|
28
|
-
readonly supportTileUrl: boolean;
|
|
29
|
-
readonly supportWmsAuthentication: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface MapLayerOptions {
|
|
32
|
-
hideExternalMapLayers?: boolean;
|
|
33
|
-
fetchPublicMapLayerSources?: boolean;
|
|
34
|
-
mapTypeOptions?: MapTypesOptions;
|
|
35
|
-
}
|
|
36
|
-
export interface MapFeatureInfoPropertyGridOptions {
|
|
37
|
-
isPropertySelectionEnabled?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export declare type MapHitEvent = BeEvent<(hit: HitDetail) => void>;
|
|
40
|
-
export interface MapFeatureInfoOptions {
|
|
41
|
-
/**
|
|
42
|
-
* HitDetail Event whenever the map is clicked.
|
|
43
|
-
* Typically the HitDetail object is provided by ElementLocateManager.doLocate.
|
|
44
|
-
* Every time this event is raised, FeatureInfoWidget will attempt to retrieve data from MapLayerImageryProviders.
|
|
45
|
-
*/
|
|
46
|
-
onMapHit: MapHitEvent;
|
|
47
|
-
disableDefaultFeatureInfoTool?: boolean;
|
|
48
|
-
showLoadProgressAnimation?: boolean;
|
|
49
|
-
propertyGridOptions?: MapFeatureInfoPropertyGridOptions;
|
|
50
|
-
}
|
|
1
|
+
import { BeEvent } from "@itwin/core-bentley";
|
|
2
|
+
import { MapSubLayerProps } from "@itwin/core-common";
|
|
3
|
+
import { HitDetail, MapLayerImageryProvider, MapTileTreeScaleRangeVisibility } from "@itwin/core-frontend";
|
|
4
|
+
export interface StyleMapLayerSettings {
|
|
5
|
+
/** Name */
|
|
6
|
+
name: string;
|
|
7
|
+
/** source (i.URL for ImageMapLayerSettings or modelId for ModelMapLayerSettings) */
|
|
8
|
+
source: string;
|
|
9
|
+
/** Controls visibility of layer */
|
|
10
|
+
visible: boolean;
|
|
11
|
+
treeVisibility: MapTileTreeScaleRangeVisibility;
|
|
12
|
+
/** 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. */
|
|
13
|
+
transparency: number;
|
|
14
|
+
/** Transparent background */
|
|
15
|
+
transparentBackground: boolean;
|
|
16
|
+
/** set map as underlay or overlay */
|
|
17
|
+
isOverlay: boolean;
|
|
18
|
+
/** layer index in the viewport */
|
|
19
|
+
layerIndex: number;
|
|
20
|
+
/** Available map sub-layer */
|
|
21
|
+
subLayers?: MapSubLayerProps[];
|
|
22
|
+
/** sub-layer panel displayed. */
|
|
23
|
+
showSubLayers: boolean;
|
|
24
|
+
/** Some format can publish only a single layer at a time (i.e WMTS) */
|
|
25
|
+
provider?: MapLayerImageryProvider;
|
|
26
|
+
}
|
|
27
|
+
export interface MapTypesOptions {
|
|
28
|
+
readonly supportTileUrl: boolean;
|
|
29
|
+
readonly supportWmsAuthentication: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface MapLayerOptions {
|
|
32
|
+
hideExternalMapLayers?: boolean;
|
|
33
|
+
fetchPublicMapLayerSources?: boolean;
|
|
34
|
+
mapTypeOptions?: MapTypesOptions;
|
|
35
|
+
}
|
|
36
|
+
export interface MapFeatureInfoPropertyGridOptions {
|
|
37
|
+
isPropertySelectionEnabled?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare type MapHitEvent = BeEvent<(hit: HitDetail) => void>;
|
|
40
|
+
export interface MapFeatureInfoOptions {
|
|
41
|
+
/**
|
|
42
|
+
* HitDetail Event whenever the map is clicked.
|
|
43
|
+
* Typically the HitDetail object is provided by ElementLocateManager.doLocate.
|
|
44
|
+
* Every time this event is raised, FeatureInfoWidget will attempt to retrieve data from MapLayerImageryProviders.
|
|
45
|
+
*/
|
|
46
|
+
onMapHit: MapHitEvent;
|
|
47
|
+
disableDefaultFeatureInfoTool?: boolean;
|
|
48
|
+
showLoadProgressAnimation?: boolean;
|
|
49
|
+
propertyGridOptions?: MapFeatureInfoPropertyGridOptions;
|
|
50
|
+
}
|
|
51
51
|
//# sourceMappingURL=Interfaces.d.ts.map
|