@vcmap/core 5.0.0-rc.27 → 5.0.0-rc.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/index.d.ts +273 -125
  2. package/index.js +6 -4
  3. package/package.json +1 -1
  4. package/src/category/category.js +16 -16
  5. package/src/category/categoryCollection.js +13 -13
  6. package/src/interaction/eventHandler.js +4 -4
  7. package/src/layer/featureVisibility.js +3 -4
  8. package/src/layer/globalHider.js +1 -1
  9. package/src/layer/layer.js +2 -1
  10. package/src/layer/vectorLayer.js +7 -0
  11. package/src/oblique/helpers.js +7 -9
  12. package/src/ol/feature.js +28 -0
  13. package/src/overrideClassRegistry.js +17 -17
  14. package/src/style/declarativeStyleItem.js +2 -3
  15. package/src/util/editor/editFeaturesSession.js +150 -166
  16. package/src/util/editor/editGeometrySession.js +69 -47
  17. package/src/util/editor/editorHelpers.js +3 -1
  18. package/src/util/editor/editorSessionHelpers.js +11 -3
  19. package/src/util/editor/editorSymbols.js +5 -0
  20. package/src/util/editor/interactions/editFeaturesMouseOverInteraction.js +15 -49
  21. package/src/util/editor/interactions/editGeometryMouseOverInteraction.js +16 -33
  22. package/src/util/editor/interactions/ensureHandlerSelectionInteraction.js +5 -5
  23. package/src/util/editor/interactions/selectFeatureMouseOverInteraction.js +143 -0
  24. package/src/util/editor/interactions/selectMultiFeatureInteraction.js +17 -11
  25. package/src/util/editor/interactions/selectSingleFeatureInteraction.js +27 -8
  26. package/src/util/editor/interactions/translateVertexInteraction.js +2 -3
  27. package/src/util/editor/selectFeaturesSession.js +287 -0
  28. package/src/util/editor/transformation/transformationHandler.js +4 -9
  29. package/src/util/editor/transformation/transformationTypes.js +1 -0
  30. package/src/util/featureconverter/convert.js +1 -1
  31. package/src/util/indexedCollection.js +19 -3
  32. package/src/util/layerCollection.js +4 -2
  33. package/src/util/overrideCollection.js +20 -20
  34. package/src/vcsApp.js +107 -85
  35. package/src/vcsModule.js +129 -0
  36. package/src/{vcsAppContextHelpers.js → vcsModuleHelpers.js} +5 -5
  37. package/src/context.js +0 -89
package/index.js CHANGED
@@ -10,7 +10,6 @@ import './src/cesium/entity.js';
10
10
  export { default as Category } from './src/category/category.js';
11
11
  export { default as CategoryCollection } from './src/category/categoryCollection.js';
12
12
  export { layerClassRegistry, tileProviderClassRegistry, featureProviderClassRegistry, mapClassRegistry, styleClassRegistry, categoryClassRegistry, getObjectFromClassRegistry, default as ClassRegistry } from './src/classRegistry.js';
13
- export { volatileContextId, markVolatile, default as Context } from './src/context.js';
14
13
  export { default as AbstractFeatureProvider } from './src/featureProvider/abstractFeatureProvider.js';
15
14
  export { isProvidedFeature, showProvidedFeature } from './src/featureProvider/featureProviderSymbols.js';
16
15
  export { default as TileProviderFeatureProvider } from './src/featureProvider/tileProviderFeatureProvider.js';
@@ -122,7 +121,7 @@ export { default as startEditFeaturesSession } from './src/util/editor/editFeatu
122
121
  export { default as startEditGeometrySession } from './src/util/editor/editGeometrySession.js';
123
122
  export { createVertex, getClosestPointOn2DLine, pointOnLine3D, pointOnLine2D, createCameraVerticalPlane, createHorizontalPlane, getCartographicFromPlane, drapeGeometryOnTerrain, placeGeometryOnTerrain, ensureFeatureAbsolute, clampFeature } from './src/util/editor/editorHelpers.js';
124
123
  export { SessionType, setupScratchLayer, GeometryType } from './src/util/editor/editorSessionHelpers.js';
125
- export { vertexSymbol, vertexIndex, handlerSymbol } from './src/util/editor/editorSymbols.js';
124
+ export { vertexSymbol, vertexIndex, handlerSymbol, mouseOverSymbol } from './src/util/editor/editorSymbols.js';
126
125
  export { default as CreateBBoxInteraction } from './src/util/editor/interactions/createBBoxInteraction.js';
127
126
  export { default as CreateCircleInteraction } from './src/util/editor/interactions/createCircleInteraction.js';
128
127
  export { default as CreateLineStringInteraction } from './src/util/editor/interactions/createLineStringInteraction.js';
@@ -134,9 +133,11 @@ export { default as EnsureHandlerSelectionInteraction } from './src/util/editor/
134
133
  export { default as InsertVertexInteraction } from './src/util/editor/interactions/insertVertexInteraction.js';
135
134
  export { default as MapInteractionController } from './src/util/editor/interactions/mapInteractionController.js';
136
135
  export { default as RemoveVertexInteraction } from './src/util/editor/interactions/removeVertexInteraction.js';
136
+ export { SelectionMode, default as SelectFeatureMouseOverInteraction } from './src/util/editor/interactions/selectFeatureMouseOverInteraction.js';
137
137
  export { default as SelectMultiFeatureInteraction } from './src/util/editor/interactions/selectMultiFeatureInteraction.js';
138
138
  export { default as SelectSingleFeatureInteraction } from './src/util/editor/interactions/selectSingleFeatureInteraction.js';
139
139
  export { default as TranslateVertexInteraction } from './src/util/editor/interactions/translateVertexInteraction.js';
140
+ export { getDefaultHighlightStyle, default as startSelectFeaturesSession } from './src/util/editor/selectFeaturesSession.js';
140
141
  export { default as create2DHandlers } from './src/util/editor/transformation/create2DHandlers.js';
141
142
  export { default as create3DHandlers } from './src/util/editor/transformation/create3DHandlers.js';
142
143
  export { default as ExtrudeInteraction } from './src/util/editor/transformation/extrudeInteraction.js';
@@ -169,7 +170,8 @@ export { isOverrideCollection, default as makeOverrideCollection } from './src/u
169
170
  export { wgs84ToMercatorTransformer, mercatorToWgs84Transformer, setDefaultProjectionOptions, getDefaultProjection, wgs84Projection, mercatorProjection, default as Projection } from './src/util/projection.js';
170
171
  export { isSameOrigin } from './src/util/urlHelpers.js';
171
172
  export { propertyEqualsEpsilon, angleEqualsEpsilon, coordinateEqualsEpsilon, default as Viewpoint } from './src/util/viewpoint.js';
172
- export { defaultDynamicContextId, getVcsAppById, default as VcsApp } from './src/vcsApp.js';
173
- export { contextIdSymbol, deserializeMap, deserializeViewpoint, deserializeLayer, serializeLayer, getLayerIndex, destroyCollection } from './src/vcsAppContextHelpers.js';
173
+ export { defaultDynamicModuleId, getVcsAppById, default as VcsApp } from './src/vcsApp.js';
174
174
  export { default as VcsEvent } from './src/vcsEvent.js';
175
+ export { volatileModuleId, markVolatile, default as VcsModule } from './src/vcsModule.js';
176
+ export { moduleIdSymbol, deserializeMap, deserializeViewpoint, deserializeLayer, serializeLayer, getLayerIndex, destroyCollection } from './src/vcsModuleHelpers.js';
175
177
  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.27",
3
+ "version": "5.0.0-rc.28",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,7 +1,7 @@
1
1
  import { check } from '@vcsuite/check';
2
2
  import { v4 as uuidv4 } from 'uuid';
3
3
  import { Feature } from 'ol';
4
- import { contextIdSymbol, destroyCollection } from '../vcsAppContextHelpers.js';
4
+ import { moduleIdSymbol, destroyCollection } from '../vcsModuleHelpers.js';
5
5
  import makeOverrideCollection, { isOverrideCollection } from '../util/overrideCollection.js';
6
6
  import VcsObject from '../vcsObject.js';
7
7
  import VectorLayer from '../layer/vectorLayer.js';
@@ -25,7 +25,7 @@ import VcsEvent from '../vcsEvent.js';
25
25
  /**
26
26
  * @type {*|string}
27
27
  */
28
- const categoryContextId = uuidv4();
28
+ const categoryModuleId = uuidv4();
29
29
 
30
30
  /**
31
31
  * @param {import("@vcmap/core").VectorLayer} layer
@@ -69,7 +69,7 @@ function checkMergeOptionOverride(key, value, defaultOption, option) {
69
69
  /**
70
70
  * A category contains user based items and is a special container. The container should not be created directly, but via
71
71
  * the requestCategory API on the categories collection. Do not use toJSON to retrieve the state of a category, since
72
- * categories outlive contexts and may be changed with mergeOptions to no longer reflect your initial state. Requestors
72
+ * categories outlive modules and may be changed with mergeOptions to no longer reflect your initial state. Requestors
73
73
  * should keep track of the requested options themselves.
74
74
  * @class
75
75
  * @extends {VcsObject}
@@ -128,7 +128,7 @@ class Category extends VcsObject {
128
128
  this._layer = null;
129
129
  if (this._featureProperty) {
130
130
  this._layer = new VectorLayer(this._layerOptions);
131
- this._layer[contextIdSymbol] = categoryContextId;
131
+ this._layer[moduleIdSymbol] = categoryModuleId;
132
132
  }
133
133
  /**
134
134
  * @type {string}
@@ -156,7 +156,7 @@ class Category extends VcsObject {
156
156
  * @type {function():void}
157
157
  * @private
158
158
  */
159
- this._contextRemovedListener = () => {};
159
+ this._moduleRemovedListener = () => {};
160
160
  }
161
161
 
162
162
  /**
@@ -246,11 +246,11 @@ class Category extends VcsObject {
246
246
  * @returns {string}
247
247
  * @private
248
248
  */
249
- _getDynamicContextId() {
249
+ _getDynamicModuleId() {
250
250
  if (!this._app) {
251
- throw new Error('Cannot get dynamic context id, before setting the vcApp');
251
+ throw new Error('Cannot get dynamic module id, before setting the vcApp');
252
252
  }
253
- return this._app.dynamicContextId;
253
+ return this._app.dynamicModuleId;
254
254
  }
255
255
 
256
256
  /**
@@ -305,7 +305,7 @@ class Category extends VcsObject {
305
305
  /** @type {OverrideCollection} */ (collection) :
306
306
  makeOverrideCollection(
307
307
  collection,
308
- this._getDynamicContextId.bind(this),
308
+ this._getDynamicModuleId.bind(this),
309
309
  this._serializeItem.bind(this),
310
310
  this._deserializeItem.bind(this),
311
311
  );
@@ -337,8 +337,8 @@ class Category extends VcsObject {
337
337
  throw new Error('Cannot switch apps');
338
338
  }
339
339
  this._app = app;
340
- this._contextRemovedListener = this._app.contextRemoved.addEventListener((context) => {
341
- this._collection.removeContext(context.id);
340
+ this._moduleRemovedListener = this._app.moduleRemoved.addEventListener((module) => {
341
+ this._collection.removeModule(module._id);
342
342
  });
343
343
  if (this._layer) {
344
344
  this._app.layers.add(this._layer);
@@ -378,17 +378,17 @@ class Category extends VcsObject {
378
378
  }
379
379
 
380
380
  /**
381
- * @param {string} contextId
381
+ * @param {string} moduleId
382
382
  * @returns {{ name: string, items: Array<Object>}|null}
383
383
  */
384
- serializeForContext(contextId) {
384
+ serializeModule(moduleId) {
385
385
  if (this._collection.size === 0) {
386
386
  return null;
387
387
  }
388
388
 
389
389
  return {
390
390
  name: this.name,
391
- items: this.collection.serializeContext(contextId),
391
+ items: this.collection.serializeModule(moduleId),
392
392
  };
393
393
  }
394
394
 
@@ -431,8 +431,8 @@ class Category extends VcsObject {
431
431
 
432
432
  this._collectionListeners.forEach((cb) => { cb(); });
433
433
  this._collectionListeners.splice(0);
434
- this._contextRemovedListener();
435
- this._contextRemovedListener = () => {};
434
+ this._moduleRemovedListener();
435
+ this._moduleRemovedListener = () => {};
436
436
  destroyCollection(this._collection);
437
437
  this._collectionChanged.destroy();
438
438
  this._app = null;
@@ -26,7 +26,7 @@ class CategoryCollection extends IndexedCollection {
26
26
  */
27
27
  this._app = app;
28
28
  /**
29
- * Map of category names, where the value is a map of contextId and items.
29
+ * Map of category names, where the value is a map of moduleId and items.
30
30
  * @type {Map<string, Map<string, Array<Object>>>}
31
31
  * @private
32
32
  */
@@ -35,10 +35,10 @@ class CategoryCollection extends IndexedCollection {
35
35
  * @type {Function}
36
36
  * @private
37
37
  */
38
- this._contextRemovedListener = this._app.contextRemoved.addEventListener((context) => {
39
- this._cache.forEach((contextMap, name) => {
40
- contextMap.delete(context.id);
41
- if (contextMap.size === 0) {
38
+ this._moduleRemovedListener = this._app.moduleRemoved.addEventListener((module) => {
39
+ this._cache.forEach((moduleMap, name) => {
40
+ moduleMap.delete(module._id);
41
+ if (moduleMap.size === 0) {
42
42
  this._cache.delete(name);
43
43
  }
44
44
  });
@@ -60,8 +60,8 @@ class CategoryCollection extends IndexedCollection {
60
60
  if (added != null && this._cache.has(category.name)) {
61
61
  this._cache
62
62
  .get(category.name)
63
- .forEach((items, contextId) => {
64
- this.parseCategoryItems(category.name, items, contextId);
63
+ .forEach((items, moduleId) => {
64
+ this.parseCategoryItems(category.name, items, moduleId);
65
65
  });
66
66
 
67
67
  this._cache.delete(category.name);
@@ -83,18 +83,18 @@ class CategoryCollection extends IndexedCollection {
83
83
  * they will be cached, until such a category is requested.
84
84
  * @param {string} name
85
85
  * @param {Array<Object>} items
86
- * @param {string} contextId
86
+ * @param {string} moduleId
87
87
  * @returns {Promise<void>}
88
88
  */
89
- async parseCategoryItems(name, items, contextId) {
89
+ async parseCategoryItems(name, items, moduleId) {
90
90
  const category = this.getByKey(name);
91
91
 
92
92
  if (category) {
93
- await category.collection.parseItems(items, contextId);
93
+ await category.collection.parseItems(items, moduleId);
94
94
  } else if (this._cache.has(name)) {
95
- this._cache.get(name).set(contextId, items);
95
+ this._cache.get(name).set(moduleId, items);
96
96
  } else {
97
- this._cache.set(name, new Map([[contextId, items]]));
97
+ this._cache.set(name, new Map([[moduleId, items]]));
98
98
  }
99
99
  }
100
100
 
@@ -135,7 +135,7 @@ class CategoryCollection extends IndexedCollection {
135
135
 
136
136
  destroy() {
137
137
  super.destroy();
138
- this._contextRemovedListener();
138
+ this._moduleRemovedListener();
139
139
  this._cache.clear();
140
140
  this._app = null;
141
141
  }
@@ -215,18 +215,18 @@ class EventHandler {
215
215
  * Add a dynamic interaction to the interaction chain. This is the default methodology for
216
216
  * user map interactions, such as drawing or measuring. If another exclusive interaction is added,
217
217
  * this interaction is removed and a provided callback is called. Use the id parameter to add multiple interactions
218
- * from the same source (if you don't wish to provide an {@link InteractionChain}
218
+ * from the same source (if you don't wish to provide an {@link InteractionChain})
219
219
  * @param {AbstractInteraction} interaction
220
220
  * @param {Function} removed - the callback for when the interaction is forcefully removed.
221
- * @param {number=} [index=3] - the position at which to push the interaction
221
+ * @param {number=} index - the position at which to push the interaction. If no index is provided, the interaction is pushed at the end and therefore is executed last.
222
222
  * @param {string=} id - an id to allow for multiple interactions to belong to the same exclusive registerer
223
223
  * @returns {Function} function to remove the interaction with. returns number of removed interactions (0|1)
224
224
  * @api
225
225
  */
226
- addExclusiveInteraction(interaction, removed, index = 3, id) {
226
+ addExclusiveInteraction(interaction, removed, index, id) {
227
227
  check(interaction, AbstractInteraction);
228
228
  check(removed, Function);
229
- check(index, Number);
229
+ checkMaybe(index, Number);
230
230
  checkMaybe(id, String);
231
231
 
232
232
  if (this._exclusiveInteraction && this._exclusiveInteraction.id !== id) {
@@ -3,7 +3,6 @@ import Feature from 'ol/Feature.js';
3
3
  import Style from 'ol/style/Style.js';
4
4
 
5
5
  import VectorStyleItem, { fromCesiumColor } from '../style/vectorStyleItem.js';
6
- import { emptyStyle } from '../style/styleHelpers.js';
7
6
  import VcsEvent from '../vcsEvent.js';
8
7
 
9
8
  /**
@@ -71,7 +70,7 @@ export function hideFeature(feature) {
71
70
  ) {
72
71
  feature.show = false;
73
72
  } else if (feature instanceof Feature) {
74
- feature.setStyle(emptyStyle.clone());
73
+ feature.changed();
75
74
  }
76
75
  }
77
76
 
@@ -106,7 +105,7 @@ export function resetOriginalStyle(feature) {
106
105
  ) {
107
106
  feature.color = style;
108
107
  } else if (feature instanceof Feature) {
109
- feature.setStyle(style);
108
+ feature.changed();
110
109
  }
111
110
  delete feature[originalStyle];
112
111
  }
@@ -125,7 +124,7 @@ export function highlightFeature(feature) {
125
124
  ) {
126
125
  feature.color = style.cesiumFillColor;
127
126
  } else if (feature instanceof Feature) {
128
- feature.setStyle(/** @type {import("ol/style/Style").default} */ (style.style));
127
+ feature.changed();
129
128
  }
130
129
  }
131
130
  }
@@ -17,7 +17,7 @@ import VcsEvent from '../vcsEvent.js';
17
17
  * GlobalHider globally hides features existing within a layer of a {@link LayerCollection}.
18
18
  * Features can be defined as hidden by {@link VcsAppConfig} or {@link LayerOptions}.
19
19
  * Hiding will be performed, when a {@link Context} is loaded, a {@link Layer} is activated or GlobalHider API is called.
20
- * A feature can be hidden multiple times by different actors, e.g. contexts, layers, which is handled by this class.
20
+ * A feature can be hidden multiple times by different actors, e.g. modules, layers, which is handled by this class.
21
21
  * A feature will be shown again, when a {@link Context} is removed, a {@link Layer} is deactivated or GlobalHider API is called.
22
22
  * @class
23
23
  */
@@ -31,6 +31,7 @@ import GlobalHider from './globalHider.js';
31
31
  * @property {number|undefined} screenSpaceError
32
32
  * @property {*|undefined} flightOptions
33
33
  * @property {string|undefined} baseUrl
34
+ * @property {Object|undefined} [layerProperties] - the layers properties bag
34
35
  * @api
35
36
  */
36
37
 
@@ -86,7 +87,7 @@ import GlobalHider from './globalHider.js';
86
87
  * @type {string}
87
88
  * @const
88
89
  */
89
- export const vcsMetaVersion = '2.0';
90
+ export const vcsMetaVersion = '2.1';
90
91
 
91
92
  /**
92
93
  * Abstract base class for Layers.
@@ -288,6 +288,10 @@ class VectorLayer extends FeatureLayer {
288
288
  // TODO embed icons here by running over all features? this is never used anywhere
289
289
  }
290
290
 
291
+ if (Object.keys(this.properties).length !== 0) {
292
+ vcsMeta.layerProperties = { ...this.properties };
293
+ }
294
+
291
295
  return vcsMeta;
292
296
  }
293
297
 
@@ -297,6 +301,9 @@ class VectorLayer extends FeatureLayer {
297
301
  */
298
302
  setVcsMeta(vcsMeta) { // XXX what about the style?
299
303
  this.vectorProperties.setVcsMeta(vcsMeta);
304
+ if (vcsMeta.layerProperties) {
305
+ Object.assign(this.properties, vcsMeta.layerProperties);
306
+ }
300
307
  }
301
308
 
302
309
  /**
@@ -437,16 +437,14 @@ export async function transformFromImage(image, imageCoordinate, options = {}) {
437
437
  * @returns {boolean}
438
438
  */
439
439
  export function hasSameOrigin(url) {
440
- // relative Url, return true;
441
- if (!/^[a-z][a-z0-9+.-]*:/.test(url)) {
442
- return true;
443
- }
444
- // data uri, return true
445
- if (/^data:/.test(url)) {
440
+ const windowUrl = new URL(window.location.href);
441
+ const parsedUrl = new URL(url, window.location.href);
442
+
443
+ if (parsedUrl.protocol === 'data:') {
446
444
  return true;
447
445
  }
448
446
 
449
- const currentUri = new URL(window.location.href);
450
- const uri = new URL(url);
451
- return currentUri.host.toLowerCase() === uri.host.toLocaleLowerCase();
447
+ return windowUrl.origin === parsedUrl.origin &&
448
+ windowUrl.port === parsedUrl.port &&
449
+ windowUrl.protocol === parsedUrl.protocol;
452
450
  }
package/src/ol/feature.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import Feature from 'ol/Feature.js';
2
+ import { Style } from 'ol/style.js';
3
+ import { globalHidden, hidden, highlighted } from '../layer/featureVisibility.js';
2
4
 
3
5
  /**
4
6
  * To be used for cesium 3D style functions
@@ -43,5 +45,31 @@ Feature.prototype.getPropertyInherited = function getPropertyInherited(property)
43
45
  return this.getProperty(property);
44
46
  };
45
47
 
48
+ const originalStyleFunction = Feature.prototype.getStyleFunction;
49
+ Feature.prototype.getStyleFunction = function getStyleFunction() {
50
+ if (this[hidden] || this[globalHidden]) {
51
+ return () => [];
52
+ }
53
+
54
+ if (this[highlighted]) {
55
+ return () => [this[highlighted].style];
56
+ }
57
+ return originalStyleFunction.bind(this)();
58
+ };
59
+
60
+ const originalGetStyle = Feature.prototype.getStyle;
61
+ Feature.prototype.getStyle = function getStyle() {
62
+ if (this[hidden] || this[globalHidden]) {
63
+ return new Style({});
64
+ }
65
+
66
+ if (this[highlighted]) {
67
+ return this[highlighted].style;
68
+ }
69
+
70
+ return originalGetStyle.bind(this)();
71
+ };
72
+
46
73
  // TODO implement getExactClassName, isClass & isExactClass
47
74
  // TODO implement feature.content.tileset.timeSinceLoad
75
+
@@ -20,12 +20,12 @@ class OverrideClassRegistry {
20
20
  constructor(coreClassRegistry) {
21
21
  this._coreClassRegistry = coreClassRegistry;
22
22
  /**
23
- * @type {Map<string, { contextId: string, ctor: function(new: T, ...*) }>}
23
+ * @type {Map<string, { moduleId: string, ctor: function(new: T, ...*) }>}
24
24
  * @private
25
25
  */
26
26
  this._classMap = new Map();
27
27
  /**
28
- * @type {Map<string, Array<{ contextId: string, ctor: function(new: T, ...*) }>>}
28
+ * @type {Map<string, Array<{ moduleId: string, ctor: function(new: T, ...*) }>>}
29
29
  * @private
30
30
  */
31
31
  this._classShadows = new Map();
@@ -49,18 +49,18 @@ class OverrideClassRegistry {
49
49
  }
50
50
 
51
51
  /**
52
- * Register a class for a given context by name. If the class already exists, it will be replaced and replaced called with the classeName.
53
- * @param {string} contextId
52
+ * Register a class for a given module by name. If the class already exists, it will be replaced and replaced called with the classeName.
53
+ * @param {string} moduleId
54
54
  * @param {string} className
55
55
  * @param {function(new: T, ...*)} ctor
56
56
  */
57
- registerClass(contextId, className, ctor) {
58
- check(contextId, String);
57
+ registerClass(moduleId, className, ctor) {
58
+ check(moduleId, String);
59
59
  check(className, String);
60
60
  check(ctor, Function);
61
61
 
62
62
  const entry = {
63
- contextId,
63
+ moduleId,
64
64
  ctor,
65
65
  };
66
66
 
@@ -83,16 +83,16 @@ class OverrideClassRegistry {
83
83
  * Unregister a previously registered class. You can only unregister classes added to this registry, not the underlying core registry.
84
84
  * If when registering this class you have replaced class, it will be re-instated and replaced called.
85
85
  * If there is no previously registered class, it will be removed and removed will be called.
86
- * @param {string} contextId
86
+ * @param {string} moduleId
87
87
  * @param {string} className
88
88
  */
89
- unregisterClass(contextId, className) {
90
- check(contextId, String);
89
+ unregisterClass(moduleId, className) {
90
+ check(moduleId, String);
91
91
  check(className, String);
92
92
 
93
93
  if (this._classShadows.has(className)) {
94
94
  const shadowsArray = this._classShadows.get(className);
95
- const newShadowsArray = shadowsArray.filter(e => e.contextId !== contextId);
95
+ const newShadowsArray = shadowsArray.filter(e => e.moduleId !== moduleId);
96
96
  if (newShadowsArray.length === 0) {
97
97
  this._classShadows.delete(className);
98
98
  } else if (newShadowsArray.length !== shadowsArray.length) {
@@ -102,7 +102,7 @@ class OverrideClassRegistry {
102
102
 
103
103
  if (
104
104
  this._classMap.has(className) &&
105
- this._classMap.get(className).contextId === contextId
105
+ this._classMap.get(className).moduleId === moduleId
106
106
  ) {
107
107
  this._classMap.delete(className);
108
108
  if (this._classShadows.has(className)) {
@@ -177,15 +177,15 @@ class OverrideClassRegistry {
177
177
  }
178
178
 
179
179
  /**
180
- * Removes all classes registered from within a certain context. Will re-instate classes overwritten by the context
180
+ * Removes all classes registered from within a certain module. Will re-instate classes overwritten by the module
181
181
  * and call the appropriate events, outlined in unregisterClass.
182
- * @param {string} contextId
182
+ * @param {string} moduleId
183
183
  */
184
- removeContext(contextId) {
185
- check(contextId, String);
184
+ removeModule(moduleId) {
185
+ check(moduleId, String);
186
186
 
187
187
  this._classMap.forEach((cb, className) => {
188
- this.unregisterClass(contextId, className);
188
+ this.unregisterClass(moduleId, className);
189
189
  });
190
190
  }
191
191
 
@@ -11,7 +11,6 @@ import Fill from 'ol/style/Fill.js';
11
11
  import StyleItem from './styleItem.js';
12
12
  import {
13
13
  cesiumColorToColor,
14
- emptyStyle,
15
14
  getDefaultCondition,
16
15
  whiteColor,
17
16
  } from './styleHelpers.js';
@@ -191,7 +190,7 @@ class DeclarativeStyleItem extends StyleItem {
191
190
  _styleFunction(feature) {
192
191
  const actualFeature = feature[originalFeatureSymbol] || feature;
193
192
  if (!this.cesiumStyle.show.evaluate(actualFeature)) {
194
- return emptyStyle;
193
+ return undefined;
195
194
  }
196
195
 
197
196
  const geometryType = actualFeature.getGeometry().getType();
@@ -219,7 +218,7 @@ class DeclarativeStyleItem extends StyleItem {
219
218
  }
220
219
 
221
220
  this.getLogger().warning(`could not style geometry type: ${geometryType}`);
222
- return emptyStyle;
221
+ return undefined;
223
222
  }
224
223
 
225
224
  /**