@itwin/core-common 3.1.0-dev.8 → 3.1.2
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 +114 -17
- package/lib/cjs/CloudStorage.d.ts.map +1 -1
- package/lib/cjs/CloudStorage.js +14 -20
- package/lib/cjs/CloudStorage.js.map +1 -1
- package/lib/cjs/Fonts.d.ts +16 -5
- package/lib/cjs/Fonts.d.ts.map +1 -1
- package/lib/cjs/Fonts.js +6 -2
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/MapImagerySettings.d.ts +2 -0
- package/lib/cjs/MapImagerySettings.d.ts.map +1 -1
- package/lib/cjs/MapImagerySettings.js.map +1 -1
- package/lib/cjs/MapLayerSettings.d.ts +120 -37
- package/lib/cjs/MapLayerSettings.d.ts.map +1 -1
- package/lib/cjs/MapLayerSettings.js +156 -86
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/SpatialClassification.d.ts +5 -0
- package/lib/cjs/SpatialClassification.d.ts.map +1 -1
- package/lib/cjs/SpatialClassification.js +7 -0
- package/lib/cjs/SpatialClassification.js.map +1 -1
- package/lib/cjs/geometry/TextString.d.ts +5 -4
- package/lib/cjs/geometry/TextString.d.ts.map +1 -1
- package/lib/cjs/geometry/TextString.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.d.ts +0 -1
- package/lib/cjs/ipc/IpcWebSocket.d.ts.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js +4 -13
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.d.ts +2 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.d.ts.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js +24 -15
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts +1 -0
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js +1 -0
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.d.ts +4 -2
- package/lib/cjs/rpc/IModelTileRpcInterface.d.ts.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js +4 -2
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js +1 -6
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.d.ts +2 -2
- package/lib/cjs/tile/IModelTileIO.js +2 -2
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/CloudStorage.d.ts.map +1 -1
- package/lib/esm/CloudStorage.js +14 -20
- package/lib/esm/CloudStorage.js.map +1 -1
- package/lib/esm/Fonts.d.ts +16 -5
- package/lib/esm/Fonts.d.ts.map +1 -1
- package/lib/esm/Fonts.js +6 -2
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/MapImagerySettings.d.ts +2 -0
- package/lib/esm/MapImagerySettings.d.ts.map +1 -1
- package/lib/esm/MapImagerySettings.js.map +1 -1
- package/lib/esm/MapLayerSettings.d.ts +120 -37
- package/lib/esm/MapLayerSettings.d.ts.map +1 -1
- package/lib/esm/MapLayerSettings.js +152 -84
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/SpatialClassification.d.ts +5 -0
- package/lib/esm/SpatialClassification.d.ts.map +1 -1
- package/lib/esm/SpatialClassification.js +7 -0
- package/lib/esm/SpatialClassification.js.map +1 -1
- package/lib/esm/geometry/TextString.d.ts +5 -4
- package/lib/esm/geometry/TextString.d.ts.map +1 -1
- package/lib/esm/geometry/TextString.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.d.ts +0 -1
- package/lib/esm/ipc/IpcWebSocket.d.ts.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js +4 -13
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.d.ts +2 -1
- package/lib/esm/ipc/IpcWebSocketTransport.d.ts.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js +24 -15
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts +1 -0
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js +1 -0
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.d.ts +4 -2
- package/lib/esm/rpc/IModelTileRpcInterface.d.ts.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js +4 -2
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js +1 -6
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.d.ts +2 -2
- package/lib/esm/tile/IModelTileIO.js +2 -2
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,103 @@
|
|
|
1
1
|
# Change Log - @itwin/core-common
|
|
2
2
|
|
|
3
|
-
This log was last generated on Wed,
|
|
3
|
+
This log was last generated on Wed, 06 Apr 2022 22:27:56 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 3.1.2
|
|
6
|
+
Wed, 06 Apr 2022 22:27:56 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 3.1.1
|
|
11
|
+
Thu, 31 Mar 2022 15:55:48 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 3.1.0
|
|
16
|
+
Tue, 29 Mar 2022 20:53:47 GMT
|
|
17
|
+
|
|
18
|
+
### Updates
|
|
19
|
+
|
|
20
|
+
- Add support for map layers using model geometry.
|
|
21
|
+
- Deprecate IModelReadRpcInterface.getViewThumbnail
|
|
22
|
+
- Deprecate RenderMaterial.Params in favor of CreateRenderMaterialArgs (core-frontend).
|
|
23
|
+
- Remove IModelDb.elementGeometryUpdate.
|
|
24
|
+
- ElementGeometryBuilderParams
|
|
25
|
+
- Web IPC fix (when reloading frontend).
|
|
26
|
+
|
|
27
|
+
## 3.0.3
|
|
28
|
+
Fri, 25 Mar 2022 15:10:02 GMT
|
|
29
|
+
|
|
30
|
+
_Version update only_
|
|
31
|
+
|
|
32
|
+
## 3.0.2
|
|
33
|
+
Thu, 10 Mar 2022 21:18:13 GMT
|
|
34
|
+
|
|
35
|
+
_Version update only_
|
|
36
|
+
|
|
37
|
+
## 3.0.1
|
|
38
|
+
Thu, 24 Feb 2022 15:26:55 GMT
|
|
39
|
+
|
|
40
|
+
### Updates
|
|
41
|
+
|
|
42
|
+
- Migrated from deprecated MapBox api.
|
|
43
|
+
|
|
44
|
+
## 3.0.0
|
|
45
|
+
Mon, 24 Jan 2022 14:00:52 GMT
|
|
46
|
+
|
|
47
|
+
### Updates
|
|
48
|
+
|
|
49
|
+
- Add support for producing larger tiles.
|
|
50
|
+
- The Cartographic creation API now takes an interface as an argument with named properties. This will avoid callers mixing up the order of longitude, latitude, and height.
|
|
51
|
+
- improve concurrent query changes
|
|
52
|
+
- Upgrade target to ES2019 and deliver both a CommonJs and ESModule version of package
|
|
53
|
+
- Added additional documentation for ecefLocation iniModel
|
|
54
|
+
- Add support for indexed edges in tile graphics.
|
|
55
|
+
- Added non-existent property to EntityProps to make the compiler discriminate between EntityProps and Entity.
|
|
56
|
+
- Add compare method to ThematicGradientSettings. Fix Gradient.Symb.compareSymb method to also compare thematicSettings.
|
|
57
|
+
- Clean up SkyBox and GroundPlane APIs.
|
|
58
|
+
- improve getMetaData() and provide extended error codes
|
|
59
|
+
- Added support to LightSettings for Fresnel effect.
|
|
60
|
+
- Add new GeoServices class and first method to interpret WKT or complete GCS JSON."
|
|
61
|
+
- GeoCoordStatus documentation added
|
|
62
|
+
- getAccessToken always returns a token
|
|
63
|
+
- Fix frustum translate method.
|
|
64
|
+
- Make ViewFlags immutable. Simplify ViewFlagOverrides.
|
|
65
|
+
- Added LOCAL_ELLIPSOID vertical datum identifier.
|
|
66
|
+
- Added ability to convert iModel coordinates to or from any Geographic CRS
|
|
67
|
+
- rename contextId -> iTwinId
|
|
68
|
+
- MapLayerSettings.fromJSON, BaseLayerSettings.fromJSON and MapSubLayerSettings.fromJSON no longer return undefined.
|
|
69
|
+
- Fix problem with RealityDataSourceKey string convertion
|
|
70
|
+
- Promote RealityDataSource and RealityDataSourceKey API to beta and update documentation
|
|
71
|
+
- Removed internal tag from EGFBAccessors
|
|
72
|
+
- Moved RealityDataAccessProps from core-frontend to core-common
|
|
73
|
+
- FeatureOverrides now merge by default in case of conflicts.
|
|
74
|
+
- rename to @itwin/core-common
|
|
75
|
+
- Fix an import which would cause consumers of core-common to fail during build
|
|
76
|
+
- move js-base64 from devDeps to deps
|
|
77
|
+
- Improve conformance with the glTF 2.0 spec when reading glb chunks.
|
|
78
|
+
- remove ClientRequestContext and its subclasses
|
|
79
|
+
- Added AuthorizationClient
|
|
80
|
+
- Add support for inverting planar clip mask (inside vs outside)
|
|
81
|
+
- Remove deprecated APIs for 3.0.
|
|
82
|
+
- Generalize the way to attach a reality data by adding a RealityDataSourceKey to ContextRealityModelProps
|
|
83
|
+
- Enhance RealityDataSource class
|
|
84
|
+
- Replace usage of I18N with generic Localization interface.
|
|
85
|
+
- GeometryContainmentRequestProps.clip and SnapRequestProps.viewFlags use stricter type than `any`.
|
|
86
|
+
- removed deprecated apis
|
|
87
|
+
- Move map imagery provider from BackgroundMapSettings to MapImagerySettings.backgroundBase.
|
|
88
|
+
- remove IModelWriteRpcInterface
|
|
89
|
+
- Rename AnalysisStyleScalar to AnalysisStyleThematic
|
|
90
|
+
- Rename AnalysisStyleScalar to AnalysisStyleThematic.
|
|
91
|
+
- remove ClientRequestContext.current
|
|
92
|
+
- rework locks
|
|
93
|
+
- Fix for IModel._ecefTrans not being updated when setting IModel._ecefLocation.
|
|
94
|
+
- Deprecate RenderTexture.Params
|
|
95
|
+
- Renamed an iModel's parent container to iTwin
|
|
96
|
+
- Support Open City Planner (OCP) that stores orbit point clouds (OPC) in their own azure environment.
|
|
97
|
+
- FeatureAppearance transparency override by default ignores render mode and transparency view flag.
|
|
98
|
+
- Adding WebEditServer (test scenarios only for now)
|
|
99
|
+
- Concurrency fix within web IPC transport system.
|
|
100
|
+
- Add ViewFlags.wiremesh to control wiremesh display.
|
|
4
101
|
|
|
5
102
|
## 2.19.28
|
|
6
103
|
Wed, 12 Jan 2022 14:52:38 GMT
|
|
@@ -193,8 +290,8 @@ Fri, 09 Jul 2021 18:11:24 GMT
|
|
|
193
290
|
|
|
194
291
|
### Updates
|
|
195
292
|
|
|
196
|
-
- Accomodated the inability to reverse Changesets when creating change summaries.
|
|
197
|
-
- Use ecef location calculated for projected models.
|
|
293
|
+
- Accomodated the inability to reverse Changesets when creating change summaries.
|
|
294
|
+
- Use ecef location calculated for projected models.
|
|
198
295
|
- Clean up and promote AnalysisStyle APIs.
|
|
199
296
|
- Added support for section clip to ElementGraphicsRequestProps.
|
|
200
297
|
- Add internal API for reconstructing TileOptions from tree and content Ids.
|
|
@@ -460,7 +557,7 @@ Thu, 28 Jan 2021 13:39:27 GMT
|
|
|
460
557
|
### Updates
|
|
461
558
|
|
|
462
559
|
- Fix brep DataProps to/from flatbuffer to account for base64 string header.
|
|
463
|
-
- Element geometry creation by brep operations.
|
|
560
|
+
- Element geometry creation by brep operations.
|
|
464
561
|
- add EditCommand
|
|
465
562
|
- Improve ElementGeometry documentation.
|
|
466
563
|
- Remove assertion in supplyPathForOperation when defaulting changeSetId.
|
|
@@ -616,8 +713,8 @@ Fri, 02 Oct 2020 18:03:32 GMT
|
|
|
616
713
|
|
|
617
714
|
- Add documentation for ContextRealityModelProps.
|
|
618
715
|
- Fix calculation of cartographic range.
|
|
619
|
-
- Fixes to front end methods to pull, merge and push.
|
|
620
|
-
- Fixed desktop authorization after recent changes.
|
|
716
|
+
- Fixes to front end methods to pull, merge and push.
|
|
717
|
+
- Fixed desktop authorization after recent changes.
|
|
621
718
|
- Update Tile version due to changes to indexes for tesselated polylines
|
|
622
719
|
- On iOS download in background
|
|
623
720
|
- Introduce NoContentError (transmitted via 204)
|
|
@@ -749,7 +846,7 @@ Fri, 10 Jul 2020 17:23:14 GMT
|
|
|
749
846
|
- Add ability to create selective overrides from display style settings, and apply the overrides to another settings.
|
|
750
847
|
- Fix orientation of Ecef.createFromCartographicOrigin
|
|
751
848
|
- Add non-locatable flag to TerrainSettings.
|
|
752
|
-
- Setup BriefcaseDb.open() to allow profile and domain schema validation and upgrades.
|
|
849
|
+
- Setup BriefcaseDb.open() to allow profile and domain schema validation and upgrades.
|
|
753
850
|
- Support for multiple RPC interface clients and attaching interfaces after startup.
|
|
754
851
|
- Add function to convert solar angles to solar direction.
|
|
755
852
|
- enforce max texture size for stepped gradients.
|
|
@@ -783,7 +880,7 @@ Thu, 28 May 2020 22:48:59 GMT
|
|
|
783
880
|
### Updates
|
|
784
881
|
|
|
785
882
|
- Improved log message written on rpc error
|
|
786
|
-
- Change default origin mode for terrain to Geodetic.
|
|
883
|
+
- Change default origin mode for terrain to Geodetic.
|
|
787
884
|
- Fix transforms for creating and querying part instance geometry in world coordinate.
|
|
788
885
|
- channel rules
|
|
789
886
|
- Optimize thematic sensor display by culling sensors based on a distanceCutoff property on ThematicDisplaySensorSettings.
|
|
@@ -798,7 +895,7 @@ Wed, 06 May 2020 13:17:49 GMT
|
|
|
798
895
|
- Show min/max window error for mouse wheel zoom.
|
|
799
896
|
- Make animation state of a display style persistent.
|
|
800
897
|
- Send a default pending message since Azure strips content-type header if no data is present
|
|
801
|
-
- Monitor progress of downloading briefcases, ability to cancel download of briefcases.
|
|
898
|
+
- Monitor progress of downloading briefcases, ability to cancel download of briefcases.
|
|
802
899
|
- Added to DisplayStyle3dSettings: MonochromeMode, LightSettings.
|
|
803
900
|
- Simplify GeometryStreamIteratorEntry (breaking API change).
|
|
804
901
|
- constructor of ColorDef wasn't setting transparency properly for rgba() strings
|
|
@@ -821,11 +918,11 @@ Wed, 06 May 2020 13:17:49 GMT
|
|
|
821
918
|
- Added file size.
|
|
822
919
|
- Supply RPC routing props for SnapshotIModelRpcInterface open methods"
|
|
823
920
|
- MobileRpcConfiguration throws exception
|
|
824
|
-
- Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
|
|
825
|
-
- Refactored NativeApp API and RPC interfaces. This continues to be WIP.
|
|
826
|
-
- Added DownloadBriefcaseOptions and OpenBriefcaseOptions as parameters to the download/open calls for a briefcase.
|
|
921
|
+
- Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
|
|
922
|
+
- Refactored NativeApp API and RPC interfaces. This continues to be WIP.
|
|
923
|
+
- Added DownloadBriefcaseOptions and OpenBriefcaseOptions as parameters to the download/open calls for a briefcase.
|
|
827
924
|
- Added new interface for native app
|
|
828
|
-
- VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
|
|
925
|
+
- VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
|
|
829
926
|
- Handle null JSON in ViewDetails.
|
|
830
927
|
- Renamed OIDC constructs for consistency; Removed SAML support.
|
|
831
928
|
- OrbitGT point cloud interface.
|
|
@@ -875,7 +972,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
|
|
|
875
972
|
- iModel write API development
|
|
876
973
|
- Fix issue with constructing the tile cache URL() on Safari.
|
|
877
974
|
- Prevent reuse of cached tiles after project extents change.
|
|
878
|
-
- VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
|
|
975
|
+
- VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
|
|
879
976
|
- Define ViewDetails for manipulating optional detail settings of ViewDefinition and ViewState.
|
|
880
977
|
- Add support for plan projection models with 3d display priority.
|
|
881
978
|
- Add settings to control display of plan projection models.
|
|
@@ -1037,7 +1134,7 @@ Mon, 13 May 2019 15:52:05 GMT
|
|
|
1037
1134
|
|
|
1038
1135
|
### Updates
|
|
1039
1136
|
|
|
1040
|
-
- Support spatial classification of context reality models.
|
|
1137
|
+
- Support spatial classification of context reality models.
|
|
1041
1138
|
- Added OpenAPIInfo to the barrel file
|
|
1042
1139
|
- Adds parameter for api-extractor to validate missing release tags
|
|
1043
1140
|
- Adds ignoreMissingTags flag
|
|
@@ -1050,14 +1147,14 @@ Mon, 13 May 2019 15:52:05 GMT
|
|
|
1050
1147
|
- LoggerCategory -> CommonLoggerCategory
|
|
1051
1148
|
- Fix default line pattern for hidden edges.
|
|
1052
1149
|
- Introduce LoggerCategory enum to advertise logger categories used by this package.
|
|
1053
|
-
- Logging fixes.
|
|
1150
|
+
- Logging fixes.
|
|
1054
1151
|
- Put sourcemap in npm package.
|
|
1055
1152
|
- Add SVG to ImageSourceFormat
|
|
1056
1153
|
- Add imodeljs-markup
|
|
1057
1154
|
- New tile cache naming scheme.
|
|
1058
1155
|
- queryPage use memoization/pending pattern
|
|
1059
1156
|
- Remove StandaloneIModelRpcInterface
|
|
1060
|
-
- Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
|
|
1157
|
+
- Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
|
|
1061
1158
|
- Prefer the IModelToken values in the url (if different from values in JSON body -- should never happen except in a malicious request).
|
|
1062
1159
|
- Exports interface MarshalingBinaryMarker to prevent errors in api-extractor V7
|
|
1063
1160
|
- Add SnapshotIModelRpcInterface
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudStorage.d.ts","sourceRoot":"","sources":["../../src/CloudStorage.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"CloudStorage.d.ts","sourceRoot":"","sources":["../../src/CloudStorage.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,YAAY;AACZ,oBAAY,oBAAoB;IAC9B,KAAK,IAAA;IACL,MAAM,IAAA;IACN,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,OAAO,IAAA;CACR;AAED,YAAY;AACZ,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,YAAY;AACZ,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,+BAA+B,CAAC;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,YAAY;AACZ,yBAAiB,wBAAwB,CAAC;IACxC,SAAgB,KAAK,IAAI,wBAAwB,CAOhD;CACF;AAED,YAAY;AACZ,8BAAsB,iBAAiB,CAAC,UAAU,EAAE,YAAY;IAC9D,OAAO,CAAC,WAAW,CAAwC;IAEpD,QAAQ,EAAE,oBAAoB,CAAgC;aACrD,iBAAiB,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM;aACzC,gBAAgB,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM;IACxD,SAAS,CAAC,gBAAgB,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM;IAClD,SAAS,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,+BAA+B,GAAG,OAAO,CAAC,wBAAwB,CAAC;IACrI,SAAS,CAAC,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAC7F,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,wBAAwB,EAAE,GAAG,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS;;IAMrF,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;cAkBxD,eAAe,CAAC,SAAS,EAAE,wBAAwB,EAAE,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC;IAgBvG,OAAO,CAAC,yBAAyB,CAA6D;cAE9E,YAAY,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAmChF"}
|
package/lib/cjs/CloudStorage.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.CloudStorageCache = exports.CloudStorageContainerUrl = exports.CloudStorageProvider = void 0;
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
11
12
|
/** @beta */
|
|
12
13
|
var CloudStorageProvider;
|
|
13
14
|
(function (CloudStorageProvider) {
|
|
@@ -40,27 +41,20 @@ class CloudStorageCache {
|
|
|
40
41
|
formContainerKey(id) { return this.formContainerName(id); }
|
|
41
42
|
supplyUrlBase(_container, _id) { return undefined; }
|
|
42
43
|
async retrieve(id) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (response.ok) {
|
|
52
|
-
const content = await this.instantiateResource(response);
|
|
53
|
-
resolve(content);
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
resolve(undefined);
|
|
57
|
-
}
|
|
44
|
+
try {
|
|
45
|
+
const container = await this.getContainer(id);
|
|
46
|
+
if (!container.url)
|
|
47
|
+
return undefined;
|
|
48
|
+
const response = await this.requestResource(container, id);
|
|
49
|
+
if (response.ok) {
|
|
50
|
+
const content = await this.instantiateResource(response);
|
|
51
|
+
return content;
|
|
58
52
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
core_bentley_1.UnexpectedErrors.handle(err);
|
|
56
|
+
}
|
|
57
|
+
return undefined;
|
|
64
58
|
}
|
|
65
59
|
async requestResource(container, id) {
|
|
66
60
|
const base = this.supplyUrlBase(container, id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudStorage.js","sourceRoot":"","sources":["../../src/CloudStorage.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,YAAY;AACZ,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC9B,iEAAK,CAAA;IACL,mEAAM,CAAA;IACN,uEAAQ,CAAA;IACR,uEAAQ,CAAA;IACR,qEAAO,CAAA;AACT,CAAC,EANW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAM/B;AAoBD,YAAY;AACZ,IAAiB,wBAAwB,CASxC;AATD,WAAiB,wBAAwB;IACvC,SAAgB,KAAK;QACnB,OAAO;YACL,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YACxB,KAAK,EAAE,CAAC;YACR,OAAO,EAAE,CAAC;YACV,GAAG,EAAE,EAAE;SACR,CAAC;IACJ,CAAC;IAPe,8BAAK,QAOpB,CAAA;AACH,CAAC,EATgB,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QASxC;AAED,YAAY;AACZ,MAAsB,iBAAiB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QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAtFD,8CAsFC","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/** @packageDocumentation\r\n * @module CloudStorage\r\n */\r\n\r\nimport { UnexpectedErrors } from \"@itwin/core-bentley\";\r\n\r\n/** @beta */\r\nexport enum CloudStorageProvider {\r\n Azure,\r\n Amazon,\r\n AliCloud,\r\n External,\r\n Unknown,\r\n}\r\n\r\n/** @beta */\r\nexport interface CloudStorageContainerDescriptor {\r\n provider?: CloudStorageProvider;\r\n name: string;\r\n resource?: string;\r\n}\r\n\r\n/** @beta */\r\nexport interface CloudStorageContainerUrl {\r\n descriptor: CloudStorageContainerDescriptor;\r\n valid: number;\r\n expires: number;\r\n url: string;\r\n method?: string;\r\n headers?: Record<string, string>;\r\n bound?: boolean;\r\n}\r\n\r\n/** @beta */\r\nexport namespace CloudStorageContainerUrl {\r\n export function empty(): CloudStorageContainerUrl {\r\n return {\r\n descriptor: { name: \"\" },\r\n valid: 0,\r\n expires: 0,\r\n url: \"\",\r\n };\r\n }\r\n}\r\n\r\n/** @beta */\r\nexport abstract class CloudStorageCache<TContentId, TContentType> {\r\n private _containers: Map<string, CloudStorageContainerUrl>;\r\n\r\n public provider: CloudStorageProvider = CloudStorageProvider.Unknown;\r\n public abstract formContainerName(id: TContentId): string;\r\n public abstract formResourceName(id: TContentId): string;\r\n protected formContainerKey(id: TContentId): string { return this.formContainerName(id); }\r\n protected abstract obtainContainerUrl(id: TContentId, descriptor: CloudStorageContainerDescriptor): Promise<CloudStorageContainerUrl>;\r\n protected abstract instantiateResource(response: Response): Promise<TContentType | undefined>;\r\n protected supplyUrlBase(_container: CloudStorageContainerUrl, _id: TContentId): string | undefined { return undefined; }\r\n\r\n public constructor() {\r\n this._containers = new Map();\r\n }\r\n\r\n public async retrieve(id: TContentId): Promise<TContentType | undefined> {\r\n try {\r\n const container = await this.getContainer(id);\r\n if (!container.url)\r\n return undefined;\r\n\r\n const response = await this.requestResource(container, id);\r\n if (response.ok) {\r\n const content = await this.instantiateResource(response);\r\n return content;\r\n }\r\n } catch (err) {\r\n UnexpectedErrors.handle(err);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n protected async requestResource(container: CloudStorageContainerUrl, id: TContentId): Promise<Response> {\r\n const base = this.supplyUrlBase(container, id);\r\n const url = (undefined === base || \"\" === base) ? new URL(container.url) : new URL(container.url, base);\r\n\r\n if (!container.bound) {\r\n url.pathname += `/${this.formResourceName(id)}`;\r\n }\r\n\r\n const init: RequestInit = {\r\n headers: container.headers,\r\n method: \"GET\",\r\n };\r\n\r\n return fetch(url.toString(), init);\r\n }\r\n\r\n private _pendingContainerRequests: Map<string, Promise<CloudStorageContainerUrl>> = new Map();\r\n\r\n protected async getContainer(id: TContentId): Promise<CloudStorageContainerUrl> {\r\n const now = new Date().getTime();\r\n const name = this.formContainerName(id);\r\n const resource = this.formResourceName(id);\r\n const key = this.formContainerKey(id);\r\n\r\n let container = this._containers.get(key);\r\n if (container && container.url && (container.valid > now || container.expires < now)) {\r\n container = undefined;\r\n this._containers.delete(key);\r\n }\r\n\r\n if (!container) {\r\n let request = this._pendingContainerRequests.get(key);\r\n if (!request) {\r\n request = new Promise(async (resolve, reject) => {\r\n try {\r\n container = await this.obtainContainerUrl(id, { name, resource });\r\n this._containers.set(key, container);\r\n this._pendingContainerRequests.delete(key);\r\n resolve(container);\r\n } catch (err) {\r\n this._pendingContainerRequests.delete(key);\r\n reject(err);\r\n }\r\n });\r\n\r\n this._pendingContainerRequests.set(key, request);\r\n }\r\n\r\n return request;\r\n }\r\n\r\n return container;\r\n }\r\n}\r\n"]}
|
package/lib/cjs/Fonts.d.ts
CHANGED
|
@@ -9,12 +9,19 @@ export declare enum FontType {
|
|
|
9
9
|
Rsc = 2,
|
|
10
10
|
Shx = 3
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/** An iModel-local identifier for a font.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare type FontId = number;
|
|
16
|
+
/** The properties of a Font.
|
|
13
17
|
* @public
|
|
14
18
|
*/
|
|
15
19
|
export interface FontProps {
|
|
16
|
-
|
|
20
|
+
/** the Id, within an iModel, of this font. */
|
|
21
|
+
id: FontId;
|
|
22
|
+
/** The type of font */
|
|
17
23
|
type: FontType;
|
|
24
|
+
/** The name of the font. */
|
|
18
25
|
name: string;
|
|
19
26
|
}
|
|
20
27
|
/** The properties of a FontMap
|
|
@@ -23,8 +30,12 @@ export interface FontProps {
|
|
|
23
30
|
export interface FontMapProps {
|
|
24
31
|
fonts: FontProps[];
|
|
25
32
|
}
|
|
26
|
-
/**
|
|
27
|
-
* A
|
|
33
|
+
/**
|
|
34
|
+
* A FontMap holds the set of font names available in an iModel.
|
|
35
|
+
* Within the GeometryStream of an Element, a specific font is referenced by its FontId that is local to the iModel.
|
|
36
|
+
* This class maps FontIds to FontProps.
|
|
37
|
+
* @note The font map is generally established when the iModel is first created to specify the set of fonts available
|
|
38
|
+
* for editors. Adding new entries requires that the schema lock be held.
|
|
28
39
|
* @public
|
|
29
40
|
*/
|
|
30
41
|
export declare class FontMap {
|
|
@@ -33,6 +44,6 @@ export declare class FontMap {
|
|
|
33
44
|
addFonts(fonts: FontProps[]): void;
|
|
34
45
|
toJSON(): FontMapProps;
|
|
35
46
|
/** look up a font by name or number and return its FontProps */
|
|
36
|
-
getFont(arg: string |
|
|
47
|
+
getFont(arg: string | FontId): FontProps | undefined;
|
|
37
48
|
}
|
|
38
49
|
//# sourceMappingURL=Fonts.d.ts.map
|
package/lib/cjs/Fonts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fonts.d.ts","sourceRoot":"","sources":["../../src/Fonts.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,oBAAY,QAAQ;IAAG,QAAQ,IAAI;IAAE,GAAG,IAAI;IAAE,GAAG,IAAI;CAAE;AAEvD;;GAEG;AACH,MAAM,WAAW,SAAS;
|
|
1
|
+
{"version":3,"file":"Fonts.d.ts","sourceRoot":"","sources":["../../src/Fonts.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,oBAAY,QAAQ;IAAG,QAAQ,IAAI;IAAE,GAAG,IAAI;IAAE,GAAG,IAAI;CAAE;AAEvD;;GAEG;AACH,oBAAY,MAAM,GAAG,MAAM,CAAC;AAE5B;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,uBAAuB;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAAG,KAAK,EAAE,SAAS,EAAE,CAAA;CAAE;AAEpD;;;;;;;GAOG;AACH,qBAAa,OAAO;IAClB,SAAgB,KAAK,yBAAgC;gBACzC,KAAK,CAAC,EAAE,YAAY;IAIzB,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE;IAG3B,MAAM,IAAI,YAAY;IAK7B,gEAAgE;IACzD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS;CAM5D"}
|
package/lib/cjs/Fonts.js
CHANGED
|
@@ -17,8 +17,12 @@ var FontType;
|
|
|
17
17
|
FontType[FontType["Rsc"] = 2] = "Rsc";
|
|
18
18
|
FontType[FontType["Shx"] = 3] = "Shx";
|
|
19
19
|
})(FontType = exports.FontType || (exports.FontType = {}));
|
|
20
|
-
/**
|
|
21
|
-
* A
|
|
20
|
+
/**
|
|
21
|
+
* A FontMap holds the set of font names available in an iModel.
|
|
22
|
+
* Within the GeometryStream of an Element, a specific font is referenced by its FontId that is local to the iModel.
|
|
23
|
+
* This class maps FontIds to FontProps.
|
|
24
|
+
* @note The font map is generally established when the iModel is first created to specify the set of fonts available
|
|
25
|
+
* for editors. Adding new entries requires that the schema lock be held.
|
|
22
26
|
* @public
|
|
23
27
|
*/
|
|
24
28
|
class FontMap {
|
package/lib/cjs/Fonts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fonts.js","sourceRoot":"","sources":["../../src/Fonts.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,QAA2C;AAAvD,WAAY,QAAQ;IAAG,+CAAY,CAAA;IAAE,qCAAO,CAAA;IAAE,qCAAO,CAAA;AAAC,CAAC,EAA3C,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAAmC;
|
|
1
|
+
{"version":3,"file":"Fonts.js","sourceRoot":"","sources":["../../src/Fonts.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,QAA2C;AAAvD,WAAY,QAAQ;IAAG,+CAAY,CAAA;IAAE,qCAAO,CAAA;IAAE,qCAAO,CAAA;AAAC,CAAC,EAA3C,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAAmC;AAwBvD;;;;;;;GAOG;AACH,MAAa,OAAO;IAElB,YAAY,KAAoB;QADhB,UAAK,GAAG,IAAI,GAAG,EAAqB,CAAC;QAEnD,IAAI,SAAS,KAAK,KAAK;YACrB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACM,QAAQ,CAAC,KAAkB;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;IACzD,CAAC;IACM,MAAM;QACX,MAAM,KAAK,GAAgB,EAAE,CAAC;QAC9B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/C,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC;IACD,gEAAgE;IACzD,OAAO,CAAC,GAAoB;QACjC,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACxD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;YACpC,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG;gBAAE,OAAO,IAAI,CAAC;QACrC,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AArBD,0BAqBC","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/** @packageDocumentation\r\n * @module Symbology\r\n */\r\n\r\n/** The type of a font.\r\n * @public\r\n */\r\nexport enum FontType { TrueType = 1, Rsc = 2, Shx = 3 }\r\n\r\n/** An iModel-local identifier for a font.\r\n * @public\r\n */\r\nexport type FontId = number;\r\n\r\n/** The properties of a Font.\r\n * @public\r\n */\r\nexport interface FontProps {\r\n /** the Id, within an iModel, of this font. */\r\n id: FontId;\r\n /** The type of font */\r\n type: FontType;\r\n /** The name of the font. */\r\n name: string;\r\n}\r\n\r\n/** The properties of a FontMap\r\n * @public\r\n */\r\nexport interface FontMapProps { fonts: FontProps[] }\r\n\r\n/**\r\n * A FontMap holds the set of font names available in an iModel.\r\n * Within the GeometryStream of an Element, a specific font is referenced by its FontId that is local to the iModel.\r\n * This class maps FontIds to FontProps.\r\n * @note The font map is generally established when the iModel is first created to specify the set of fonts available\r\n * for editors. Adding new entries requires that the schema lock be held.\r\n * @public\r\n */\r\nexport class FontMap {\r\n public readonly fonts = new Map<FontId, FontProps>();\r\n constructor(props?: FontMapProps) {\r\n if (undefined !== props)\r\n this.addFonts(props.fonts);\r\n }\r\n public addFonts(fonts: FontProps[]) {\r\n fonts.forEach((font) => this.fonts.set(font.id, font));\r\n }\r\n public toJSON(): FontMapProps {\r\n const fonts: FontProps[] = [];\r\n this.fonts.forEach((font) => fonts.push(font));\r\n return { fonts };\r\n }\r\n /** look up a font by name or number and return its FontProps */\r\n public getFont(arg: string | FontId): FontProps | undefined {\r\n if (typeof arg === \"number\") return this.fonts.get(arg);\r\n for (const font of this.fonts.values())\r\n if (font.name === arg) return font;\r\n return undefined;\r\n }\r\n}\r\n"]}
|
|
@@ -13,6 +13,8 @@ export declare type BaseLayerProps = BaseMapLayerProps | ColorDefProps;
|
|
|
13
13
|
* In earlier versions only a background map was supported as specified by the providerName and mapType members of [[BackgroundMapSettings]] object.
|
|
14
14
|
* In order to provide backward compatibility the original [[BackgroundMapSettings]] are synchronized with the [[MapImagerySettings]] base layer as long as
|
|
15
15
|
* the settings are compatible.
|
|
16
|
+
* The non-base map layers may represent image layers generated by tile servers or model layers that are generated by 2d projection of model geomety, typically from a model
|
|
17
|
+
* that is generated from two dimensional GIS data.
|
|
16
18
|
* @beta
|
|
17
19
|
*/
|
|
18
20
|
export interface MapImageryProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapImagerySettings.d.ts","sourceRoot":"","sources":["../../src/MapImagerySettings.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE9G;;GAEG;AACH,oBAAY,cAAc,GAAG,iBAAiB,GAAG,aAAa,CAAC;AAE/D
|
|
1
|
+
{"version":3,"file":"MapImagerySettings.d.ts","sourceRoot":"","sources":["../../src/Map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;IAM5F,MAAM,IAAI,eAAe;CAUjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapImagerySettings.js","sourceRoot":"","sources":["../../src/MapImagerySettings.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,yCAAqD;AACrD,yDAA8G;
|
|
1
|
+
{"version":3,"file":"MapImagerySettings.js","sourceRoot":"","sources":["../../src/MapImagerySettings.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,yCAAqD;AACrD,yDAA8G;AA4B9G,YAAY;AACZ,2DAA2D;AAC3D,IAAiB,iBAAiB,CAKjC;AALD,WAAiB,iBAAiB;IAChC,wDAAwD;IACxD,SAAgB,QAAQ,CAAC,KAAqB;QAC5C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,mBAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,uCAAoB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACrG,CAAC;IAFe,0BAAQ,WAEvB,CAAA;AACH,CAAC,EALgB,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAKjC;AAED;;;;;GAKG;AACH,MAAa,kBAAkB;IAK7B,YAAoB,IAAuB,EAAE,oBAAsC,EAAE,kBAAoC;QAHjH,sBAAiB,GAAG,IAAI,KAAK,EAAoB,CAAC;QAClD,mBAAc,GAAG,IAAI,KAAK,EAAoB,CAAC;QAGrD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,oBAAoB,EAAE;YACxB,KAAK,MAAM,UAAU,IAAI,oBAAoB,EAAE;gBAC7C,MAAM,KAAK,GAAG,mCAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;gBACpD,IAAI,KAAK;oBACP,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACtC;SACF;QACD,IAAI,kBAAkB,EAAE;Y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CAAC,SAAS,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,gBAAgB,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,aAAa,CAAC,CAAC;IACtG,CAAC;IAEM,MAAM;QACX,MAAM,KAAK,GAAoB,EAAE,cAAc,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC;QACjF,IAAI,IAAI,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC;YACnC,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QAEjF,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC;YAChC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QAE3E,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA9DD,gDA8DC","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/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\nimport { DeprecatedBackgroundMapProps } from \"./BackgroundMapSettings\";\r\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\r\nimport { BaseMapLayerProps, BaseMapLayerSettings, MapLayerProps, MapLayerSettings } from \"./MapLayerSettings\";\r\n\r\n/** JSON representation of a [[BaseLayerSettings]].\r\n * @beta\r\n */\r\nexport type BaseLayerProps = BaseMapLayerProps | ColorDefProps;\r\n\r\n/** The JSON representation of the map imagery. Map imagery include the specification for the base layer (which was originally\r\n * represented by [[BackgroundMapProps.providerName]] && [[BackgroundMapProps.providerData]]) and additional map layers.\r\n * In earlier versions only a background map was supported as specified by the providerName and mapType members of [[BackgroundMapSettings]] object.\r\n * In order to provide backward compatibility the original [[BackgroundMapSettings]] are synchronized with the [[MapImagerySettings]] base layer as long as\r\n * the settings are compatible.\r\n * The non-base map layers may represent image layers generated by tile servers or model layers that are generated by 2d projection of model geomety, typically from a model\r\n * that is generated from two dimensional GIS data.\r\n * @beta\r\n */\r\nexport interface MapImageryProps {\r\n backgroundBase?: BaseLayerProps;\r\n backgroundLayers?: MapLayerProps[];\r\n overlayLayers?: MapLayerProps[];\r\n}\r\n\r\n/** The base layer for a [[MapImagerySettings]].\r\n * @see [[MapImagerySettings.backgroundBase]].\r\n * @beta\r\n */\r\nexport type BaseLayerSettings = BaseMapLayerSettings | ColorDef;\r\n\r\n/** @beta */\r\n// eslint-disable-next-line @typescript-eslint/no-redeclare\r\nexport namespace BaseLayerSettings {\r\n /** Create a base layer from its JSON representation. */\r\n export function fromJSON(props: BaseLayerProps): BaseLayerSettings {\r\n return typeof props === \"number\" ? ColorDef.fromJSON(props) : BaseMapLayerSettings.fromJSON(props);\r\n }\r\n}\r\n\r\n/** Provides access to the map imagery settings (Base and layers).\r\n * In earlier versions only a background map was supported as specified by the providerName and mapType members of [[BackgroundMapSettings]] object.\r\n * In order to provide backward compatibility the original [[BackgroundMapSettings]] are synchronized with the [[MapImagerySettings]] base layer as long as\r\n * the settings are compatible.\r\n * @beta\r\n */\r\nexport class MapImagerySettings {\r\n private _backgroundBase: BaseLayerSettings;\r\n private _backgroundLayers = new Array<MapLayerSettings>();\r\n private _overlayLayers = new Array<MapLayerSettings>();\r\n\r\n private constructor(base: BaseLayerSettings, backgroundLayerProps?: MapLayerProps[], overlayLayersProps?: MapLayerProps[]) {\r\n this._backgroundBase = base;\r\n if (backgroundLayerProps) {\r\n for (const layerProps of backgroundLayerProps) {\r\n const layer = MapLayerSettings.fromJSON(layerProps);\r\n if (layer)\r\n this._backgroundLayers.push(layer);\r\n }\r\n }\r\n if (overlayLayersProps) {\r\n for (const overlayLayerProps of overlayLayersProps) {\r\n const overlayLayer = MapLayerSettings.fromJSON(overlayLayerProps);\r\n if (overlayLayer)\r\n this._overlayLayers.push(overlayLayer);\r\n }\r\n }\r\n }\r\n\r\n /** The settings for the base layer.\r\n * @note If changing the base provider it is currently necessary to also update the background map settings.\r\n */\r\n public get backgroundBase(): BaseLayerSettings { return this._backgroundBase; }\r\n public set backgroundBase(base: BaseLayerSettings) { this._backgroundBase = base; }\r\n\r\n public get backgroundLayers(): MapLayerSettings[] { return this._backgroundLayers; }\r\n public get overlayLayers(): MapLayerSettings[] { return this._overlayLayers; }\r\n\r\n /** Return base transparency as a number between 0 and 1.\r\n * @internal\r\n */\r\n public get baseTransparency(): number {\r\n return (this._backgroundBase instanceof ColorDef) ? (this._backgroundBase.getTransparency() / 255) : this._backgroundBase.transparency;\r\n\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static fromJSON(imageryJson?: MapImageryProps) {\r\n return this.createFromJSON(imageryJson, undefined);\r\n }\r\n\r\n /** @internal */\r\n public static createFromJSON(imageryJson?: MapImageryProps, mapProps?: DeprecatedBackgroundMapProps) {\r\n const baseLayer = imageryJson?.backgroundBase ? BaseLayerSettings.fromJSON(imageryJson.backgroundBase) : BaseMapLayerSettings.fromBackgroundMapProps(mapProps ?? { });\r\n\r\n return new MapImagerySettings(baseLayer, imageryJson?.backgroundLayers, imageryJson?.overlayLayers);\r\n }\r\n\r\n public toJSON(): MapImageryProps {\r\n const props: MapImageryProps = { backgroundBase: this._backgroundBase.toJSON() };\r\n if (this._backgroundLayers.length > 0)\r\n props.backgroundLayers = this._backgroundLayers.map((layer) => layer.toJSON());\r\n\r\n if (this._overlayLayers.length > 0)\r\n props.overlayLayers = this._overlayLayers.map((layer) => layer.toJSON());\r\n\r\n return props;\r\n }\r\n}\r\n"]}
|