@vcmap/core 5.0.0-rc.21 → 5.0.0-rc.23

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 (35) hide show
  1. package/index.d.ts +263 -24
  2. package/index.js +13 -4
  3. package/package.json +2 -2
  4. package/src/category/appBackedCategory.js +3 -3
  5. package/src/context.js +2 -2
  6. package/src/featureProvider/wmsFeatureProvider.js +1 -1
  7. package/src/layer/cesium/dataSourceCesiumImpl.js +1 -1
  8. package/src/layer/cesium/x3dmHelper.js +1 -1
  9. package/src/layer/cesiumTilesetLayer.js +0 -5
  10. package/src/layer/wmsHelpers.js +2 -0
  11. package/src/map/baseOLMap.js +12 -6
  12. package/src/map/cesiumMap.js +32 -44
  13. package/src/map/obliqueMap.js +19 -19
  14. package/src/map/openlayersMap.js +15 -14
  15. package/src/map/vcsMap.js +31 -9
  16. package/src/oblique/obliqueProvider.js +2 -2
  17. package/src/style/declarativeStyleItem.js +2 -8
  18. package/src/util/editor/editGeometrySession.js +401 -0
  19. package/src/util/editor/editorHelpers.js +109 -0
  20. package/src/util/editor/editorSessionHelpers.js +1 -2
  21. package/src/util/editor/editorSymbols.js +10 -0
  22. package/src/util/editor/interactions/editGeometryMouseOverInteraction.js +133 -0
  23. package/src/util/editor/interactions/insertVertexInteraction.js +92 -0
  24. package/src/util/editor/interactions/mapInteractionController.js +99 -0
  25. package/src/util/editor/interactions/removeVertexInteraction.js +39 -0
  26. package/src/util/editor/interactions/selectSingleFeatureInteraction.js +95 -0
  27. package/src/util/editor/interactions/translateVertexInteraction.js +61 -0
  28. package/src/util/mapCollection.js +39 -14
  29. package/src/util/math.js +9 -0
  30. package/src/util/splitScreen.js +1 -1
  31. package/src/util/viewpoint.js +16 -16
  32. package/src/vcsApp.js +15 -15
  33. package/src/vcsAppContextHelpers.js +6 -6
  34. package/tests/unit/helpers/cesiumHelpers.js +6 -5
  35. package/tests/unit/helpers/obliqueHelpers.js +5 -5
package/src/vcsApp.js CHANGED
@@ -5,7 +5,7 @@ import Context from './context.js';
5
5
  import {
6
6
  contextIdSymbol,
7
7
  destroyCollection,
8
- deserializeViewPoint,
8
+ deserializeViewpoint,
9
9
  deserializeMap,
10
10
  getLayerIndex,
11
11
  serializeLayer,
@@ -18,7 +18,7 @@ import VcsMap from './map/vcsMap.js';
18
18
  import Layer from './layer/layer.js';
19
19
  import Collection from './util/collection.js';
20
20
  import ObliqueCollection from './oblique/obliqueCollection.js';
21
- import ViewPoint from './util/viewpoint.js';
21
+ import Viewpoint from './util/viewpoint.js';
22
22
  import StyleItem from './style/styleItem.js';
23
23
  import IndexedCollection from './util/indexedCollection.js';
24
24
  import VcsEvent from './vcsEvent.js';
@@ -144,15 +144,15 @@ class VcsApp {
144
144
  ObliqueCollection,
145
145
  );
146
146
  /**
147
- * @type {OverrideCollection<import("@vcmap/core").ViewPoint>}
147
+ * @type {OverrideCollection<import("@vcmap/core").Viewpoint>}
148
148
  * @private
149
149
  */
150
- this._viewPoints = makeOverrideCollection(
150
+ this._viewpoints = makeOverrideCollection(
151
151
  new Collection(),
152
152
  getDynamicContextId,
153
153
  null,
154
- deserializeViewPoint,
155
- ViewPoint,
154
+ deserializeViewpoint,
155
+ Viewpoint,
156
156
  );
157
157
  /**
158
158
  * @type {OverrideClassRegistry<StyleItem>}
@@ -275,10 +275,10 @@ class VcsApp {
275
275
  get obliqueCollections() { return this._obliqueCollections; }
276
276
 
277
277
  /**
278
- * @type {OverrideCollection<import("@vcmap/core").ViewPoint>}
278
+ * @type {OverrideCollection<import("@vcmap/core").Viewpoint>}
279
279
  * @readonly
280
280
  */
281
- get viewPoints() { return this._viewPoints; }
281
+ get viewpoints() { return this._viewpoints; }
282
282
 
283
283
  /**
284
284
  * @type {OverrideCollection<import("@vcmap/core").StyleItem>}
@@ -396,7 +396,7 @@ class VcsApp {
396
396
  // TODO add flights & ade here
397
397
 
398
398
  await this._obliqueCollections.parseItems(config.obliqueCollections, context.id);
399
- await this._viewPoints.parseItems(config.viewpoints, context.id);
399
+ await this._viewpoints.parseItems(config.viewpoints, context.id);
400
400
  await this._maps.parseItems(config.maps, context.id);
401
401
 
402
402
  if (Array.isArray(config.categories)) {
@@ -442,10 +442,10 @@ class VcsApp {
442
442
  await this._maps.setActiveMap([...this._maps][0].name);
443
443
  }
444
444
 
445
- if (config.startingViewPointName && this._maps.activeMap) {
446
- const startViewPoint = this._viewPoints.getByKey(config.startingViewPointName);
447
- if (startViewPoint) {
448
- await this._maps.activeMap.gotoViewPoint(startViewPoint);
445
+ if (config.startingViewpointName && this._maps.activeMap) {
446
+ const startViewpoint = this._viewpoints.getByKey(config.startingViewpointName);
447
+ if (startViewpoint) {
448
+ await this._maps.activeMap.gotoViewpoint(startViewpoint);
449
449
  }
450
450
  }
451
451
  }
@@ -501,7 +501,7 @@ class VcsApp {
501
501
  await Promise.all([
502
502
  this._maps.removeContext(contextId),
503
503
  this._layers.removeContext(contextId),
504
- this._viewPoints.removeContext(contextId),
504
+ this._viewpoints.removeContext(contextId),
505
505
  this._styles.removeContext(contextId),
506
506
  this._obliqueCollections.removeContext(contextId),
507
507
  ]);
@@ -539,7 +539,7 @@ class VcsApp {
539
539
  destroyCollection(this._maps);
540
540
  destroyCollection(this._layers);
541
541
  destroyCollection(this._obliqueCollections);
542
- destroyCollection(this._viewPoints);
542
+ destroyCollection(this._viewpoints);
543
543
  destroyCollection(this._styles);
544
544
  destroyCollection(this._contexts);
545
545
  destroyCollection(this._categories);
@@ -1,5 +1,5 @@
1
1
  import { getLogger as getLoggerByName } from '@vcsuite/logger';
2
- import ViewPoint from './util/viewpoint.js';
2
+ import Viewpoint from './util/viewpoint.js';
3
3
  import { getObjectFromClassRegistry } from './classRegistry.js';
4
4
 
5
5
  /**
@@ -35,15 +35,15 @@ export function deserializeMap(vcsApp, mapConfig) {
35
35
  }
36
36
 
37
37
  /**
38
- * @param {ViewPointOptions} viewPointObject
39
- * @returns {null|import("@vcmap/core").ViewPoint}
38
+ * @param {ViewpointOptions} viewpointObject
39
+ * @returns {null|import("@vcmap/core").Viewpoint}
40
40
  */
41
- export function deserializeViewPoint(viewPointObject) {
42
- const viewpoint = new ViewPoint(viewPointObject);
41
+ export function deserializeViewpoint(viewpointObject) {
42
+ const viewpoint = new Viewpoint(viewpointObject);
43
43
  if (viewpoint && viewpoint.isValid()) {
44
44
  return viewpoint;
45
45
  }
46
- getLogger().warning(`Viewpoint ${viewPointObject.name} is not valid`);
46
+ getLogger().warning(`Viewpoint ${viewpointObject.name} is not valid`);
47
47
  return null;
48
48
  }
49
49
 
@@ -13,10 +13,9 @@ import {
13
13
  ScreenSpaceEventHandler,
14
14
  Color,
15
15
  Cesium3DTileFeature,
16
+ TweenCollection,
17
+ ContextLimits,
16
18
  } from '@vcmap/cesium';
17
- import TweenCollection from '@vcmap/cesium/Source/Scene/TweenCollection.js';
18
- import ContextLimits from '@vcmap/cesium/Source/Renderer/ContextLimits.js';
19
-
20
19
  import CesiumTilesetLayer from '../../../src/layer/cesiumTilesetLayer.js';
21
20
  import DataSourceLayer from '../../../src/layer/dataSourceLayer.js';
22
21
  import CesiumMap from '../../../src/map/cesiumMap.js';
@@ -158,7 +157,9 @@ export function getMockScene() {
158
157
  depthTexture: true,
159
158
  stencilBuffer: true,
160
159
  },
161
- render() {},
160
+ render(time) {
161
+ this.postRender.raiseEvent(this, time);
162
+ },
162
163
  pick() {},
163
164
  pickPosition() {},
164
165
  destroy() {
@@ -259,7 +260,7 @@ class BatchTable {
259
260
  this.destroyed = false;
260
261
  }
261
262
 
262
- getPropertyNames() { return Object.keys(this.properties); }
263
+ getPropertyIds() { return Object.keys(this.properties); }
263
264
 
264
265
  getProperty(id, prop) { return this.properties[prop]; }
265
266
 
@@ -1,6 +1,6 @@
1
1
  import Projection from '../../../src/util/projection.js';
2
2
  import ObliqueMap from '../../../src/map/obliqueMap.js';
3
- import ViewPoint from '../../../src/util/viewpoint.js';
3
+ import Viewpoint from '../../../src/util/viewpoint.js';
4
4
 
5
5
  import { getTerrainProvider } from './terrain/terrainData.js';
6
6
  import ObliqueCollection from '../../../src/oblique/obliqueCollection.js';
@@ -24,10 +24,10 @@ export const mercatorCoordinates = [1488644.796500772, 6892246.018669462, 0];
24
24
  let obliqueProjection = null;
25
25
 
26
26
  /**
27
- * @returns {ViewPoint}
27
+ * @returns {Viewpoint}
28
28
  */
29
29
  function getStartingViewpoint() {
30
- return new ViewPoint({
30
+ return new Viewpoint({
31
31
  name: '5b609a0d-28a1-4f4e-ba6c-29f2592fa889',
32
32
  distance: 264.6285087486175,
33
33
  cameraPosition: null,
@@ -97,7 +97,7 @@ export async function getObliqueMap(mapOptions = {}, scope) {
97
97
  /**
98
98
  * @param {VcsApp} app
99
99
  * @param {Scope=} scope optional server, if provided the map will be initialized with a terrainProvider
100
- * @param {ViewPoint=} startingVP
100
+ * @param {Viewpoint=} startingVP
101
101
  * @returns {Promise<ObliqueMap>}
102
102
  */
103
103
  export async function setObliqueMap(app, scope, startingVP) {
@@ -107,6 +107,6 @@ export async function setObliqueMap(app, scope, startingVP) {
107
107
  );
108
108
  app.maps.add(map);
109
109
  await app.maps.setActiveMap(map.name);
110
- await map.gotoViewPoint(startingVP || getStartingViewpoint());
110
+ await map.gotoViewpoint(startingVP || getStartingViewpoint());
111
111
  return map;
112
112
  }