@vcmap/core 5.1.0-rc.2 → 5.1.0
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/README.md +1 -1
- package/dist/src/layer/geojsonHelpers.js +2 -2
- package/dist/src/layer/geojsonHelpers.js.map +1 -1
- package/dist/src/layer/geojsonLayer.js +4 -2
- package/dist/src/layer/geojsonLayer.js.map +1 -1
- package/dist/src/layer/layer.js +5 -1
- package/dist/src/layer/layer.js.map +1 -1
- package/dist/src/layer/rasterLayer.js +1 -2
- package/dist/src/layer/rasterLayer.js.map +1 -1
- package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js +1 -2
- package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js.map +1 -1
- package/dist/src/layer/tmsLayer.js +1 -2
- package/dist/src/layer/tmsLayer.js.map +1 -1
- package/dist/src/layer/vectorProperties.d.ts +2 -1
- package/dist/src/layer/vectorProperties.js.map +1 -1
- package/dist/src/layer/wfsLayer.js +1 -2
- package/dist/src/layer/wfsLayer.js.map +1 -1
- package/dist/src/layer/wmtsLayer.js +1 -2
- package/dist/src/layer/wmtsLayer.js.map +1 -1
- package/dist/src/util/editor/createFeatureSession.d.ts +4 -1
- package/dist/src/util/editor/createFeatureSession.js +54 -2
- package/dist/src/util/editor/createFeatureSession.js.map +1 -1
- package/dist/src/util/editor/editGeometrySession.d.ts +1 -1
- package/dist/src/util/editor/editGeometrySession.js +50 -7
- package/dist/src/util/editor/editGeometrySession.js.map +1 -1
- package/dist/src/util/editor/editorHelpers.d.ts +4 -4
- package/dist/src/util/editor/editorHelpers.js +17 -4
- package/dist/src/util/editor/editorHelpers.js.map +1 -1
- package/dist/src/util/editor/editorSessionHelpers.d.ts +7 -0
- package/dist/src/util/editor/editorSessionHelpers.js +20 -1
- package/dist/src/util/editor/editorSessionHelpers.js.map +1 -1
- package/dist/src/util/editor/interactions/insertVertexInteraction.js +2 -2
- package/dist/src/util/editor/interactions/insertVertexInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/translateVertexInteraction.js +3 -0
- package/dist/src/util/editor/interactions/translateVertexInteraction.js.map +1 -1
- package/dist/src/util/featureconverter/pointToCesium.js +1 -8
- package/dist/src/util/featureconverter/pointToCesium.js.map +1 -1
- package/package.json +1 -1
- package/src/layer/geojsonHelpers.ts +2 -2
- package/src/layer/geojsonLayer.ts +4 -3
- package/src/layer/layer.ts +6 -1
- package/src/layer/rasterLayer.ts +1 -2
- package/src/layer/tileProvider/staticGeojsonTileProvider.ts +1 -2
- package/src/layer/tmsLayer.ts +1 -2
- package/src/layer/vectorProperties.ts +7 -2
- package/src/layer/wfsLayer.ts +1 -2
- package/src/layer/wmtsLayer.ts +1 -2
- package/src/util/editor/createFeatureSession.ts +66 -1
- package/src/util/editor/editGeometrySession.ts +81 -8
- package/src/util/editor/editorHelpers.ts +26 -4
- package/src/util/editor/editorSessionHelpers.ts +28 -1
- package/src/util/editor/interactions/insertVertexInteraction.ts +5 -1
- package/src/util/editor/interactions/translateVertexInteraction.ts +3 -0
- package/src/util/featureconverter/pointToCesium.ts +1 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointToCesium.js","sourceRoot":"","sources":["../../../../src/util/featureconverter/pointToCesium.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,EACL,eAAe,EACf,cAAc,EACd,UAAU,EACV,UAAU,EACV,gBAAgB,GAKjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAc,MAAM,aAAa,CAAC;AAE/C,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAI1C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,mBAAmB,EACnB,aAAa,GACd,MAAM,6BAA6B,CAAC;AACrC,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,c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QAC/B,OAAO,KAAK,CAAC;KACd;IACD,MAAM,eAAe,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC;IACnD,IAAI,eAAe,IAAI,eAAe,CAAC,MAAM,IAAI,CAAC,EAAE;QAClD,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;KACjE;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oCAAoC,CAClD,WAAyB,EACzB,UAA4B;IAE5B,MAAM,cAAc,GAAG,IAAI,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACrD,MAAM,SAAS,GAAG,IAAI,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,WAAW,GACf,UAAU,CAAC,WAAW;QACtB,UAAU,CAAC,wBAAwB,CAAC,MAAM,CACxC,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE,CAAC,GAAG,GAAG,YAAY,EACzC,CAAC,CACF,CAAC;IACJ,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACnC,cAAc,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAChE,
|
|
1
|
+
{"version":3,"file":"pointToCesium.js","sourceRoot":"","sources":["../../../../src/util/featureconverter/pointToCesium.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,EACL,eAAe,EACf,cAAc,EACd,UAAU,EACV,UAAU,EACV,gBAAgB,GAKjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAc,MAAM,aAAa,CAAC;AAE/C,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAI1C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,mBAAmB,EACnB,aA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,QAAQ,EAAE,CAAC;YACvC,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,SAAS,CAAC,uBAAuB,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;SACnE;KACF;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -415,7 +415,7 @@ export function writeGeoJSONFeature(
|
|
|
415
415
|
coordinates.forEach((ring) => {
|
|
416
416
|
enforceEndingVertex(ring);
|
|
417
417
|
});
|
|
418
|
-
geometry.
|
|
418
|
+
geometry = new Polygon(coordinates, geometry.getLayout());
|
|
419
419
|
} else if (geometry instanceof MultiPolygon) {
|
|
420
420
|
const coordinates = geometry.getCoordinates();
|
|
421
421
|
coordinates.forEach((poly) => {
|
|
@@ -423,7 +423,7 @@ export function writeGeoJSONFeature(
|
|
|
423
423
|
enforceEndingVertex(ring);
|
|
424
424
|
});
|
|
425
425
|
});
|
|
426
|
-
geometry.
|
|
426
|
+
geometry = new MultiPolygon(coordinates, geometry.getLayout());
|
|
427
427
|
}
|
|
428
428
|
|
|
429
429
|
const geojsonGeometry = getFormat().writeGeometryObject(geometry, {
|
|
@@ -37,9 +37,10 @@ class GeoJSONLayer extends VectorLayer {
|
|
|
37
37
|
|
|
38
38
|
constructor(options: GeoJSONOptions) {
|
|
39
39
|
const defaultOptions = GeoJSONLayer.getDefaultOptions();
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
super({
|
|
41
|
+
projection: defaultOptions.projection,
|
|
42
|
+
...options,
|
|
43
|
+
});
|
|
43
44
|
this._featuresToLoad = options.features || defaultOptions.features;
|
|
44
45
|
}
|
|
45
46
|
|
package/src/layer/layer.ts
CHANGED
|
@@ -90,6 +90,7 @@ class Layer<
|
|
|
90
90
|
copyright: undefined,
|
|
91
91
|
datasourceId: undefined,
|
|
92
92
|
headers: undefined,
|
|
93
|
+
zIndex: 0,
|
|
93
94
|
};
|
|
94
95
|
}
|
|
95
96
|
|
|
@@ -189,7 +190,7 @@ class Layer<
|
|
|
189
190
|
|
|
190
191
|
this._url = options.url;
|
|
191
192
|
|
|
192
|
-
this._zIndex = parseInteger(options.zIndex,
|
|
193
|
+
this._zIndex = parseInteger(options.zIndex, defaultOptions.zIndex);
|
|
193
194
|
|
|
194
195
|
this.zIndexChanged = new VcsEvent();
|
|
195
196
|
|
|
@@ -689,6 +690,10 @@ class Layer<
|
|
|
689
690
|
config.headers = structuredClone(this._headers);
|
|
690
691
|
}
|
|
691
692
|
|
|
693
|
+
if (this._zIndex !== defaultOptions.zIndex) {
|
|
694
|
+
config.zIndex = this._zIndex;
|
|
695
|
+
}
|
|
696
|
+
|
|
692
697
|
return config;
|
|
693
698
|
}
|
|
694
699
|
|
package/src/layer/rasterLayer.ts
CHANGED
|
@@ -198,8 +198,7 @@ class RasterLayer<
|
|
|
198
198
|
* @param options
|
|
199
199
|
*/
|
|
200
200
|
constructor(options: RasterLayerOptions) {
|
|
201
|
-
|
|
202
|
-
super(options);
|
|
201
|
+
super({ url: '', ...options });
|
|
203
202
|
const defaultOptions = RasterLayer.getDefaultOptions();
|
|
204
203
|
this.extent = options.extent ? new Extent(options.extent) : new Extent();
|
|
205
204
|
this.tilingSchema = parseEnumValue(
|
|
@@ -29,8 +29,7 @@ class StaticGeoJSONTileProvider extends TileProvider {
|
|
|
29
29
|
|
|
30
30
|
constructor(options: StaticGeoJSONTileProviderOptions) {
|
|
31
31
|
const defaultOptions = StaticGeoJSONTileProvider.getDefaultOptions();
|
|
32
|
-
options
|
|
33
|
-
super(options);
|
|
32
|
+
super({ ...options, baseLevels: defaultOptions.baseLevels });
|
|
34
33
|
|
|
35
34
|
this.url = options.url || defaultOptions.url;
|
|
36
35
|
}
|
package/src/layer/tmsLayer.ts
CHANGED
|
@@ -44,8 +44,7 @@ class TMSLayer extends RasterLayer<TmsCesiumImpl | TmsOpenlayersImpl> {
|
|
|
44
44
|
|
|
45
45
|
constructor(options: TMSOptions) {
|
|
46
46
|
const defaultOptions = TMSLayer.getDefaultOptions();
|
|
47
|
-
|
|
48
|
-
super(options);
|
|
47
|
+
super({ tilingSchema: defaultOptions.tilingSchema, ...options });
|
|
49
48
|
|
|
50
49
|
this._supportedMaps = [OpenlayersMap.className, CesiumMap.className];
|
|
51
50
|
|
|
@@ -153,6 +153,11 @@ export type VectorPropertiesOptions = {
|
|
|
153
153
|
baseUrl?: string;
|
|
154
154
|
};
|
|
155
155
|
|
|
156
|
+
export type PropertyChangedKey = Exclude<
|
|
157
|
+
keyof VectorProperties,
|
|
158
|
+
'propertyChanged'
|
|
159
|
+
>;
|
|
160
|
+
|
|
156
161
|
export type VcsMeta = VectorPropertiesOptions & {
|
|
157
162
|
/**
|
|
158
163
|
* The version of the schema
|
|
@@ -387,7 +392,7 @@ class VectorProperties {
|
|
|
387
392
|
* Event raised when properties change. is passed an array of keys for the changed properties.
|
|
388
393
|
* @readonly
|
|
389
394
|
*/
|
|
390
|
-
readonly propertyChanged: VcsEvent<
|
|
395
|
+
readonly propertyChanged: VcsEvent<PropertyChangedKey[]>;
|
|
391
396
|
|
|
392
397
|
/**
|
|
393
398
|
* @param options
|
|
@@ -1028,7 +1033,7 @@ class VectorProperties {
|
|
|
1028
1033
|
*/
|
|
1029
1034
|
setValues(options: VectorPropertiesOptions): void {
|
|
1030
1035
|
const defaultValues = VectorProperties.getDefaultOptions();
|
|
1031
|
-
const changedProperties = [];
|
|
1036
|
+
const changedProperties: PropertyChangedKey[] = [];
|
|
1032
1037
|
// check if key exists in options, to also set undefined values
|
|
1033
1038
|
if ('altitudeMode' in options) {
|
|
1034
1039
|
const defaultAltitudeMode = parseEnumKey(
|
package/src/layer/wfsLayer.ts
CHANGED
|
@@ -65,8 +65,7 @@ class WFSLayer extends VectorLayer {
|
|
|
65
65
|
(proj.epsg as string).match(/\d+/)?.[0] as string
|
|
66
66
|
}`,
|
|
67
67
|
];
|
|
68
|
-
options
|
|
69
|
-
super(options);
|
|
68
|
+
super({ ...options, projection: proj });
|
|
70
69
|
|
|
71
70
|
this.featureType = Array.isArray(options.featureType)
|
|
72
71
|
? options.featureType
|
package/src/layer/wmtsLayer.ts
CHANGED
|
@@ -106,8 +106,7 @@ class WMTSLayer extends RasterLayer<WmtsCesiumImpl | WmtsOpenlayersImpl> {
|
|
|
106
106
|
|
|
107
107
|
constructor(options: WMTSOptions) {
|
|
108
108
|
const defaultOptions = WMTSLayer.getDefaultOptions();
|
|
109
|
-
|
|
110
|
-
super(options);
|
|
109
|
+
super({ tilingSchema: defaultOptions.tilingSchema, ...options });
|
|
111
110
|
|
|
112
111
|
this._supportedMaps = [OpenlayersMap.className, CesiumMap.className];
|
|
113
112
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { check, ofEnum } from '@vcsuite/check';
|
|
2
2
|
import { Feature } from 'ol';
|
|
3
3
|
import type { Geometry } from 'ol/geom.js';
|
|
4
|
+
import { unByKey } from 'ol/Observable.js';
|
|
4
5
|
import VcsEvent from '../../vcsEvent.js';
|
|
5
6
|
import {
|
|
7
|
+
createPickingBehavior,
|
|
6
8
|
EditorSession,
|
|
7
9
|
GeometryToType,
|
|
8
10
|
GeometryType,
|
|
@@ -20,10 +22,12 @@ import { createSync } from '../../layer/vectorSymbols.js';
|
|
|
20
22
|
import geometryIsValid from './validateGeoemetry.js';
|
|
21
23
|
import ObliqueMap from '../../map/obliqueMap.js';
|
|
22
24
|
import { cursorMap } from './interactions/editGeometryMouseOverInteraction.js';
|
|
25
|
+
import { AltitudeModeType } from '../../layer/vectorProperties.js';
|
|
23
26
|
|
|
24
27
|
export type CreateFeatureSession<T extends GeometryType> =
|
|
25
28
|
EditorSession<SessionType.CREATE> & {
|
|
26
29
|
geometryType: T;
|
|
30
|
+
featureAltitudeMode: AltitudeModeType | undefined;
|
|
27
31
|
featureCreated: VcsEvent<Feature<GeometryToType<T>>>;
|
|
28
32
|
creationFinished: VcsEvent<Feature<GeometryToType<T>> | null>;
|
|
29
33
|
finish(): void;
|
|
@@ -86,12 +90,14 @@ export interface CreateInteraction<T extends Geometry> {
|
|
|
86
90
|
* @param app
|
|
87
91
|
* @param layer
|
|
88
92
|
* @param geometryType
|
|
93
|
+
* @param initialAltitudeMode - whether to use the layers altitude mode or set this on the feature
|
|
89
94
|
* @group Editor
|
|
90
95
|
*/
|
|
91
96
|
function startCreateFeatureSession<T extends GeometryType>(
|
|
92
97
|
app: VcsApp,
|
|
93
98
|
layer: VectorLayer,
|
|
94
99
|
geometryType: T,
|
|
100
|
+
initialAltitudeMode?: AltitudeModeType,
|
|
95
101
|
): CreateFeatureSession<T> {
|
|
96
102
|
check(app, VcsApp);
|
|
97
103
|
check(layer, VectorLayer);
|
|
@@ -116,8 +122,31 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
116
122
|
*/
|
|
117
123
|
let isOblique = false;
|
|
118
124
|
|
|
125
|
+
let featureAltitudeMode = initialAltitudeMode;
|
|
126
|
+
const pickingBehavior = createPickingBehavior(app);
|
|
127
|
+
|
|
128
|
+
const altitudeModeChanged = (): void => {
|
|
129
|
+
const altitudeModeFeature =
|
|
130
|
+
currentFeature ?? new Feature({ olcs_altitudeMode: featureAltitudeMode });
|
|
131
|
+
const altitudeModeInUse =
|
|
132
|
+
layer.vectorProperties.getAltitudeMode(altitudeModeFeature);
|
|
133
|
+
|
|
134
|
+
pickingBehavior.setForAltitudeMode(altitudeModeInUse);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const vectorPropertiesListener =
|
|
138
|
+
layer.vectorProperties.propertyChanged.addEventListener((properties) => {
|
|
139
|
+
if (properties.includes('altitudeMode') && !featureAltitudeMode) {
|
|
140
|
+
altitudeModeChanged();
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
altitudeModeChanged();
|
|
145
|
+
|
|
146
|
+
let currentFeatureListener = (): void => {};
|
|
119
147
|
let interactionListeners: (() => void)[] = [];
|
|
120
148
|
const destroyCurrentInteraction = (): void => {
|
|
149
|
+
currentFeatureListener();
|
|
121
150
|
if (currentInteraction) {
|
|
122
151
|
interactionChain.removeInteraction(currentInteraction);
|
|
123
152
|
currentInteraction.destroy();
|
|
@@ -142,6 +171,20 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
142
171
|
GeometryToType<T>
|
|
143
172
|
>;
|
|
144
173
|
currentFeature[createSync] = true;
|
|
174
|
+
if (featureAltitudeMode) {
|
|
175
|
+
currentFeature.set('olcs_altitudeMode', featureAltitudeMode);
|
|
176
|
+
}
|
|
177
|
+
const propChangeListener = currentFeature.on(
|
|
178
|
+
'propertychange',
|
|
179
|
+
(event) => {
|
|
180
|
+
if (event.key === 'olcs_altitudeMode') {
|
|
181
|
+
altitudeModeChanged();
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
);
|
|
185
|
+
currentFeatureListener = (): void => {
|
|
186
|
+
unByKey(propChangeListener);
|
|
187
|
+
};
|
|
145
188
|
layer.addFeatures([currentFeature]);
|
|
146
189
|
featureCreated.raiseEvent(currentFeature);
|
|
147
190
|
}),
|
|
@@ -161,8 +204,9 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
161
204
|
]);
|
|
162
205
|
currentFeature = null;
|
|
163
206
|
}
|
|
207
|
+
currentFeatureListener();
|
|
164
208
|
}
|
|
165
|
-
|
|
209
|
+
altitudeModeChanged();
|
|
166
210
|
creationFinished.raiseEvent(currentFeature);
|
|
167
211
|
currentFeature = null;
|
|
168
212
|
if (!isStopped) {
|
|
@@ -218,6 +262,10 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
218
262
|
}
|
|
219
263
|
destroyCurrentInteraction();
|
|
220
264
|
destroyInteractionChain();
|
|
265
|
+
currentFeatureListener();
|
|
266
|
+
vectorPropertiesListener();
|
|
267
|
+
pickingBehavior.reset();
|
|
268
|
+
|
|
221
269
|
stopped.raiseEvent();
|
|
222
270
|
stopped.destroy();
|
|
223
271
|
featureCreated.destroy();
|
|
@@ -227,6 +275,23 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
227
275
|
return {
|
|
228
276
|
type: SessionType.CREATE,
|
|
229
277
|
geometryType,
|
|
278
|
+
get featureAltitudeMode(): AltitudeModeType | undefined {
|
|
279
|
+
return featureAltitudeMode;
|
|
280
|
+
},
|
|
281
|
+
set featureAltitudeMode(value) {
|
|
282
|
+
if (featureAltitudeMode !== value) {
|
|
283
|
+
featureAltitudeMode = value;
|
|
284
|
+
if (currentFeature) {
|
|
285
|
+
if (featureAltitudeMode) {
|
|
286
|
+
currentFeature.set('olcs_altitudeMode', featureAltitudeMode);
|
|
287
|
+
} else {
|
|
288
|
+
currentFeature.unset('olcs_altitudeMode');
|
|
289
|
+
}
|
|
290
|
+
} else {
|
|
291
|
+
altitudeModeChanged();
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
},
|
|
230
295
|
featureCreated,
|
|
231
296
|
creationFinished,
|
|
232
297
|
stopped,
|
|
@@ -11,6 +11,7 @@ import type {
|
|
|
11
11
|
} from 'ol/geom.js';
|
|
12
12
|
import { EventsKey } from 'ol/events.js';
|
|
13
13
|
import {
|
|
14
|
+
createPickingBehavior,
|
|
14
15
|
EditorSession,
|
|
15
16
|
GeometryType,
|
|
16
17
|
SessionType,
|
|
@@ -21,7 +22,12 @@ import InteractionChain from '../../interaction/interactionChain.js';
|
|
|
21
22
|
import VcsEvent from '../../vcsEvent.js';
|
|
22
23
|
import TranslateVertexInteraction from './interactions/translateVertexInteraction.js';
|
|
23
24
|
import RemoveVertexInteraction from './interactions/removeVertexInteraction.js';
|
|
24
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
createVertex,
|
|
27
|
+
geometryChangeKeys,
|
|
28
|
+
getOlcsPropsFromFeature,
|
|
29
|
+
vectorPropertyChangeKeys,
|
|
30
|
+
} from './editorHelpers.js';
|
|
25
31
|
import InsertVertexInteraction from './interactions/insertVertexInteraction.js';
|
|
26
32
|
import EditGeometryMouseOverInteraction from './interactions/editGeometryMouseOverInteraction.js';
|
|
27
33
|
import { cartesian2DDistance, modulo } from '../math.js';
|
|
@@ -30,9 +36,14 @@ import geometryIsValid from './validateGeoemetry.js';
|
|
|
30
36
|
import MapInteractionController from './interactions/mapInteractionController.js';
|
|
31
37
|
import type VectorLayer from '../../layer/vectorLayer.js';
|
|
32
38
|
import type VcsApp from '../../vcsApp.js';
|
|
39
|
+
import type {
|
|
40
|
+
// eslint-disable-next-line import/no-named-default
|
|
41
|
+
default as VectorProperties,
|
|
42
|
+
PropertyChangedKey,
|
|
43
|
+
} from '../../layer/vectorProperties.js';
|
|
33
44
|
|
|
34
45
|
export type EditGeometrySession = EditorSession<SessionType.EDIT_GEOMETRY> & {
|
|
35
|
-
setFeature(feature
|
|
46
|
+
setFeature(feature?: Feature): void;
|
|
36
47
|
feature: Feature | null;
|
|
37
48
|
};
|
|
38
49
|
|
|
@@ -41,6 +52,13 @@ type EditGeometryInteraction = {
|
|
|
41
52
|
destroy(): void;
|
|
42
53
|
};
|
|
43
54
|
|
|
55
|
+
function assignVectorProperty<
|
|
56
|
+
K extends PropertyChangedKey,
|
|
57
|
+
V extends VectorProperties[K],
|
|
58
|
+
>(props: VectorProperties, key: K, value: V): void {
|
|
59
|
+
props[key] = value;
|
|
60
|
+
}
|
|
61
|
+
|
|
44
62
|
/**
|
|
45
63
|
* Create the editing interaction for a feature with a line geometry
|
|
46
64
|
* @param feature
|
|
@@ -53,7 +71,10 @@ function createEditLineStringGeometryInteraction(
|
|
|
53
71
|
): EditGeometryInteraction {
|
|
54
72
|
const geometry =
|
|
55
73
|
feature[obliqueGeometry] ?? (feature.getGeometry() as LineString);
|
|
56
|
-
const
|
|
74
|
+
const olcsProps = getOlcsPropsFromFeature(feature);
|
|
75
|
+
const vertices = geometry
|
|
76
|
+
.getCoordinates()
|
|
77
|
+
.map((c) => createVertex(c, olcsProps));
|
|
57
78
|
scratchLayer.addFeatures(vertices);
|
|
58
79
|
const resetGeometry = (): void => {
|
|
59
80
|
geometry.setCoordinates(
|
|
@@ -103,7 +124,10 @@ function createEditCircleGeometryInteraction(
|
|
|
103
124
|
): EditGeometryInteraction {
|
|
104
125
|
const geometry =
|
|
105
126
|
feature[obliqueGeometry] ?? (feature.getGeometry() as Circle);
|
|
106
|
-
const
|
|
127
|
+
const olcsProps = getOlcsPropsFromFeature(feature);
|
|
128
|
+
const vertices = geometry
|
|
129
|
+
.getCoordinates()
|
|
130
|
+
.map((c) => createVertex(c, olcsProps));
|
|
107
131
|
scratchLayer.addFeatures(vertices);
|
|
108
132
|
|
|
109
133
|
const translateVertex = new TranslateVertexInteraction();
|
|
@@ -150,7 +174,11 @@ function createEditBBoxGeometryInteraction(
|
|
|
150
174
|
): EditGeometryInteraction {
|
|
151
175
|
const geometry =
|
|
152
176
|
feature[obliqueGeometry] ?? (feature.getGeometry() as Polygon);
|
|
153
|
-
const
|
|
177
|
+
const olcsProps = getOlcsPropsFromFeature(feature);
|
|
178
|
+
const vertices = geometry
|
|
179
|
+
.getCoordinates()[0]
|
|
180
|
+
.map((c) => createVertex(c, olcsProps));
|
|
181
|
+
|
|
154
182
|
scratchLayer.addFeatures(vertices);
|
|
155
183
|
let suspend = false;
|
|
156
184
|
const translateVertex = new TranslateVertexInteraction();
|
|
@@ -226,7 +254,11 @@ function createEditSimplePolygonInteraction(
|
|
|
226
254
|
const geometry =
|
|
227
255
|
feature[obliqueGeometry] ?? (feature.getGeometry() as Polygon);
|
|
228
256
|
const linearRing = geometry.getLinearRing(0) as LinearRing;
|
|
229
|
-
const
|
|
257
|
+
const olcsProps = getOlcsPropsFromFeature(feature);
|
|
258
|
+
|
|
259
|
+
const vertices = linearRing
|
|
260
|
+
.getCoordinates()
|
|
261
|
+
.map((c) => createVertex(c, olcsProps));
|
|
230
262
|
scratchLayer.addFeatures(vertices);
|
|
231
263
|
const resetGeometry = (): void => {
|
|
232
264
|
const coordinates = vertices.map((f) => f.getGeometry()!.getCoordinates());
|
|
@@ -279,7 +311,9 @@ function createEditPointInteraction(
|
|
|
279
311
|
layer: VectorLayer,
|
|
280
312
|
): EditGeometryInteraction {
|
|
281
313
|
const geometry = feature[obliqueGeometry] ?? (feature.getGeometry() as Point);
|
|
282
|
-
const
|
|
314
|
+
const olcsProps = getOlcsPropsFromFeature(feature);
|
|
315
|
+
|
|
316
|
+
const vertex = createVertex(geometry.getCoordinates(), olcsProps);
|
|
283
317
|
const featureIdArray = [feature.getId() as string];
|
|
284
318
|
layer.featureVisibility.hideObjects(featureIdArray);
|
|
285
319
|
vertex[createSync] = true;
|
|
@@ -345,6 +379,38 @@ function startEditGeometrySession(
|
|
|
345
379
|
*/
|
|
346
380
|
let currentFeature: Feature | null = null;
|
|
347
381
|
|
|
382
|
+
const pickingBehavior = createPickingBehavior(app);
|
|
383
|
+
const altitudeModeChanged = (): void => {
|
|
384
|
+
const altitudeMode = currentFeature
|
|
385
|
+
? layer.vectorProperties.getAltitudeMode(currentFeature)
|
|
386
|
+
: layer.vectorProperties.altitudeMode;
|
|
387
|
+
pickingBehavior.setForAltitudeMode(altitudeMode);
|
|
388
|
+
};
|
|
389
|
+
altitudeModeChanged();
|
|
390
|
+
vectorPropertyChangeKeys.forEach((key) => {
|
|
391
|
+
assignVectorProperty(
|
|
392
|
+
scratchLayer.vectorProperties,
|
|
393
|
+
key,
|
|
394
|
+
layer.vectorProperties[key],
|
|
395
|
+
);
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
const vectorPropertiesChangedListener =
|
|
399
|
+
layer.vectorProperties.propertyChanged.addEventListener((props) => {
|
|
400
|
+
vectorPropertyChangeKeys.forEach((key) => {
|
|
401
|
+
if (props.includes(key)) {
|
|
402
|
+
assignVectorProperty(
|
|
403
|
+
scratchLayer.vectorProperties,
|
|
404
|
+
key,
|
|
405
|
+
layer.vectorProperties[key],
|
|
406
|
+
);
|
|
407
|
+
if (key === 'altitudeMode') {
|
|
408
|
+
altitudeModeChanged();
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
|
|
348
414
|
const destroyCurrentInteractionSet = (): void => {
|
|
349
415
|
if (currentInteractionSet) {
|
|
350
416
|
interactionChain.removeInteraction(
|
|
@@ -359,8 +425,10 @@ function startEditGeometrySession(
|
|
|
359
425
|
if (!geometryIsValid(currentFeature.getGeometry())) {
|
|
360
426
|
layer.removeFeaturesById([currentFeature.getId() as string | number]);
|
|
361
427
|
}
|
|
428
|
+
currentFeature.unset('olcs_allowPicking');
|
|
362
429
|
}
|
|
363
430
|
currentFeature = null;
|
|
431
|
+
altitudeModeChanged();
|
|
364
432
|
};
|
|
365
433
|
|
|
366
434
|
let featureListener: EventsKey | undefined;
|
|
@@ -374,6 +442,7 @@ function startEditGeometrySession(
|
|
|
374
442
|
if (featureListener) {
|
|
375
443
|
unByKey(featureListener);
|
|
376
444
|
}
|
|
445
|
+
|
|
377
446
|
if (feature) {
|
|
378
447
|
featureListener = feature.on('propertychange', ({ key }) => {
|
|
379
448
|
if (geometryChangeKeys.includes(key)) {
|
|
@@ -419,6 +488,8 @@ function startEditGeometrySession(
|
|
|
419
488
|
|
|
420
489
|
if (currentInteractionSet) {
|
|
421
490
|
interactionChain.addInteraction(currentInteractionSet.interactionChain);
|
|
491
|
+
currentFeature.set('olcs_allowPicking', false);
|
|
492
|
+
altitudeModeChanged();
|
|
422
493
|
} else {
|
|
423
494
|
getLogger('EditGeometrySession').warning(
|
|
424
495
|
`Geometry of type ${geometryType} is currently not supported`,
|
|
@@ -448,6 +519,8 @@ function startEditGeometrySession(
|
|
|
448
519
|
mouseOverInteraction.reset();
|
|
449
520
|
destroyCurrentInteractionSet();
|
|
450
521
|
destroyInteractionChain();
|
|
522
|
+
vectorPropertiesChangedListener();
|
|
523
|
+
pickingBehavior.reset();
|
|
451
524
|
stopped.raiseEvent();
|
|
452
525
|
stopped.destroy();
|
|
453
526
|
};
|
|
@@ -457,7 +530,7 @@ function startEditGeometrySession(
|
|
|
457
530
|
type: SessionType.EDIT_GEOMETRY,
|
|
458
531
|
stopped,
|
|
459
532
|
stop,
|
|
460
|
-
setFeature(feature
|
|
533
|
+
setFeature(feature?: Feature): void {
|
|
461
534
|
createCurrentInteractionSet(feature);
|
|
462
535
|
},
|
|
463
536
|
get feature(): Feature | null {
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
} from '../../layer/vectorSymbols.js';
|
|
29
29
|
import type VectorLayer from '../../layer/vectorLayer.js';
|
|
30
30
|
import type VcsMap from '../../map/vcsMap.js';
|
|
31
|
+
import { PropertyChangedKey } from '../../layer/vectorProperties.js';
|
|
31
32
|
|
|
32
33
|
export type Vertex = Feature<Point>;
|
|
33
34
|
|
|
@@ -46,14 +47,35 @@ export const geometryChangeKeys = [
|
|
|
46
47
|
'olcs_heightAboveGround',
|
|
47
48
|
];
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
export const vectorPropertyChangeKeys: PropertyChangedKey[] = [
|
|
51
|
+
'altitudeMode',
|
|
52
|
+
'groundLevel',
|
|
53
|
+
'heightAboveGround',
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
export function getOlcsPropsFromFeature(
|
|
57
|
+
feature: Feature,
|
|
58
|
+
): Record<string, number | string> {
|
|
59
|
+
const props: Record<string, number> = {};
|
|
60
|
+
geometryChangeKeys.forEach((key) => {
|
|
61
|
+
const value = feature.get(key) as number | undefined;
|
|
62
|
+
if (value != null) {
|
|
63
|
+
props[key] = value;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
return props;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function createVertex(
|
|
71
|
+
coordinate: Coordinate,
|
|
72
|
+
olcsProps: Record<string, number | string>,
|
|
73
|
+
): Vertex {
|
|
53
74
|
const geometry = new Point(coordinate);
|
|
54
75
|
geometry[alreadyTransformedToImage] = true;
|
|
55
76
|
const vertex = new Feature({
|
|
56
77
|
geometry,
|
|
78
|
+
...olcsProps,
|
|
57
79
|
});
|
|
58
80
|
vertex[vertexSymbol] = true;
|
|
59
81
|
vertex[doNotTransform] = true;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Point, Polygon, Circle, LineString } from 'ol/geom.js';
|
|
2
|
+
import { HeightReference } from '@vcmap-cesium/engine';
|
|
2
3
|
import VectorLayer from '../../layer/vectorLayer.js';
|
|
3
4
|
import { mercatorProjection } from '../projection.js';
|
|
4
5
|
import InteractionChain from '../../interaction/interactionChain.js';
|
|
@@ -8,6 +9,7 @@ import LayerCollection, { maxZIndex } from '../layerCollection.js';
|
|
|
8
9
|
import { markVolatile } from '../../vcsModule.js';
|
|
9
10
|
import { PrimitiveOptionsType } from '../../layer/vectorProperties.js';
|
|
10
11
|
import EventHandler from '../../interaction/eventHandler.js';
|
|
12
|
+
import type VcsApp from '../../vcsApp.js';
|
|
11
13
|
|
|
12
14
|
export enum SessionType {
|
|
13
15
|
CREATE = 'create',
|
|
@@ -100,7 +102,7 @@ export function setupInteractionChain(
|
|
|
100
102
|
);
|
|
101
103
|
const currentFeatureInteractionEvent = eventHandler.featureInteraction.active;
|
|
102
104
|
eventHandler.featureInteraction.setActive(
|
|
103
|
-
EventType.CLICKMOVE | EventType.
|
|
105
|
+
EventType.CLICKMOVE | EventType.DRAGEVENTS,
|
|
104
106
|
);
|
|
105
107
|
|
|
106
108
|
return {
|
|
@@ -135,3 +137,28 @@ export type GeometryToType<T extends GeometryType> =
|
|
|
135
137
|
: T extends GeometryType.Circle
|
|
136
138
|
? Circle
|
|
137
139
|
: never;
|
|
140
|
+
|
|
141
|
+
export type PickingBehavior = {
|
|
142
|
+
setForAltitudeMode(altitudeMode: HeightReference): void;
|
|
143
|
+
reset(): void;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export function createPickingBehavior(app: VcsApp): PickingBehavior {
|
|
147
|
+
const initialPickPosition =
|
|
148
|
+
app.maps.eventHandler.featureInteraction.pickPosition;
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
setForAltitudeMode(altitudeMode: HeightReference): void {
|
|
152
|
+
if (altitudeMode === HeightReference.NONE) {
|
|
153
|
+
app.maps.eventHandler.featureInteraction.pickPosition =
|
|
154
|
+
EventType.CLICKMOVE | EventType.DRAGEVENTS;
|
|
155
|
+
} else {
|
|
156
|
+
app.maps.eventHandler.featureInteraction.pickPosition = EventType.NONE;
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
reset(): void {
|
|
160
|
+
app.maps.eventHandler.featureInteraction.pickPosition =
|
|
161
|
+
initialPickPosition;
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import { cartesian2DDistance } from '../../math.js';
|
|
11
11
|
import {
|
|
12
12
|
createVertex,
|
|
13
|
+
getOlcsPropsFromFeature,
|
|
13
14
|
pointOnLine2D,
|
|
14
15
|
pointOnLine3D,
|
|
15
16
|
type Vertex,
|
|
@@ -74,7 +75,10 @@ class InsertVertexInteraction extends AbstractInteraction {
|
|
|
74
75
|
index = 0;
|
|
75
76
|
}
|
|
76
77
|
this.vertexInserted.raiseEvent({
|
|
77
|
-
vertex: createVertex(
|
|
78
|
+
vertex: createVertex(
|
|
79
|
+
closestCoord,
|
|
80
|
+
getOlcsPropsFromFeature(this._feature),
|
|
81
|
+
),
|
|
78
82
|
index,
|
|
79
83
|
});
|
|
80
84
|
}
|
|
@@ -5,6 +5,7 @@ import { EventType } from '../../../interaction/interactionType.js';
|
|
|
5
5
|
import { vertexSymbol } from '../editorSymbols.js';
|
|
6
6
|
import VcsEvent from '../../../vcsEvent.js';
|
|
7
7
|
import { Vertex } from '../editorHelpers.js';
|
|
8
|
+
import { emptyStyle } from '../../../style/styleHelpers.js';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Class to translate a vertex. Will call the passed in vertex changed event with the changed vertex.
|
|
@@ -27,6 +28,7 @@ class TranslateVertexInteraction extends AbstractInteraction {
|
|
|
27
28
|
|
|
28
29
|
if (event.type & EventType.DRAGEND) {
|
|
29
30
|
this._vertex.unset('olcs_allowPicking');
|
|
31
|
+
this._vertex.setStyle(undefined);
|
|
30
32
|
this._vertex = null;
|
|
31
33
|
}
|
|
32
34
|
event.stopPropagation = true;
|
|
@@ -37,6 +39,7 @@ class TranslateVertexInteraction extends AbstractInteraction {
|
|
|
37
39
|
) {
|
|
38
40
|
this._vertex = event.feature as Vertex;
|
|
39
41
|
this._vertex.set('olcs_allowPicking', false);
|
|
42
|
+
this._vertex.setStyle(emptyStyle);
|
|
40
43
|
event.stopPropagation = true;
|
|
41
44
|
}
|
|
42
45
|
return Promise.resolve(event);
|