@itwin/saved-views-react 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/applySavedView.d.ts +1 -1
- package/lib/applySavedView.js +19 -0
- package/package.json +1 -1
package/lib/applySavedView.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface ApplySavedViewSettings {
|
|
|
51
51
|
categories?: ApplyVisibilitySettings | undefined;
|
|
52
52
|
/**
|
|
53
53
|
* How to handle the visibility of subcategories that exist in iModel.
|
|
54
|
-
* @default "
|
|
54
|
+
* @default "ignore"
|
|
55
55
|
*/
|
|
56
56
|
subcategories?: ShowStrategy | undefined;
|
|
57
57
|
/**
|
package/lib/applySavedView.js
CHANGED
|
@@ -102,6 +102,25 @@ async function applyViewStateProps(viewStateProps, iModel, viewport, savedViewDa
|
|
|
102
102
|
* ]);
|
|
103
103
|
*/
|
|
104
104
|
export async function applySavedView(iModel, viewport, savedViewData, settings = {}, overrides) {
|
|
105
|
+
// Apply default ApplyVisibilitySettings settings
|
|
106
|
+
settings = {
|
|
107
|
+
...settings,
|
|
108
|
+
viewState: settings.viewState ?? "apply",
|
|
109
|
+
camera: settings.camera ?? "apply",
|
|
110
|
+
emphasis: settings.emphasis ?? "apply",
|
|
111
|
+
perModelCategoryVisibility: settings.perModelCategoryVisibility ?? "apply",
|
|
112
|
+
models: {
|
|
113
|
+
enabled: settings.models?.enabled ?? "ignore",
|
|
114
|
+
disabled: settings.models?.disabled ?? "ignore",
|
|
115
|
+
other: settings.models?.other ?? "ignore",
|
|
116
|
+
},
|
|
117
|
+
categories: {
|
|
118
|
+
enabled: settings.categories?.enabled ?? "ignore",
|
|
119
|
+
disabled: settings.categories?.disabled ?? "ignore",
|
|
120
|
+
other: settings.categories?.other ?? "ignore",
|
|
121
|
+
},
|
|
122
|
+
subcategories: settings.subcategories ?? "ignore",
|
|
123
|
+
};
|
|
105
124
|
let viewStateProps = await createSeedViewStateProps(iModel, viewport, savedViewData, settings);
|
|
106
125
|
viewStateProps = applyCameraOptions(viewStateProps, iModel, viewport, savedViewData, settings);
|
|
107
126
|
await applyViewStateProps(viewStateProps, iModel, viewport, savedViewData, settings);
|