@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/index.d.ts CHANGED
@@ -155,8 +155,8 @@ export interface VcsAppConfig {
155
155
  layers?: LayerOptions[];
156
156
  maps?: VcsMapOptions[];
157
157
  styles?: StyleItemOptions[];
158
- viewpoints?: ViewPointOptions[];
159
- startingViewPointName?: string;
158
+ viewpoints?: ViewpointOptions[];
159
+ startingViewpointName?: string;
160
160
  startingMapName?: string;
161
161
  projection?: ProjectionOptions;
162
162
  categories?: { name: string; items: object[]; }[];
@@ -5002,6 +5002,10 @@ export class BaseOLMap extends VcsMap {
5002
5002
  * When setting the layer colleciton, the destroyLayerCollection flag is automatically set to false.
5003
5003
  */
5004
5004
  layerCollection: LayerCollection;
5005
+ /**
5006
+ * An event raised on the maps post render
5007
+ */
5008
+ readonly postRender: VcsEvent<VcsMapRenderEvent>;
5005
5009
  /**
5006
5010
  * unique Name
5007
5011
  */
@@ -5088,6 +5092,11 @@ export interface CesiumMapOptions extends VcsMapOptions {
5088
5092
  globeColor?: string | undefined;
5089
5093
  }
5090
5094
 
5095
+ export interface CesiumMapEvent {
5096
+ scene: import("@vcmap/cesium").Scene;
5097
+ time: import("@vcmap/cesium").JulianDate;
5098
+ }
5099
+
5091
5100
  /**
5092
5101
  * Cesium Globe Map Class (3D map)
5093
5102
  */
@@ -5248,6 +5257,10 @@ export class CesiumMap extends VcsMap {
5248
5257
  * When setting the layer colleciton, the destroyLayerCollection flag is automatically set to false.
5249
5258
  */
5250
5259
  layerCollection: LayerCollection;
5260
+ /**
5261
+ * An event raised on the maps post render
5262
+ */
5263
+ readonly postRender: VcsEvent<VcsMapRenderEvent>;
5251
5264
  /**
5252
5265
  * unique Name
5253
5266
  */
@@ -5280,7 +5293,7 @@ export interface ObliqueOptions extends VcsMapOptions {
5280
5293
  /**
5281
5294
  * returns the direction which matches the heading of the viewpoint
5282
5295
  */
5283
- export function getViewDirectionFromViewPoint(viewpoint: ViewPoint): ObliqueViewDirection;
5296
+ export function getViewDirectionFromViewpoint(viewpoint: Viewpoint): ObliqueViewDirection;
5284
5297
 
5285
5298
  /**
5286
5299
  * ObliqueMap Map Class (2D map with oblique imagery)
@@ -5302,7 +5315,7 @@ export class ObliqueMap extends BaseOLMap {
5302
5315
  /**
5303
5316
  * Sets a new oblique collection
5304
5317
  */
5305
- setCollection(obliqueCollection: ObliqueCollection, viewpoint?: ViewPoint): Promise<void>;
5318
+ setCollection(obliqueCollection: ObliqueCollection, viewpoint?: Viewpoint): Promise<void>;
5306
5319
  /**
5307
5320
  * Sets an image by its name on the map
5308
5321
  */
@@ -5354,6 +5367,10 @@ export class ObliqueMap extends BaseOLMap {
5354
5367
  * When setting the layer colleciton, the destroyLayerCollection flag is automatically set to false.
5355
5368
  */
5356
5369
  layerCollection: LayerCollection;
5370
+ /**
5371
+ * An event raised on the maps post render
5372
+ */
5373
+ readonly postRender: VcsEvent<VcsMapRenderEvent>;
5357
5374
  /**
5358
5375
  * unique Name
5359
5376
  */
@@ -5426,6 +5443,10 @@ export class OpenlayersMap extends BaseOLMap {
5426
5443
  * When setting the layer colleciton, the destroyLayerCollection flag is automatically set to false.
5427
5444
  */
5428
5445
  layerCollection: LayerCollection;
5446
+ /**
5447
+ * An event raised on the maps post render
5448
+ */
5449
+ readonly postRender: VcsEvent<VcsMapRenderEvent>;
5429
5450
  /**
5430
5451
  * unique Name
5431
5452
  */
@@ -5460,6 +5481,11 @@ export interface ClickPosition {
5460
5481
  exactPosition?: boolean | undefined;
5461
5482
  }
5462
5483
 
5484
+ export interface VcsMapRenderEvent {
5485
+ map: VcsMap;
5486
+ originalEvent: import("ol").MapEvent | CesiumMapEvent;
5487
+ }
5488
+
5463
5489
  /**
5464
5490
  * Map Base Class, each different map is derived from this abstract base class.
5465
5491
  */
@@ -5507,10 +5533,14 @@ export class VcsMap extends VcsObject {
5507
5533
  */
5508
5534
  readonly target: HTMLElement | null;
5509
5535
  layerCollection: any;
5536
+ /**
5537
+ * An event raised on the maps post render
5538
+ */
5539
+ readonly postRender: VcsEvent<VcsMapRenderEvent>;
5510
5540
  /**
5511
5541
  * Determines whether this map can show this viewpoint. Returns true in any other map then {@link Oblique}
5512
5542
  */
5513
- canShowViewpoint(viewpoint: ViewPoint): Promise<boolean>;
5543
+ canShowViewpoint(viewpoint: Viewpoint): Promise<boolean>;
5514
5544
  /**
5515
5545
  * Sets the map target.
5516
5546
  */
@@ -5551,23 +5581,23 @@ export class VcsMap extends VcsObject {
5551
5581
  */
5552
5582
  deactivate(): void;
5553
5583
  /**
5554
- * prevent all movement, including navigation controls, gotoViewPoint & setting of oblique images
5584
+ * prevent all movement, including navigation controls, gotoViewpoint & setting of oblique images
5555
5585
  */
5556
5586
  disableMovement(prevent: boolean): void;
5557
5587
  /**
5558
5588
  * sets the view to the given viewpoint
5559
5589
  * @param [optMaximumHeight] - during animation (can be used to get rid of the bunny hop)
5560
- * gotoViewPoint
5590
+ * gotoViewpoint
5561
5591
  */
5562
- gotoViewPoint(viewpoint: ViewPoint, optMaximumHeight?: number): Promise<void>;
5592
+ gotoViewpoint(viewpoint: Viewpoint, optMaximumHeight?: number): Promise<void>;
5563
5593
  /**
5564
5594
  * Returns the most precise viewpoint possible in ObliqueMap.
5565
5595
  */
5566
- getViewPoint(): Promise<ViewPoint | null>;
5596
+ getViewpoint(): Promise<Viewpoint | null>;
5567
5597
  /**
5568
5598
  * Returns an approximate viewpoint in ObliqueMap, not requesting terrain.
5569
5599
  */
5570
- getViewPointSync(): ViewPoint | null;
5600
+ getViewpointSync(): Viewpoint | null;
5571
5601
  /**
5572
5602
  * Resolution in meters per pixe
5573
5603
  * @param coordinate - coordinate in mercator for which to determine resolution. only required in 3D
@@ -6064,7 +6094,7 @@ export class ObliqueImageMeta {
6064
6094
 
6065
6095
  /**
6066
6096
  */
6067
- export interface ObliqueViewPoint {
6097
+ export interface ObliqueViewpoint {
6068
6098
  /**
6069
6099
  * in mercator
6070
6100
  */
@@ -6125,7 +6155,7 @@ export class ObliqueProvider {
6125
6155
  /**
6126
6156
  * Returns a viewpoint for the currently set view.
6127
6157
  */
6128
- getView(): Promise<ObliqueViewPoint>;
6158
+ getView(): Promise<ObliqueViewpoint>;
6129
6159
  /**
6130
6160
  * Destroys all openlayers resources created by this oblique provider
6131
6161
  */
@@ -6876,6 +6906,35 @@ export interface CreateFeatureSession extends EditorSession {
6876
6906
  finish: (...params: any[]) => any;
6877
6907
  }
6878
6908
 
6909
+ /**
6910
+ */
6911
+ export interface EditGeometrySession extends EditorSession {
6912
+ /**
6913
+ * the feature selection for this session.
6914
+ */
6915
+ featureSelection: SelectSingleFeatureInteraction;
6916
+ }
6917
+
6918
+ export function createVertex(coordinate: import("ol/coordinate").Coordinate): Vertex;
6919
+
6920
+ /**
6921
+ * @param start - line segment start
6922
+ * @param end - line segment end
6923
+ * @param point - the point to project
6924
+ */
6925
+ export function pointOnLine3D(start: import("ol/coordinate").Coordinate, end: import("ol/coordinate").Coordinate, point: import("ol/coordinate").Coordinate, epsilon?: number): boolean;
6926
+
6927
+ /**
6928
+ * @param start - line segment start
6929
+ * @param end - line segment end
6930
+ * @param point - the point to project
6931
+ */
6932
+ export function pointOnLine2D(start: import("ol/coordinate").Coordinate, end: import("ol/coordinate").Coordinate, point: import("ol/coordinate").Coordinate, epsilon?: number): boolean;
6933
+
6934
+ export function createVerticalPlane(originCoordinates: import("ol/coordinate").Coordinate, scene: import("@vcmap/cesium").Scene): import("@vcmap/cesium").Plane;
6935
+
6936
+ export function createHorizontalPlane(originCoordinates: import("ol/coordinate").Coordinate, scene: import("@vcmap/cesium").Scene): import("@vcmap/cesium").Plane;
6937
+
6879
6938
  /**
6880
6939
  * An editor session is a currently set of interactions to create or edit geometries & features.
6881
6940
  * All editor sessions can be stopped and will be stopped, if their interactions get removed from the
@@ -6902,10 +6961,19 @@ export const enum GeometryType {
6902
6961
  Circle,
6903
6962
  LineString,
6904
6963
  Polygon,
6905
- BBox,
6906
- Rectangle
6964
+ BBox
6907
6965
  }
6908
6966
 
6967
+ /**
6968
+ * Symbol to identify a {@see Vertex}
6969
+ */
6970
+ export const vertexSymbol: symbol;
6971
+
6972
+ /**
6973
+ * Symbol to denote the vertexes index in the vertices array. This is important for snapping & bbox operations
6974
+ */
6975
+ export const vertexIndex: symbol;
6976
+
6909
6977
 
6910
6978
 
6911
6979
  /**
@@ -7047,6 +7115,166 @@ export class CreatePolygonInteraction extends AbstractInteraction implements Cre
7047
7115
  pointerKey: number;
7048
7116
  }
7049
7117
 
7118
+ /**
7119
+ * only exported for tests
7120
+ */
7121
+ export const cursorMap: any;
7122
+
7123
+ /**
7124
+ * A class to handle mouse over effects on features for editor sessions.
7125
+ * @param layerName - the layer name of the currently editing layer
7126
+ */
7127
+ export class EditGeometryMouseOverInteraction extends AbstractInteraction {
7128
+ constructor(layerName: string);
7129
+ /**
7130
+ * The layer name to react to
7131
+ */
7132
+ layerName: string;
7133
+ cursorStyle: CSSStyleDeclaration;
7134
+ /**
7135
+ * Reset the cursorStyle to auto
7136
+ */
7137
+ reset(): void;
7138
+ /**
7139
+ * A unique identifier for this interaction
7140
+ */
7141
+ id: string;
7142
+ /**
7143
+ * The current active bitmask for {@link EventType}
7144
+ */
7145
+ active: number;
7146
+ /**
7147
+ * The current active {@link ModificationKeyType}
7148
+ */
7149
+ modificationKey: number;
7150
+ /**
7151
+ * The currently active {@link PointerKeyType}
7152
+ */
7153
+ pointerKey: number;
7154
+ }
7155
+
7156
+ export interface VertexInsertedEvent {
7157
+ vertex: Vertex;
7158
+ index: number;
7159
+ }
7160
+
7161
+ export class InsertVertexInteraction extends AbstractInteraction {
7162
+ constructor(feature: import("ol").Feature<import("ol/geom").LineString | import("ol/geom").Polygon>, geometry: import("ol/geom").LineString | import("ol/geom").LinearRing);
7163
+ vertexInserted: VcsEvent<VertexInsertedEvent>;
7164
+ /**
7165
+ * A unique identifier for this interaction
7166
+ */
7167
+ id: string;
7168
+ /**
7169
+ * The current active bitmask for {@link EventType}
7170
+ */
7171
+ active: number;
7172
+ /**
7173
+ * The current active {@link ModificationKeyType}
7174
+ */
7175
+ modificationKey: number;
7176
+ /**
7177
+ * The currently active {@link PointerKeyType}
7178
+ */
7179
+ pointerKey: number;
7180
+ }
7181
+
7182
+ /**
7183
+ * An interaction to suppress map interactions when handling editor features (e.g. dragPan)
7184
+ */
7185
+ export class MapInteractionController {
7186
+ pipe(event: InteractionEvent): Promise<InteractionEvent>;
7187
+ /**
7188
+ * Resets the event handlers for the currently suspended map
7189
+ */
7190
+ reset(): void;
7191
+ }
7192
+
7193
+ /**
7194
+ * This interaction will raise the passed in event for each feature clicked with the vertex symbol
7195
+ */
7196
+ export class RemoveVertexInteraction extends AbstractInteraction {
7197
+ vertexRemoved: VcsEvent<Vertex>;
7198
+ /**
7199
+ * A unique identifier for this interaction
7200
+ */
7201
+ id: string;
7202
+ /**
7203
+ * The current active bitmask for {@link EventType}
7204
+ */
7205
+ active: number;
7206
+ /**
7207
+ * The current active {@link ModificationKeyType}
7208
+ */
7209
+ modificationKey: number;
7210
+ /**
7211
+ * The currently active {@link PointerKeyType}
7212
+ */
7213
+ pointerKey: number;
7214
+ }
7215
+
7216
+ /**
7217
+ * Class to select features for editing.
7218
+ * Static FeatureStore features will be converted into their dynamic form
7219
+ */
7220
+ export class SelectSingleFeatureInteraction extends AbstractInteraction {
7221
+ constructor(layer: VectorLayer);
7222
+ /**
7223
+ * Event called when the feature changes. Called with null if the selection is cleared.
7224
+ */
7225
+ featureChanged: VcsEvent<import("ol").Feature | null>;
7226
+ selectedFeature: any;
7227
+ /**
7228
+ * Selects the given feature. if passed in a tiled feature store feature, it will be converted. Do not pass in uneditable features (feature which do not
7229
+ * belong to the layer for which this interaction was created)
7230
+ */
7231
+ selectFeature(feature: import("ol").Feature | import("@vcmap/cesium").Cesium3DTileFeature | import("@vcmap/cesium").Cesium3DTilePointFeature): Promise<void>;
7232
+ /**
7233
+ * Clears the current selection, if there is one.
7234
+ */
7235
+ clear(): void;
7236
+ /**
7237
+ * A unique identifier for this interaction
7238
+ */
7239
+ id: string;
7240
+ /**
7241
+ * The current active bitmask for {@link EventType}
7242
+ */
7243
+ active: number;
7244
+ /**
7245
+ * The current active {@link ModificationKeyType}
7246
+ */
7247
+ modificationKey: number;
7248
+ /**
7249
+ * The currently active {@link PointerKeyType}
7250
+ */
7251
+ pointerKey: number;
7252
+ }
7253
+
7254
+ /**
7255
+ * Class to translate a vertex. Will call the passed in vertex changed event with the changed vertex.
7256
+ * Will modify the vertex in place
7257
+ */
7258
+ export class TranslateVertexInteraction extends AbstractInteraction {
7259
+ vertexChanged: VcsEvent<Vertex>;
7260
+ /**
7261
+ * A unique identifier for this interaction
7262
+ */
7263
+ id: string;
7264
+ /**
7265
+ * The current active bitmask for {@link EventType}
7266
+ */
7267
+ active: number;
7268
+ /**
7269
+ * The current active {@link ModificationKeyType}
7270
+ */
7271
+ modificationKey: number;
7272
+ /**
7273
+ * The currently active {@link PointerKeyType}
7274
+ */
7275
+ pointerKey: number;
7276
+ }
7277
+
7050
7278
  /**
7051
7279
  * Tracks layer exclusivity, added to every {@link LayerCollection}.
7052
7280
  */
@@ -7364,6 +7592,10 @@ export class MapCollection extends Collection<VcsMap> {
7364
7592
  * Set split screen for these maps.
7365
7593
  */
7366
7594
  splitScreen: any;
7595
+ /**
7596
+ * Raised on the active maps post render event
7597
+ */
7598
+ readonly postRender: VcsEvent<VcsMapRenderEvent>;
7367
7599
  /**
7368
7600
  * Adds a map to the collection. This will set the collections target, {@link SplitScreen}
7369
7601
  * and the collections {@link LayerCollection} on the map.
@@ -7413,6 +7645,11 @@ export function cartesian2DDistance(point0: import("ol/coordinate").Coordinate,
7413
7645
 
7414
7646
  export function cartesian3DDistance(p1: import("ol/coordinate").Coordinate, p2: import("ol/coordinate").Coordinate): number;
7415
7647
 
7648
+ /**
7649
+ * Avoid JS negative number modulo bug.
7650
+ */
7651
+ export function modulo(n: number, m: number): number;
7652
+
7416
7653
  /**
7417
7654
  * A symbol added to override collections.
7418
7655
  */
@@ -7567,7 +7804,7 @@ export function coordinateEqualsEpsilon(left: import("ol/coordinate").Coordinate
7567
7804
 
7568
7805
  /**
7569
7806
  */
7570
- export interface ViewPointOptions extends VcsObjectOptions {
7807
+ export interface ViewpointOptions extends VcsObjectOptions {
7571
7808
  /**
7572
7809
  * ol3 coordinate array with xyz coordinates (z value is mandatory)
7573
7810
  */
@@ -7609,8 +7846,8 @@ export interface ViewPointOptions extends VcsObjectOptions {
7609
7846
  /**
7610
7847
  * A Viewpoint Object
7611
7848
  */
7612
- export class ViewPoint extends VcsObject {
7613
- constructor(options: ViewPointOptions);
7849
+ export class Viewpoint extends VcsObject {
7850
+ constructor(options: ViewpointOptions);
7614
7851
  /**
7615
7852
  * position of the camera (optional) (cameraPosition needs x, y, and height value)
7616
7853
  * either a cameraPosition or a groundPosition have to be provided
@@ -7658,7 +7895,7 @@ export class ViewPoint extends VcsObject {
7658
7895
  * clones the viewpoint
7659
7896
  * @returns viewpoint
7660
7897
  */
7661
- clone(): ViewPoint;
7898
+ clone(): Viewpoint;
7662
7899
  /**
7663
7900
  * creates a String representation of this viewpoint
7664
7901
  */
@@ -7666,11 +7903,11 @@ export class ViewPoint extends VcsObject {
7666
7903
  /**
7667
7904
  * Creates a viewpoint based on an extent
7668
7905
  */
7669
- static createViewPointFromExtent(extent: import("ol/extent").Extent | Extent): ViewPoint;
7906
+ static createViewpointFromExtent(extent: import("ol/extent").Extent | Extent): Viewpoint;
7670
7907
  /**
7671
- * creates a new ViewPoint Object from url Paramter
7908
+ * creates a new Viewpoint Object from url Paramter
7672
7909
  */
7673
- static parseURLparameter(urlParameter: any): ViewPoint;
7910
+ static parseURLparameter(urlParameter: any): Viewpoint;
7674
7911
  /**
7675
7912
  * Checks if this Viewpoint is Valid
7676
7913
  */
@@ -7678,7 +7915,7 @@ export class ViewPoint extends VcsObject {
7678
7915
  /**
7679
7916
  * compares the provided Viewpoint with this viewpoint componentwise
7680
7917
  */
7681
- equals(other: ViewPoint, epsilon?: number): boolean;
7918
+ equals(other: Viewpoint, epsilon?: number): boolean;
7682
7919
  /**
7683
7920
  * unique Name
7684
7921
  */
@@ -7700,7 +7937,7 @@ export class VcsApp {
7700
7937
  readonly maps: OverrideMapCollection;
7701
7938
  readonly layers: OverrideLayerCollection;
7702
7939
  readonly obliqueCollections: OverrideCollection<ObliqueCollection>;
7703
- readonly viewPoints: OverrideCollection<ViewPoint>;
7940
+ readonly viewpoints: OverrideCollection<Viewpoint>;
7704
7941
  readonly styles: OverrideCollection<StyleItem>;
7705
7942
  readonly categories: CategoryCollection;
7706
7943
  readonly destroyed: VcsEvent<void>;
@@ -7748,7 +7985,7 @@ export interface ContextLayerOptions extends LayerOptions {
7748
7985
 
7749
7986
  export function deserializeMap(vcsApp: VcsApp, mapConfig: VcsMapOptions): VcsMap | null;
7750
7987
 
7751
- export function deserializeViewPoint(viewPointObject: ViewPointOptions): null | ViewPoint;
7988
+ export function deserializeViewpoint(viewpointObject: ViewpointOptions): null | Viewpoint;
7752
7989
 
7753
7990
  export function deserializeLayer(vcsApp: VcsApp, layerConfig: ContextLayerOptions): Layer | null;
7754
7991
 
@@ -7881,3 +8118,5 @@ export interface CreateInteraction<T extends import("ol/geom").Geometry> {
7881
8118
  destroy():void;
7882
8119
  }
7883
8120
 
8121
+ export type Vertex = import("ol").Feature<import("ol/geom").Point>;
8122
+
package/index.js CHANGED
@@ -92,7 +92,7 @@ export { default as BaseOLMap } from './src/map/baseOLMap.js';
92
92
  export { CameraLimiterMode, default as CameraLimiter } from './src/map/cameraLimiter.js';
93
93
  export { default as CesiumMap } from './src/map/cesiumMap.js';
94
94
  export { default as MapState } from './src/map/mapState.js';
95
- export { getViewDirectionFromViewPoint, default as ObliqueMap } from './src/map/obliqueMap.js';
95
+ export { getViewDirectionFromViewpoint, default as ObliqueMap } from './src/map/obliqueMap.js';
96
96
  export { default as OpenlayersMap } from './src/map/openlayersMap.js';
97
97
  export { default as VcsMap } from './src/map/vcsMap.js';
98
98
  export { default as DefaultObliqueCollection } from './src/oblique/defaultObliqueCollection.js';
@@ -118,12 +118,21 @@ export { default as ClippingObjectManager } from './src/util/clipping/clippingOb
118
118
  export { createClippingPlaneCollection, copyClippingPlanesToCollection, clearClippingPlanes, setClippingPlanes, createClippingFeature, getClippingOptions } from './src/util/clipping/clippingPlaneHelper.js';
119
119
  export { default as Collection } from './src/util/collection.js';
120
120
  export { default as startCreateFeatureSession } from './src/util/editor/createFeatureSession.js';
121
+ export { default as startEditGeometrySession } from './src/util/editor/editGeometrySession.js';
122
+ export { createVertex, pointOnLine3D, pointOnLine2D, createVerticalPlane, createHorizontalPlane } from './src/util/editor/editorHelpers.js';
121
123
  export { SessionType, setupScratchLayer, GeometryType } from './src/util/editor/editorSessionHelpers.js';
124
+ export { vertexSymbol, vertexIndex } from './src/util/editor/editorSymbols.js';
122
125
  export { default as CreateBBoxInteraction } from './src/util/editor/interactions/createBBoxInteraction.js';
123
126
  export { default as CreateCircleInteraction } from './src/util/editor/interactions/createCircleInteraction.js';
124
127
  export { default as CreateLineStringInteraction } from './src/util/editor/interactions/createLineStringInteraction.js';
125
128
  export { default as CreatePointInteraction } from './src/util/editor/interactions/createPointInteraction.js';
126
129
  export { default as CreatePolygonInteraction } from './src/util/editor/interactions/createPolygonInteraction.js';
130
+ export { cursorMap, default as EditGeometryMouseOverInteraction } from './src/util/editor/interactions/editGeometryMouseOverInteraction.js';
131
+ export { default as InsertVertexInteraction } from './src/util/editor/interactions/insertVertexInteraction.js';
132
+ export { default as MapInteractionController } from './src/util/editor/interactions/mapInteractionController.js';
133
+ export { default as RemoveVertexInteraction } from './src/util/editor/interactions/removeVertexInteraction.js';
134
+ export { default as SelectSingleFeatureInteraction } from './src/util/editor/interactions/selectSingleFeatureInteraction.js';
135
+ export { default as TranslateVertexInteraction } from './src/util/editor/interactions/translateVertexInteraction.js';
127
136
  export { default as geometryIsValid } from './src/util/editor/validateGeoemetry.js';
128
137
  export { default as ExclusiveManager } from './src/util/exclusiveManager.js';
129
138
  export { default as Extent } from './src/util/extent.js';
@@ -141,13 +150,13 @@ export { isMobile } from './src/util/isMobile.js';
141
150
  export { maxZIndex, default as LayerCollection } from './src/util/layerCollection.js';
142
151
  export { detectBrowserLocale } from './src/util/locale.js';
143
152
  export { default as MapCollection } from './src/util/mapCollection.js';
144
- export { coordinateAtDistance, initialBearingBetweenCoords, cartesian2DDistance, cartesian3DDistance } from './src/util/math.js';
153
+ export { coordinateAtDistance, initialBearingBetweenCoords, cartesian2DDistance, cartesian3DDistance, modulo } from './src/util/math.js';
145
154
  export { isOverrideCollection, default as makeOverrideCollection } from './src/util/overrideCollection.js';
146
155
  export { wgs84ToMercatorTransformer, mercatorToWgs84Transformer, setDefaultProjectionOptions, getDefaultProjection, wgs84Projection, mercatorProjection, default as Projection } from './src/util/projection.js';
147
156
  export { default as SplitScreen } from './src/util/splitScreen.js';
148
157
  export { isSameOrigin } from './src/util/urlHelpers.js';
149
- export { propertyEqualsEpsilon, angleEqualsEpsilon, coordinateEqualsEpsilon, default as ViewPoint } from './src/util/viewpoint.js';
158
+ export { propertyEqualsEpsilon, angleEqualsEpsilon, coordinateEqualsEpsilon, default as Viewpoint } from './src/util/viewpoint.js';
150
159
  export { defaultDynamicContextId, getVcsAppById, default as VcsApp } from './src/vcsApp.js';
151
- export { contextIdSymbol, deserializeMap, deserializeViewPoint, deserializeLayer, serializeLayer, getLayerIndex, destroyCollection } from './src/vcsAppContextHelpers.js';
160
+ export { contextIdSymbol, deserializeMap, deserializeViewpoint, deserializeLayer, serializeLayer, getLayerIndex, destroyCollection } from './src/vcsAppContextHelpers.js';
152
161
  export { default as VcsEvent } from './src/vcsEvent.js';
153
162
  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.21",
3
+ "version": "5.0.0-rc.23",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -56,7 +56,7 @@
56
56
  "typescript": "^4.6.2"
57
57
  },
58
58
  "peerDependencies": {
59
- "@vcmap/cesium": "~1.93.1",
59
+ "@vcmap/cesium": "~1.97.1",
60
60
  "ol": "~7.1.0"
61
61
  },
62
62
  "eslintConfig": {
@@ -1,6 +1,6 @@
1
1
  import Category from './category.js';
2
2
  import { categoryClassRegistry } from '../classRegistry.js';
3
- import ViewPoint from '../util/viewpoint.js';
3
+ import Viewpoint from '../util/viewpoint.js';
4
4
  import ObliqueCollection from '../oblique/obliqueCollection.js';
5
5
  import { deserializeLayer, deserializeMap } from '../vcsAppContextHelpers.js';
6
6
 
@@ -45,8 +45,8 @@ class AppBackedCategory extends Category {
45
45
  throw new Error('Cannot deserialize item before setting the vcApp');
46
46
  }
47
47
 
48
- if (this._collectionName === 'viewPoints') {
49
- return new ViewPoint(config);
48
+ if (this._collectionName === 'viewpoints') {
49
+ return new Viewpoint(config);
50
50
  } else if (this._collectionName === 'obliqueCollections') {
51
51
  return new ObliqueCollection(config);
52
52
  } else if (this._collectionName === 'layers') {
package/src/context.js CHANGED
@@ -7,8 +7,8 @@ import { contextIdSymbol } from './vcsAppContextHelpers.js';
7
7
  * @property {Array<LayerOptions>} [layers]
8
8
  * @property {Array<VcsMapOptions>} [maps]
9
9
  * @property {Array<StyleItemOptions>} [styles]
10
- * @property {Array<ViewPointOptions>} [viewpoints]
11
- * @property {string} [startingViewPointName]
10
+ * @property {Array<ViewpointOptions>} [viewpoints]
11
+ * @property {string} [startingViewpointName]
12
12
  * @property {string} [startingMapName]
13
13
  * @property {ProjectionOptions} [projection]
14
14
  * @property {Array<{ name: string, items: Array<Object> }>} [categories]
@@ -61,7 +61,7 @@ export function getFormat(responseType, options = {}) {
61
61
  if (responseType === 'application/vnd.ogc.gml') {
62
62
  return new GML2(options);
63
63
  }
64
- if (responseType === 'application/vnd.ogc.gml/3.1.1') {
64
+ if (responseType === 'application/vnd.ogc.gml/3.1.1' || responseType === 'text/xml; subtype=gml/3.1.1') {
65
65
  return new GML3(options);
66
66
  }
67
67
  return null;
@@ -111,7 +111,7 @@ class DataSourceCesiumImpl extends LayerImplementation {
111
111
 
112
112
  const bSphere = new BoundingSphere();
113
113
 
114
- const viewpoint = this.map.getViewPointSync();
114
+ const viewpoint = this.map.getViewpointSync();
115
115
  const { heading, pitch } = viewpoint;
116
116
  const offset = new HeadingPitchRange(
117
117
  CesiumMath.toRadians(heading),
@@ -3,7 +3,7 @@
3
3
  * @returns {Object}
4
4
  */
5
5
  export default function getJSONObjectFromObject(feature) {
6
- const properties = feature.getPropertyNames();
6
+ const properties = feature.getPropertyIds();
7
7
  const JSONObject = {};
8
8
  for (let i = 0; i < properties.length; i++) {
9
9
  JSONObject[properties[i]] = feature.getProperty(properties[i]);
@@ -204,11 +204,6 @@ class CesiumTilesetLayer extends FeatureLayer {
204
204
  }
205
205
  }
206
206
 
207
- async initialize() {
208
- await this.style.cesiumStyle.readyPromise;
209
- return super.initialize();
210
- }
211
-
212
207
  /**
213
208
  * @inheritDoc
214
209
  * @returns {CesiumTilesetImplementationOptions}
@@ -60,6 +60,8 @@ export function getWMSSource(options) {
60
60
  } else {
61
61
  sourceOptions.projection = 'EPSG:4326';
62
62
  }
63
+ } else {
64
+ sourceOptions.projection = 'EPSG:3857';
63
65
  }
64
66
  return new TileWMS(sourceOptions);
65
67
  }
@@ -128,7 +128,6 @@ class BaseOLMap extends VcsMap {
128
128
  }),
129
129
  target: this.mapElement,
130
130
  });
131
-
132
131
  // @ts-ignore
133
132
  const pointerDownListener = /** @type {import("ol/events").EventsKey} */ (this.olMap.on('pointerdown', (event) => {
134
133
  this._raisePointerInteraction(
@@ -143,11 +142,18 @@ class BaseOLMap extends VcsMap {
143
142
  PointerEventType.UP,
144
143
  );
145
144
  }));
146
- // @ts-ignore
147
- const pointerMoveListener = /** @type {import("ol/events").EventsKey} */ (this.olMap.on('pointermove', (event) => {
148
- this._raisePointerInteraction(event, PointerEventType.MOVE);
149
- }));
150
- this._olListeners.push(pointerDownListener, pointerUpListener, pointerMoveListener);
145
+
146
+ const pointerMoveListener = /** @type {import("ol/events").EventsKey} */ (this.olMap
147
+ .on('pointermove', (event) => {
148
+ this._raisePointerInteraction(event, PointerEventType.MOVE);
149
+ }));
150
+
151
+ const postRenderListener = /** @type {import("ol/events").EventsKey} */ (this.olMap
152
+ .on('postrender', (originalEvent) => {
153
+ this.postRender.raiseEvent({ map: this, originalEvent });
154
+ }));
155
+
156
+ this._olListeners.push(pointerDownListener, pointerUpListener, pointerMoveListener, postRenderListener);
151
157
  }
152
158
  }
153
159