@vcmap/core 5.0.0-rc.21 → 5.0.0-rc.22
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 +229 -24
- package/index.js +13 -4
- package/package.json +2 -2
- package/src/category/appBackedCategory.js +3 -3
- package/src/context.js +2 -2
- package/src/layer/cesium/dataSourceCesiumImpl.js +1 -1
- package/src/layer/cesium/x3dmHelper.js +1 -1
- package/src/layer/cesiumTilesetLayer.js +0 -5
- package/src/map/cesiumMap.js +10 -13
- package/src/map/obliqueMap.js +19 -19
- package/src/map/openlayersMap.js +9 -9
- package/src/map/vcsMap.js +9 -9
- package/src/oblique/obliqueProvider.js +2 -2
- package/src/style/declarativeStyleItem.js +2 -8
- package/src/util/editor/editGeometrySession.js +401 -0
- package/src/util/editor/editorHelpers.js +109 -0
- package/src/util/editor/editorSessionHelpers.js +1 -2
- package/src/util/editor/editorSymbols.js +10 -0
- package/src/util/editor/interactions/editGeometryMouseOverInteraction.js +133 -0
- package/src/util/editor/interactions/insertVertexInteraction.js +92 -0
- package/src/util/editor/interactions/mapInteractionController.js +99 -0
- package/src/util/editor/interactions/removeVertexInteraction.js +39 -0
- package/src/util/editor/interactions/selectSingleFeatureInteraction.js +95 -0
- package/src/util/editor/interactions/translateVertexInteraction.js +61 -0
- package/src/util/mapCollection.js +14 -14
- package/src/util/math.js +9 -0
- package/src/util/splitScreen.js +1 -1
- package/src/util/viewpoint.js +16 -16
- package/src/vcsApp.js +15 -15
- package/src/vcsAppContextHelpers.js +6 -6
- package/tests/unit/helpers/cesiumHelpers.js +3 -4
- 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?:
|
|
159
|
-
|
|
158
|
+
viewpoints?: ViewpointOptions[];
|
|
159
|
+
startingViewpointName?: string;
|
|
160
160
|
startingMapName?: string;
|
|
161
161
|
projection?: ProjectionOptions;
|
|
162
162
|
categories?: { name: string; items: object[]; }[];
|
|
@@ -5280,7 +5280,7 @@ export interface ObliqueOptions extends VcsMapOptions {
|
|
|
5280
5280
|
/**
|
|
5281
5281
|
* returns the direction which matches the heading of the viewpoint
|
|
5282
5282
|
*/
|
|
5283
|
-
export function
|
|
5283
|
+
export function getViewDirectionFromViewpoint(viewpoint: Viewpoint): ObliqueViewDirection;
|
|
5284
5284
|
|
|
5285
5285
|
/**
|
|
5286
5286
|
* ObliqueMap Map Class (2D map with oblique imagery)
|
|
@@ -5302,7 +5302,7 @@ export class ObliqueMap extends BaseOLMap {
|
|
|
5302
5302
|
/**
|
|
5303
5303
|
* Sets a new oblique collection
|
|
5304
5304
|
*/
|
|
5305
|
-
setCollection(obliqueCollection: ObliqueCollection, viewpoint?:
|
|
5305
|
+
setCollection(obliqueCollection: ObliqueCollection, viewpoint?: Viewpoint): Promise<void>;
|
|
5306
5306
|
/**
|
|
5307
5307
|
* Sets an image by its name on the map
|
|
5308
5308
|
*/
|
|
@@ -5510,7 +5510,7 @@ export class VcsMap extends VcsObject {
|
|
|
5510
5510
|
/**
|
|
5511
5511
|
* Determines whether this map can show this viewpoint. Returns true in any other map then {@link Oblique}
|
|
5512
5512
|
*/
|
|
5513
|
-
canShowViewpoint(viewpoint:
|
|
5513
|
+
canShowViewpoint(viewpoint: Viewpoint): Promise<boolean>;
|
|
5514
5514
|
/**
|
|
5515
5515
|
* Sets the map target.
|
|
5516
5516
|
*/
|
|
@@ -5551,23 +5551,23 @@ export class VcsMap extends VcsObject {
|
|
|
5551
5551
|
*/
|
|
5552
5552
|
deactivate(): void;
|
|
5553
5553
|
/**
|
|
5554
|
-
* prevent all movement, including navigation controls,
|
|
5554
|
+
* prevent all movement, including navigation controls, gotoViewpoint & setting of oblique images
|
|
5555
5555
|
*/
|
|
5556
5556
|
disableMovement(prevent: boolean): void;
|
|
5557
5557
|
/**
|
|
5558
5558
|
* sets the view to the given viewpoint
|
|
5559
5559
|
* @param [optMaximumHeight] - during animation (can be used to get rid of the bunny hop)
|
|
5560
|
-
*
|
|
5560
|
+
* gotoViewpoint
|
|
5561
5561
|
*/
|
|
5562
|
-
|
|
5562
|
+
gotoViewpoint(viewpoint: Viewpoint, optMaximumHeight?: number): Promise<void>;
|
|
5563
5563
|
/**
|
|
5564
5564
|
* Returns the most precise viewpoint possible in ObliqueMap.
|
|
5565
5565
|
*/
|
|
5566
|
-
|
|
5566
|
+
getViewpoint(): Promise<Viewpoint | null>;
|
|
5567
5567
|
/**
|
|
5568
5568
|
* Returns an approximate viewpoint in ObliqueMap, not requesting terrain.
|
|
5569
5569
|
*/
|
|
5570
|
-
|
|
5570
|
+
getViewpointSync(): Viewpoint | null;
|
|
5571
5571
|
/**
|
|
5572
5572
|
* Resolution in meters per pixe
|
|
5573
5573
|
* @param coordinate - coordinate in mercator for which to determine resolution. only required in 3D
|
|
@@ -6064,7 +6064,7 @@ export class ObliqueImageMeta {
|
|
|
6064
6064
|
|
|
6065
6065
|
/**
|
|
6066
6066
|
*/
|
|
6067
|
-
export interface
|
|
6067
|
+
export interface ObliqueViewpoint {
|
|
6068
6068
|
/**
|
|
6069
6069
|
* in mercator
|
|
6070
6070
|
*/
|
|
@@ -6125,7 +6125,7 @@ export class ObliqueProvider {
|
|
|
6125
6125
|
/**
|
|
6126
6126
|
* Returns a viewpoint for the currently set view.
|
|
6127
6127
|
*/
|
|
6128
|
-
getView(): Promise<
|
|
6128
|
+
getView(): Promise<ObliqueViewpoint>;
|
|
6129
6129
|
/**
|
|
6130
6130
|
* Destroys all openlayers resources created by this oblique provider
|
|
6131
6131
|
*/
|
|
@@ -6876,6 +6876,35 @@ export interface CreateFeatureSession extends EditorSession {
|
|
|
6876
6876
|
finish: (...params: any[]) => any;
|
|
6877
6877
|
}
|
|
6878
6878
|
|
|
6879
|
+
/**
|
|
6880
|
+
*/
|
|
6881
|
+
export interface EditGeometrySession extends EditorSession {
|
|
6882
|
+
/**
|
|
6883
|
+
* the feature selection for this session.
|
|
6884
|
+
*/
|
|
6885
|
+
featureSelection: SelectSingleFeatureInteraction;
|
|
6886
|
+
}
|
|
6887
|
+
|
|
6888
|
+
export function createVertex(coordinate: import("ol/coordinate").Coordinate): Vertex;
|
|
6889
|
+
|
|
6890
|
+
/**
|
|
6891
|
+
* @param start - line segment start
|
|
6892
|
+
* @param end - line segment end
|
|
6893
|
+
* @param point - the point to project
|
|
6894
|
+
*/
|
|
6895
|
+
export function pointOnLine3D(start: import("ol/coordinate").Coordinate, end: import("ol/coordinate").Coordinate, point: import("ol/coordinate").Coordinate, epsilon?: number): boolean;
|
|
6896
|
+
|
|
6897
|
+
/**
|
|
6898
|
+
* @param start - line segment start
|
|
6899
|
+
* @param end - line segment end
|
|
6900
|
+
* @param point - the point to project
|
|
6901
|
+
*/
|
|
6902
|
+
export function pointOnLine2D(start: import("ol/coordinate").Coordinate, end: import("ol/coordinate").Coordinate, point: import("ol/coordinate").Coordinate, epsilon?: number): boolean;
|
|
6903
|
+
|
|
6904
|
+
export function createVerticalPlane(originCoordinates: import("ol/coordinate").Coordinate, scene: import("@vcmap/cesium").Scene): import("@vcmap/cesium").Plane;
|
|
6905
|
+
|
|
6906
|
+
export function createHorizontalPlane(originCoordinates: import("ol/coordinate").Coordinate, scene: import("@vcmap/cesium").Scene): import("@vcmap/cesium").Plane;
|
|
6907
|
+
|
|
6879
6908
|
/**
|
|
6880
6909
|
* An editor session is a currently set of interactions to create or edit geometries & features.
|
|
6881
6910
|
* All editor sessions can be stopped and will be stopped, if their interactions get removed from the
|
|
@@ -6902,10 +6931,19 @@ export const enum GeometryType {
|
|
|
6902
6931
|
Circle,
|
|
6903
6932
|
LineString,
|
|
6904
6933
|
Polygon,
|
|
6905
|
-
BBox
|
|
6906
|
-
Rectangle
|
|
6934
|
+
BBox
|
|
6907
6935
|
}
|
|
6908
6936
|
|
|
6937
|
+
/**
|
|
6938
|
+
* Symbol to identify a {@see Vertex}
|
|
6939
|
+
*/
|
|
6940
|
+
export const vertexSymbol: symbol;
|
|
6941
|
+
|
|
6942
|
+
/**
|
|
6943
|
+
* Symbol to denote the vertexes index in the vertices array. This is important for snapping & bbox operations
|
|
6944
|
+
*/
|
|
6945
|
+
export const vertexIndex: symbol;
|
|
6946
|
+
|
|
6909
6947
|
|
|
6910
6948
|
|
|
6911
6949
|
/**
|
|
@@ -7047,6 +7085,166 @@ export class CreatePolygonInteraction extends AbstractInteraction implements Cre
|
|
|
7047
7085
|
pointerKey: number;
|
|
7048
7086
|
}
|
|
7049
7087
|
|
|
7088
|
+
/**
|
|
7089
|
+
* only exported for tests
|
|
7090
|
+
*/
|
|
7091
|
+
export const cursorMap: any;
|
|
7092
|
+
|
|
7093
|
+
/**
|
|
7094
|
+
* A class to handle mouse over effects on features for editor sessions.
|
|
7095
|
+
* @param layerName - the layer name of the currently editing layer
|
|
7096
|
+
*/
|
|
7097
|
+
export class EditGeometryMouseOverInteraction extends AbstractInteraction {
|
|
7098
|
+
constructor(layerName: string);
|
|
7099
|
+
/**
|
|
7100
|
+
* The layer name to react to
|
|
7101
|
+
*/
|
|
7102
|
+
layerName: string;
|
|
7103
|
+
cursorStyle: CSSStyleDeclaration;
|
|
7104
|
+
/**
|
|
7105
|
+
* Reset the cursorStyle to auto
|
|
7106
|
+
*/
|
|
7107
|
+
reset(): void;
|
|
7108
|
+
/**
|
|
7109
|
+
* A unique identifier for this interaction
|
|
7110
|
+
*/
|
|
7111
|
+
id: string;
|
|
7112
|
+
/**
|
|
7113
|
+
* The current active bitmask for {@link EventType}
|
|
7114
|
+
*/
|
|
7115
|
+
active: number;
|
|
7116
|
+
/**
|
|
7117
|
+
* The current active {@link ModificationKeyType}
|
|
7118
|
+
*/
|
|
7119
|
+
modificationKey: number;
|
|
7120
|
+
/**
|
|
7121
|
+
* The currently active {@link PointerKeyType}
|
|
7122
|
+
*/
|
|
7123
|
+
pointerKey: number;
|
|
7124
|
+
}
|
|
7125
|
+
|
|
7126
|
+
export interface VertexInsertedEvent {
|
|
7127
|
+
vertex: Vertex;
|
|
7128
|
+
index: number;
|
|
7129
|
+
}
|
|
7130
|
+
|
|
7131
|
+
export class InsertVertexInteraction extends AbstractInteraction {
|
|
7132
|
+
constructor(feature: import("ol").Feature<import("ol/geom").LineString | import("ol/geom").Polygon>, geometry: import("ol/geom").LineString | import("ol/geom").LinearRing);
|
|
7133
|
+
vertexInserted: VcsEvent<VertexInsertedEvent>;
|
|
7134
|
+
/**
|
|
7135
|
+
* A unique identifier for this interaction
|
|
7136
|
+
*/
|
|
7137
|
+
id: string;
|
|
7138
|
+
/**
|
|
7139
|
+
* The current active bitmask for {@link EventType}
|
|
7140
|
+
*/
|
|
7141
|
+
active: number;
|
|
7142
|
+
/**
|
|
7143
|
+
* The current active {@link ModificationKeyType}
|
|
7144
|
+
*/
|
|
7145
|
+
modificationKey: number;
|
|
7146
|
+
/**
|
|
7147
|
+
* The currently active {@link PointerKeyType}
|
|
7148
|
+
*/
|
|
7149
|
+
pointerKey: number;
|
|
7150
|
+
}
|
|
7151
|
+
|
|
7152
|
+
/**
|
|
7153
|
+
* An interaction to suppress map interactions when handling editor features (e.g. dragPan)
|
|
7154
|
+
*/
|
|
7155
|
+
export class MapInteractionController {
|
|
7156
|
+
pipe(event: InteractionEvent): Promise<InteractionEvent>;
|
|
7157
|
+
/**
|
|
7158
|
+
* Resets the event handlers for the currently suspended map
|
|
7159
|
+
*/
|
|
7160
|
+
reset(): void;
|
|
7161
|
+
}
|
|
7162
|
+
|
|
7163
|
+
/**
|
|
7164
|
+
* This interaction will raise the passed in event for each feature clicked with the vertex symbol
|
|
7165
|
+
*/
|
|
7166
|
+
export class RemoveVertexInteraction extends AbstractInteraction {
|
|
7167
|
+
vertexRemoved: VcsEvent<Vertex>;
|
|
7168
|
+
/**
|
|
7169
|
+
* A unique identifier for this interaction
|
|
7170
|
+
*/
|
|
7171
|
+
id: string;
|
|
7172
|
+
/**
|
|
7173
|
+
* The current active bitmask for {@link EventType}
|
|
7174
|
+
*/
|
|
7175
|
+
active: number;
|
|
7176
|
+
/**
|
|
7177
|
+
* The current active {@link ModificationKeyType}
|
|
7178
|
+
*/
|
|
7179
|
+
modificationKey: number;
|
|
7180
|
+
/**
|
|
7181
|
+
* The currently active {@link PointerKeyType}
|
|
7182
|
+
*/
|
|
7183
|
+
pointerKey: number;
|
|
7184
|
+
}
|
|
7185
|
+
|
|
7186
|
+
/**
|
|
7187
|
+
* Class to select features for editing.
|
|
7188
|
+
* Static FeatureStore features will be converted into their dynamic form
|
|
7189
|
+
*/
|
|
7190
|
+
export class SelectSingleFeatureInteraction extends AbstractInteraction {
|
|
7191
|
+
constructor(layer: VectorLayer);
|
|
7192
|
+
/**
|
|
7193
|
+
* Event called when the feature changes. Called with null if the selection is cleared.
|
|
7194
|
+
*/
|
|
7195
|
+
featureChanged: VcsEvent<import("ol").Feature | null>;
|
|
7196
|
+
selectedFeature: any;
|
|
7197
|
+
/**
|
|
7198
|
+
* 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
|
|
7199
|
+
* belong to the layer for which this interaction was created)
|
|
7200
|
+
*/
|
|
7201
|
+
selectFeature(feature: import("ol").Feature | import("@vcmap/cesium").Cesium3DTileFeature | import("@vcmap/cesium").Cesium3DTilePointFeature): Promise<void>;
|
|
7202
|
+
/**
|
|
7203
|
+
* Clears the current selection, if there is one.
|
|
7204
|
+
*/
|
|
7205
|
+
clear(): void;
|
|
7206
|
+
/**
|
|
7207
|
+
* A unique identifier for this interaction
|
|
7208
|
+
*/
|
|
7209
|
+
id: string;
|
|
7210
|
+
/**
|
|
7211
|
+
* The current active bitmask for {@link EventType}
|
|
7212
|
+
*/
|
|
7213
|
+
active: number;
|
|
7214
|
+
/**
|
|
7215
|
+
* The current active {@link ModificationKeyType}
|
|
7216
|
+
*/
|
|
7217
|
+
modificationKey: number;
|
|
7218
|
+
/**
|
|
7219
|
+
* The currently active {@link PointerKeyType}
|
|
7220
|
+
*/
|
|
7221
|
+
pointerKey: number;
|
|
7222
|
+
}
|
|
7223
|
+
|
|
7224
|
+
/**
|
|
7225
|
+
* Class to translate a vertex. Will call the passed in vertex changed event with the changed vertex.
|
|
7226
|
+
* Will modify the vertex in place
|
|
7227
|
+
*/
|
|
7228
|
+
export class TranslateVertexInteraction extends AbstractInteraction {
|
|
7229
|
+
vertexChanged: VcsEvent<Vertex>;
|
|
7230
|
+
/**
|
|
7231
|
+
* A unique identifier for this interaction
|
|
7232
|
+
*/
|
|
7233
|
+
id: string;
|
|
7234
|
+
/**
|
|
7235
|
+
* The current active bitmask for {@link EventType}
|
|
7236
|
+
*/
|
|
7237
|
+
active: number;
|
|
7238
|
+
/**
|
|
7239
|
+
* The current active {@link ModificationKeyType}
|
|
7240
|
+
*/
|
|
7241
|
+
modificationKey: number;
|
|
7242
|
+
/**
|
|
7243
|
+
* The currently active {@link PointerKeyType}
|
|
7244
|
+
*/
|
|
7245
|
+
pointerKey: number;
|
|
7246
|
+
}
|
|
7247
|
+
|
|
7050
7248
|
/**
|
|
7051
7249
|
* Tracks layer exclusivity, added to every {@link LayerCollection}.
|
|
7052
7250
|
*/
|
|
@@ -7413,6 +7611,11 @@ export function cartesian2DDistance(point0: import("ol/coordinate").Coordinate,
|
|
|
7413
7611
|
|
|
7414
7612
|
export function cartesian3DDistance(p1: import("ol/coordinate").Coordinate, p2: import("ol/coordinate").Coordinate): number;
|
|
7415
7613
|
|
|
7614
|
+
/**
|
|
7615
|
+
* Avoid JS negative number modulo bug.
|
|
7616
|
+
*/
|
|
7617
|
+
export function modulo(n: number, m: number): number;
|
|
7618
|
+
|
|
7416
7619
|
/**
|
|
7417
7620
|
* A symbol added to override collections.
|
|
7418
7621
|
*/
|
|
@@ -7567,7 +7770,7 @@ export function coordinateEqualsEpsilon(left: import("ol/coordinate").Coordinate
|
|
|
7567
7770
|
|
|
7568
7771
|
/**
|
|
7569
7772
|
*/
|
|
7570
|
-
export interface
|
|
7773
|
+
export interface ViewpointOptions extends VcsObjectOptions {
|
|
7571
7774
|
/**
|
|
7572
7775
|
* ol3 coordinate array with xyz coordinates (z value is mandatory)
|
|
7573
7776
|
*/
|
|
@@ -7609,8 +7812,8 @@ export interface ViewPointOptions extends VcsObjectOptions {
|
|
|
7609
7812
|
/**
|
|
7610
7813
|
* A Viewpoint Object
|
|
7611
7814
|
*/
|
|
7612
|
-
export class
|
|
7613
|
-
constructor(options:
|
|
7815
|
+
export class Viewpoint extends VcsObject {
|
|
7816
|
+
constructor(options: ViewpointOptions);
|
|
7614
7817
|
/**
|
|
7615
7818
|
* position of the camera (optional) (cameraPosition needs x, y, and height value)
|
|
7616
7819
|
* either a cameraPosition or a groundPosition have to be provided
|
|
@@ -7658,7 +7861,7 @@ export class ViewPoint extends VcsObject {
|
|
|
7658
7861
|
* clones the viewpoint
|
|
7659
7862
|
* @returns viewpoint
|
|
7660
7863
|
*/
|
|
7661
|
-
clone():
|
|
7864
|
+
clone(): Viewpoint;
|
|
7662
7865
|
/**
|
|
7663
7866
|
* creates a String representation of this viewpoint
|
|
7664
7867
|
*/
|
|
@@ -7666,11 +7869,11 @@ export class ViewPoint extends VcsObject {
|
|
|
7666
7869
|
/**
|
|
7667
7870
|
* Creates a viewpoint based on an extent
|
|
7668
7871
|
*/
|
|
7669
|
-
static
|
|
7872
|
+
static createViewpointFromExtent(extent: import("ol/extent").Extent | Extent): Viewpoint;
|
|
7670
7873
|
/**
|
|
7671
|
-
* creates a new
|
|
7874
|
+
* creates a new Viewpoint Object from url Paramter
|
|
7672
7875
|
*/
|
|
7673
|
-
static parseURLparameter(urlParameter: any):
|
|
7876
|
+
static parseURLparameter(urlParameter: any): Viewpoint;
|
|
7674
7877
|
/**
|
|
7675
7878
|
* Checks if this Viewpoint is Valid
|
|
7676
7879
|
*/
|
|
@@ -7678,7 +7881,7 @@ export class ViewPoint extends VcsObject {
|
|
|
7678
7881
|
/**
|
|
7679
7882
|
* compares the provided Viewpoint with this viewpoint componentwise
|
|
7680
7883
|
*/
|
|
7681
|
-
equals(other:
|
|
7884
|
+
equals(other: Viewpoint, epsilon?: number): boolean;
|
|
7682
7885
|
/**
|
|
7683
7886
|
* unique Name
|
|
7684
7887
|
*/
|
|
@@ -7700,7 +7903,7 @@ export class VcsApp {
|
|
|
7700
7903
|
readonly maps: OverrideMapCollection;
|
|
7701
7904
|
readonly layers: OverrideLayerCollection;
|
|
7702
7905
|
readonly obliqueCollections: OverrideCollection<ObliqueCollection>;
|
|
7703
|
-
readonly
|
|
7906
|
+
readonly viewpoints: OverrideCollection<Viewpoint>;
|
|
7704
7907
|
readonly styles: OverrideCollection<StyleItem>;
|
|
7705
7908
|
readonly categories: CategoryCollection;
|
|
7706
7909
|
readonly destroyed: VcsEvent<void>;
|
|
@@ -7748,7 +7951,7 @@ export interface ContextLayerOptions extends LayerOptions {
|
|
|
7748
7951
|
|
|
7749
7952
|
export function deserializeMap(vcsApp: VcsApp, mapConfig: VcsMapOptions): VcsMap | null;
|
|
7750
7953
|
|
|
7751
|
-
export function
|
|
7954
|
+
export function deserializeViewpoint(viewpointObject: ViewpointOptions): null | Viewpoint;
|
|
7752
7955
|
|
|
7753
7956
|
export function deserializeLayer(vcsApp: VcsApp, layerConfig: ContextLayerOptions): Layer | null;
|
|
7754
7957
|
|
|
@@ -7881,3 +8084,5 @@ export interface CreateInteraction<T extends import("ol/geom").Geometry> {
|
|
|
7881
8084
|
destroy():void;
|
|
7882
8085
|
}
|
|
7883
8086
|
|
|
8087
|
+
export type Vertex = import("ol").Feature<import("ol/geom").Point>;
|
|
8088
|
+
|
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 {
|
|
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
|
|
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,
|
|
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.
|
|
3
|
+
"version": "5.0.0-rc.22",
|
|
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.
|
|
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
|
|
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 === '
|
|
49
|
-
return new
|
|
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<
|
|
11
|
-
* @property {string} [
|
|
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]
|
|
@@ -111,7 +111,7 @@ class DataSourceCesiumImpl extends LayerImplementation {
|
|
|
111
111
|
|
|
112
112
|
const bSphere = new BoundingSphere();
|
|
113
113
|
|
|
114
|
-
const viewpoint = this.map.
|
|
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.
|
|
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}
|
package/src/map/cesiumMap.js
CHANGED
|
@@ -27,13 +27,12 @@ import {
|
|
|
27
27
|
KeyboardEventModifier,
|
|
28
28
|
ScreenSpaceEventType,
|
|
29
29
|
Cesium3DTileset,
|
|
30
|
-
ExperimentalFeatures,
|
|
31
30
|
} from '@vcmap/cesium';
|
|
32
31
|
|
|
33
32
|
import { check, checkMaybe } from '@vcsuite/check';
|
|
34
33
|
import { parseBoolean, parseInteger } from '@vcsuite/parsers';
|
|
35
34
|
import VcsMap from './vcsMap.js';
|
|
36
|
-
import
|
|
35
|
+
import Viewpoint from '../util/viewpoint.js';
|
|
37
36
|
import Projection, { mercatorProjection } from '../util/projection.js';
|
|
38
37
|
import { getHeightFromTerrainProvider } from '../layer/terrainHelpers.js';
|
|
39
38
|
import { vcsLayerName } from '../layer/layerSymbols.js';
|
|
@@ -197,8 +196,6 @@ function setDebugOnVisualizations(visualizations, debug) {
|
|
|
197
196
|
});
|
|
198
197
|
}
|
|
199
198
|
|
|
200
|
-
ExperimentalFeatures.enableModelExperimental = false; // TODO check on release
|
|
201
|
-
|
|
202
199
|
/**
|
|
203
200
|
* Cesium Globe Map Class (3D map)
|
|
204
201
|
* @class
|
|
@@ -531,7 +528,7 @@ class CesiumMap extends VcsMap {
|
|
|
531
528
|
this._cesiumWidget.scene.globe.depthTestAgainstTerrain = true;
|
|
532
529
|
this._cesiumWidget.scene.highDynamicRange = false;
|
|
533
530
|
// this._cesiumWidget.scene.logarithmicDepthBuffer = false; // TODO observe this
|
|
534
|
-
this._cesiumWidget.scene.
|
|
531
|
+
this._cesiumWidget.scene.splitPosition = 0.5;
|
|
535
532
|
|
|
536
533
|
this._cesiumWidget.scene.globe.enableLighting = this.enableLightning;
|
|
537
534
|
|
|
@@ -612,17 +609,17 @@ class CesiumMap extends VcsMap {
|
|
|
612
609
|
|
|
613
610
|
/**
|
|
614
611
|
* @inheritDoc
|
|
615
|
-
* @returns {Promise<null|
|
|
612
|
+
* @returns {Promise<null|Viewpoint>}
|
|
616
613
|
*/
|
|
617
|
-
async
|
|
618
|
-
return this.
|
|
614
|
+
async getViewpoint() {
|
|
615
|
+
return this.getViewpointSync();
|
|
619
616
|
}
|
|
620
617
|
|
|
621
618
|
/**
|
|
622
619
|
* @inheritDoc
|
|
623
|
-
* @returns {
|
|
620
|
+
* @returns {Viewpoint|null}
|
|
624
621
|
*/
|
|
625
|
-
|
|
622
|
+
getViewpointSync() {
|
|
626
623
|
if (!this._cesiumWidget || !this._cesiumWidget.scene || !this.target) {
|
|
627
624
|
return null;
|
|
628
625
|
}
|
|
@@ -648,7 +645,7 @@ class CesiumMap extends VcsMap {
|
|
|
648
645
|
CesiumMath.toDegrees(cameraPositionCartographic.latitude),
|
|
649
646
|
cameraPositionCartographic.height,
|
|
650
647
|
];
|
|
651
|
-
return new
|
|
648
|
+
return new Viewpoint({
|
|
652
649
|
groundPosition,
|
|
653
650
|
cameraPosition,
|
|
654
651
|
distance,
|
|
@@ -659,12 +656,12 @@ class CesiumMap extends VcsMap {
|
|
|
659
656
|
}
|
|
660
657
|
|
|
661
658
|
/**
|
|
662
|
-
* @param {
|
|
659
|
+
* @param {Viewpoint} viewpoint
|
|
663
660
|
* @param {number=} optMaximumHeight
|
|
664
661
|
* @returns {Promise<void>}
|
|
665
662
|
* @inheritDoc
|
|
666
663
|
*/
|
|
667
|
-
async
|
|
664
|
+
async gotoViewpoint(viewpoint, optMaximumHeight) {
|
|
668
665
|
if (this.movementDisabled || !viewpoint.isValid()) {
|
|
669
666
|
return;
|
|
670
667
|
}
|