@itwin/core-common 3.1.0-dev.8 → 3.2.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -17
- package/lib/cjs/Fonts.d.ts +16 -5
- package/lib/cjs/Fonts.d.ts.map +1 -1
- package/lib/cjs/Fonts.js +6 -2
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/MapImagerySettings.d.ts +2 -0
- package/lib/cjs/MapImagerySettings.d.ts.map +1 -1
- package/lib/cjs/MapImagerySettings.js.map +1 -1
- package/lib/cjs/MapLayerSettings.d.ts +120 -37
- package/lib/cjs/MapLayerSettings.d.ts.map +1 -1
- package/lib/cjs/MapLayerSettings.js +156 -86
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/SpatialClassification.d.ts +5 -0
- package/lib/cjs/SpatialClassification.d.ts.map +1 -1
- package/lib/cjs/SpatialClassification.js +7 -0
- package/lib/cjs/SpatialClassification.js.map +1 -1
- package/lib/cjs/geometry/TextString.d.ts +5 -4
- package/lib/cjs/geometry/TextString.d.ts.map +1 -1
- package/lib/cjs/geometry/TextString.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.d.ts +0 -1
- package/lib/cjs/ipc/IpcWebSocket.d.ts.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js +4 -13
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.d.ts +2 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.d.ts.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js +24 -15
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts +1 -0
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js +1 -0
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.d.ts +2 -2
- package/lib/cjs/tile/IModelTileIO.js +2 -2
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/Fonts.d.ts +16 -5
- package/lib/esm/Fonts.d.ts.map +1 -1
- package/lib/esm/Fonts.js +6 -2
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/MapImagerySettings.d.ts +2 -0
- package/lib/esm/MapImagerySettings.d.ts.map +1 -1
- package/lib/esm/MapImagerySettings.js.map +1 -1
- package/lib/esm/MapLayerSettings.d.ts +120 -37
- package/lib/esm/MapLayerSettings.d.ts.map +1 -1
- package/lib/esm/MapLayerSettings.js +152 -84
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/SpatialClassification.d.ts +5 -0
- package/lib/esm/SpatialClassification.d.ts.map +1 -1
- package/lib/esm/SpatialClassification.js +7 -0
- package/lib/esm/SpatialClassification.js.map +1 -1
- package/lib/esm/geometry/TextString.d.ts +5 -4
- package/lib/esm/geometry/TextString.d.ts.map +1 -1
- package/lib/esm/geometry/TextString.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.d.ts +0 -1
- package/lib/esm/ipc/IpcWebSocket.d.ts.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js +4 -13
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.d.ts +2 -1
- package/lib/esm/ipc/IpcWebSocketTransport.d.ts.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js +24 -15
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts +1 -0
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js +1 -0
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.d.ts +2 -2
- package/lib/esm/tile/IModelTileIO.js +2 -2
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/package.json +7 -7
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module DisplayStyles
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.BaseMapLayerSettings = exports.MapLayerSettings = exports.MapSubLayerSettings = void 0;
|
|
10
|
+
exports.BaseMapLayerSettings = exports.ModelMapLayerSettings = exports.ImageMapLayerSettings = exports.MapLayerSettings = exports.MapSubLayerSettings = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
const BackgroundMapProvider_1 = require("./BackgroundMapProvider");
|
|
13
13
|
/** Normalized representation of a [[MapSubLayerProps]] for which values
|
|
@@ -72,85 +72,99 @@ class MapSubLayerSettings {
|
|
|
72
72
|
get idString() { return (typeof this.id === "number") ? this.id.toString(10) : this.id; }
|
|
73
73
|
}
|
|
74
74
|
exports.MapSubLayerSettings = MapSubLayerSettings;
|
|
75
|
-
/**
|
|
75
|
+
/** 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.
|
|
76
|
+
* This class is extended by [[ImageMapLayerSettings]] and [ModelMapLayerSettings]] to create the settings for image and model based layers.
|
|
76
77
|
* One or more map layers may be included within [[MapImagerySettings]] object.
|
|
77
78
|
* @see [[MapImagerySettings]]
|
|
78
79
|
* @beta
|
|
79
80
|
*/
|
|
80
81
|
class MapLayerSettings {
|
|
81
82
|
/** @internal */
|
|
82
|
-
constructor(
|
|
83
|
-
var _a;
|
|
84
|
-
this.formatId = formatId;
|
|
83
|
+
constructor(name, visible = true, transparency = 0, transparentBackground = true) {
|
|
85
84
|
this.name = name;
|
|
86
85
|
this.visible = visible;
|
|
87
86
|
this.transparentBackground = transparentBackground;
|
|
88
|
-
this.isBase = isBase;
|
|
89
|
-
this.subLayers = new Array();
|
|
90
|
-
if (jsonSubLayers !== undefined) {
|
|
91
|
-
let hasUnnamedGroups = false;
|
|
92
|
-
for (const jsonSubLayer of jsonSubLayers) {
|
|
93
|
-
const subLayer = MapSubLayerSettings.fromJSON(jsonSubLayer);
|
|
94
|
-
if (undefined !== subLayer) {
|
|
95
|
-
this.subLayers.push(subLayer);
|
|
96
|
-
if (((_a = subLayer.children) === null || _a === void 0 ? void 0 : _a.length) !== 0 && !subLayer.isNamed && !hasUnnamedGroups)
|
|
97
|
-
hasUnnamedGroups = true;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
this.userName = userName;
|
|
101
|
-
this.password = password;
|
|
102
|
-
}
|
|
103
|
-
this.accessKey = accessKey;
|
|
104
87
|
this.transparency = transparency;
|
|
105
|
-
this.url = url;
|
|
106
|
-
}
|
|
107
|
-
setCredentials(userName, password) {
|
|
108
|
-
this.userName = userName;
|
|
109
|
-
this.password = password;
|
|
110
88
|
}
|
|
111
|
-
/**
|
|
112
|
-
static fromJSON(
|
|
113
|
-
|
|
114
|
-
return new this(json.url, json.name, json.formatId, json.visible, json.subLayers, json.transparency, transparentBackground, json.isBase === true, undefined, undefined, json.accessKey);
|
|
89
|
+
/** Create a map layer settings from its JSON representation. */
|
|
90
|
+
static fromJSON(props) {
|
|
91
|
+
return undefined !== props.modelId ? ModelMapLayerSettings.fromJSON(props) : ImageMapLayerSettings.fromJSON(props);
|
|
115
92
|
}
|
|
116
|
-
/**
|
|
117
|
-
|
|
118
|
-
const props = {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const subLayerJson = subLayer.toJSON();
|
|
123
|
-
if (subLayerJson)
|
|
124
|
-
props.subLayers.push(subLayerJson);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
93
|
+
/** @internal */
|
|
94
|
+
_toJSON() {
|
|
95
|
+
const props = {
|
|
96
|
+
name: this.name,
|
|
97
|
+
visible: this.visible,
|
|
98
|
+
};
|
|
127
99
|
if (0 !== this.transparency)
|
|
128
100
|
props.transparency = this.transparency;
|
|
129
101
|
if (this.transparentBackground === false)
|
|
130
102
|
props.transparentBackground = this.transparentBackground;
|
|
131
|
-
if (this.isBase === true)
|
|
132
|
-
props.isBase = this.isBase;
|
|
133
|
-
props.visible = this.visible;
|
|
134
103
|
return props;
|
|
135
104
|
}
|
|
136
105
|
/** @internal */
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
106
|
+
cloneProps(changedProps) {
|
|
107
|
+
return {
|
|
108
|
+
name: undefined !== changedProps.name ? changedProps.name : this.name,
|
|
109
|
+
visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,
|
|
110
|
+
transparency: undefined !== changedProps.transparency ? changedProps.transparency : this.transparency,
|
|
111
|
+
transparentBackground: undefined !== changedProps.transparentBackground ? changedProps.transparentBackground : this.transparentBackground,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/** @internal */
|
|
115
|
+
displayMatches(other) {
|
|
116
|
+
return this.name === other.name && this.visible === other.visible && this.transparency === other.transparency && this.transparentBackground === other.transparentBackground;
|
|
117
|
+
}
|
|
118
|
+
/** @internal */
|
|
119
|
+
matchesNameAndSource(name, source) {
|
|
120
|
+
return this.name === name && this.source === source;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
exports.MapLayerSettings = MapLayerSettings;
|
|
124
|
+
/** Normalized representation of a [[ImageMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
|
|
125
|
+
* Image map layers are created from servers that produce images that represent map tiles. Map layers map also be represented by models.
|
|
126
|
+
* One or more map layers may be included within [[MapImagerySettings]] object.
|
|
127
|
+
* @see [[MapImagerySettings]]
|
|
128
|
+
* @see [[ModelMapLayerSettings]] for model based map layer settings.
|
|
129
|
+
* @beta
|
|
130
|
+
*/
|
|
131
|
+
class ImageMapLayerSettings extends MapLayerSettings {
|
|
132
|
+
/** @internal */
|
|
133
|
+
constructor(props) {
|
|
134
|
+
var _a;
|
|
135
|
+
const transparentBackground = (_a = props.transparentBackground) !== null && _a !== void 0 ? _a : true;
|
|
136
|
+
super(props.name, props.visible, props.transparency, transparentBackground);
|
|
137
|
+
this.formatId = props.formatId;
|
|
138
|
+
this.url = props.url;
|
|
139
|
+
this.accessKey = props.accessKey;
|
|
140
|
+
this.subLayers = [];
|
|
141
|
+
if (!props.subLayers)
|
|
142
|
+
return;
|
|
143
|
+
for (const subLayerProps of props.subLayers) {
|
|
144
|
+
const subLayer = MapSubLayerSettings.fromJSON(subLayerProps);
|
|
145
|
+
if (subLayer)
|
|
146
|
+
this.subLayers.push(subLayer);
|
|
146
147
|
}
|
|
147
148
|
}
|
|
149
|
+
get source() { return this.url; }
|
|
150
|
+
static fromJSON(props) {
|
|
151
|
+
return new this(props);
|
|
152
|
+
}
|
|
153
|
+
/** return JSON representation of this MapLayerSettings object */
|
|
154
|
+
toJSON() {
|
|
155
|
+
const props = super._toJSON();
|
|
156
|
+
props.url = this.url;
|
|
157
|
+
props.formatId = this.formatId;
|
|
158
|
+
if (this.subLayers.length > 0)
|
|
159
|
+
props.subLayers = this.subLayers.map((x) => x.toJSON());
|
|
160
|
+
return props;
|
|
161
|
+
}
|
|
148
162
|
/** Create a copy of this MapLayerSettings, optionally modifying some of its properties.
|
|
149
163
|
* @param changedProps JSON representation of the properties to change.
|
|
150
164
|
* @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.
|
|
151
165
|
*/
|
|
152
166
|
clone(changedProps) {
|
|
153
|
-
const clone =
|
|
167
|
+
const clone = ImageMapLayerSettings.fromJSON(this.cloneProps(changedProps));
|
|
154
168
|
// Clone members not part of MapLayerProps
|
|
155
169
|
clone.userName = this.userName;
|
|
156
170
|
clone.password = this.password;
|
|
@@ -159,27 +173,19 @@ class MapLayerSettings {
|
|
|
159
173
|
}
|
|
160
174
|
/** @internal */
|
|
161
175
|
cloneProps(changedProps) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
subLayers: undefined !== changedProps.subLayers ? changedProps.subLayers : this.subLayers,
|
|
170
|
-
accessKey: undefined !== changedProps.accessKey ? changedProps.accessKey : this.accessKey,
|
|
171
|
-
};
|
|
176
|
+
var _a, _b, _c, _d;
|
|
177
|
+
const props = super.cloneProps(changedProps);
|
|
178
|
+
props.formatId = (_a = changedProps.formatId) !== null && _a !== void 0 ? _a : this.formatId;
|
|
179
|
+
props.url = (_b = changedProps.url) !== null && _b !== void 0 ? _b : this.url;
|
|
180
|
+
props.accessKey = (_c = changedProps.accessKey) !== null && _c !== void 0 ? _c : this.accessKey;
|
|
181
|
+
props.subLayers = (_d = changedProps.subLayers) !== null && _d !== void 0 ? _d : this.subLayers;
|
|
182
|
+
return props;
|
|
172
183
|
}
|
|
173
184
|
/** @internal */
|
|
174
185
|
displayMatches(other) {
|
|
175
|
-
if (!
|
|
176
|
-
|| this.visible !== other.visible
|
|
177
|
-
|| this.transparency !== other.transparency
|
|
178
|
-
|| this.transparentBackground !== other.transparentBackground
|
|
179
|
-
|| this.subLayers.length !== other.subLayers.length) {
|
|
186
|
+
if (!(other instanceof ImageMapLayerSettings) || !super.displayMatches(other))
|
|
180
187
|
return false;
|
|
181
|
-
|
|
182
|
-
if (this.userName !== other.userName || this.password !== other.password) {
|
|
188
|
+
if (this.userName !== other.userName || this.password !== other.password || this.subLayers.length !== other.subLayers.length) {
|
|
183
189
|
return false;
|
|
184
190
|
}
|
|
185
191
|
for (let i = 0; i < this.subLayers.length; i++)
|
|
@@ -187,10 +193,6 @@ class MapLayerSettings {
|
|
|
187
193
|
return false;
|
|
188
194
|
return true;
|
|
189
195
|
}
|
|
190
|
-
/** @internal */
|
|
191
|
-
matchesNameAndUrl(name, url) {
|
|
192
|
-
return this.name === name && this.url === url;
|
|
193
|
-
}
|
|
194
196
|
/** Return a sublayer matching id -- or undefined if not found */
|
|
195
197
|
subLayerById(id) {
|
|
196
198
|
return id === undefined ? undefined : this.subLayers.find((subLayer) => subLayer.id === id);
|
|
@@ -211,7 +213,7 @@ class MapLayerSettings {
|
|
|
211
213
|
return false;
|
|
212
214
|
return !this.hasInvisibleAncestors(subLayer);
|
|
213
215
|
}
|
|
214
|
-
/** Return true if all sublayers are
|
|
216
|
+
/** Return true if all sublayers are invisible. */
|
|
215
217
|
get allSubLayersInvisible() {
|
|
216
218
|
if (this.subLayers.length === 0)
|
|
217
219
|
return false;
|
|
@@ -229,9 +231,76 @@ class MapLayerSettings {
|
|
|
229
231
|
});
|
|
230
232
|
return children;
|
|
231
233
|
}
|
|
234
|
+
/** @internal */
|
|
235
|
+
static mapTypeName(type) {
|
|
236
|
+
switch (type) {
|
|
237
|
+
case BackgroundMapProvider_1.BackgroundMapType.Aerial:
|
|
238
|
+
return "Aerial Imagery";
|
|
239
|
+
default:
|
|
240
|
+
case BackgroundMapProvider_1.BackgroundMapType.Hybrid:
|
|
241
|
+
return "Aerial Imagery with labels";
|
|
242
|
+
case BackgroundMapProvider_1.BackgroundMapType.Street:
|
|
243
|
+
return "Streets";
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
setCredentials(userName, password) {
|
|
247
|
+
this.userName = userName;
|
|
248
|
+
this.password = password;
|
|
249
|
+
}
|
|
232
250
|
}
|
|
233
|
-
exports.
|
|
234
|
-
/**
|
|
251
|
+
exports.ImageMapLayerSettings = ImageMapLayerSettings;
|
|
252
|
+
/** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
|
|
253
|
+
* Model map layers are produced from models, typically from two dimensional geometry that may originate in a GIS system.
|
|
254
|
+
* One or more map layers may be included within [[MapImagerySettings]] object.
|
|
255
|
+
* @see [[MapImagerySettings]]
|
|
256
|
+
* @see [[ImageMapLayerSettings]] for image based map layer settings.
|
|
257
|
+
* @beta
|
|
258
|
+
*/
|
|
259
|
+
class ModelMapLayerSettings extends MapLayerSettings {
|
|
260
|
+
/** @internal */
|
|
261
|
+
constructor(modelId, name, visible = true, transparency = 0, transparentBackground = true) {
|
|
262
|
+
super(name, visible, transparency, transparentBackground);
|
|
263
|
+
this.modelId = modelId;
|
|
264
|
+
}
|
|
265
|
+
get source() { return this.modelId; }
|
|
266
|
+
/** Construct from JSON, performing validation and applying default values for undefined fields. */
|
|
267
|
+
static fromJSON(json) {
|
|
268
|
+
const transparentBackground = (json.transparentBackground === undefined) ? true : json.transparentBackground;
|
|
269
|
+
return new this(json.modelId, json.name, json.visible, json.transparency, transparentBackground);
|
|
270
|
+
}
|
|
271
|
+
/** return JSON representation of this MapLayerSettings object */
|
|
272
|
+
toJSON() {
|
|
273
|
+
const props = super._toJSON();
|
|
274
|
+
props.modelId = this.modelId;
|
|
275
|
+
return props;
|
|
276
|
+
}
|
|
277
|
+
/** Create a copy of this MapLayerSettings, optionally modifying some of its properties.
|
|
278
|
+
* @param changedProps JSON representation of the properties to change.
|
|
279
|
+
* @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.
|
|
280
|
+
*/
|
|
281
|
+
clone(changedProps) {
|
|
282
|
+
return ModelMapLayerSettings.fromJSON(this.cloneProps(changedProps));
|
|
283
|
+
}
|
|
284
|
+
/** @internal */
|
|
285
|
+
cloneProps(changedProps) {
|
|
286
|
+
var _a;
|
|
287
|
+
const props = super.cloneProps(changedProps);
|
|
288
|
+
props.modelId = (_a = changedProps.modelId) !== null && _a !== void 0 ? _a : this.modelId;
|
|
289
|
+
return props;
|
|
290
|
+
}
|
|
291
|
+
/** @internal */
|
|
292
|
+
displayMatches(other) {
|
|
293
|
+
if (!(other instanceof ModelMapLayerSettings) || !super.displayMatches(other))
|
|
294
|
+
return false;
|
|
295
|
+
return this.modelId === other.modelId;
|
|
296
|
+
}
|
|
297
|
+
/** Return true if all sublayers are invisible (always false as model layers do not include sublayers). */
|
|
298
|
+
get allSubLayersInvisible() {
|
|
299
|
+
return false;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
exports.ModelMapLayerSettings = ModelMapLayerSettings;
|
|
303
|
+
/** A [[ImageMapLayerSettings]] that can serve as the base layer for a [[MapImagerySettings]].
|
|
235
304
|
* The base layer supports all of the same options as any other layer, but also allows for simplified configuration based
|
|
236
305
|
* on a small set of known supported [[BackgroundMapProvider]]s like [Bing Maps](https://www.microsoft.com/en-us/maps).
|
|
237
306
|
* If the base layer was configured from such a provider, that information will be preserved and can be queried; this allows
|
|
@@ -239,7 +308,7 @@ exports.MapLayerSettings = MapLayerSettings;
|
|
|
239
308
|
* @see [[MapImagerySettings.backgroundBase]].
|
|
240
309
|
* @beta
|
|
241
310
|
*/
|
|
242
|
-
class BaseMapLayerSettings extends
|
|
311
|
+
class BaseMapLayerSettings extends ImageMapLayerSettings {
|
|
243
312
|
/** The provider from which this base layer was configured, if any. */
|
|
244
313
|
get provider() { return this._provider; }
|
|
245
314
|
/** Create a base layer from its JSON representation.
|
|
@@ -264,7 +333,9 @@ class BaseMapLayerSettings extends MapLayerSettings {
|
|
|
264
333
|
/** @internal */
|
|
265
334
|
cloneProps(changedProps) {
|
|
266
335
|
const props = super.cloneProps(changedProps);
|
|
267
|
-
if (
|
|
336
|
+
if (changedProps.provider)
|
|
337
|
+
props.provider = changedProps.provider;
|
|
338
|
+
else if (this.provider)
|
|
268
339
|
props.provider = this.provider.toJSON();
|
|
269
340
|
return props;
|
|
270
341
|
}
|
|
@@ -296,21 +367,21 @@ class BaseMapLayerSettings extends MapLayerSettings {
|
|
|
296
367
|
imagerySet = "AerialWithLabels";
|
|
297
368
|
break;
|
|
298
369
|
}
|
|
299
|
-
name = `Bing Maps: ${
|
|
370
|
+
name = `Bing Maps: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;
|
|
300
371
|
url = `https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${imagerySet}?o=json&incl=ImageryProviders&key={bingKey}`;
|
|
301
372
|
break;
|
|
302
373
|
case "MapBoxProvider":
|
|
303
374
|
formatId = "MapboxImagery";
|
|
304
|
-
name = `MapBox: ${
|
|
375
|
+
name = `MapBox: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;
|
|
305
376
|
switch (provider.type) {
|
|
306
377
|
case BackgroundMapProvider_1.BackgroundMapType.Street:
|
|
307
|
-
url = "https://api.mapbox.com/
|
|
378
|
+
url = "https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/";
|
|
308
379
|
break;
|
|
309
380
|
case BackgroundMapProvider_1.BackgroundMapType.Aerial:
|
|
310
|
-
url = "https://api.mapbox.com/
|
|
381
|
+
url = "https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/";
|
|
311
382
|
break;
|
|
312
383
|
case BackgroundMapProvider_1.BackgroundMapType.Hybrid:
|
|
313
|
-
url = "https://api.mapbox.com/
|
|
384
|
+
url = "https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/";
|
|
314
385
|
break;
|
|
315
386
|
}
|
|
316
387
|
break;
|
|
@@ -320,7 +391,6 @@ class BaseMapLayerSettings extends MapLayerSettings {
|
|
|
320
391
|
formatId,
|
|
321
392
|
url,
|
|
322
393
|
transparentBackground: false,
|
|
323
|
-
isBase: true,
|
|
324
394
|
visible: !(options === null || options === void 0 ? void 0 : options.invisible),
|
|
325
395
|
transparency: options === null || options === void 0 ? void 0 : options.transparency,
|
|
326
396
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerSettings.js","sourceRoot":"","sources":["../../src/MapLayerSettings.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,mEAA+G;AAqB/G;;;;;;;GAOG;AACH,MAAa,mBAAmB;IAc9B,YAAY,IAAY,EAAE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A2C,CAAC;wBAClD,MAAM;oBACR,KAAK,yCAAiB,CAAC,MAAM;wBAC3B,GAAG,GAAG,6CAA6C,CAAC;wBACpD,MAAM;oBACR,KAAK,yCAAiB,CAAC,MAAM;wBAC3B,GAAG,GAAG,qDAAqD,CAAC;wBAC5D,MAAM;iBACT;gBACD,MAAM;SACT;QAED,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;YAC9B,IAAI;YACJ,QAAQ;YACR,GAAG;YACH,qBAAqB,EAAE,KAAK;YAC5B,MAAM,EAAE,IAAI;YACZ,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,IAAA,qBAAM,EAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;QAC/B,IAAA,qBAAM,EAAC,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,6CAAqB,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;AArHD,oDAqHC","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,sDAAyD;AACzD,mEAA+G;AAqB/G;;;;;;;GAOG;AACH,MAAa,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;IAED,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,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjJ,CAAC;IAEM,MAAM;QACX,MAAM,KAAK,GAAqB,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;QAE3E,IAAI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AAM,CAAC,sBAAsB,CAAC,KAAmC;QACtE,OAAO,IAAI,CAAC,YAAY,CAAC,6CAAqB,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;AAzHD,oDAyHC","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;
|
|
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;IAE5C,2BAA2B;gBACR,MA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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"}
|
|
@@ -123,6 +123,13 @@ class SpatialClassifier {
|
|
|
123
123
|
isActive: false,
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
+
/** Construct from Model Map Layer.
|
|
127
|
+
* @beta
|
|
128
|
+
*/
|
|
129
|
+
static fromModelMapLayer(mapLayer) {
|
|
130
|
+
const flags = SpatialClassifierFlags.fromJSON({ inside: SpatialClassifierInsideDisplay.Off, outside: SpatialClassifierOutsideDisplay.Off });
|
|
131
|
+
return new SpatialClassifier(mapLayer.modelId, mapLayer.name, flags);
|
|
132
|
+
}
|
|
126
133
|
/** Create a classifier identical to this one except for any properties explicitly specified by `changedProps`. */
|
|
127
134
|
clone(changedProps) {
|
|
128
135
|
if (!changedProps)
|