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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +82 -17
  2. package/lib/cjs/Fonts.d.ts +16 -5
  3. package/lib/cjs/Fonts.d.ts.map +1 -1
  4. package/lib/cjs/Fonts.js +6 -2
  5. package/lib/cjs/Fonts.js.map +1 -1
  6. package/lib/cjs/MapImagerySettings.d.ts +2 -0
  7. package/lib/cjs/MapImagerySettings.d.ts.map +1 -1
  8. package/lib/cjs/MapImagerySettings.js.map +1 -1
  9. package/lib/cjs/MapLayerSettings.d.ts +120 -37
  10. package/lib/cjs/MapLayerSettings.d.ts.map +1 -1
  11. package/lib/cjs/MapLayerSettings.js +156 -86
  12. package/lib/cjs/MapLayerSettings.js.map +1 -1
  13. package/lib/cjs/SpatialClassification.d.ts +5 -0
  14. package/lib/cjs/SpatialClassification.d.ts.map +1 -1
  15. package/lib/cjs/SpatialClassification.js +7 -0
  16. package/lib/cjs/SpatialClassification.js.map +1 -1
  17. package/lib/cjs/geometry/TextString.d.ts +5 -4
  18. package/lib/cjs/geometry/TextString.d.ts.map +1 -1
  19. package/lib/cjs/geometry/TextString.js.map +1 -1
  20. package/lib/cjs/ipc/IpcWebSocket.d.ts +0 -1
  21. package/lib/cjs/ipc/IpcWebSocket.d.ts.map +1 -1
  22. package/lib/cjs/ipc/IpcWebSocket.js +4 -13
  23. package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
  24. package/lib/cjs/ipc/IpcWebSocketTransport.d.ts +2 -1
  25. package/lib/cjs/ipc/IpcWebSocketTransport.d.ts.map +1 -1
  26. package/lib/cjs/ipc/IpcWebSocketTransport.js +24 -15
  27. package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
  28. package/lib/cjs/rpc/IModelReadRpcInterface.d.ts +1 -0
  29. package/lib/cjs/rpc/IModelReadRpcInterface.d.ts.map +1 -1
  30. package/lib/cjs/rpc/IModelReadRpcInterface.js +1 -0
  31. package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
  32. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +1 -1
  33. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  34. package/lib/cjs/tile/IModelTileIO.d.ts +2 -2
  35. package/lib/cjs/tile/IModelTileIO.js +2 -2
  36. package/lib/cjs/tile/IModelTileIO.js.map +1 -1
  37. package/lib/esm/Fonts.d.ts +16 -5
  38. package/lib/esm/Fonts.d.ts.map +1 -1
  39. package/lib/esm/Fonts.js +6 -2
  40. package/lib/esm/Fonts.js.map +1 -1
  41. package/lib/esm/MapImagerySettings.d.ts +2 -0
  42. package/lib/esm/MapImagerySettings.d.ts.map +1 -1
  43. package/lib/esm/MapImagerySettings.js.map +1 -1
  44. package/lib/esm/MapLayerSettings.d.ts +120 -37
  45. package/lib/esm/MapLayerSettings.d.ts.map +1 -1
  46. package/lib/esm/MapLayerSettings.js +152 -84
  47. package/lib/esm/MapLayerSettings.js.map +1 -1
  48. package/lib/esm/SpatialClassification.d.ts +5 -0
  49. package/lib/esm/SpatialClassification.d.ts.map +1 -1
  50. package/lib/esm/SpatialClassification.js +7 -0
  51. package/lib/esm/SpatialClassification.js.map +1 -1
  52. package/lib/esm/geometry/TextString.d.ts +5 -4
  53. package/lib/esm/geometry/TextString.d.ts.map +1 -1
  54. package/lib/esm/geometry/TextString.js.map +1 -1
  55. package/lib/esm/ipc/IpcWebSocket.d.ts +0 -1
  56. package/lib/esm/ipc/IpcWebSocket.d.ts.map +1 -1
  57. package/lib/esm/ipc/IpcWebSocket.js +4 -13
  58. package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
  59. package/lib/esm/ipc/IpcWebSocketTransport.d.ts +2 -1
  60. package/lib/esm/ipc/IpcWebSocketTransport.d.ts.map +1 -1
  61. package/lib/esm/ipc/IpcWebSocketTransport.js +24 -15
  62. package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
  63. package/lib/esm/rpc/IModelReadRpcInterface.d.ts +1 -0
  64. package/lib/esm/rpc/IModelReadRpcInterface.d.ts.map +1 -1
  65. package/lib/esm/rpc/IModelReadRpcInterface.js +1 -0
  66. package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
  67. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +1 -1
  68. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  69. package/lib/esm/tile/IModelTileIO.d.ts +2 -2
  70. package/lib/esm/tile/IModelTileIO.js +2 -2
  71. package/lib/esm/tile/IModelTileIO.js.map +1 -1
  72. package/package.json +7 -7
@@ -68,85 +68,98 @@ export class MapSubLayerSettings {
68
68
  /** return a string representing this sublayer id (converting to string if underlying id is number) */
69
69
  get idString() { return (typeof this.id === "number") ? this.id.toString(10) : this.id; }
70
70
  }
71
- /** Normalized representation of a [[MapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
71
+ /** 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.
72
+ * This class is extended by [[ImageMapLayerSettings]] and [ModelMapLayerSettings]] to create the settings for image and model based layers.
72
73
  * One or more map layers may be included within [[MapImagerySettings]] object.
73
74
  * @see [[MapImagerySettings]]
74
75
  * @beta
75
76
  */
76
77
  export class MapLayerSettings {
77
78
  /** @internal */
78
- constructor(url, name, formatId, visible = true, jsonSubLayers = undefined, transparency = 0, transparentBackground = true, isBase = false, userName, password, accessKey) {
79
- var _a;
80
- this.formatId = formatId;
79
+ constructor(name, visible = true, transparency = 0, transparentBackground = true) {
81
80
  this.name = name;
82
81
  this.visible = visible;
83
82
  this.transparentBackground = transparentBackground;
84
- this.isBase = isBase;
85
- this.subLayers = new Array();
86
- if (jsonSubLayers !== undefined) {
87
- let hasUnnamedGroups = false;
88
- for (const jsonSubLayer of jsonSubLayers) {
89
- const subLayer = MapSubLayerSettings.fromJSON(jsonSubLayer);
90
- if (undefined !== subLayer) {
91
- this.subLayers.push(subLayer);
92
- if (((_a = subLayer.children) === null || _a === void 0 ? void 0 : _a.length) !== 0 && !subLayer.isNamed && !hasUnnamedGroups)
93
- hasUnnamedGroups = true;
94
- }
95
- }
96
- this.userName = userName;
97
- this.password = password;
98
- }
99
- this.accessKey = accessKey;
100
83
  this.transparency = transparency;
101
- this.url = url;
102
- }
103
- setCredentials(userName, password) {
104
- this.userName = userName;
105
- this.password = password;
106
84
  }
107
- /** Construct from JSON, performing validation and applying default values for undefined fields. */
108
- static fromJSON(json) {
109
- const transparentBackground = (json.transparentBackground === undefined) ? true : json.transparentBackground;
110
- return new this(json.url, json.name, json.formatId, json.visible, json.subLayers, json.transparency, transparentBackground, json.isBase === true, undefined, undefined, json.accessKey);
85
+ /** Create a map layer settings from its JSON representation. */
86
+ static fromJSON(props) {
87
+ return undefined !== props.modelId ? ModelMapLayerSettings.fromJSON(props) : ImageMapLayerSettings.fromJSON(props);
111
88
  }
112
- /** return JSON representation of this MapLayerSettings object */
113
- toJSON() {
114
- const props = { formatId: this.formatId, name: this.name, url: this.url };
115
- if (this.subLayers.length > 0) {
116
- props.subLayers = [];
117
- this.subLayers.forEach((subLayer) => {
118
- const subLayerJson = subLayer.toJSON();
119
- if (subLayerJson)
120
- props.subLayers.push(subLayerJson);
121
- });
122
- }
89
+ /** @internal */
90
+ _toJSON() {
91
+ const props = {
92
+ name: this.name,
93
+ visible: this.visible,
94
+ };
123
95
  if (0 !== this.transparency)
124
96
  props.transparency = this.transparency;
125
97
  if (this.transparentBackground === false)
126
98
  props.transparentBackground = this.transparentBackground;
127
- if (this.isBase === true)
128
- props.isBase = this.isBase;
129
- props.visible = this.visible;
130
99
  return props;
131
100
  }
132
101
  /** @internal */
133
- static mapTypeName(type) {
134
- switch (type) {
135
- case BackgroundMapType.Aerial:
136
- return "Aerial Imagery";
137
- default:
138
- case BackgroundMapType.Hybrid:
139
- return "Aerial Imagery with labels";
140
- case BackgroundMapType.Street:
141
- return "Streets";
102
+ cloneProps(changedProps) {
103
+ return {
104
+ name: undefined !== changedProps.name ? changedProps.name : this.name,
105
+ visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,
106
+ transparency: undefined !== changedProps.transparency ? changedProps.transparency : this.transparency,
107
+ transparentBackground: undefined !== changedProps.transparentBackground ? changedProps.transparentBackground : this.transparentBackground,
108
+ };
109
+ }
110
+ /** @internal */
111
+ displayMatches(other) {
112
+ return this.name === other.name && this.visible === other.visible && this.transparency === other.transparency && this.transparentBackground === other.transparentBackground;
113
+ }
114
+ /** @internal */
115
+ matchesNameAndSource(name, source) {
116
+ return this.name === name && this.source === source;
117
+ }
118
+ }
119
+ /** Normalized representation of a [[ImageMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
120
+ * Image map layers are created from servers that produce images that represent map tiles. Map layers map also be represented by models.
121
+ * One or more map layers may be included within [[MapImagerySettings]] object.
122
+ * @see [[MapImagerySettings]]
123
+ * @see [[ModelMapLayerSettings]] for model based map layer settings.
124
+ * @beta
125
+ */
126
+ export class ImageMapLayerSettings extends MapLayerSettings {
127
+ /** @internal */
128
+ constructor(props) {
129
+ var _a;
130
+ const transparentBackground = (_a = props.transparentBackground) !== null && _a !== void 0 ? _a : true;
131
+ super(props.name, props.visible, props.transparency, transparentBackground);
132
+ this.formatId = props.formatId;
133
+ this.url = props.url;
134
+ this.accessKey = props.accessKey;
135
+ this.subLayers = [];
136
+ if (!props.subLayers)
137
+ return;
138
+ for (const subLayerProps of props.subLayers) {
139
+ const subLayer = MapSubLayerSettings.fromJSON(subLayerProps);
140
+ if (subLayer)
141
+ this.subLayers.push(subLayer);
142
142
  }
143
143
  }
144
+ get source() { return this.url; }
145
+ static fromJSON(props) {
146
+ return new this(props);
147
+ }
148
+ /** return JSON representation of this MapLayerSettings object */
149
+ toJSON() {
150
+ const props = super._toJSON();
151
+ props.url = this.url;
152
+ props.formatId = this.formatId;
153
+ if (this.subLayers.length > 0)
154
+ props.subLayers = this.subLayers.map((x) => x.toJSON());
155
+ return props;
156
+ }
144
157
  /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.
145
158
  * @param changedProps JSON representation of the properties to change.
146
159
  * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.
147
160
  */
148
161
  clone(changedProps) {
149
- const clone = MapLayerSettings.fromJSON(this.cloneProps(changedProps));
162
+ const clone = ImageMapLayerSettings.fromJSON(this.cloneProps(changedProps));
150
163
  // Clone members not part of MapLayerProps
151
164
  clone.userName = this.userName;
152
165
  clone.password = this.password;
@@ -155,27 +168,19 @@ export class MapLayerSettings {
155
168
  }
156
169
  /** @internal */
157
170
  cloneProps(changedProps) {
158
- return {
159
- name: undefined !== changedProps.name ? changedProps.name : this.name,
160
- formatId: undefined !== changedProps.formatId ? changedProps.formatId : this.formatId,
161
- visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,
162
- url: undefined !== changedProps.url ? changedProps.url : this.url,
163
- transparency: undefined !== changedProps.transparency ? changedProps.transparency : this.transparency,
164
- transparentBackground: undefined !== changedProps.transparentBackground ? changedProps.transparentBackground : this.transparentBackground,
165
- subLayers: undefined !== changedProps.subLayers ? changedProps.subLayers : this.subLayers,
166
- accessKey: undefined !== changedProps.accessKey ? changedProps.accessKey : this.accessKey,
167
- };
171
+ var _a, _b, _c, _d;
172
+ const props = super.cloneProps(changedProps);
173
+ props.formatId = (_a = changedProps.formatId) !== null && _a !== void 0 ? _a : this.formatId;
174
+ props.url = (_b = changedProps.url) !== null && _b !== void 0 ? _b : this.url;
175
+ props.accessKey = (_c = changedProps.accessKey) !== null && _c !== void 0 ? _c : this.accessKey;
176
+ props.subLayers = (_d = changedProps.subLayers) !== null && _d !== void 0 ? _d : this.subLayers;
177
+ return props;
168
178
  }
169
179
  /** @internal */
170
180
  displayMatches(other) {
171
- if (!this.matchesNameAndUrl(other.name, other.url)
172
- || this.visible !== other.visible
173
- || this.transparency !== other.transparency
174
- || this.transparentBackground !== other.transparentBackground
175
- || this.subLayers.length !== other.subLayers.length) {
181
+ if (!(other instanceof ImageMapLayerSettings) || !super.displayMatches(other))
176
182
  return false;
177
- }
178
- if (this.userName !== other.userName || this.password !== other.password) {
183
+ if (this.userName !== other.userName || this.password !== other.password || this.subLayers.length !== other.subLayers.length) {
179
184
  return false;
180
185
  }
181
186
  for (let i = 0; i < this.subLayers.length; i++)
@@ -183,10 +188,6 @@ export class MapLayerSettings {
183
188
  return false;
184
189
  return true;
185
190
  }
186
- /** @internal */
187
- matchesNameAndUrl(name, url) {
188
- return this.name === name && this.url === url;
189
- }
190
191
  /** Return a sublayer matching id -- or undefined if not found */
191
192
  subLayerById(id) {
192
193
  return id === undefined ? undefined : this.subLayers.find((subLayer) => subLayer.id === id);
@@ -207,7 +208,7 @@ export class MapLayerSettings {
207
208
  return false;
208
209
  return !this.hasInvisibleAncestors(subLayer);
209
210
  }
210
- /** Return true if all sublayers are visible. */
211
+ /** Return true if all sublayers are invisible. */
211
212
  get allSubLayersInvisible() {
212
213
  if (this.subLayers.length === 0)
213
214
  return false;
@@ -225,8 +226,74 @@ export class MapLayerSettings {
225
226
  });
226
227
  return children;
227
228
  }
229
+ /** @internal */
230
+ static mapTypeName(type) {
231
+ switch (type) {
232
+ case BackgroundMapType.Aerial:
233
+ return "Aerial Imagery";
234
+ default:
235
+ case BackgroundMapType.Hybrid:
236
+ return "Aerial Imagery with labels";
237
+ case BackgroundMapType.Street:
238
+ return "Streets";
239
+ }
240
+ }
241
+ setCredentials(userName, password) {
242
+ this.userName = userName;
243
+ this.password = password;
244
+ }
245
+ }
246
+ /** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
247
+ * Model map layers are produced from models, typically from two dimensional geometry that may originate in a GIS system.
248
+ * One or more map layers may be included within [[MapImagerySettings]] object.
249
+ * @see [[MapImagerySettings]]
250
+ * @see [[ImageMapLayerSettings]] for image based map layer settings.
251
+ * @beta
252
+ */
253
+ export class ModelMapLayerSettings extends MapLayerSettings {
254
+ /** @internal */
255
+ constructor(modelId, name, visible = true, transparency = 0, transparentBackground = true) {
256
+ super(name, visible, transparency, transparentBackground);
257
+ this.modelId = modelId;
258
+ }
259
+ get source() { return this.modelId; }
260
+ /** Construct from JSON, performing validation and applying default values for undefined fields. */
261
+ static fromJSON(json) {
262
+ const transparentBackground = (json.transparentBackground === undefined) ? true : json.transparentBackground;
263
+ return new this(json.modelId, json.name, json.visible, json.transparency, transparentBackground);
264
+ }
265
+ /** return JSON representation of this MapLayerSettings object */
266
+ toJSON() {
267
+ const props = super._toJSON();
268
+ props.modelId = this.modelId;
269
+ return props;
270
+ }
271
+ /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.
272
+ * @param changedProps JSON representation of the properties to change.
273
+ * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.
274
+ */
275
+ clone(changedProps) {
276
+ return ModelMapLayerSettings.fromJSON(this.cloneProps(changedProps));
277
+ }
278
+ /** @internal */
279
+ cloneProps(changedProps) {
280
+ var _a;
281
+ const props = super.cloneProps(changedProps);
282
+ props.modelId = (_a = changedProps.modelId) !== null && _a !== void 0 ? _a : this.modelId;
283
+ return props;
284
+ }
285
+ /** @internal */
286
+ displayMatches(other) {
287
+ if (!(other instanceof ModelMapLayerSettings) || !super.displayMatches(other))
288
+ return false;
289
+ return this.modelId === other.modelId;
290
+ }
291
+ /** Return true if all sublayers are invisible (always false as model layers do not include sublayers). */
292
+ get allSubLayersInvisible() {
293
+ return false;
294
+ }
228
295
  }
229
- /** A [[MapLayerSettings]] that can serve as the base layer for a [[MapImagerySettings]].
296
+ /** A [[ImageMapLayerSettings]] that can serve as the base layer for a [[MapImagerySettings]].
230
297
  * The base layer supports all of the same options as any other layer, but also allows for simplified configuration based
231
298
  * on a small set of known supported [[BackgroundMapProvider]]s like [Bing Maps](https://www.microsoft.com/en-us/maps).
232
299
  * If the base layer was configured from such a provider, that information will be preserved and can be queried; this allows
@@ -234,7 +301,7 @@ export class MapLayerSettings {
234
301
  * @see [[MapImagerySettings.backgroundBase]].
235
302
  * @beta
236
303
  */
237
- export class BaseMapLayerSettings extends MapLayerSettings {
304
+ export class BaseMapLayerSettings extends ImageMapLayerSettings {
238
305
  /** The provider from which this base layer was configured, if any. */
239
306
  get provider() { return this._provider; }
240
307
  /** Create a base layer from its JSON representation.
@@ -259,7 +326,9 @@ export class BaseMapLayerSettings extends MapLayerSettings {
259
326
  /** @internal */
260
327
  cloneProps(changedProps) {
261
328
  const props = super.cloneProps(changedProps);
262
- if (this.provider)
329
+ if (changedProps.provider)
330
+ props.provider = changedProps.provider;
331
+ else if (this.provider)
263
332
  props.provider = this.provider.toJSON();
264
333
  return props;
265
334
  }
@@ -291,21 +360,21 @@ export class BaseMapLayerSettings extends MapLayerSettings {
291
360
  imagerySet = "AerialWithLabels";
292
361
  break;
293
362
  }
294
- name = `Bing Maps: ${MapLayerSettings.mapTypeName(provider.type)}`;
363
+ name = `Bing Maps: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;
295
364
  url = `https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${imagerySet}?o=json&incl=ImageryProviders&key={bingKey}`;
296
365
  break;
297
366
  case "MapBoxProvider":
298
367
  formatId = "MapboxImagery";
299
- name = `MapBox: ${MapLayerSettings.mapTypeName(provider.type)}`;
368
+ name = `MapBox: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;
300
369
  switch (provider.type) {
301
370
  case BackgroundMapType.Street:
302
- url = "https://api.mapbox.com/v4/mapbox.streets/";
371
+ url = "https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/";
303
372
  break;
304
373
  case BackgroundMapType.Aerial:
305
- url = "https://api.mapbox.com/v4/mapbox.satellite/";
374
+ url = "https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/";
306
375
  break;
307
376
  case BackgroundMapType.Hybrid:
308
- url = "https://api.mapbox.com/v4/mapbox.streets-satellite/";
377
+ url = "https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/";
309
378
  break;
310
379
  }
311
380
  break;
@@ -315,7 +384,6 @@ export class BaseMapLayerSettings extends MapLayerSettings {
315
384
  formatId,
316
385
  url,
317
386
  transparentBackground: false,
318
- isBase: true,
319
387
  visible: !(options === null || options === void 0 ? void 0 : options.invisible),
320
388
  transparency: options === null || options === void 0 ? void 0 : options.transparency,
321
389
  });
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayerSettings.js","sourceRoot":"","sources":["../../src/MapLayerSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAA8B,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAqB/G;;;;;;;GAOG;AACH,MAAM,OAAO,mBAAmB;IAc9B,YAAY,IAAY,EAAE,KAAc,EAAE,OAAiB,EAAE,EAAe,EAAE,MAAmB,EAAE,QAAuB;QACxH,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC;QAChD,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IACD,mGAAmG;IAC5F,MAAM,CAAC,QAAQ,CAAC,IAAsB;QAC3C,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CA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M,CAAC,sBAAsB,CAAC,KAAmC;QACtE,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;IAChF,CAAC;IAED,aAAa;IACN,iBAAiB,CAAC,QAA+B;QACtD,OAAO,oBAAoB,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IACpH,CAAC;CACF","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 { assert } from \"@itwin/core-bentley\";\r\nimport { BackgroundMapProvider, BackgroundMapProviderProps, BackgroundMapType } from \"./BackgroundMapProvider\";\r\nimport { DeprecatedBackgroundMapProps } from \"./BackgroundMapSettings\";\r\n\r\n/** @beta */\r\nexport type SubLayerId = string | number;\r\n\r\n/** JSON representation of the settings associated with a map sublayer included within a [[MapLayerProps]].\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * @see [[MapLayerProps]]\r\n * @beta\r\n */\r\nexport interface MapSubLayerProps {\r\n name: string;\r\n title?: string;\r\n visible?: boolean;\r\n id?: SubLayerId;\r\n parent?: SubLayerId;\r\n children?: SubLayerId[];\r\n}\r\n\r\n/** Normalized representation of a [[MapSubLayerProps]] for which values\r\n * have been validated and default values have been applied where explicit values not defined.\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * This class can represent a hierarchy, in this case a sub layer is visible only if all its ancestors are also visible.\r\n * @see [[MapLayerSettings]]\r\n * @beta\r\n */\r\nexport class MapSubLayerSettings {\r\n /** Typically Name is a single word used for machine-to-machine communication while the Title is for the benefit of humans (WMS) */\r\n public readonly name: string;\r\n /** Title. */\r\n public readonly title?: string;\r\n /** If true the sub layer is visible. If part of a hierarchy, a sub layer is visible only if its ancestors are also visible. */\r\n public readonly visible: boolean;\r\n /** A unique string or number that may be used to identify the sub layer (ArcGIS) */\r\n public readonly id: SubLayerId;\r\n /** One or more sublayer children */\r\n public readonly children?: SubLayerId[];\r\n /** sublayer parent. */\r\n public readonly parent?: SubLayerId;\r\n\r\n constructor(name: string, title?: string, visible?: boolean, id?: SubLayerId, parent?: SubLayerId, children?: SubLayerId[]) {\r\n this.name = name;\r\n this.title = title;\r\n this.visible = visible !== undefined && visible;\r\n this.id = (id === undefined) ? this.name : id;\r\n this.parent = parent;\r\n this.children = children;\r\n }\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static fromJSON(json: MapSubLayerProps): MapSubLayerSettings {\r\n return new MapSubLayerSettings(json.name, json.title, json.visible, (json.id === json.name) ? undefined : json.id, json.parent, json.children);\r\n }\r\n public toJSON(): MapSubLayerProps {\r\n const props: MapSubLayerProps = { name: this.name, visible: this.visible };\r\n\r\n if (undefined !== this.id && this.id !== this.name)\r\n props.id = this.id;\r\n\r\n if (undefined !== this.title)\r\n props.title = this.title;\r\n\r\n if (this.children)\r\n props.children = [...this.children];\r\n\r\n if (undefined !== this.parent)\r\n props.parent = this.parent;\r\n\r\n return props;\r\n }\r\n\r\n /** Creating a copy of this MapSubLayer, optionally modifying some if its properties */\r\n public clone(changedProps: Partial<MapSubLayerProps>): MapSubLayerSettings {\r\n if (undefined === changedProps)\r\n return this;\r\n\r\n const props = {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n id: undefined !== changedProps.id ? changedProps.id : this.id,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n parent: undefined !== changedProps.parent ? changedProps.parent : this.parent,\r\n children: undefined !== changedProps.children ? changedProps.children.slice() : this.children?.slice(),\r\n title: undefined !== changedProps.title ? changedProps.title : this.title,\r\n };\r\n return MapSubLayerSettings.fromJSON(props)!;\r\n }\r\n /** @internal */\r\n public displayMatches(other: MapSubLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible;\r\n }\r\n /** return true if this sublayer is named. */\r\n public get isNamed(): boolean { return this.name.length > 0; }\r\n\r\n /** return true if this sublayer is a leaf (has no children) */\r\n public get isLeaf(): boolean { return this.children === undefined || this.children.length === 0; }\r\n\r\n /** return true if this sublayer is an unnamed group */\r\n public get isUnnamedGroup(): boolean { return !this.isLeaf && !this.isNamed; }\r\n\r\n /** return a string representing this sublayer id (converting to string if underlying id is number) */\r\n public get idString(): string { return (typeof this.id === \"number\") ? this.id.toString(10) : this.id; }\r\n}\r\n\r\n/** JSON representation of the settings associated with a map layer. One or more map layers may be included within a [[MapImageryProps]] object.\r\n * @see [[MapImageryProps]]\r\n * @beta\r\n */\r\nexport interface MapLayerProps {\r\n /** Controls visibility of layer. Defaults to 'true'. */\r\n visible?: boolean;\r\n /** Identifies the map layers source.*/\r\n formatId: string;\r\n /** Name */\r\n name: string;\r\n /** URL */\r\n url: string;\r\n /** Source layers. If undefined all layers are displayed. */\r\n subLayers?: MapSubLayerProps[];\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing,\r\n * or false to indicate the transparency should not be overridden. Default value: 0.\r\n * If omitted, defaults to 0. */\r\n transparency?: number;\r\n /** True to indicate background is transparent. Defaults to 'true'. */\r\n transparentBackground?: boolean;\r\n /** Is a base layer. Defaults to 'false'. */\r\n isBase?: boolean;\r\n /** Access Key for the Layer, like a subscription key or access token.\r\n * TODO This does not belong in the props object. It should never be persisted.\r\n */\r\n accessKey?: MapLayerKey;\r\n}\r\n\r\n/**\r\n * stores key-value pair to be added to all requests made involving map layer.\r\n * @beta\r\n */\r\nexport interface MapLayerKey {\r\n key: string;\r\n value: string;\r\n}\r\n\r\n/** Normalized representation of a [[MapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @beta\r\n */\r\nexport class MapLayerSettings {\r\n public readonly visible: boolean;\r\n public readonly formatId: string;\r\n public readonly name: string;\r\n public readonly url: string;\r\n public readonly transparency: number;\r\n public readonly subLayers: MapSubLayerSettings[];\r\n public readonly transparentBackground: boolean;\r\n public readonly isBase: boolean;\r\n public userName?: string;\r\n public password?: string;\r\n public accessKey?: MapLayerKey;\r\n\r\n public setCredentials(userName?: string, password?: string) {\r\n this.userName = userName;\r\n this.password = password;\r\n }\r\n\r\n /** @internal */\r\n protected constructor(url: string, name: string, formatId: string, visible = true,\r\n jsonSubLayers: MapSubLayerProps[] | undefined = undefined, transparency: number = 0,\r\n transparentBackground = true, isBase = false, userName?: string, password?: string, accessKey?: MapLayerKey) {\r\n this.formatId = formatId;\r\n this.name = name;\r\n this.visible = visible;\r\n this.transparentBackground = transparentBackground;\r\n this.isBase = isBase;\r\n this.subLayers = new Array<MapSubLayerSettings>();\r\n if (jsonSubLayers !== undefined) {\r\n let hasUnnamedGroups = false;\r\n for (const jsonSubLayer of jsonSubLayers) {\r\n const subLayer = MapSubLayerSettings.fromJSON(jsonSubLayer);\r\n if (undefined !== subLayer) {\r\n this.subLayers.push(subLayer);\r\n if (subLayer.children?.length !== 0 && !subLayer.isNamed && !hasUnnamedGroups)\r\n hasUnnamedGroups = true;\r\n }\r\n }\r\n\r\n this.userName = userName;\r\n this.password = password;\r\n }\r\n this.accessKey = accessKey;\r\n this.transparency = transparency;\r\n this.url = url;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static fromJSON(json: MapLayerProps): MapLayerSettings {\r\n const transparentBackground = (json.transparentBackground === undefined) ? true : json.transparentBackground;\r\n return new this(json.url, json.name, json.formatId, json.visible, json.subLayers, json.transparency, transparentBackground, json.isBase === true, undefined, undefined, json.accessKey);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public toJSON(): MapLayerProps {\r\n const props: MapLayerProps = { formatId: this.formatId, name: this.name, url: this.url };\r\n if (this.subLayers.length > 0) {\r\n props.subLayers = [];\r\n this.subLayers.forEach((subLayer) => {\r\n const subLayerJson = subLayer.toJSON();\r\n if (subLayerJson)\r\n props.subLayers!.push(subLayerJson);\r\n });\r\n }\r\n\r\n if (0 !== this.transparency)\r\n props.transparency = this.transparency;\r\n\r\n if (this.transparentBackground === false)\r\n props.transparentBackground = this.transparentBackground;\r\n\r\n if (this.isBase === true)\r\n props.isBase = this.isBase;\r\n\r\n props.visible = this.visible;\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n protected static mapTypeName(type: BackgroundMapType) { // TBD.. Localization.\r\n switch (type) {\r\n case BackgroundMapType.Aerial:\r\n return \"Aerial Imagery\";\r\n default:\r\n case BackgroundMapType.Hybrid:\r\n return \"Aerial Imagery with labels\";\r\n case BackgroundMapType.Street:\r\n return \"Streets\";\r\n }\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<MapLayerProps>): MapLayerSettings {\r\n const clone = MapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n\r\n // Clone members not part of MapLayerProps\r\n clone.userName = this.userName;\r\n clone.password = this.password;\r\n clone.accessKey = this.accessKey;\r\n\r\n return clone;\r\n }\r\n\r\n /** @internal */\r\n protected cloneProps(changedProps: Partial<MapLayerProps>): MapLayerProps {\r\n return {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n formatId: undefined !== changedProps.formatId ? changedProps.formatId : this.formatId,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n url: undefined !== changedProps.url ? changedProps.url : this.url,\r\n transparency: undefined !== changedProps.transparency ? changedProps.transparency : this.transparency,\r\n transparentBackground: undefined !== changedProps.transparentBackground ? changedProps.transparentBackground : this.transparentBackground,\r\n subLayers: undefined !== changedProps.subLayers ? changedProps.subLayers : this.subLayers,\r\n accessKey: undefined !== changedProps.accessKey ? changedProps.accessKey : this.accessKey,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapLayerSettings): boolean {\r\n if (!this.matchesNameAndUrl(other.name, other.url)\r\n || this.visible !== other.visible\r\n || this.transparency !== other.transparency\r\n || this.transparentBackground !== other.transparentBackground\r\n || this.subLayers.length !== other.subLayers.length) {\r\n return false;\r\n }\r\n\r\n if (this.userName !== other.userName || this.password !== other.password) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < this.subLayers.length; i++)\r\n if (!this.subLayers[i].displayMatches(other.subLayers[i]))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n /** @internal */\r\n public matchesNameAndUrl(name: string, url: string): boolean {\r\n return this.name === name && this.url === url;\r\n }\r\n\r\n /** Return a sublayer matching id -- or undefined if not found */\r\n public subLayerById(id?: SubLayerId): MapSubLayerSettings | undefined {\r\n return id === undefined ? undefined : this.subLayers.find((subLayer) => subLayer.id === id);\r\n }\r\n\r\n private hasInvisibleAncestors(subLayer?: MapSubLayerSettings): boolean {\r\n if (!subLayer || !subLayer.parent)\r\n return false;\r\n\r\n const parent = this.subLayerById(subLayer.parent);\r\n if (!parent)\r\n return false;\r\n\r\n // Visibility of named group has no impact on the visibility of children (only unnamed group does)\r\n // i.e For WMS, its should be possible to request a child layer when its parent is not visible (if the parent is also named)\r\n return (!parent.visible && !parent.isNamed) || this.hasInvisibleAncestors(parent);\r\n }\r\n\r\n /** Return true if sublayer is visible -- testing ancestors for visibility if they exist. */\r\n public isSubLayerVisible(subLayer: MapSubLayerSettings): boolean {\r\n if (!subLayer.visible)\r\n return false;\r\n\r\n return !this.hasInvisibleAncestors(subLayer);\r\n }\r\n\r\n /** Return true if all sublayers are visible. */\r\n public get allSubLayersInvisible(): boolean {\r\n if (this.subLayers.length === 0)\r\n return false;\r\n\r\n return this.subLayers.every((subLayer) => (subLayer.isUnnamedGroup || !this.isSubLayerVisible(subLayer)));\r\n }\r\n\r\n /** Return the children for a sublayer */\r\n public getSubLayerChildren(subLayer: MapSubLayerSettings): MapSubLayerSettings[] | undefined {\r\n if (!subLayer.children)\r\n return undefined;\r\n\r\n const children = new Array<MapSubLayerSettings>();\r\n subLayer.children.forEach((childId) => {\r\n const child = this.subLayerById(childId);\r\n if (child !== undefined)\r\n children.push(child);\r\n });\r\n\r\n return children;\r\n }\r\n}\r\n\r\n/** JSON representation of a [[BaseMapLayerSettings]].\r\n * @beta\r\n */\r\nexport interface BaseMapLayerProps extends MapLayerProps {\r\n provider?: BackgroundMapProviderProps;\r\n}\r\n\r\n/** A [[MapLayerSettings]] that can serve as the base layer for a [[MapImagerySettings]].\r\n * The base layer supports all of the same options as any other layer, but also allows for simplified configuration based\r\n * on a small set of known supported [[BackgroundMapProvider]]s like [Bing Maps](https://www.microsoft.com/en-us/maps).\r\n * If the base layer was configured from such a provider, that information will be preserved and can be queried; this allows\r\n * the imagery provider and/or type to be easily modified.\r\n * @see [[MapImagerySettings.backgroundBase]].\r\n * @beta\r\n */\r\nexport class BaseMapLayerSettings extends MapLayerSettings {\r\n private _provider?: BackgroundMapProvider;\r\n\r\n /** The provider from which this base layer was configured, if any. */\r\n public get provider(): BackgroundMapProvider | undefined { return this._provider; }\r\n\r\n /** Create a base layer from its JSON representation.\r\n * TODO: This, MapLayerSettings.fromJSON, and MapSubLayerSettings.fromJSON should never return undefined.\r\n * That means they should not accept undefined for props and should define props such that it fully describes the\r\n * layer - e.g., url and name must be defined.\r\n */\r\n public static override fromJSON(props: BaseMapLayerProps): BaseMapLayerSettings {\r\n const settings = super.fromJSON(props);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n if (props.provider)\r\n settings._provider = BackgroundMapProvider.fromJSON(props.provider);\r\n\r\n return settings;\r\n }\r\n\r\n /** Convert this layer to its JSON representation. */\r\n public override toJSON(): BaseMapLayerProps {\r\n const props = super.toJSON() as BaseMapLayerProps;\r\n if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override cloneProps(changedProps: Partial<MapLayerProps>): BaseMapLayerProps {\r\n const props = super.cloneProps(changedProps) as BaseMapLayerProps;\r\n if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this layer. */\r\n public override clone(changedProps: Partial<MapLayerProps>): BaseMapLayerSettings {\r\n const prevUrl = this.url;\r\n const clone = BaseMapLayerSettings.fromJSON(this.cloneProps(changedProps))!;\r\n\r\n if (this.provider && prevUrl !== this.url)\r\n clone._provider = undefined;\r\n\r\n return clone;\r\n }\r\n\r\n /** Create a base layer from a BackgroundMapProvider. */\r\n public static fromProvider(provider: BackgroundMapProvider, options?: { invisible?: boolean, transparency?: number }): BaseMapLayerSettings {\r\n let formatId: string, url: string, name: string;\r\n switch (provider.name) {\r\n case \"BingProvider\":\r\n default:\r\n formatId = \"BingMaps\";\r\n\r\n let imagerySet;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n imagerySet = \"Road\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n imagerySet = \"Aerial\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n default:\r\n imagerySet = \"AerialWithLabels\";\r\n break;\r\n }\r\n name = `Bing Maps: ${MapLayerSettings.mapTypeName(provider.type)}`;\r\n url = `https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${imagerySet}?o=json&incl=ImageryProviders&key={bingKey}`;\r\n break;\r\n\r\n case \"MapBoxProvider\":\r\n formatId = \"MapboxImagery\";\r\n name = `MapBox: ${MapLayerSettings.mapTypeName(provider.type)}`;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n url = \"https://api.mapbox.com/v4/mapbox.streets/\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n url = \"https://api.mapbox.com/v4/mapbox.satellite/\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n url = \"https://api.mapbox.com/v4/mapbox.streets-satellite/\";\r\n break;\r\n }\r\n break;\r\n }\r\n\r\n const settings = super.fromJSON({\r\n name,\r\n formatId,\r\n url,\r\n transparentBackground: false,\r\n isBase: true,\r\n visible: !options?.invisible,\r\n transparency: options?.transparency,\r\n });\r\n\r\n assert(undefined !== settings);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n\r\n settings._provider = provider;\r\n return settings;\r\n }\r\n\r\n /** @internal */\r\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): BaseMapLayerSettings {\r\n return this.fromProvider(BackgroundMapProvider.fromBackgroundMapProps(props));\r\n }\r\n\r\n /** @alpha */\r\n public cloneWithProvider(provider: BackgroundMapProvider): BaseMapLayerSettings {\r\n return BaseMapLayerSettings.fromProvider(provider, { invisible: !this.visible, transparency: this.transparency });\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"MapLayerSettings.js","sourceRoot":"","sources":["../../src/MapLayerSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAA8B,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAqB/G;;;;;;;GAOG;AACH,MAAM,OAAO,mBAAmB;IAc9B,YAAY,IAAY,EAAE,KAAc,EAAE,OAAiB,EAAE,EAAe,EAAE,MAAmB,EAAE,QAAuB;QACxH,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC;QAChD,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C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BAC7E,MAAM;iBACT;gBAED,MAAM;SACT;QAED,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;YAC9B,IAAI;YACJ,QAAQ;YACR,GAAG;YACH,qBAAqB,EAAE,KAAK;YAC5B,OAAO,EAAE,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,CAAA;YAC5B,YAAY,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY;SACpC,CAAC,CAAC;QAEH,MAAM,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;QAC/B,MAAM,CAAC,QAAQ,YAAY,oBAAoB,CAAC,CAAC;QAEjD,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC9B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,sBAAsB,CAAC,KAAmC;QACtE,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;IAChF,CAAC;IAED,aAAa;IACN,iBAAiB,CAAC,QAA+B;QACtD,OAAO,oBAAoB,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IACpH,CAAC;CACF","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 { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport { BackgroundMapProvider, BackgroundMapProviderProps, BackgroundMapType } from \"./BackgroundMapProvider\";\r\nimport { DeprecatedBackgroundMapProps } from \"./BackgroundMapSettings\";\r\n\r\n/** @beta */\r\nexport type SubLayerId = string | number;\r\n\r\n/** JSON representation of the settings associated with a map sublayer included within a [[MapLayerProps]].\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * @see [[MapLayerProps]]\r\n * @beta\r\n */\r\nexport interface MapSubLayerProps {\r\n name: string;\r\n title?: string;\r\n visible?: boolean;\r\n id?: SubLayerId;\r\n parent?: SubLayerId;\r\n children?: SubLayerId[];\r\n}\r\n\r\n/** Normalized representation of a [[MapSubLayerProps]] for which values\r\n * have been validated and default values have been applied where explicit values not defined.\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * This class can represent a hierarchy, in this case a sub layer is visible only if all its ancestors are also visible.\r\n * @see [[MapLayerSettings]]\r\n * @beta\r\n */\r\nexport class MapSubLayerSettings {\r\n /** Typically Name is a single word used for machine-to-machine communication while the Title is for the benefit of humans (WMS) */\r\n public readonly name: string;\r\n /** Title. */\r\n public readonly title?: string;\r\n /** If true the sub layer is visible. If part of a hierarchy, a sub layer is visible only if its ancestors are also visible. */\r\n public readonly visible: boolean;\r\n /** A unique string or number that may be used to identify the sub layer (ArcGIS) */\r\n public readonly id: SubLayerId;\r\n /** One or more sublayer children */\r\n public readonly children?: SubLayerId[];\r\n /** sublayer parent. */\r\n public readonly parent?: SubLayerId;\r\n\r\n constructor(name: string, title?: string, visible?: boolean, id?: SubLayerId, parent?: SubLayerId, children?: SubLayerId[]) {\r\n this.name = name;\r\n this.title = title;\r\n this.visible = visible !== undefined && visible;\r\n this.id = (id === undefined) ? this.name : id;\r\n this.parent = parent;\r\n this.children = children;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static fromJSON(json: MapSubLayerProps): MapSubLayerSettings {\r\n return new MapSubLayerSettings(json.name, json.title, json.visible, (json.id === json.name) ? undefined : json.id, json.parent, json.children);\r\n }\r\n\r\n public toJSON(): MapSubLayerProps {\r\n const props: MapSubLayerProps = { name: this.name, visible: this.visible };\r\n\r\n if (undefined !== this.id && this.id !== this.name)\r\n props.id = this.id;\r\n\r\n if (undefined !== this.title)\r\n props.title = this.title;\r\n\r\n if (this.children)\r\n props.children = [...this.children];\r\n\r\n if (undefined !== this.parent)\r\n props.parent = this.parent;\r\n\r\n return props;\r\n }\r\n\r\n /** Creating a copy of this MapSubLayer, optionally modifying some if its properties */\r\n public clone(changedProps: Partial<MapSubLayerProps>): MapSubLayerSettings {\r\n if (undefined === changedProps)\r\n return this;\r\n\r\n const props = {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n id: undefined !== changedProps.id ? changedProps.id : this.id,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n parent: undefined !== changedProps.parent ? changedProps.parent : this.parent,\r\n children: undefined !== changedProps.children ? changedProps.children.slice() : this.children?.slice(),\r\n title: undefined !== changedProps.title ? changedProps.title : this.title,\r\n };\r\n return MapSubLayerSettings.fromJSON(props)!;\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapSubLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible;\r\n }\r\n\r\n /** return true if this sublayer is named. */\r\n public get isNamed(): boolean { return this.name.length > 0; }\r\n\r\n /** return true if this sublayer is a leaf (has no children) */\r\n public get isLeaf(): boolean { return this.children === undefined || this.children.length === 0; }\r\n\r\n /** return true if this sublayer is an unnamed group */\r\n public get isUnnamedGroup(): boolean { return !this.isLeaf && !this.isNamed; }\r\n\r\n /** return a string representing this sublayer id (converting to string if underlying id is number) */\r\n public get idString(): string { return (typeof this.id === \"number\") ? this.id.toString(10) : this.id; }\r\n}\r\n\r\n/** JSON representation of properties common to both [[ImageMapLayerProps]] and [[ModelMapLayerProps]].\r\n * @see [[MapImageryProps]]\r\n * @beta\r\n */\r\nexport interface CommonMapLayerProps {\r\n /** Controls visibility of layer. Defaults to 'true'. */\r\n visible?: boolean;\r\n\r\n /** A user-friendly name for the layer. */\r\n name: string;\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing,\r\n * or false to indicate the transparency should not be overridden.\r\n * Default value: 0.\r\n */\r\n transparency?: number;\r\n /** True to indicate background is transparent.\r\n * Default: true.\r\n */\r\n transparentBackground?: boolean;\r\n}\r\n\r\n/** JSON representation of an [[ImageMapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @beta\r\n */\r\nexport interface ImageMapLayerProps extends CommonMapLayerProps {\r\n /** URL */\r\n url: string;\r\n /** Identifies the map layers source.*/\r\n formatId: string;\r\n /** Source layers. If undefined all layers are displayed. */\r\n subLayers?: MapSubLayerProps[];\r\n /** Access Key for the Layer, like a subscription key or access token.\r\n * ###TODO This does not belong in the props object. It should never be persisted.\r\n */\r\n accessKey?: MapLayerKey;\r\n\r\n /** @internal */\r\n modelId?: never;\r\n}\r\n\r\n/** JSON representation of a [[ModelMapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @beta\r\n */\r\nexport interface ModelMapLayerProps extends CommonMapLayerProps {\r\n /** The Id of the [GeometricModel]($backend) containing the geometry to be drawn by the layer. */\r\n modelId: Id64String;\r\n\r\n /** @internal */\r\n url?: never;\r\n /** @internal */\r\n formatId?: never;\r\n /** @internal */\r\n subLayers?: never;\r\n /** @internal */\r\n accessKey?: never;\r\n}\r\n\r\n/** JSON representation of a [[MapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @beta\r\n */\r\nexport type MapLayerProps = ImageMapLayerProps | ModelMapLayerProps;\r\n\r\n/**\r\n * stores key-value pair to be added to all requests made involving map layer.\r\n * @beta\r\n */\r\nexport interface MapLayerKey {\r\n key: string;\r\n value: string;\r\n}\r\n\r\n/** 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.\r\n * This class is extended by [[ImageMapLayerSettings]] and [ModelMapLayerSettings]] to create the settings for image and model based layers.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @beta\r\n */\r\nexport abstract class MapLayerSettings {\r\n public readonly visible: boolean;\r\n\r\n public readonly name: string;\r\n public readonly transparency: number;\r\n public readonly transparentBackground: boolean;\r\n public abstract get allSubLayersInvisible(): boolean;\r\n public abstract clone(changedProps: Partial<MapLayerProps>): MapLayerSettings;\r\n public abstract toJSON(): MapLayerProps;\r\n\r\n /** @internal */\r\n protected constructor(name: string, visible = true, transparency: number = 0, transparentBackground = true) {\r\n this.name = name;\r\n this.visible = visible;\r\n this.transparentBackground = transparentBackground;\r\n this.transparency = transparency;\r\n }\r\n\r\n /** Create a map layer settings from its JSON representation. */\r\n public static fromJSON(props: MapLayerProps): MapLayerSettings {\r\n return undefined !== props.modelId ? ModelMapLayerSettings.fromJSON(props) : ImageMapLayerSettings.fromJSON(props);\r\n }\r\n\r\n /** @internal */\r\n protected _toJSON(): CommonMapLayerProps {\r\n const props: CommonMapLayerProps = {\r\n name: this.name,\r\n visible: this.visible,\r\n };\r\n\r\n if (0 !== this.transparency)\r\n props.transparency = this.transparency;\r\n\r\n if (this.transparentBackground === false)\r\n props.transparentBackground = this.transparentBackground;\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n protected cloneProps(changedProps: Partial<MapLayerProps>): CommonMapLayerProps {\r\n return {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n transparency: undefined !== changedProps.transparency ? changedProps.transparency : this.transparency,\r\n transparentBackground: undefined !== changedProps.transparentBackground ? changedProps.transparentBackground : this.transparentBackground,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible && this.transparency === other.transparency && this.transparentBackground === other.transparentBackground;\r\n }\r\n\r\n /** Return a unique string identifying the layers source... The URL for image layer or modelID for model layer */\r\n public abstract get source(): string;\r\n\r\n /** @internal */\r\n public matchesNameAndSource(name: string, source: string): boolean {\r\n return this.name === name && this.source === source;\r\n }\r\n}\r\n\r\n/** Normalized representation of a [[ImageMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * Image map layers are created from servers that produce images that represent map tiles. Map layers map also be represented by models.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @see [[ModelMapLayerSettings]] for model based map layer settings.\r\n * @beta\r\n */\r\nexport class ImageMapLayerSettings extends MapLayerSettings {\r\n public readonly formatId: string;\r\n public readonly url: string;\r\n public userName?: string;\r\n public password?: string;\r\n public accessKey?: MapLayerKey;\r\n public readonly subLayers: MapSubLayerSettings[];\r\n public override get source(): string { return this.url; }\r\n\r\n /** @internal */\r\n protected constructor(props: ImageMapLayerProps) {\r\n const transparentBackground = props.transparentBackground ?? true;\r\n super(props.name, props.visible, props.transparency, transparentBackground);\r\n\r\n this.formatId = props.formatId;\r\n this.url = props.url;\r\n this.accessKey = props.accessKey;\r\n this.subLayers = [];\r\n if (!props.subLayers)\r\n return;\r\n\r\n for (const subLayerProps of props.subLayers) {\r\n const subLayer = MapSubLayerSettings.fromJSON(subLayerProps);\r\n if (subLayer)\r\n this.subLayers.push(subLayer);\r\n }\r\n }\r\n\r\n public static override fromJSON(props: ImageMapLayerProps): ImageMapLayerSettings {\r\n return new this(props);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public override toJSON(): ImageMapLayerProps {\r\n const props = super._toJSON() as ImageMapLayerProps;\r\n props.url = this.url;\r\n props.formatId = this.formatId;\r\n\r\n if (this.subLayers.length > 0)\r\n props.subLayers = this.subLayers.map((x) => x.toJSON());\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerSettings {\r\n const clone = ImageMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n\r\n // Clone members not part of MapLayerProps\r\n clone.userName = this.userName;\r\n clone.password = this.password;\r\n clone.accessKey = this.accessKey;\r\n\r\n return clone;\r\n }\r\n\r\n /** @internal */\r\n protected override cloneProps(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerProps {\r\n const props = super.cloneProps(changedProps) as ImageMapLayerProps;\r\n\r\n props.formatId = changedProps.formatId ?? this.formatId;\r\n props.url = changedProps.url ?? this.url;\r\n props.accessKey = changedProps.accessKey ?? this.accessKey;\r\n props.subLayers = changedProps.subLayers ?? this.subLayers;\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override displayMatches(other: MapLayerSettings): boolean {\r\n if (! (other instanceof ImageMapLayerSettings) || !super.displayMatches(other))\r\n return false;\r\n\r\n if (this.userName !== other.userName || this.password !== other.password || this.subLayers.length !== other.subLayers.length) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < this.subLayers.length; i++)\r\n if (!this.subLayers[i].displayMatches(other.subLayers[i]))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n /** Return a sublayer matching id -- or undefined if not found */\r\n public subLayerById(id?: SubLayerId): MapSubLayerSettings | undefined {\r\n return id === undefined ? undefined : this.subLayers.find((subLayer) => subLayer.id === id);\r\n }\r\n\r\n private hasInvisibleAncestors(subLayer?: MapSubLayerSettings): boolean {\r\n if (!subLayer || !subLayer.parent)\r\n return false;\r\n\r\n const parent = this.subLayerById(subLayer.parent);\r\n if (!parent)\r\n return false;\r\n\r\n // Visibility of named group has no impact on the visibility of children (only unnamed group does)\r\n // i.e For WMS, its should be possible to request a child layer when its parent is not visible (if the parent is also named)\r\n return (!parent.visible && !parent.isNamed) || this.hasInvisibleAncestors(parent);\r\n }\r\n\r\n /** Return true if sublayer is visible -- testing ancestors for visibility if they exist. */\r\n public isSubLayerVisible(subLayer: MapSubLayerSettings): boolean {\r\n if (!subLayer.visible)\r\n return false;\r\n\r\n return !this.hasInvisibleAncestors(subLayer);\r\n }\r\n\r\n /** Return true if all sublayers are invisible. */\r\n public get allSubLayersInvisible(): boolean {\r\n if (this.subLayers.length === 0)\r\n return false;\r\n\r\n return this.subLayers.every((subLayer) => (subLayer.isUnnamedGroup || !this.isSubLayerVisible(subLayer)));\r\n }\r\n\r\n /** Return the children for a sublayer */\r\n public getSubLayerChildren(subLayer: MapSubLayerSettings): MapSubLayerSettings[] | undefined {\r\n if (!subLayer.children)\r\n return undefined;\r\n\r\n const children = new Array<MapSubLayerSettings>();\r\n subLayer.children.forEach((childId) => {\r\n const child = this.subLayerById(childId);\r\n if (child !== undefined)\r\n children.push(child);\r\n });\r\n\r\n return children;\r\n }\r\n\r\n /** @internal */\r\n protected static mapTypeName(type: BackgroundMapType) { // TBD.. Localization.\r\n switch (type) {\r\n case BackgroundMapType.Aerial:\r\n return \"Aerial Imagery\";\r\n default:\r\n case BackgroundMapType.Hybrid:\r\n return \"Aerial Imagery with labels\";\r\n case BackgroundMapType.Street:\r\n return \"Streets\";\r\n }\r\n }\r\n\r\n public setCredentials(userName?: string, password?: string) {\r\n this.userName = userName;\r\n this.password = password;\r\n }\r\n}\r\n\r\n/** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * Model map layers are produced from models, typically from two dimensional geometry that may originate in a GIS system.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @see [[ImageMapLayerSettings]] for image based map layer settings.\r\n * @beta\r\n */\r\nexport class ModelMapLayerSettings extends MapLayerSettings {\r\n public readonly modelId: Id64String;\r\n public override get source(): string { return this.modelId; }\r\n\r\n /** @internal */\r\n protected constructor(modelId: Id64String, name: string, visible = true,\r\n transparency: number = 0, transparentBackground = true) {\r\n super(name, visible, transparency, transparentBackground);\r\n this.modelId = modelId;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static override fromJSON(json: ModelMapLayerProps): ModelMapLayerSettings {\r\n const transparentBackground = (json.transparentBackground === undefined) ? true : json.transparentBackground;\r\n return new this(json.modelId, json.name, json.visible, json.transparency, transparentBackground);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public override toJSON(): ModelMapLayerProps {\r\n const props = super._toJSON() as ModelMapLayerProps;\r\n props.modelId = this.modelId;\r\n return props;\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerSettings {\r\n return ModelMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n }\r\n\r\n /** @internal */\r\n protected override cloneProps(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerProps {\r\n const props = super.cloneProps(changedProps) as ModelMapLayerProps;\r\n props.modelId = changedProps.modelId ?? this.modelId;\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override displayMatches(other: MapLayerSettings): boolean {\r\n if (!(other instanceof ModelMapLayerSettings) || !super.displayMatches(other))\r\n return false;\r\n\r\n return this.modelId === other.modelId;\r\n }\r\n\r\n /** Return true if all sublayers are invisible (always false as model layers do not include sublayers). */\r\n public get allSubLayersInvisible(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\n/** JSON representation of a [[BaseMapLayerSettings]].\r\n * @beta\r\n */\r\nexport interface BaseMapLayerProps extends ImageMapLayerProps {\r\n provider?: BackgroundMapProviderProps;\r\n}\r\n\r\n/** A [[ImageMapLayerSettings]] that can serve as the base layer for a [[MapImagerySettings]].\r\n * The base layer supports all of the same options as any other layer, but also allows for simplified configuration based\r\n * on a small set of known supported [[BackgroundMapProvider]]s like [Bing Maps](https://www.microsoft.com/en-us/maps).\r\n * If the base layer was configured from such a provider, that information will be preserved and can be queried; this allows\r\n * the imagery provider and/or type to be easily modified.\r\n * @see [[MapImagerySettings.backgroundBase]].\r\n * @beta\r\n */\r\nexport class BaseMapLayerSettings extends ImageMapLayerSettings {\r\n private _provider?: BackgroundMapProvider;\r\n\r\n /** The provider from which this base layer was configured, if any. */\r\n public get provider(): BackgroundMapProvider | undefined { return this._provider; }\r\n\r\n /** Create a base layer from its JSON representation.\r\n * TODO: This, MapLayerSettings.fromJSON, and MapSubLayerSettings.fromJSON should never return undefined.\r\n * That means they should not accept undefined for props and should define props such that it fully describes the\r\n * layer - e.g., url and name must be defined.\r\n */\r\n public static override fromJSON(props: BaseMapLayerProps): BaseMapLayerSettings {\r\n const settings = super.fromJSON(props);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n if (props.provider)\r\n settings._provider = BackgroundMapProvider.fromJSON(props.provider);\r\n\r\n return settings;\r\n }\r\n\r\n /** Convert this layer to its JSON representation. */\r\n public override toJSON(): BaseMapLayerProps {\r\n const props = super.toJSON() as BaseMapLayerProps;\r\n if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override cloneProps(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerProps {\r\n const props = super.cloneProps(changedProps) as BaseMapLayerProps;\r\n\r\n if (changedProps.provider)\r\n props.provider = changedProps.provider;\r\n else if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this layer. */\r\n public override clone(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerSettings {\r\n const prevUrl = this.url;\r\n const clone = BaseMapLayerSettings.fromJSON(this.cloneProps(changedProps))!;\r\n\r\n if (this.provider && prevUrl !== this.url)\r\n clone._provider = undefined;\r\n\r\n return clone;\r\n }\r\n\r\n /** Create a base layer from a BackgroundMapProvider. */\r\n public static fromProvider(provider: BackgroundMapProvider, options?: { invisible?: boolean, transparency?: number }): BaseMapLayerSettings {\r\n let formatId: string, url: string, name: string;\r\n switch (provider.name) {\r\n case \"BingProvider\":\r\n default:\r\n formatId = \"BingMaps\";\r\n\r\n let imagerySet;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n imagerySet = \"Road\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n imagerySet = \"Aerial\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n default:\r\n imagerySet = \"AerialWithLabels\";\r\n break;\r\n }\r\n\r\n name = `Bing Maps: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;\r\n url = `https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${imagerySet}?o=json&incl=ImageryProviders&key={bingKey}`;\r\n break;\r\n\r\n case \"MapBoxProvider\":\r\n formatId = \"MapboxImagery\";\r\n name = `MapBox: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/\";\r\n break;\r\n }\r\n\r\n break;\r\n }\r\n\r\n const settings = super.fromJSON({\r\n name,\r\n formatId,\r\n url,\r\n transparentBackground: false,\r\n visible: !options?.invisible,\r\n transparency: options?.transparency,\r\n });\r\n\r\n assert(undefined !== settings);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n\r\n settings._provider = provider;\r\n return settings;\r\n }\r\n\r\n /** @internal */\r\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): BaseMapLayerSettings {\r\n return this.fromProvider(BackgroundMapProvider.fromBackgroundMapProps(props));\r\n }\r\n\r\n /** @alpha */\r\n public cloneWithProvider(provider: BackgroundMapProvider): BaseMapLayerSettings {\r\n return BaseMapLayerSettings.fromProvider(provider, { invisible: !this.visible, transparency: this.transparency });\r\n }\r\n}\r\n"]}
@@ -2,6 +2,7 @@
2
2
  * @module DisplayStyles
3
3
  */
4
4
  import { Id64String } from "@itwin/core-bentley";
5
+ import { ModelMapLayerSettings } from "./MapLayerSettings";
5
6
  /** Describes how a [[SpatialClassifier]] affects the display of classified geometry - that is, geometry intersecting
6
7
  * the classifier.
7
8
  * @public
@@ -118,6 +119,10 @@ export declare class SpatialClassifier {
118
119
  * @note This method always sets the [[SpatialClassifierProps.isActive]] property to `false`.
119
120
  */
120
121
  toJSON(): SpatialClassifierProps;
122
+ /** Construct from Model Map Layer.
123
+ * @beta
124
+ */
125
+ static fromModelMapLayer(mapLayer: ModelMapLayerSettings): SpatialClassifier;
121
126
  /** Create a classifier identical to this one except for any properties explicitly specified by `changedProps`. */
122
127
  clone(changedProps?: Partial<SpatialClassifierProps>): SpatialClassifier;
123
128
  /** Return true if this classifier is equivalent to `other`. */
@@ -1 +1 @@
1
- {"version":3,"file":"SpatialClassification.d.ts","sourceRoot":"","sources":["../../src/SpatialClassification.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;GAGG;AACH,oBAAY,8BAA8B;IACxC,qCAAqC;IACrC,GAAG,IAAI;IACP,oDAAoD;IACpD,EAAE,IAAI;IACN,gCAAgC;IAChC,MAAM,IAAI;IACV,wEAAwE;IACxE,MAAM,IAAI;IACV,yEAAyE;IACzE,YAAY,IAAI;CACjB;AAED;;;GAGG;AACH,oBAAY,+BAA+B;IACzC,qCAAqC;IACrC,GAAG,IAAI;IACP,oDAAoD;IACpD,EAAE,IAAI;IACN,gCAAgC;IAChC,MAAM,IAAI;CACX;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,8CAA8C;IAC9C,MAAM,EAAE,8BAA8B,CAAC;IACvC,+CAA+C;IAC/C,OAAO,EAAE,+BAA+B,CAAC;IACzC,0DAA0D;IAC1D,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,qBAAa,sBAAsB;IACjC,oEAAoE;IACpE,SAAgB,MAAM,E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;IACI,GAAG,CAAC,UAAU,EAAE,iBAAiB,GAAG,iBAAiB;IAc5D;;;;;OAKG;IACI,OAAO,CAAC,SAAS,EAAE,iBAAiB,EAAE,WAAW,EAAE,iBAAiB,GAAG,OAAO;IA4BrF;;;OAGG;IACI,MAAM,CAAC,UAAU,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,SAAS;IA0B3E,4CAA4C;IACrC,KAAK,IAAI,IAAI;IAMpB,OAAO,KAAK,MAAM,GAEjB;CACF"}
1
+ {"version":3,"file":"SpatialClassification.d.ts","sourceRoot":"","sources":["../../src/SpatialClassification.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;GAGG;AACH,oBAAY,8BAA8B;IACxC,qCAAqC;IACrC,GAAG,IAAI;IACP,oDAAoD;IACpD,EAAE,IAAI;IACN,gCAAgC;IAChC,MAAM,IAAI;IACV,wEAAwE;IACxE,MAAM,IAAI;IACV,yEAAyE;IACzE,YAAY,IAAI;CACjB;AAED;;;GAGG;AACH,oBAAY,+BAA+B;IACzC,qCAAqC;IACrC,GAAG,IAAI;IACP,oDAAoD;IACpD,EAAE,IAAI;IACN,gCAAgC;IAChC,MAAM,IAAI;CACX;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,8CAA8C;IAC9C,MAAM,EAAE,8BAA8B,CAAC;IACvC,+CAA+C;IAC/C,OAAO,EAAE,+BAA+B,CAAC;IACzC,0DAA0D;IAC1D,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,qBAAa,sBAAsB;IACjC,oEAAoE;IACpE,SAAgB,MAAM,EAAE,8BAA8B,CAAC;IACvD,wEAAwE;IACxE,SAAgB,OAAO,EAAE,+BAA+B,CAAC;IACzD,uEAAuE;IACvE,SAAgB,kBAAkB,EAAE,OAAO,CAAC;IA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;;;;OAKG;IACI,OAAO,CAAC,SAAS,EAAE,iBAAiB,EAAE,WAAW,EAAE,iBAAiB,GAAG,OAAO;IA4BrF;;;OAGG;IACI,MAAM,CAAC,UAAU,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,SAAS;IA0B3E,4CAA4C;IACrC,KAAK,IAAI,IAAI;IAMpB,OAAO,KAAK,MAAM,GAEjB;CACF"}
@@ -119,6 +119,13 @@ export class SpatialClassifier {
119
119
  isActive: false,
120
120
  };
121
121
  }
122
+ /** Construct from Model Map Layer.
123
+ * @beta
124
+ */
125
+ static fromModelMapLayer(mapLayer) {
126
+ const flags = SpatialClassifierFlags.fromJSON({ inside: SpatialClassifierInsideDisplay.Off, outside: SpatialClassifierOutsideDisplay.Off });
127
+ return new SpatialClassifier(mapLayer.modelId, mapLayer.name, flags);
128
+ }
122
129
  /** Create a classifier identical to this one except for any properties explicitly specified by `changedProps`. */
123
130
  clone(changedProps) {
124
131
  if (!changedProps)