@itwin/core-common 3.1.0-dev.8 → 3.2.0-dev.12

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +87 -17
  2. package/lib/cjs/BackgroundMapProvider.d.ts +4 -0
  3. package/lib/cjs/BackgroundMapProvider.d.ts.map +1 -1
  4. package/lib/cjs/BackgroundMapProvider.js +9 -0
  5. package/lib/cjs/BackgroundMapProvider.js.map +1 -1
  6. package/lib/cjs/Fonts.d.ts +16 -5
  7. package/lib/cjs/Fonts.d.ts.map +1 -1
  8. package/lib/cjs/Fonts.js +6 -2
  9. package/lib/cjs/Fonts.js.map +1 -1
  10. package/lib/cjs/MapImagerySettings.d.ts +2 -0
  11. package/lib/cjs/MapImagerySettings.d.ts.map +1 -1
  12. package/lib/cjs/MapImagerySettings.js.map +1 -1
  13. package/lib/cjs/MapLayerSettings.d.ts +120 -37
  14. package/lib/cjs/MapLayerSettings.d.ts.map +1 -1
  15. package/lib/cjs/MapLayerSettings.js +156 -86
  16. package/lib/cjs/MapLayerSettings.js.map +1 -1
  17. package/lib/cjs/SpatialClassification.d.ts +5 -0
  18. package/lib/cjs/SpatialClassification.d.ts.map +1 -1
  19. package/lib/cjs/SpatialClassification.js +7 -0
  20. package/lib/cjs/SpatialClassification.js.map +1 -1
  21. package/lib/cjs/geometry/TextString.d.ts +5 -4
  22. package/lib/cjs/geometry/TextString.d.ts.map +1 -1
  23. package/lib/cjs/geometry/TextString.js.map +1 -1
  24. package/lib/cjs/ipc/IpcWebSocket.d.ts +0 -1
  25. package/lib/cjs/ipc/IpcWebSocket.d.ts.map +1 -1
  26. package/lib/cjs/ipc/IpcWebSocket.js +4 -13
  27. package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
  28. package/lib/cjs/ipc/IpcWebSocketTransport.d.ts +2 -1
  29. package/lib/cjs/ipc/IpcWebSocketTransport.d.ts.map +1 -1
  30. package/lib/cjs/ipc/IpcWebSocketTransport.js +24 -15
  31. package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
  32. package/lib/cjs/rpc/IModelReadRpcInterface.d.ts +1 -0
  33. package/lib/cjs/rpc/IModelReadRpcInterface.d.ts.map +1 -1
  34. package/lib/cjs/rpc/IModelReadRpcInterface.js +1 -0
  35. package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
  36. package/lib/cjs/rpc/core/RpcInvocation.d.ts.map +1 -1
  37. package/lib/cjs/rpc/core/RpcInvocation.js +1 -6
  38. package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
  39. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +1 -1
  40. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  41. package/lib/cjs/tile/IModelTileIO.d.ts +2 -2
  42. package/lib/cjs/tile/IModelTileIO.js +2 -2
  43. package/lib/cjs/tile/IModelTileIO.js.map +1 -1
  44. package/lib/esm/BackgroundMapProvider.d.ts +4 -0
  45. package/lib/esm/BackgroundMapProvider.d.ts.map +1 -1
  46. package/lib/esm/BackgroundMapProvider.js +9 -0
  47. package/lib/esm/BackgroundMapProvider.js.map +1 -1
  48. package/lib/esm/Fonts.d.ts +16 -5
  49. package/lib/esm/Fonts.d.ts.map +1 -1
  50. package/lib/esm/Fonts.js +6 -2
  51. package/lib/esm/Fonts.js.map +1 -1
  52. package/lib/esm/MapImagerySettings.d.ts +2 -0
  53. package/lib/esm/MapImagerySettings.d.ts.map +1 -1
  54. package/lib/esm/MapImagerySettings.js.map +1 -1
  55. package/lib/esm/MapLayerSettings.d.ts +120 -37
  56. package/lib/esm/MapLayerSettings.d.ts.map +1 -1
  57. package/lib/esm/MapLayerSettings.js +152 -84
  58. package/lib/esm/MapLayerSettings.js.map +1 -1
  59. package/lib/esm/SpatialClassification.d.ts +5 -0
  60. package/lib/esm/SpatialClassification.d.ts.map +1 -1
  61. package/lib/esm/SpatialClassification.js +7 -0
  62. package/lib/esm/SpatialClassification.js.map +1 -1
  63. package/lib/esm/geometry/TextString.d.ts +5 -4
  64. package/lib/esm/geometry/TextString.d.ts.map +1 -1
  65. package/lib/esm/geometry/TextString.js.map +1 -1
  66. package/lib/esm/ipc/IpcWebSocket.d.ts +0 -1
  67. package/lib/esm/ipc/IpcWebSocket.d.ts.map +1 -1
  68. package/lib/esm/ipc/IpcWebSocket.js +4 -13
  69. package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
  70. package/lib/esm/ipc/IpcWebSocketTransport.d.ts +2 -1
  71. package/lib/esm/ipc/IpcWebSocketTransport.d.ts.map +1 -1
  72. package/lib/esm/ipc/IpcWebSocketTransport.js +24 -15
  73. package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
  74. package/lib/esm/rpc/IModelReadRpcInterface.d.ts +1 -0
  75. package/lib/esm/rpc/IModelReadRpcInterface.d.ts.map +1 -1
  76. package/lib/esm/rpc/IModelReadRpcInterface.js +1 -0
  77. package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
  78. package/lib/esm/rpc/core/RpcInvocation.d.ts.map +1 -1
  79. package/lib/esm/rpc/core/RpcInvocation.js +1 -6
  80. package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
  81. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +1 -1
  82. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  83. package/lib/esm/tile/IModelTileIO.d.ts +2 -2
  84. package/lib/esm/tile/IModelTileIO.js +2 -2
  85. package/lib/esm/tile/IModelTileIO.js.map +1 -1
  86. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -1,6 +1,76 @@
1
1
  # Change Log - @itwin/core-common
2
2
 
3
- This log was last generated on Wed, 12 Jan 2022 14:52:38 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 10 Mar 2022 21:18:13 GMT and should not be manually modified.
4
+
5
+ ## 3.0.2
6
+ Thu, 10 Mar 2022 21:18:13 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 3.0.1
11
+ Thu, 24 Feb 2022 15:26:55 GMT
12
+
13
+ ### Updates
14
+
15
+ - Migrated from deprecated MapBox api.
16
+
17
+ ## 3.0.0
18
+ Mon, 24 Jan 2022 14:00:52 GMT
19
+
20
+ ### Updates
21
+
22
+ - Add support for producing larger tiles.
23
+ - 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.
24
+ - improve concurrent query changes
25
+ - Upgrade target to ES2019 and deliver both a CommonJs and ESModule version of package
26
+ - Added additional documentation for ecefLocation iniModel
27
+ - Add support for indexed edges in tile graphics.
28
+ - Added non-existent property to EntityProps to make the compiler discriminate between EntityProps and Entity.
29
+ - Add compare method to ThematicGradientSettings. Fix Gradient.Symb.compareSymb method to also compare thematicSettings.
30
+ - Clean up SkyBox and GroundPlane APIs.
31
+ - improve getMetaData() and provide extended error codes
32
+ - Added support to LightSettings for Fresnel effect.
33
+ - Add new GeoServices class and first method to interpret WKT or complete GCS JSON."
34
+ - GeoCoordStatus documentation added
35
+ - getAccessToken always returns a token
36
+ - Fix frustum translate method.
37
+ - Make ViewFlags immutable. Simplify ViewFlagOverrides.
38
+ - Added LOCAL_ELLIPSOID vertical datum identifier.
39
+ - Added ability to convert iModel coordinates to or from any Geographic CRS
40
+ - rename contextId -> iTwinId
41
+ - MapLayerSettings.fromJSON, BaseLayerSettings.fromJSON and MapSubLayerSettings.fromJSON no longer return undefined.
42
+ - Fix problem with RealityDataSourceKey string convertion
43
+ - Promote RealityDataSource and RealityDataSourceKey API to beta and update documentation
44
+ - Removed internal tag from EGFBAccessors
45
+ - Moved RealityDataAccessProps from core-frontend to core-common
46
+ - FeatureOverrides now merge by default in case of conflicts.
47
+ - rename to @itwin/core-common
48
+ - Fix an import which would cause consumers of core-common to fail during build
49
+ - move js-base64 from devDeps to deps
50
+ - Improve conformance with the glTF 2.0 spec when reading glb chunks.
51
+ - remove ClientRequestContext and its subclasses
52
+ - Added AuthorizationClient
53
+ - Add support for inverting planar clip mask (inside vs outside)
54
+ - Remove deprecated APIs for 3.0.
55
+ - Generalize the way to attach a reality data by adding a RealityDataSourceKey to ContextRealityModelProps
56
+ - Enhance RealityDataSource class
57
+ - Replace usage of I18N with generic Localization interface.
58
+ - GeometryContainmentRequestProps.clip and SnapRequestProps.viewFlags use stricter type than `any`.
59
+ - removed deprecated apis
60
+ - Move map imagery provider from BackgroundMapSettings to MapImagerySettings.backgroundBase.
61
+ - remove IModelWriteRpcInterface
62
+ - Rename AnalysisStyleScalar to AnalysisStyleThematic
63
+ - Rename AnalysisStyleScalar to AnalysisStyleThematic.
64
+ - remove ClientRequestContext.current
65
+ - rework locks
66
+ - Fix for IModel._ecefTrans not being updated when setting IModel._ecefLocation.
67
+ - Deprecate RenderTexture.Params
68
+ - Renamed an iModel's parent container to iTwin
69
+ - Support Open City Planner (OCP) that stores orbit point clouds (OPC) in their own azure environment.
70
+ - FeatureAppearance transparency override by default ignores render mode and transparency view flag.
71
+ - Adding WebEditServer (test scenarios only for now)
72
+ - Concurrency fix within web IPC transport system.
73
+ - Add ViewFlags.wiremesh to control wiremesh display.
4
74
 
5
75
  ## 2.19.28
6
76
  Wed, 12 Jan 2022 14:52:38 GMT
@@ -193,8 +263,8 @@ Fri, 09 Jul 2021 18:11:24 GMT
193
263
 
194
264
  ### Updates
195
265
 
196
- - Accomodated the inability to reverse Changesets when creating change summaries.
197
- - Use ecef location calculated for projected models.
266
+ - Accomodated the inability to reverse Changesets when creating change summaries.
267
+ - Use ecef location calculated for projected models.
198
268
  - Clean up and promote AnalysisStyle APIs.
199
269
  - Added support for section clip to ElementGraphicsRequestProps.
200
270
  - Add internal API for reconstructing TileOptions from tree and content Ids.
@@ -460,7 +530,7 @@ Thu, 28 Jan 2021 13:39:27 GMT
460
530
  ### Updates
461
531
 
462
532
  - Fix brep DataProps to/from flatbuffer to account for base64 string header.
463
- - Element geometry creation by brep operations.
533
+ - Element geometry creation by brep operations.
464
534
  - add EditCommand
465
535
  - Improve ElementGeometry documentation.
466
536
  - Remove assertion in supplyPathForOperation when defaulting changeSetId.
@@ -616,8 +686,8 @@ Fri, 02 Oct 2020 18:03:32 GMT
616
686
 
617
687
  - Add documentation for ContextRealityModelProps.
618
688
  - Fix calculation of cartographic range.
619
- - Fixes to front end methods to pull, merge and push.
620
- - Fixed desktop authorization after recent changes.
689
+ - Fixes to front end methods to pull, merge and push.
690
+ - Fixed desktop authorization after recent changes.
621
691
  - Update Tile version due to changes to indexes for tesselated polylines
622
692
  - On iOS download in background
623
693
  - Introduce NoContentError (transmitted via 204)
@@ -749,7 +819,7 @@ Fri, 10 Jul 2020 17:23:14 GMT
749
819
  - Add ability to create selective overrides from display style settings, and apply the overrides to another settings.
750
820
  - Fix orientation of Ecef.createFromCartographicOrigin
751
821
  - Add non-locatable flag to TerrainSettings.
752
- - Setup BriefcaseDb.open() to allow profile and domain schema validation and upgrades.
822
+ - Setup BriefcaseDb.open() to allow profile and domain schema validation and upgrades.
753
823
  - Support for multiple RPC interface clients and attaching interfaces after startup.
754
824
  - Add function to convert solar angles to solar direction.
755
825
  - enforce max texture size for stepped gradients.
@@ -783,7 +853,7 @@ Thu, 28 May 2020 22:48:59 GMT
783
853
  ### Updates
784
854
 
785
855
  - Improved log message written on rpc error
786
- - Change default origin mode for terrain to Geodetic.
856
+ - Change default origin mode for terrain to Geodetic.
787
857
  - Fix transforms for creating and querying part instance geometry in world coordinate.
788
858
  - channel rules
789
859
  - Optimize thematic sensor display by culling sensors based on a distanceCutoff property on ThematicDisplaySensorSettings.
@@ -798,7 +868,7 @@ Wed, 06 May 2020 13:17:49 GMT
798
868
  - Show min/max window error for mouse wheel zoom.
799
869
  - Make animation state of a display style persistent.
800
870
  - 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.
871
+ - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
802
872
  - Added to DisplayStyle3dSettings: MonochromeMode, LightSettings.
803
873
  - Simplify GeometryStreamIteratorEntry (breaking API change).
804
874
  - constructor of ColorDef wasn't setting transparency properly for rgba() strings
@@ -821,11 +891,11 @@ Wed, 06 May 2020 13:17:49 GMT
821
891
  - Added file size.
822
892
  - Supply RPC routing props for SnapshotIModelRpcInterface open methods"
823
893
  - 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.
894
+ - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
895
+ - Refactored NativeApp API and RPC interfaces. This continues to be WIP.
896
+ - Added DownloadBriefcaseOptions and OpenBriefcaseOptions as parameters to the download/open calls for a briefcase.
827
897
  - Added new interface for native app
828
- - VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
898
+ - VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
829
899
  - Handle null JSON in ViewDetails.
830
900
  - Renamed OIDC constructs for consistency; Removed SAML support.
831
901
  - OrbitGT point cloud interface.
@@ -875,7 +945,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
875
945
  - iModel write API development
876
946
  - Fix issue with constructing the tile cache URL() on Safari.
877
947
  - 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.
948
+ - VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
879
949
  - Define ViewDetails for manipulating optional detail settings of ViewDefinition and ViewState.
880
950
  - Add support for plan projection models with 3d display priority.
881
951
  - Add settings to control display of plan projection models.
@@ -1037,7 +1107,7 @@ Mon, 13 May 2019 15:52:05 GMT
1037
1107
 
1038
1108
  ### Updates
1039
1109
 
1040
- - Support spatial classification of context reality models.
1110
+ - Support spatial classification of context reality models.
1041
1111
  - Added OpenAPIInfo to the barrel file
1042
1112
  - Adds parameter for api-extractor to validate missing release tags
1043
1113
  - Adds ignoreMissingTags flag
@@ -1050,14 +1120,14 @@ Mon, 13 May 2019 15:52:05 GMT
1050
1120
  - LoggerCategory -> CommonLoggerCategory
1051
1121
  - Fix default line pattern for hidden edges.
1052
1122
  - Introduce LoggerCategory enum to advertise logger categories used by this package.
1053
- - Logging fixes.
1123
+ - Logging fixes.
1054
1124
  - Put sourcemap in npm package.
1055
1125
  - Add SVG to ImageSourceFormat
1056
1126
  - Add imodeljs-markup
1057
1127
  - New tile cache naming scheme.
1058
1128
  - queryPage use memoization/pending pattern
1059
1129
  - Remove StandaloneIModelRpcInterface
1060
- - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
1130
+ - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
1061
1131
  - Prefer the IModelToken values in the url (if different from values in JSON body -- should never happen except in a malicious request).
1062
1132
  - Exports interface MarshalingBinaryMarker to prevent errors in api-extractor V7
1063
1133
  - Add SnapshotIModelRpcInterface
@@ -42,5 +42,9 @@ export declare class BackgroundMapProvider {
42
42
  static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): BackgroundMapProvider;
43
43
  /** Return true if this provider is equivalent to `other`. */
44
44
  equals(other: BackgroundMapProvider): boolean;
45
+ /** Produce a copy of this provider with identical properties except for those explicitly specified by `changedProps`.
46
+ * Any properties explicitly set to `undefined` in `changedProps` will be reset to their default values.
47
+ */
48
+ clone(changedProps: BackgroundMapProviderProps): BackgroundMapProvider;
45
49
  }
46
50
  //# sourceMappingURL=BackgroundMapProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BackgroundMapProvider.d.ts","sourceRoot":"","sources":["../../src/BackgroundMapProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEvE;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,MAAM,IAAI;IACV,MAAM,IAAI;IACV,MAAM,IAAI;CACX;AAED;;;GAGG;AACH,oBAAY,yBAAyB,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAE1E;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,wDAAwD;IACxD,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,uDAAuD;IACvD,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAED;;GAEG;AACH,qBAAa,qBAAqB;IAChC,gCAAgC;IAChC,SAAgB,IAAI,EAAE,yBAAyB,CAAC;IAChD,wCAAwC;IACxC,SAAgB,IAAI,EAAE,iBAAiB,CAAC;IAExC,OAAO;IAKP,sDAAsD;WACxC,QAAQ,CAAC,KAAK,EAAE,0BAA0B,GAAG,qBAAqB;IAgBhF,wDAAwD;IACjD,MAAM,IAAI,0BAA0B;IAI3C,gBAAgB;WACF,sBAAsB,CAAC,KAAK,EAAE,4BAA4B,GAAG,qBAAqB;IAKhG,6DAA6D;IACtD,MAAM,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO;CAGrD"}
1
+ {"version":3,"file":"BackgroundMapProvider.d.ts","sourceRoot":"","sources":["../../src/BackgroundMapProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEvE;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,MAAM,IAAI;IACV,MAAM,IAAI;IACV,MAAM,IAAI;CACX;AAED;;;GAGG;AACH,oBAAY,yBAAyB,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAE1E;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,wDAAwD;IACxD,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,uDAAuD;IACvD,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAED;;GAEG;AACH,qBAAa,qBAAqB;IAChC,gCAAgC;IAChC,SAAgB,IAAI,EAAE,yBAAyB,CAAC;IAChD,wCAAwC;IACxC,SAAgB,IAAI,EAAE,iBAAiB,CAAC;IAExC,OAAO;IAKP,sDAAsD;WACxC,QAAQ,CAAC,KAAK,EAAE,0BAA0B,GAAG,qBAAqB;IAgBhF,wDAAwD;IACjD,MAAM,IAAI,0BAA0B;IAI3C,gBAAgB;WACF,sBAAsB,CAAC,KAAK,EAAE,4BAA4B,GAAG,qBAAqB;IAKhG,6DAA6D;IACtD,MAAM,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO;IAIpD;;OAEG;IACI,KAAK,CAAC,YAAY,EAAE,0BAA0B,GAAG,qBAAqB;CAM9E"}
@@ -54,6 +54,15 @@ class BackgroundMapProvider {
54
54
  equals(other) {
55
55
  return this.name === other.name && this.type === other.type;
56
56
  }
57
+ /** Produce a copy of this provider with identical properties except for those explicitly specified by `changedProps`.
58
+ * Any properties explicitly set to `undefined` in `changedProps` will be reset to their default values.
59
+ */
60
+ clone(changedProps) {
61
+ return BackgroundMapProvider.fromJSON({
62
+ ...this.toJSON(),
63
+ ...changedProps,
64
+ });
65
+ }
57
66
  }
58
67
  exports.BackgroundMapProvider = BackgroundMapProvider;
59
68
  //# sourceMappingURL=BackgroundMapProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BackgroundMapProvider.js","sourceRoot":"","sources":["../../src/BackgroundMapProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH;;GAEG;AACH,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,6DAAU,CAAA;IACV,6DAAU,CAAA;IACV,6DAAU,CAAA;AACZ,CAAC,EAJW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAI5B;AAmBD;;GAEG;AACH,MAAa,qBAAqB;IAMhC,YAAoB,IAA+B,EAAE,IAAuB;QAC1E,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,sDAAsD;IAC/C,MAAM,CAAC,QAAQ,CAAC,KAAiC;QACtD,MAAM,IAAI,GAA8B,KAAK,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC;QACtG,IAAI,IAAI,CAAC;QACT,QAAQ,KAAK,CAAC,IAAI,EAAE;YAClB,KAAK,iBAAiB,CAAC,MAAM,CAAC;YAC9B,KAAK,iBAAiB,CAAC,MAAM;gBAC3B,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;gBAClB,MAAM;YACR;gBACE,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC;gBAChC,MAAM;SACT;QAED,OAAO,IAAI,qBAAqB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED,wDAAwD;IACjD,MAAM;QACX,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAC9C,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,sBAAsB,CAAC,KAAmC;;QACtE,mDAAmD;QACnD,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,YAAyC,EAAE,IAAI,EAAE,MAAA,KAAK,CAAC,YAAY,0CAAE,OAAO,EAAE,CAAC,CAAC;IACrH,CAAC;IAED,6DAA6D;IACtD,MAAM,CAAC,KAA4B;QACxC,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC;IAC9D,CAAC;CACF;AA3CD,sDA2CC","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\n\r\n/** Enumerates the types of map imagery that can be supplied by a [[BackgroundMapProvider]].\r\n * @public\r\n */\r\nexport enum BackgroundMapType {\r\n Street = 1,\r\n Aerial = 2,\r\n Hybrid = 3,\r\n}\r\n\r\n/** Enumerates a set of supported [[BackgroundMapProvider]]s that can provide map imagery.\r\n * @note To access imagery from such a provider, an API key must be supplied via [IModelAppOptions.mapLayerOptions]($frontend).\r\n * @public\r\n */\r\nexport type BackgroundMapProviderName = \"BingProvider\" | \"MapBoxProvider\";\r\n\r\n/** JSON representation of a [[BackgroundMapProvider]].\r\n * @see [[BaseMapLayerProps.provider]].\r\n * @beta\r\n */\r\nexport interface BackgroundMapProviderProps {\r\n /** The name of the provider. Default: \"BingProvider\" */\r\n name?: BackgroundMapProviderName;\r\n /** The type of imagery to display. Default: Hybrid. */\r\n type?: BackgroundMapType;\r\n}\r\n\r\n/** Describes one of a small set of standard, known suppliers of background map imagery as part of a [[BaseMapLayerSettings]].\r\n * @beta\r\n */\r\nexport class BackgroundMapProvider {\r\n /** The name of the provider. */\r\n public readonly name: BackgroundMapProviderName;\r\n /** The type of map imagery provided. */\r\n public readonly type: BackgroundMapType;\r\n\r\n private constructor(name: BackgroundMapProviderName, type: BackgroundMapType) {\r\n this.name = name;\r\n this.type = type;\r\n }\r\n\r\n /** Create a provider from its JSON representation. */\r\n public static fromJSON(props: BackgroundMapProviderProps): BackgroundMapProvider {\r\n const name: BackgroundMapProviderName = props.name === \"MapBoxProvider\" ? props.name : \"BingProvider\";\r\n let type;\r\n switch (props.type) {\r\n case BackgroundMapType.Street:\r\n case BackgroundMapType.Aerial:\r\n type = props.type;\r\n break;\r\n default:\r\n type = BackgroundMapType.Hybrid;\r\n break;\r\n }\r\n\r\n return new BackgroundMapProvider(name, type);\r\n }\r\n\r\n /** Convert this provider to its JSON representation. */\r\n public toJSON(): BackgroundMapProviderProps {\r\n return { name: this.name, type: this.type };\r\n }\r\n\r\n /** @internal */\r\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): BackgroundMapProvider {\r\n // eslint-disable-next-line deprecation/deprecation\r\n return this.fromJSON({ name: props.providerName as BackgroundMapProviderName, type: props.providerData?.mapType });\r\n }\r\n\r\n /** Return true if this provider is equivalent to `other`. */\r\n public equals(other: BackgroundMapProvider): boolean {\r\n return this.name === other.name && this.type === other.type;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"BackgroundMapProvider.js","sourceRoot":"","sources":["../../src/BackgroundMapProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH;;GAEG;AACH,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,6DAAU,CAAA;IACV,6DAAU,CAAA;IACV,6DAAU,CAAA;AACZ,CAAC,EAJW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAI5B;AAmBD;;GAEG;AACH,MAAa,qBAAqB;IAMhC,YAAoB,IAA+B,EAAE,IAAuB;QAC1E,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,sDAAsD;IAC/C,MAAM,CAAC,QAAQ,CAAC,KAAiC;QACtD,MAAM,IAAI,GAA8B,KAAK,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC;QACtG,IAAI,IAAI,CAAC;QACT,QAAQ,KAAK,CAAC,IAAI,EAAE;YAClB,KAAK,iBAAiB,CAAC,MAAM,CAAC;YAC9B,KAAK,iBAAiB,CAAC,MAAM;gBAC3B,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;gBAClB,MAAM;YACR;gBACE,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC;gBAChC,MAAM;SACT;QAED,OAAO,IAAI,qBAAqB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED,wDAAwD;IACjD,MAAM;QACX,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAC9C,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,sBAAsB,CAAC,KAAmC;;QACtE,mDAAmD;QACnD,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,YAAyC,EAAE,IAAI,EAAE,MAAA,KAAK,CAAC,YAAY,0CAAE,OAAO,EAAE,CAAC,CAAC;IACrH,CAAC;IAED,6DAA6D;IACtD,MAAM,CAAC,KAA4B;QACxC,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC;IAC9D,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,YAAwC;QACnD,OAAO,qBAAqB,CAAC,QAAQ,CAAC;YACpC,GAAG,IAAI,CAAC,MAAM,EAAE;YAChB,GAAG,YAAY;SAChB,CAAC,CAAC;IACL,CAAC;CACF;AArDD,sDAqDC","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\n\r\n/** Enumerates the types of map imagery that can be supplied by a [[BackgroundMapProvider]].\r\n * @public\r\n */\r\nexport enum BackgroundMapType {\r\n Street = 1,\r\n Aerial = 2,\r\n Hybrid = 3,\r\n}\r\n\r\n/** Enumerates a set of supported [[BackgroundMapProvider]]s that can provide map imagery.\r\n * @note To access imagery from such a provider, an API key must be supplied via [IModelAppOptions.mapLayerOptions]($frontend).\r\n * @public\r\n */\r\nexport type BackgroundMapProviderName = \"BingProvider\" | \"MapBoxProvider\";\r\n\r\n/** JSON representation of a [[BackgroundMapProvider]].\r\n * @see [[BaseMapLayerProps.provider]].\r\n * @beta\r\n */\r\nexport interface BackgroundMapProviderProps {\r\n /** The name of the provider. Default: \"BingProvider\" */\r\n name?: BackgroundMapProviderName;\r\n /** The type of imagery to display. Default: Hybrid. */\r\n type?: BackgroundMapType;\r\n}\r\n\r\n/** Describes one of a small set of standard, known suppliers of background map imagery as part of a [[BaseMapLayerSettings]].\r\n * @beta\r\n */\r\nexport class BackgroundMapProvider {\r\n /** The name of the provider. */\r\n public readonly name: BackgroundMapProviderName;\r\n /** The type of map imagery provided. */\r\n public readonly type: BackgroundMapType;\r\n\r\n private constructor(name: BackgroundMapProviderName, type: BackgroundMapType) {\r\n this.name = name;\r\n this.type = type;\r\n }\r\n\r\n /** Create a provider from its JSON representation. */\r\n public static fromJSON(props: BackgroundMapProviderProps): BackgroundMapProvider {\r\n const name: BackgroundMapProviderName = props.name === \"MapBoxProvider\" ? props.name : \"BingProvider\";\r\n let type;\r\n switch (props.type) {\r\n case BackgroundMapType.Street:\r\n case BackgroundMapType.Aerial:\r\n type = props.type;\r\n break;\r\n default:\r\n type = BackgroundMapType.Hybrid;\r\n break;\r\n }\r\n\r\n return new BackgroundMapProvider(name, type);\r\n }\r\n\r\n /** Convert this provider to its JSON representation. */\r\n public toJSON(): BackgroundMapProviderProps {\r\n return { name: this.name, type: this.type };\r\n }\r\n\r\n /** @internal */\r\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): BackgroundMapProvider {\r\n // eslint-disable-next-line deprecation/deprecation\r\n return this.fromJSON({ name: props.providerName as BackgroundMapProviderName, type: props.providerData?.mapType });\r\n }\r\n\r\n /** Return true if this provider is equivalent to `other`. */\r\n public equals(other: BackgroundMapProvider): boolean {\r\n return this.name === other.name && this.type === other.type;\r\n }\r\n\r\n /** Produce a copy of this provider with identical properties except for those explicitly specified by `changedProps`.\r\n * Any properties explicitly set to `undefined` in `changedProps` will be reset to their default values.\r\n */\r\n public clone(changedProps: BackgroundMapProviderProps): BackgroundMapProvider {\r\n return BackgroundMapProvider.fromJSON({\r\n ...this.toJSON(),\r\n ...changedProps,\r\n });\r\n }\r\n}\r\n"]}
@@ -9,12 +9,19 @@ export declare enum FontType {
9
9
  Rsc = 2,
10
10
  Shx = 3
11
11
  }
12
- /** The properties of a Font. This includes a iModel local id, the font type, and the font name.
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
- id: number;
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
- /** A FontMap holds the table of known fonts available in an iModel.
27
- * A font is referenced by an "id" that is local to the iModel. This table maps those local ids to a FontProps.
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 | number): FontProps | undefined;
47
+ getFont(arg: string | FontId): FontProps | undefined;
37
48
  }
38
49
  //# sourceMappingURL=Fonts.d.ts.map
@@ -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;AAEv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onts.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
- /** A FontMap holds the table of known fonts available in an iModel.
21
- * A font is referenced by an "id" that is local to the iModel. This table maps those local ids to a FontProps.
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 {
@@ -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;AAYvD;;;GAGG;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/** The properties of a Font. This includes a iModel local id, the font type, and the font name.\r\n * @public\r\n */\r\nexport interface FontProps { id: number, type: FontType, name: string }\r\n\r\n/** The properties of a FontMap\r\n * @public\r\n */\r\nexport interface FontMapProps { fonts: FontProps[] }\r\n\r\n/** A FontMap holds the table of known fonts available in an iModel.\r\n * A font is referenced by an \"id\" that is local to the iModel. This table maps those local ids to a FontProps.\r\n * @public\r\n */\r\nexport class FontMap {\r\n public readonly fonts = new Map<number, 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 | number): 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"]}
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;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,gBAAgB,CAAC,EAAE,aAAa,EAAE,CAAC;IACnC,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;CACjC;AAED;;;GAGG;AACH,oBAAY,iBAAiB,GAAG,oBAAoB,GAAG,QAAQ,CAAC;AAEhE,YAAY;AAEZ,yBAAiB,iBAAiB,CAAC;IACjC,wDAAwD;IACxD,SAAgB,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,iBAAiB,CAEjE;CACF;AAED;;;;;GAKG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,eAAe,CAAoB;IAC3C,OAAO,CAAC,iBAAiB,CAAiC;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AE,SAAS,CAAC,CAAC;IACrD,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,WAA6B,EAAE,QAAuC;QACjG,MAAM,SAAS,GAAG,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,EAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,uCAAoB,CAAC,sBAAsB,CAAC,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAG,CAAC,CAAC;QAEtK,OAAO,IAAI,kBAAkB,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 * @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"]}
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;YACtB,KAAK,MAAM,iBAA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W,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"]}
@@ -1,6 +1,7 @@
1
1
  /** @packageDocumentation
2
2
  * @module DisplayStyles
3
3
  */
4
+ import { Id64String } from "@itwin/core-bentley";
4
5
  import { BackgroundMapProvider, BackgroundMapProviderProps, BackgroundMapType } from "./BackgroundMapProvider";
5
6
  import { DeprecatedBackgroundMapProps } from "./BackgroundMapSettings";
6
7
  /** @beta */
@@ -57,34 +58,64 @@ export declare class MapSubLayerSettings {
57
58
  /** return a string representing this sublayer id (converting to string if underlying id is number) */
58
59
  get idString(): string;
59
60
  }
60
- /** JSON representation of the settings associated with a map layer. One or more map layers may be included within a [[MapImageryProps]] object.
61
+ /** JSON representation of properties common to both [[ImageMapLayerProps]] and [[ModelMapLayerProps]].
61
62
  * @see [[MapImageryProps]]
62
63
  * @beta
63
64
  */
64
- export interface MapLayerProps {
65
+ export interface CommonMapLayerProps {
65
66
  /** Controls visibility of layer. Defaults to 'true'. */
66
67
  visible?: boolean;
67
- /** Identifies the map layers source.*/
68
- formatId: string;
69
- /** Name */
68
+ /** A user-friendly name for the layer. */
70
69
  name: string;
70
+ /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing,
71
+ * or false to indicate the transparency should not be overridden.
72
+ * Default value: 0.
73
+ */
74
+ transparency?: number;
75
+ /** True to indicate background is transparent.
76
+ * Default: true.
77
+ */
78
+ transparentBackground?: boolean;
79
+ }
80
+ /** JSON representation of an [[ImageMapLayerSettings]].
81
+ * @see [[MapImagerySettings]].
82
+ * @beta
83
+ */
84
+ export interface ImageMapLayerProps extends CommonMapLayerProps {
71
85
  /** URL */
72
86
  url: string;
87
+ /** Identifies the map layers source.*/
88
+ formatId: string;
73
89
  /** Source layers. If undefined all layers are displayed. */
74
90
  subLayers?: MapSubLayerProps[];
75
- /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing,
76
- * or false to indicate the transparency should not be overridden. Default value: 0.
77
- * If omitted, defaults to 0. */
78
- transparency?: number;
79
- /** True to indicate background is transparent. Defaults to 'true'. */
80
- transparentBackground?: boolean;
81
- /** Is a base layer. Defaults to 'false'. */
82
- isBase?: boolean;
83
91
  /** Access Key for the Layer, like a subscription key or access token.
84
- * TODO This does not belong in the props object. It should never be persisted.
92
+ * ###TODO This does not belong in the props object. It should never be persisted.
85
93
  */
86
94
  accessKey?: MapLayerKey;
95
+ /** @internal */
96
+ modelId?: never;
87
97
  }
98
+ /** JSON representation of a [[ModelMapLayerSettings]].
99
+ * @see [[MapImagerySettings]].
100
+ * @beta
101
+ */
102
+ export interface ModelMapLayerProps extends CommonMapLayerProps {
103
+ /** The Id of the [GeometricModel]($backend) containing the geometry to be drawn by the layer. */
104
+ modelId: Id64String;
105
+ /** @internal */
106
+ url?: never;
107
+ /** @internal */
108
+ formatId?: never;
109
+ /** @internal */
110
+ subLayers?: never;
111
+ /** @internal */
112
+ accessKey?: never;
113
+ }
114
+ /** JSON representation of a [[MapLayerSettings]].
115
+ * @see [[MapImagerySettings]].
116
+ * @beta
117
+ */
118
+ export declare type MapLayerProps = ImageMapLayerProps | ModelMapLayerProps;
88
119
  /**
89
120
  * stores key-value pair to be added to all requests made involving map layer.
90
121
  * @beta
@@ -93,60 +124,112 @@ export interface MapLayerKey {
93
124
  key: string;
94
125
  value: string;
95
126
  }
96
- /** Normalized representation of a [[MapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
127
+ /** Abstract base class for normalized representation of a [[MapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
128
+ * This class is extended by [[ImageMapLayerSettings]] and [ModelMapLayerSettings]] to create the settings for image and model based layers.
97
129
  * One or more map layers may be included within [[MapImagerySettings]] object.
98
130
  * @see [[MapImagerySettings]]
99
131
  * @beta
100
132
  */
101
- export declare class MapLayerSettings {
133
+ export declare abstract class MapLayerSettings {
102
134
  readonly visible: boolean;
103
- readonly formatId: string;
104
135
  readonly name: string;
105
- readonly url: string;
106
136
  readonly transparency: number;
107
- readonly subLayers: MapSubLayerSettings[];
108
137
  readonly transparentBackground: boolean;
109
- readonly isBase: boolean;
138
+ abstract get allSubLayersInvisible(): boolean;
139
+ abstract clone(changedProps: Partial<MapLayerProps>): MapLayerSettings;
140
+ abstract toJSON(): MapLayerProps;
141
+ /** @internal */
142
+ protected constructor(name: string, visible?: boolean, transparency?: number, transparentBackground?: boolean);
143
+ /** Create a map layer settings from its JSON representation. */
144
+ static fromJSON(props: MapLayerProps): MapLayerSettings;
145
+ /** @internal */
146
+ protected _toJSON(): CommonMapLayerProps;
147
+ /** @internal */
148
+ protected cloneProps(changedProps: Partial<MapLayerProps>): CommonMapLayerProps;
149
+ /** @internal */
150
+ displayMatches(other: MapLayerSettings): boolean;
151
+ /** Return a unique string identifying the layers source... The URL for image layer or modelID for model layer */
152
+ abstract get source(): string;
153
+ /** @internal */
154
+ matchesNameAndSource(name: string, source: string): boolean;
155
+ }
156
+ /** Normalized representation of a [[ImageMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
157
+ * Image map layers are created from servers that produce images that represent map tiles. Map layers map also be represented by models.
158
+ * One or more map layers may be included within [[MapImagerySettings]] object.
159
+ * @see [[MapImagerySettings]]
160
+ * @see [[ModelMapLayerSettings]] for model based map layer settings.
161
+ * @beta
162
+ */
163
+ export declare class ImageMapLayerSettings extends MapLayerSettings {
164
+ readonly formatId: string;
165
+ readonly url: string;
110
166
  userName?: string;
111
167
  password?: string;
112
168
  accessKey?: MapLayerKey;
113
- setCredentials(userName?: string, password?: string): void;
169
+ readonly subLayers: MapSubLayerSettings[];
170
+ get source(): string;
114
171
  /** @internal */
115
- protected constructor(url: string, name: string, formatId: string, visible?: boolean, jsonSubLayers?: MapSubLayerProps[] | undefined, transparency?: number, transparentBackground?: boolean, isBase?: boolean, userName?: string, password?: string, accessKey?: MapLayerKey);
116
- /** Construct from JSON, performing validation and applying default values for undefined fields. */
117
- static fromJSON(json: MapLayerProps): MapLayerSettings;
172
+ protected constructor(props: ImageMapLayerProps);
173
+ static fromJSON(props: ImageMapLayerProps): ImageMapLayerSettings;
118
174
  /** return JSON representation of this MapLayerSettings object */
119
- toJSON(): MapLayerProps;
120
- /** @internal */
121
- protected static mapTypeName(type: BackgroundMapType): "Aerial Imagery" | "Aerial Imagery with labels" | "Streets";
175
+ toJSON(): ImageMapLayerProps;
122
176
  /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.
123
177
  * @param changedProps JSON representation of the properties to change.
124
178
  * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.
125
179
  */
126
- clone(changedProps: Partial<MapLayerProps>): MapLayerSettings;
180
+ clone(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerSettings;
127
181
  /** @internal */
128
- protected cloneProps(changedProps: Partial<MapLayerProps>): MapLayerProps;
182
+ protected cloneProps(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerProps;
129
183
  /** @internal */
130
184
  displayMatches(other: MapLayerSettings): boolean;
131
- /** @internal */
132
- matchesNameAndUrl(name: string, url: string): boolean;
133
185
  /** Return a sublayer matching id -- or undefined if not found */
134
186
  subLayerById(id?: SubLayerId): MapSubLayerSettings | undefined;
135
187
  private hasInvisibleAncestors;
136
188
  /** Return true if sublayer is visible -- testing ancestors for visibility if they exist. */
137
189
  isSubLayerVisible(subLayer: MapSubLayerSettings): boolean;
138
- /** Return true if all sublayers are visible. */
190
+ /** Return true if all sublayers are invisible. */
139
191
  get allSubLayersInvisible(): boolean;
140
192
  /** Return the children for a sublayer */
141
193
  getSubLayerChildren(subLayer: MapSubLayerSettings): MapSubLayerSettings[] | undefined;
194
+ /** @internal */
195
+ protected static mapTypeName(type: BackgroundMapType): "Aerial Imagery" | "Aerial Imagery with labels" | "Streets";
196
+ setCredentials(userName?: string, password?: string): void;
197
+ }
198
+ /** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
199
+ * Model map layers are produced from models, typically from two dimensional geometry that may originate in a GIS system.
200
+ * One or more map layers may be included within [[MapImagerySettings]] object.
201
+ * @see [[MapImagerySettings]]
202
+ * @see [[ImageMapLayerSettings]] for image based map layer settings.
203
+ * @beta
204
+ */
205
+ export declare class ModelMapLayerSettings extends MapLayerSettings {
206
+ readonly modelId: Id64String;
207
+ get source(): string;
208
+ /** @internal */
209
+ protected constructor(modelId: Id64String, name: string, visible?: boolean, transparency?: number, transparentBackground?: boolean);
210
+ /** Construct from JSON, performing validation and applying default values for undefined fields. */
211
+ static fromJSON(json: ModelMapLayerProps): ModelMapLayerSettings;
212
+ /** return JSON representation of this MapLayerSettings object */
213
+ toJSON(): ModelMapLayerProps;
214
+ /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.
215
+ * @param changedProps JSON representation of the properties to change.
216
+ * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.
217
+ */
218
+ clone(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerSettings;
219
+ /** @internal */
220
+ protected cloneProps(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerProps;
221
+ /** @internal */
222
+ displayMatches(other: MapLayerSettings): boolean;
223
+ /** Return true if all sublayers are invisible (always false as model layers do not include sublayers). */
224
+ get allSubLayersInvisible(): boolean;
142
225
  }
143
226
  /** JSON representation of a [[BaseMapLayerSettings]].
144
227
  * @beta
145
228
  */
146
- export interface BaseMapLayerProps extends MapLayerProps {
229
+ export interface BaseMapLayerProps extends ImageMapLayerProps {
147
230
  provider?: BackgroundMapProviderProps;
148
231
  }
149
- /** A [[MapLayerSettings]] that can serve as the base layer for a [[MapImagerySettings]].
232
+ /** A [[ImageMapLayerSettings]] that can serve as the base layer for a [[MapImagerySettings]].
150
233
  * The base layer supports all of the same options as any other layer, but also allows for simplified configuration based
151
234
  * on a small set of known supported [[BackgroundMapProvider]]s like [Bing Maps](https://www.microsoft.com/en-us/maps).
152
235
  * If the base layer was configured from such a provider, that information will be preserved and can be queried; this allows
@@ -154,7 +237,7 @@ export interface BaseMapLayerProps extends MapLayerProps {
154
237
  * @see [[MapImagerySettings.backgroundBase]].
155
238
  * @beta
156
239
  */
157
- export declare class BaseMapLayerSettings extends MapLayerSettings {
240
+ export declare class BaseMapLayerSettings extends ImageMapLayerSettings {
158
241
  private _provider?;
159
242
  /** The provider from which this base layer was configured, if any. */
160
243
  get provider(): BackgroundMapProvider | undefined;
@@ -167,9 +250,9 @@ export declare class BaseMapLayerSettings extends MapLayerSettings {
167
250
  /** Convert this layer to its JSON representation. */
168
251
  toJSON(): BaseMapLayerProps;
169
252
  /** @internal */
170
- cloneProps(changedProps: Partial<MapLayerProps>): BaseMapLayerProps;
253
+ cloneProps(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerProps;
171
254
  /** Create a copy of this layer. */
172
- clone(changedProps: Partial<MapLayerProps>): BaseMapLayerSettings;
255
+ clone(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerSettings;
173
256
  /** Create a base layer from a BackgroundMapProvider. */
174
257
  static fromProvider(provider: BackgroundMapProvider, options?: {
175
258
  invisible?: boolean;