@vcmap/core 5.0.0-rc.16 → 5.0.0-rc.19
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/index.d.ts +23 -28
- package/index.js +3 -3
- package/package.json +3 -2
- package/src/category/appBackedCategory.js +13 -0
- package/src/category/category.js +32 -5
- package/src/context.js +19 -3
- package/src/layer/wmtsLayer.js +6 -6
- package/src/style/styleItem.js +0 -7
- package/src/util/featureconverter/pointToCesium.js +6 -3
- package/src/util/layerCollection.js +7 -0
- package/src/vcsApp.js +6 -1
- package/tests/unit/helpers/cesiumHelpers.js +24 -6
- package/tests/data/buildings/tileset.json +0 -428
package/index.d.ts
CHANGED
|
@@ -8,25 +8,21 @@ export interface AppBackedCategoryOptions extends CategoryOptions {
|
|
|
8
8
|
export class AppBackedCategory extends Category<VcsObject> {
|
|
9
9
|
constructor(options: AppBackedCategoryOptions);
|
|
10
10
|
protected _deserializeItem(config: VcsObjectOptions): Promise<VcsObject>;
|
|
11
|
+
setApp(app: VcsApp): void;
|
|
11
12
|
serializeForContext(contextId: string): null;
|
|
13
|
+
toJSON(): AppBackedCategoryOptions;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
*/
|
|
16
18
|
export interface CategoryOptions extends VcsObjectOptions {
|
|
17
|
-
title?: string
|
|
18
|
-
[key: string]: string;
|
|
19
|
-
};
|
|
19
|
+
title?: string;
|
|
20
20
|
/**
|
|
21
21
|
* the class registry name on the current app to provide classes for this category. if provided, parseItems will deserialize using this class registry. See: {@link getObjectFromClassRegistry}.
|
|
22
22
|
*/
|
|
23
23
|
classRegistryName?: string | symbol;
|
|
24
24
|
featureProperty?: string | undefined;
|
|
25
25
|
layerOptions?: VectorOptions;
|
|
26
|
-
/**
|
|
27
|
-
* items are not evaluated by the constructor but passed to parseItem during deserialization.
|
|
28
|
-
*/
|
|
29
|
-
items?: object[];
|
|
30
26
|
keyProperty?: string;
|
|
31
27
|
}
|
|
32
28
|
|
|
@@ -39,9 +35,7 @@ export interface CategoryOptions extends VcsObjectOptions {
|
|
|
39
35
|
export class Category<T extends Object|VcsObject> extends VcsObject {
|
|
40
36
|
constructor(options: CategoryOptions);
|
|
41
37
|
static getDefaultConfig(): CategoryOptions;
|
|
42
|
-
title: string
|
|
43
|
-
[key: string]: string;
|
|
44
|
-
};
|
|
38
|
+
title: string;
|
|
45
39
|
protected _app: VcsApp;
|
|
46
40
|
protected _layer: VectorLayer;
|
|
47
41
|
readonly classRegistryName: string | symbol;
|
|
@@ -81,7 +75,7 @@ export class Category<T extends Object|VcsObject> extends VcsObject {
|
|
|
81
75
|
*/
|
|
82
76
|
protected _deserializeItem(config: any): Promise<T>;
|
|
83
77
|
protected _serializeItem(item: T): object[];
|
|
84
|
-
serializeForContext(contextId: string):
|
|
78
|
+
serializeForContext(contextId: string): any | null;
|
|
85
79
|
/**
|
|
86
80
|
* unique Name
|
|
87
81
|
*/
|
|
@@ -169,6 +163,14 @@ export interface VcsAppConfig {
|
|
|
169
163
|
obliqueCollections?: ObliqueCollectionOptions[];
|
|
170
164
|
}
|
|
171
165
|
|
|
166
|
+
/**
|
|
167
|
+
* This marks an object as "volatile". This ensures, that an object added to the {@see VcsApp}
|
|
168
|
+
* will never be serialized into a context, regardless of the current dynamic context. Typical use case is a scratch layer
|
|
169
|
+
* which represents temporary features.
|
|
170
|
+
* @param object - the object to mark as volatile
|
|
171
|
+
*/
|
|
172
|
+
export function markVolatile(object: VcsObject | any): void;
|
|
173
|
+
|
|
172
174
|
export class Context {
|
|
173
175
|
constructor(config: VcsAppConfig);
|
|
174
176
|
readonly id: string;
|
|
@@ -4796,7 +4798,7 @@ export class WMSLayer extends RasterLayer {
|
|
|
4796
4798
|
|
|
4797
4799
|
export interface WMTSOptions extends RasterLayerOptions {
|
|
4798
4800
|
layer: string;
|
|
4799
|
-
|
|
4801
|
+
wmtsStyle?: string | undefined;
|
|
4800
4802
|
format?: string | undefined;
|
|
4801
4803
|
tileMatrixSetID?: string | undefined;
|
|
4802
4804
|
tileMatrixPrefix?: string | undefined;
|
|
@@ -4828,7 +4830,7 @@ export class WMTSLayer extends RasterLayer {
|
|
|
4828
4830
|
numberOfLevelZeroTilesX: number;
|
|
4829
4831
|
numberOfLevelZeroTilesY: number;
|
|
4830
4832
|
layer: string;
|
|
4831
|
-
|
|
4833
|
+
wmtsStyle: string;
|
|
4832
4834
|
format: string;
|
|
4833
4835
|
tileMatrixPrefix: string;
|
|
4834
4836
|
tileMatrixSetID: string;
|
|
@@ -6408,21 +6410,6 @@ export function getDefaultCondition(attribute: string, isColor?: boolean): strin
|
|
|
6408
6410
|
|
|
6409
6411
|
export const defaultExtrudedHeightCondition: string;
|
|
6410
6412
|
|
|
6411
|
-
/**
|
|
6412
|
-
*/
|
|
6413
|
-
export interface StyleItemLegendEntry {
|
|
6414
|
-
/**
|
|
6415
|
-
* the color to display
|
|
6416
|
-
*/
|
|
6417
|
-
color: string;
|
|
6418
|
-
/**
|
|
6419
|
-
* the name to display for the given color
|
|
6420
|
-
*/
|
|
6421
|
-
name: string | {
|
|
6422
|
-
[key: string]: string;
|
|
6423
|
-
};
|
|
6424
|
-
}
|
|
6425
|
-
|
|
6426
6413
|
/**
|
|
6427
6414
|
*/
|
|
6428
6415
|
export interface StyleItemOptions extends VcsObjectOptions {
|
|
@@ -7079,6 +7066,12 @@ export class IndexedCollection<T extends any> extends Collection<T> {
|
|
|
7079
7066
|
destroy(): void;
|
|
7080
7067
|
}
|
|
7081
7068
|
|
|
7069
|
+
/**
|
|
7070
|
+
* The largest integer zindex which can be safely assigned to a layer (equal to Number.MAX_SAFE_INTEGER)
|
|
7071
|
+
* You should use this to ensure layers are always rendered on top.
|
|
7072
|
+
*/
|
|
7073
|
+
export const maxZIndex: number;
|
|
7074
|
+
|
|
7082
7075
|
/**
|
|
7083
7076
|
* A collection of layers. Manages rendering order and layer exclusivity. Emits state changes for convenience. Passed to
|
|
7084
7077
|
* {@link Map} for layers available to said map. Layers must have unique names.
|
|
@@ -7489,6 +7482,8 @@ export class ViewPoint extends VcsObject {
|
|
|
7489
7482
|
readonly className: string;
|
|
7490
7483
|
}
|
|
7491
7484
|
|
|
7485
|
+
export const defaultDynamicContextId: string;
|
|
7486
|
+
|
|
7492
7487
|
export class VcsApp {
|
|
7493
7488
|
readonly id: string;
|
|
7494
7489
|
/**
|
package/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { default as AppBackedCategory } from './src/category/appBackedCategory.j
|
|
|
11
11
|
export { default as Category } from './src/category/category.js';
|
|
12
12
|
export { default as CategoryCollection } from './src/category/categoryCollection.js';
|
|
13
13
|
export { layerClassRegistry, tileProviderClassRegistry, featureProviderClassRegistry, mapClassRegistry, styleClassRegistry, categoryClassRegistry, getObjectFromClassRegistry, default as ClassRegistry } from './src/classRegistry.js';
|
|
14
|
-
export { default as Context } from './src/context.js';
|
|
14
|
+
export { markVolatile, default as Context } from './src/context.js';
|
|
15
15
|
export { default as AbstractFeatureProvider } from './src/featureProvider/abstractFeatureProvider.js';
|
|
16
16
|
export { getGenericFeatureFromProvidedFeature } from './src/featureProvider/featureProviderHelpers.js';
|
|
17
17
|
export { isProvidedFeature, showProvidedFeature } from './src/featureProvider/featureProviderSymbols.js';
|
|
@@ -130,7 +130,7 @@ export { requestUrl, requestJson, requestArrayBuffer } from './src/util/fetch.js
|
|
|
130
130
|
export { getFlatCoordinatesFromSimpleGeometry, getFlatCoordinatesFromGeometry, circleFromCenterRadius, convertGeometryToPolygon, enforceEndingVertex, removeEndingVertex, removeEndingVertexFromGeometry, enforceRightHand } from './src/util/geometryHelpers.js';
|
|
131
131
|
export { default as IndexedCollection } from './src/util/indexedCollection.js';
|
|
132
132
|
export { isMobile } from './src/util/isMobile.js';
|
|
133
|
-
export { default as LayerCollection } from './src/util/layerCollection.js';
|
|
133
|
+
export { maxZIndex, default as LayerCollection } from './src/util/layerCollection.js';
|
|
134
134
|
export { detectBrowserLocale } from './src/util/locale.js';
|
|
135
135
|
export { default as MapCollection } from './src/util/mapCollection.js';
|
|
136
136
|
export { coordinateAtDistance, initialBearingBetweenCoords, cartesian2DDistance, cartesian3DDistance } from './src/util/math.js';
|
|
@@ -139,7 +139,7 @@ export { wgs84ToMercatorTransformer, mercatorToWgs84Transformer, setDefaultProje
|
|
|
139
139
|
export { default as SplitScreen } from './src/util/splitScreen.js';
|
|
140
140
|
export { isSameOrigin } from './src/util/urlHelpers.js';
|
|
141
141
|
export { propertyEqualsEpsilon, angleEqualsEpsilon, coordinateEqualsEpsilon, default as ViewPoint } from './src/util/viewpoint.js';
|
|
142
|
-
export { getVcsAppById, default as VcsApp } from './src/vcsApp.js';
|
|
142
|
+
export { defaultDynamicContextId, getVcsAppById, default as VcsApp } from './src/vcsApp.js';
|
|
143
143
|
export { contextIdSymbol, deserializeMap, deserializeViewPoint, deserializeLayer, serializeLayer, getLayerIndex, destroyCollection } from './src/vcsAppContextHelpers.js';
|
|
144
144
|
export { default as VcsEvent } from './src/vcsEvent.js';
|
|
145
145
|
export { default as VcsObject } from './src/vcsObject.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vcmap/core",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -68,7 +68,8 @@
|
|
|
68
68
|
"node_modules",
|
|
69
69
|
"coverage",
|
|
70
70
|
"index.js",
|
|
71
|
-
"*.d.ts"
|
|
71
|
+
"*.d.ts",
|
|
72
|
+
"docs"
|
|
72
73
|
],
|
|
73
74
|
"dependencies": {
|
|
74
75
|
"@types/rbush": "^3.0.0",
|
|
@@ -57,6 +57,9 @@ class AppBackedCategory extends Category {
|
|
|
57
57
|
return super._deserializeItem(config);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* @param {import("@vcmap/core").VcsApp} app
|
|
62
|
+
*/
|
|
60
63
|
setApp(app) {
|
|
61
64
|
super.setApp(app);
|
|
62
65
|
this.setCollection(this._app[this._collectionName]);
|
|
@@ -70,6 +73,16 @@ class AppBackedCategory extends Category {
|
|
|
70
73
|
serializeForContext(contextId) {
|
|
71
74
|
return null;
|
|
72
75
|
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @returns {AppBackedCategoryOptions}
|
|
79
|
+
*/
|
|
80
|
+
toJSON() {
|
|
81
|
+
const config = /** @type {AppBackedCategoryOptions} */ (super.toJSON());
|
|
82
|
+
delete config.classRegistryName;
|
|
83
|
+
config.collectionName = this._collectionName;
|
|
84
|
+
return config;
|
|
85
|
+
}
|
|
73
86
|
}
|
|
74
87
|
|
|
75
88
|
export default AppBackedCategory;
|
package/src/category/category.js
CHANGED
|
@@ -15,11 +15,10 @@ import VcsEvent from '../vcsEvent.js';
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @typedef {VcsObjectOptions} CategoryOptions
|
|
18
|
-
* @property {string
|
|
18
|
+
* @property {string} [title]
|
|
19
19
|
* @property {string|symbol} [classRegistryName] - the class registry name on the current app to provide classes for this category. if provided, parseItems will deserialize using this class registry. See: {@link getObjectFromClassRegistry}.
|
|
20
20
|
* @property {string|undefined} [featureProperty]
|
|
21
21
|
* @property {VectorOptions} [layerOptions={}]
|
|
22
|
-
* @property {Array<Object>} [items] - items are not evaluated by the constructor but passed to parseItem during deserialization.
|
|
23
22
|
* @property {string} [keyProperty=name]
|
|
24
23
|
*/
|
|
25
24
|
|
|
@@ -89,7 +88,6 @@ class Category extends VcsObject {
|
|
|
89
88
|
classRegistryName: undefined,
|
|
90
89
|
layerOptions: {},
|
|
91
90
|
keyProperty: 'name',
|
|
92
|
-
items: [],
|
|
93
91
|
};
|
|
94
92
|
}
|
|
95
93
|
|
|
@@ -100,7 +98,7 @@ class Category extends VcsObject {
|
|
|
100
98
|
super(options);
|
|
101
99
|
const defaultOptions = Category.getDefaultConfig();
|
|
102
100
|
/**
|
|
103
|
-
* @type {string
|
|
101
|
+
* @type {string}
|
|
104
102
|
*/
|
|
105
103
|
this.title = options.title || this.name;
|
|
106
104
|
/**
|
|
@@ -381,7 +379,7 @@ class Category extends VcsObject {
|
|
|
381
379
|
|
|
382
380
|
/**
|
|
383
381
|
* @param {string} contextId
|
|
384
|
-
* @returns {
|
|
382
|
+
* @returns {{ name: string, items: Array<Object>}|null}
|
|
385
383
|
*/
|
|
386
384
|
serializeForContext(contextId) {
|
|
387
385
|
if (this._collection.size === 0) {
|
|
@@ -394,6 +392,34 @@ class Category extends VcsObject {
|
|
|
394
392
|
};
|
|
395
393
|
}
|
|
396
394
|
|
|
395
|
+
/**
|
|
396
|
+
* @returns {CategoryOptions}
|
|
397
|
+
*/
|
|
398
|
+
toJSON() {
|
|
399
|
+
const config = /** @type {CategoryOptions} */ (super.toJSON());
|
|
400
|
+
|
|
401
|
+
const defaultOptions = Category.getDefaultConfig();
|
|
402
|
+
if (this.title !== this.name) {
|
|
403
|
+
config.title = this.title;
|
|
404
|
+
}
|
|
405
|
+
if (this._featureProperty !== defaultOptions.featureProperty) {
|
|
406
|
+
config.featureProperty = this._featureProperty;
|
|
407
|
+
}
|
|
408
|
+
if (this._classRegistryName !== defaultOptions.classRegistryName) {
|
|
409
|
+
config.classRegistryName = this._classRegistryName;
|
|
410
|
+
}
|
|
411
|
+
if (Object.keys(this._layerOptions).length > 0) {
|
|
412
|
+
config.layerOptions = { ...this._layerOptions };
|
|
413
|
+
}
|
|
414
|
+
if (this._keyProperty !== defaultOptions.keyProperty) {
|
|
415
|
+
config.keyProperty = this._keyProperty;
|
|
416
|
+
}
|
|
417
|
+
return config;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* @inheritDoc
|
|
422
|
+
*/
|
|
397
423
|
destroy() {
|
|
398
424
|
super.destroy();
|
|
399
425
|
if (this._app && this._layer) {
|
|
@@ -415,3 +441,4 @@ class Category extends VcsObject {
|
|
|
415
441
|
|
|
416
442
|
export default Category;
|
|
417
443
|
categoryClassRegistry.registerClass(Category.className, Category);
|
|
444
|
+
|
package/src/context.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v5 as uuidv5, v4 as uuidv4 } from 'uuid';
|
|
2
|
+
import { contextIdSymbol } from './vcsAppContextHelpers.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @typedef {Object} VcsAppConfig
|
|
@@ -17,7 +18,22 @@ import { v4 as uuidv4, v5 as uuidv5 } from 'uuid';
|
|
|
17
18
|
/**
|
|
18
19
|
* @type {string}
|
|
19
20
|
*/
|
|
20
|
-
const
|
|
21
|
+
const uniqueNamespace = '9c27cc2d-552f-4637-9194-09329ed4c1dc';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
26
|
+
const volatileContextId = uuidv4();
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* This marks an object as "volatile". This ensures, that an object added to the {@see VcsApp}
|
|
30
|
+
* will never be serialized into a context, regardless of the current dynamic context. Typical use case is a scratch layer
|
|
31
|
+
* which represents temporary features.
|
|
32
|
+
* @param {import("@vcmap/core").VcsObject|Object} object - the object to mark as volatile
|
|
33
|
+
*/
|
|
34
|
+
export function markVolatile(object) {
|
|
35
|
+
object[contextIdSymbol] = volatileContextId;
|
|
36
|
+
}
|
|
21
37
|
|
|
22
38
|
/**
|
|
23
39
|
* @class
|
|
@@ -36,7 +52,7 @@ class Context {
|
|
|
36
52
|
* @type {string}
|
|
37
53
|
* @private
|
|
38
54
|
*/
|
|
39
|
-
this._checkSum = uuidv5(JSON.stringify(config),
|
|
55
|
+
this._checkSum = uuidv5(JSON.stringify(config), uniqueNamespace);
|
|
40
56
|
/**
|
|
41
57
|
* @type {string}
|
|
42
58
|
* @private
|
package/src/layer/wmtsLayer.js
CHANGED
|
@@ -10,7 +10,7 @@ import { layerClassRegistry } from '../classRegistry.js';
|
|
|
10
10
|
/**
|
|
11
11
|
* @typedef {RasterLayerOptions} WMTSOptions
|
|
12
12
|
* @property {string} layer
|
|
13
|
-
* @property {string|undefined}
|
|
13
|
+
* @property {string|undefined} [wmtsStyle]
|
|
14
14
|
* @property {string|undefined} format
|
|
15
15
|
* @property {string|undefined} tileMatrixSetID
|
|
16
16
|
* @property {string|undefined} tileMatrixPrefix
|
|
@@ -76,7 +76,7 @@ class WMTSLayer extends RasterLayer {
|
|
|
76
76
|
numberOfLevelZeroTilesX: 1,
|
|
77
77
|
numberOfLevelZeroTilesY: 1,
|
|
78
78
|
layer: '',
|
|
79
|
-
|
|
79
|
+
wmtsStyle: '',
|
|
80
80
|
format: '',
|
|
81
81
|
tileMatrixPrefix: '',
|
|
82
82
|
tileMatrixSetID: '',
|
|
@@ -115,7 +115,7 @@ class WMTSLayer extends RasterLayer {
|
|
|
115
115
|
this.layer = options.layer || defaultOptions.layer;
|
|
116
116
|
|
|
117
117
|
/** @type {string} */
|
|
118
|
-
this.
|
|
118
|
+
this.wmtsStyle = options.wmtsStyle || defaultOptions.wmtsStyle;
|
|
119
119
|
|
|
120
120
|
/** @type {string} */
|
|
121
121
|
this.format = options.format || defaultOptions.format;
|
|
@@ -144,7 +144,7 @@ class WMTSLayer extends RasterLayer {
|
|
|
144
144
|
return {
|
|
145
145
|
...super.getImplementationOptions(),
|
|
146
146
|
layer: this.layer,
|
|
147
|
-
style: this.
|
|
147
|
+
style: this.wmtsStyle,
|
|
148
148
|
format: this.format,
|
|
149
149
|
tileMatrixSetID: this.tileMatrixSetID,
|
|
150
150
|
tileSize: this.tileSize,
|
|
@@ -197,8 +197,8 @@ class WMTSLayer extends RasterLayer {
|
|
|
197
197
|
config.layer = this.layer;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
if (this.
|
|
201
|
-
config.
|
|
200
|
+
if (this.wmtsStyle !== defaultOptions.wmtsStyle) {
|
|
201
|
+
config.wmtsStyle = this.wmtsStyle;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
if (this.format !== defaultOptions.format) {
|
package/src/style/styleItem.js
CHANGED
|
@@ -6,13 +6,6 @@ import VcsObject from '../vcsObject.js';
|
|
|
6
6
|
import VcsEvent from '../vcsEvent.js';
|
|
7
7
|
import { styleClassRegistry } from '../classRegistry.js';
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* @typedef {Object} StyleItemLegendEntry
|
|
11
|
-
* @property {string} color - the color to display
|
|
12
|
-
* @property {string|Object<string, string>} name - the name to display for the given color
|
|
13
|
-
* @api
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
9
|
/**
|
|
17
10
|
* @typedef {VcsObjectOptions} StyleItemOptions
|
|
18
11
|
* @property {number} [colorBlendMode=import("@vcmap/cesium").Cesium3DTileColorBlendMode.HIGHLIGHT] - colorBlendMode for 3D Tiledataset @see https://cesiumjs.org/import("@vcmap/cesium").Build/Documentation/Cesium3DTileColorBlendMode.html
|
|
@@ -107,9 +107,13 @@ export function getLabelOptions(feature, style, heightReference, vectorPropertie
|
|
|
107
107
|
|
|
108
108
|
options.heightReference = heightReference;
|
|
109
109
|
|
|
110
|
-
const offsetX = textStyle.getOffsetX()
|
|
111
|
-
const offsetY = textStyle.getOffsetY()
|
|
110
|
+
const offsetX = textStyle.getOffsetX() ?? 0;
|
|
111
|
+
const offsetY = textStyle.getOffsetY() ?? 0;
|
|
112
112
|
options.pixelOffset = new Cartesian2(offsetX, offsetY);
|
|
113
|
+
const scale = textStyle.getScale();
|
|
114
|
+
if (scale) {
|
|
115
|
+
options.scale = Array.isArray(scale) ? scale[0] : scale;
|
|
116
|
+
}
|
|
113
117
|
|
|
114
118
|
const font = textStyle.getFont();
|
|
115
119
|
if (font) {
|
|
@@ -171,7 +175,6 @@ export function getLabelOptions(feature, style, heightReference, vectorPropertie
|
|
|
171
175
|
options.verticalOrigin = verticalOrigin;
|
|
172
176
|
options.eyeOffset = vectorProperties.getEyeOffset(feature);
|
|
173
177
|
options.scaleByDistance = vectorProperties.getScaleByDistance(feature);
|
|
174
|
-
|
|
175
178
|
return options;
|
|
176
179
|
}
|
|
177
180
|
return null;
|
|
@@ -5,6 +5,13 @@ import LayerState from '../layer/layerState.js';
|
|
|
5
5
|
import VcsEvent from '../vcsEvent.js';
|
|
6
6
|
import GlobalHider from '../layer/globalHider.js';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* The largest integer zindex which can be safely assigned to a layer (equal to Number.MAX_SAFE_INTEGER)
|
|
10
|
+
* You should use this to ensure layers are always rendered on top.
|
|
11
|
+
* @type {number}
|
|
12
|
+
*/
|
|
13
|
+
export const maxZIndex = Number.MAX_SAFE_INTEGER;
|
|
14
|
+
|
|
8
15
|
/**
|
|
9
16
|
* A collection of layers. Manages rendering order and layer exclusivity. Emits state changes for convenience. Passed to
|
|
10
17
|
* {@link Map} for layers available to said map. Layers must have unique names.
|
package/src/vcsApp.js
CHANGED
|
@@ -47,6 +47,11 @@ function getLogger() {
|
|
|
47
47
|
*/
|
|
48
48
|
const vcsApps = new Map();
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* @type {string}
|
|
52
|
+
*/
|
|
53
|
+
export const defaultDynamicContextId = '_defaultDynamicContext';
|
|
54
|
+
|
|
50
55
|
/**
|
|
51
56
|
* @class
|
|
52
57
|
*/
|
|
@@ -61,7 +66,7 @@ class VcsApp {
|
|
|
61
66
|
* @type {Context}
|
|
62
67
|
* @private
|
|
63
68
|
*/
|
|
64
|
-
this._defaultDynamicContext = new Context({ id:
|
|
69
|
+
this._defaultDynamicContext = new Context({ id: defaultDynamicContextId });
|
|
65
70
|
/**
|
|
66
71
|
* @type {Context}
|
|
67
72
|
* @private
|
|
@@ -20,13 +20,31 @@ import ContextLimits from '@vcmap/cesium/Source/Renderer/ContextLimits.js';
|
|
|
20
20
|
import CesiumTilesetLayer from '../../../src/layer/cesiumTilesetLayer.js';
|
|
21
21
|
import DataSourceLayer from '../../../src/layer/dataSourceLayer.js';
|
|
22
22
|
import CesiumMap from '../../../src/map/cesiumMap.js';
|
|
23
|
-
import importJSON from './importJSON.js';
|
|
24
23
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
export const tilesetJSON = {
|
|
25
|
+
asset: {
|
|
26
|
+
version: '0.0',
|
|
27
|
+
tilesetVersion: '54443336650',
|
|
28
|
+
},
|
|
29
|
+
geometricError: 48.828125,
|
|
30
|
+
root: {
|
|
31
|
+
boundingVolume: {
|
|
32
|
+
region: [
|
|
33
|
+
0.233260953,
|
|
34
|
+
0.916361773,
|
|
35
|
+
0.233644448,
|
|
36
|
+
0.91655352,
|
|
37
|
+
0.0,
|
|
38
|
+
140.3,
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
geometricError: 24.4140625,
|
|
42
|
+
refine: 'ADD',
|
|
43
|
+
children: [],
|
|
44
|
+
},
|
|
45
|
+
properties: {},
|
|
46
|
+
extras: { _3DTILESDIFFUSE: true },
|
|
47
|
+
};
|
|
30
48
|
|
|
31
49
|
/**
|
|
32
50
|
* @param {Sinon.SinonSandbox} sandbox
|
|
@@ -1,428 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"asset": {
|
|
3
|
-
"version": "0.0",
|
|
4
|
-
"tilesetVersion": "54443336650"
|
|
5
|
-
},
|
|
6
|
-
"geometricError": 48.828125,
|
|
7
|
-
"root": {
|
|
8
|
-
"boundingVolume": {
|
|
9
|
-
"region": [
|
|
10
|
-
0.233260953,
|
|
11
|
-
0.916361773,
|
|
12
|
-
0.233644448,
|
|
13
|
-
0.91655352,
|
|
14
|
-
0.0,
|
|
15
|
-
140.3
|
|
16
|
-
]
|
|
17
|
-
},
|
|
18
|
-
"geometricError": 24.4140625,
|
|
19
|
-
"refine": "ADD",
|
|
20
|
-
"children": [
|
|
21
|
-
{
|
|
22
|
-
"boundingVolume": {
|
|
23
|
-
"region": [
|
|
24
|
-
0.233260953,
|
|
25
|
-
0.916361773,
|
|
26
|
-
0.233380094,
|
|
27
|
-
0.916457646,
|
|
28
|
-
31.1,
|
|
29
|
-
78.7
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
"geometricError": 0.0,
|
|
33
|
-
"refine": "REPLACE",
|
|
34
|
-
"content": {
|
|
35
|
-
"boundingVolume": {
|
|
36
|
-
"region": [
|
|
37
|
-
0.233331935,
|
|
38
|
-
0.916407795,
|
|
39
|
-
0.233380094,
|
|
40
|
-
0.916449129,
|
|
41
|
-
31.1,
|
|
42
|
-
78.7
|
|
43
|
-
]
|
|
44
|
-
},
|
|
45
|
-
"uri": "15/35201/6825.b3dm"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"boundingVolume": {
|
|
50
|
-
"region": [
|
|
51
|
-
0.233356409,
|
|
52
|
-
0.916457646,
|
|
53
|
-
0.233456404,
|
|
54
|
-
0.91655352,
|
|
55
|
-
30.3,
|
|
56
|
-
137.0
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
"geometricError": 0.0,
|
|
60
|
-
"refine": "REPLACE",
|
|
61
|
-
"content": {
|
|
62
|
-
"boundingVolume": {
|
|
63
|
-
"region": [
|
|
64
|
-
0.233356409,
|
|
65
|
-
0.916461664,
|
|
66
|
-
0.233456404,
|
|
67
|
-
0.916504342,
|
|
68
|
-
30.3,
|
|
69
|
-
137.0
|
|
70
|
-
]
|
|
71
|
-
},
|
|
72
|
-
"uri": "15/35202/6824.b3dm"
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"boundingVolume": {
|
|
77
|
-
"region": [
|
|
78
|
-
0.233356827,
|
|
79
|
-
0.916361773,
|
|
80
|
-
0.233463022,
|
|
81
|
-
0.916459533,
|
|
82
|
-
0.0,
|
|
83
|
-
140.3
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
"geometricError": 0.0,
|
|
87
|
-
"refine": "REPLACE",
|
|
88
|
-
"content": {
|
|
89
|
-
"boundingVolume": {
|
|
90
|
-
"region": [
|
|
91
|
-
0.233366702,
|
|
92
|
-
0.916369892,
|
|
93
|
-
0.233463022,
|
|
94
|
-
0.916459533,
|
|
95
|
-
0.0,
|
|
96
|
-
140.3
|
|
97
|
-
]
|
|
98
|
-
},
|
|
99
|
-
"uri": "15/35202/6825.b3dm"
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"boundingVolume": {
|
|
104
|
-
"region": [
|
|
105
|
-
0.233448286,
|
|
106
|
-
0.916457646,
|
|
107
|
-
0.233552106,
|
|
108
|
-
0.91655352,
|
|
109
|
-
0.0,
|
|
110
|
-
104.6
|
|
111
|
-
]
|
|
112
|
-
},
|
|
113
|
-
"geometricError": 0.0,
|
|
114
|
-
"refine": "REPLACE",
|
|
115
|
-
"content": {
|
|
116
|
-
"boundingVolume": {
|
|
117
|
-
"region": [
|
|
118
|
-
0.233448286,
|
|
119
|
-
0.916458978,
|
|
120
|
-
0.233552106,
|
|
121
|
-
0.916523912,
|
|
122
|
-
0.0,
|
|
123
|
-
104.6
|
|
124
|
-
]
|
|
125
|
-
},
|
|
126
|
-
"uri": "15/35203/6824.b3dm"
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
"boundingVolume": {
|
|
131
|
-
"region": [
|
|
132
|
-
0.233444878,
|
|
133
|
-
0.916361773,
|
|
134
|
-
0.233565333,
|
|
135
|
-
0.916468504,
|
|
136
|
-
0.0,
|
|
137
|
-
87.9
|
|
138
|
-
]
|
|
139
|
-
},
|
|
140
|
-
"geometricError": 0.0,
|
|
141
|
-
"refine": "REPLACE",
|
|
142
|
-
"content": {
|
|
143
|
-
"boundingVolume": {
|
|
144
|
-
"region": [
|
|
145
|
-
0.233444878,
|
|
146
|
-
0.916381249,
|
|
147
|
-
0.233565333,
|
|
148
|
-
0.916468504,
|
|
149
|
-
0.0,
|
|
150
|
-
87.9
|
|
151
|
-
]
|
|
152
|
-
},
|
|
153
|
-
"uri": "15/35203/6825.b3dm"
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
"boundingVolume": {
|
|
158
|
-
"region": [
|
|
159
|
-
0.233503526,
|
|
160
|
-
0.916457646,
|
|
161
|
-
0.233644448,
|
|
162
|
-
0.91655352,
|
|
163
|
-
31.9,
|
|
164
|
-
69.5
|
|
165
|
-
]
|
|
166
|
-
},
|
|
167
|
-
"geometricError": 0.0,
|
|
168
|
-
"refine": "REPLACE",
|
|
169
|
-
"content": {
|
|
170
|
-
"boundingVolume": {
|
|
171
|
-
"region": [
|
|
172
|
-
0.233503526,
|
|
173
|
-
0.916459892,
|
|
174
|
-
0.233593156,
|
|
175
|
-
0.916528355,
|
|
176
|
-
31.9,
|
|
177
|
-
69.5
|
|
178
|
-
]
|
|
179
|
-
},
|
|
180
|
-
"uri": "15/35204/6824.b3dm"
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
"boundingVolume": {
|
|
185
|
-
"region": [
|
|
186
|
-
0.233537322,
|
|
187
|
-
0.916361773,
|
|
188
|
-
0.233644448,
|
|
189
|
-
0.916457646,
|
|
190
|
-
30.9,
|
|
191
|
-
82.2
|
|
192
|
-
]
|
|
193
|
-
},
|
|
194
|
-
"geometricError": 0.0,
|
|
195
|
-
"refine": "REPLACE",
|
|
196
|
-
"content": {
|
|
197
|
-
"boundingVolume": {
|
|
198
|
-
"region": [
|
|
199
|
-
0.233537322,
|
|
200
|
-
0.916378958,
|
|
201
|
-
0.233589257,
|
|
202
|
-
0.916452399,
|
|
203
|
-
30.9,
|
|
204
|
-
82.2
|
|
205
|
-
]
|
|
206
|
-
},
|
|
207
|
-
"uri": "15/35204/6825.b3dm"
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
]
|
|
211
|
-
},
|
|
212
|
-
"properties": {
|
|
213
|
-
"EIG_KL_ST": {
|
|
214
|
-
"valueType": "INTEGER",
|
|
215
|
-
"minimum": -1.0,
|
|
216
|
-
"maximum": 1.0
|
|
217
|
-
},
|
|
218
|
-
"FOLIE": {
|
|
219
|
-
"valueType": "STRING"
|
|
220
|
-
},
|
|
221
|
-
"ANZ_LOC": {
|
|
222
|
-
"valueType": "INTEGER",
|
|
223
|
-
"minimum": 1.0,
|
|
224
|
-
"maximum": 2.0
|
|
225
|
-
},
|
|
226
|
-
"TexVersion": {
|
|
227
|
-
"valueType": "INTEGER",
|
|
228
|
-
"minimum": 1.0,
|
|
229
|
-
"maximum": 1.0
|
|
230
|
-
},
|
|
231
|
-
"HoeheDach": {
|
|
232
|
-
"valueType": "STRING"
|
|
233
|
-
},
|
|
234
|
-
"Address": {
|
|
235
|
-
"valueType": "SIMPLEADDRESS"
|
|
236
|
-
},
|
|
237
|
-
"file_candidate_gmlid": {
|
|
238
|
-
"valueType": "STRING"
|
|
239
|
-
},
|
|
240
|
-
"LFD": {
|
|
241
|
-
"valueType": "STRING"
|
|
242
|
-
},
|
|
243
|
-
"HNR": {
|
|
244
|
-
"valueType": "STRING"
|
|
245
|
-
},
|
|
246
|
-
"overlap_DB_to_file": {
|
|
247
|
-
"valueType": "INTEGER",
|
|
248
|
-
"minimum": 100.0,
|
|
249
|
-
"maximum": 100.0
|
|
250
|
-
},
|
|
251
|
-
"externalReference 1 externalObjectName": {
|
|
252
|
-
"valueType": "STRING"
|
|
253
|
-
},
|
|
254
|
-
"area_diff": {
|
|
255
|
-
"valueType": "INTEGER",
|
|
256
|
-
"minimum": 0.0,
|
|
257
|
-
"maximum": 0.0
|
|
258
|
-
},
|
|
259
|
-
"externalReference externalObjectName": {
|
|
260
|
-
"valueType": "STRING"
|
|
261
|
-
},
|
|
262
|
-
"STR": {
|
|
263
|
-
"valueType": "STRING"
|
|
264
|
-
},
|
|
265
|
-
"based_on_file_lod": {
|
|
266
|
-
"valueType": "INTEGER",
|
|
267
|
-
"minimum": 0.0,
|
|
268
|
-
"maximum": 0.0
|
|
269
|
-
},
|
|
270
|
-
"overlap_filter": {
|
|
271
|
-
"valueType": "INTEGER",
|
|
272
|
-
"minimum": 89.0,
|
|
273
|
-
"maximum": 89.0
|
|
274
|
-
},
|
|
275
|
-
"measuredHeight": {
|
|
276
|
-
"valueType": "DOUBLE",
|
|
277
|
-
"minimum": 3.41,
|
|
278
|
-
"maximum": 70.89
|
|
279
|
-
},
|
|
280
|
-
"DENKMALART": {
|
|
281
|
-
"valueType": "STRING"
|
|
282
|
-
},
|
|
283
|
-
"ADZ": {
|
|
284
|
-
"valueType": "STRING"
|
|
285
|
-
},
|
|
286
|
-
"function": {
|
|
287
|
-
"valueType": "STRING"
|
|
288
|
-
},
|
|
289
|
-
"NiedrigsteTraufeDesGebaeudes": {
|
|
290
|
-
"valueType": "STRING"
|
|
291
|
-
},
|
|
292
|
-
"Qualitaet": {
|
|
293
|
-
"valueType": "STRING"
|
|
294
|
-
},
|
|
295
|
-
"DENK_ID": {
|
|
296
|
-
"valueType": "STRING"
|
|
297
|
-
},
|
|
298
|
-
"Methode": {
|
|
299
|
-
"valueType": "STRING"
|
|
300
|
-
},
|
|
301
|
-
"H_First_Max": {
|
|
302
|
-
"valueType": "DOUBLE",
|
|
303
|
-
"minimum": 37.27528,
|
|
304
|
-
"maximum": 140.5875
|
|
305
|
-
},
|
|
306
|
-
"creationDate": {
|
|
307
|
-
"valueType": "STRING"
|
|
308
|
-
},
|
|
309
|
-
"KREIS": {
|
|
310
|
-
"valueType": "STRING"
|
|
311
|
-
},
|
|
312
|
-
"GE_LoD3_zOffset": {
|
|
313
|
-
"valueType": "STRING"
|
|
314
|
-
},
|
|
315
|
-
"area_diff_filter": {
|
|
316
|
-
"valueType": "INTEGER",
|
|
317
|
-
"minimum": 10.0,
|
|
318
|
-
"maximum": 10.0
|
|
319
|
-
},
|
|
320
|
-
"gml:description": {
|
|
321
|
-
"valueType": "STRING"
|
|
322
|
-
},
|
|
323
|
-
"H_First_Min": {
|
|
324
|
-
"valueType": "DOUBLE",
|
|
325
|
-
"minimum": 36.8,
|
|
326
|
-
"maximum": 70.00429
|
|
327
|
-
},
|
|
328
|
-
"DatenquelleDachhoehe": {
|
|
329
|
-
"valueType": "STRING"
|
|
330
|
-
},
|
|
331
|
-
"OAR": {
|
|
332
|
-
"valueType": "STRING"
|
|
333
|
-
},
|
|
334
|
-
"Kachel": {
|
|
335
|
-
"valueType": "STRING"
|
|
336
|
-
},
|
|
337
|
-
"RBEZ": {
|
|
338
|
-
"valueType": "STRING"
|
|
339
|
-
},
|
|
340
|
-
"DatenquelleBodenhoehe": {
|
|
341
|
-
"valueType": "STRING"
|
|
342
|
-
},
|
|
343
|
-
"GMDE": {
|
|
344
|
-
"valueType": "STRING"
|
|
345
|
-
},
|
|
346
|
-
"LAND": {
|
|
347
|
-
"valueType": "STRING"
|
|
348
|
-
},
|
|
349
|
-
"matching_mode": {
|
|
350
|
-
"valueType": "INTEGER",
|
|
351
|
-
"minimum": 1.0,
|
|
352
|
-
"maximum": 1.0
|
|
353
|
-
},
|
|
354
|
-
"overlap_file_to_DB": {
|
|
355
|
-
"valueType": "INTEGER",
|
|
356
|
-
"minimum": 100.0,
|
|
357
|
-
"maximum": 100.0
|
|
358
|
-
},
|
|
359
|
-
"H_Trauf_Max": {
|
|
360
|
-
"valueType": "DOUBLE",
|
|
361
|
-
"minimum": 37.27528,
|
|
362
|
-
"maximum": 140.5875
|
|
363
|
-
},
|
|
364
|
-
"roofType": {
|
|
365
|
-
"valueType": "STRING"
|
|
366
|
-
},
|
|
367
|
-
"TerrainHeight": {
|
|
368
|
-
"valueType": "DOUBLE",
|
|
369
|
-
"minimum": 35.0,
|
|
370
|
-
"maximum": 35.0
|
|
371
|
-
},
|
|
372
|
-
"H_Trauf_Min": {
|
|
373
|
-
"valueType": "DOUBLE",
|
|
374
|
-
"minimum": 36.8,
|
|
375
|
-
"maximum": 70.00429
|
|
376
|
-
},
|
|
377
|
-
"EIG_KL_PV": {
|
|
378
|
-
"valueType": "INTEGER",
|
|
379
|
-
"minimum": -1.0,
|
|
380
|
-
"maximum": 3.0
|
|
381
|
-
},
|
|
382
|
-
"GE_LoD2_zOffset": {
|
|
383
|
-
"valueType": "STRING"
|
|
384
|
-
},
|
|
385
|
-
"HoeheGrund": {
|
|
386
|
-
"valueType": "STRING"
|
|
387
|
-
},
|
|
388
|
-
"gml:name": {
|
|
389
|
-
"valueType": "STRING"
|
|
390
|
-
},
|
|
391
|
-
"integrating_person": {
|
|
392
|
-
"valueType": "STRING"
|
|
393
|
-
},
|
|
394
|
-
"based_on_db_lod": {
|
|
395
|
-
"valueType": "INTEGER",
|
|
396
|
-
"minimum": 0.0,
|
|
397
|
-
"maximum": 0.0
|
|
398
|
-
},
|
|
399
|
-
"Address 2": {
|
|
400
|
-
"valueType": "SIMPLEADDRESS"
|
|
401
|
-
},
|
|
402
|
-
"Address 3": {
|
|
403
|
-
"valueType": "SIMPLEADDRESS"
|
|
404
|
-
},
|
|
405
|
-
"GE_LoD4_zOffset": {
|
|
406
|
-
"valueType": "STRING"
|
|
407
|
-
},
|
|
408
|
-
"Address 1": {
|
|
409
|
-
"valueType": "SIMPLEADDRESS"
|
|
410
|
-
},
|
|
411
|
-
"BezugspunktDachhoehe": {
|
|
412
|
-
"valueType": "STRING"
|
|
413
|
-
},
|
|
414
|
-
"integration_date": {
|
|
415
|
-
"valueType": "STRING"
|
|
416
|
-
},
|
|
417
|
-
"Address 4": {
|
|
418
|
-
"valueType": "SIMPLEADDRESS"
|
|
419
|
-
},
|
|
420
|
-
"Kennung": {
|
|
421
|
-
"valueType": "STRING"
|
|
422
|
-
},
|
|
423
|
-
"Address 5": {
|
|
424
|
-
"valueType": "SIMPLEADDRESS"
|
|
425
|
-
}
|
|
426
|
-
},
|
|
427
|
-
"extras": { "_3DTILESDIFFUSE" : true}
|
|
428
|
-
}
|