@vcmap/core 6.0.0-rc.8 → 6.0.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 +4 -1
- package/dist/cesium.d.ts +117 -0
- package/dist/index.d.ts +14 -6
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/ol.d.ts +1 -0
- package/dist/src/cesium/cesium3DTileFeature.d.ts +2 -1
- package/dist/src/cesium/cesium3DTileFeature.js +13 -1
- package/dist/src/cesium/cesium3DTileFeature.js.map +1 -1
- package/dist/src/cesium/cesium3DTilePointFeature.js +2 -0
- package/dist/src/cesium/cesium3DTilePointFeature.js.map +1 -1
- package/dist/src/cesium/entity.js +3 -0
- package/dist/src/cesium/entity.js.map +1 -1
- package/dist/src/interaction/featureAtPixelInteraction.d.ts +4 -12
- package/dist/src/interaction/featureAtPixelInteraction.js +6 -27
- package/dist/src/interaction/featureAtPixelInteraction.js.map +1 -1
- package/dist/src/layer/cesium/openStreetMapCesiumImpl.js +2 -4
- package/dist/src/layer/cesium/openStreetMapCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/rasterLayerCesiumImpl.d.ts +4 -0
- package/dist/src/layer/cesium/rasterLayerCesiumImpl.js +15 -0
- package/dist/src/layer/cesium/rasterLayerCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/singleImageCesiumImpl.js +2 -6
- package/dist/src/layer/cesium/singleImageCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/terrainCesiumImpl.js +3 -0
- package/dist/src/layer/cesium/terrainCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/tmsCesiumImpl.js +1 -4
- package/dist/src/layer/cesium/tmsCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vcsTile/vcsChildTile.d.ts +12 -0
- package/dist/src/layer/cesium/vcsTile/vcsChildTile.js +18 -0
- package/dist/src/layer/cesium/vcsTile/vcsChildTile.js.map +1 -0
- package/dist/src/layer/cesium/vcsTile/vcsDebugTile.d.ts +21 -0
- package/dist/src/layer/cesium/vcsTile/vcsDebugTile.js +89 -0
- package/dist/src/layer/cesium/vcsTile/vcsDebugTile.js.map +1 -0
- package/dist/src/layer/cesium/vcsTile/vcsNoDataTile.d.ts +11 -0
- package/dist/src/layer/cesium/vcsTile/vcsNoDataTile.js +17 -0
- package/dist/src/layer/cesium/vcsTile/vcsNoDataTile.js.map +1 -0
- package/dist/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.d.ts +39 -0
- package/dist/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.js +192 -0
- package/dist/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.js.map +1 -0
- package/dist/src/layer/cesium/vcsTile/vcsTileHelpers.d.ts +52 -0
- package/dist/src/layer/cesium/vcsTile/vcsTileHelpers.js +73 -0
- package/dist/src/layer/cesium/vcsTile/vcsTileHelpers.js.map +1 -0
- package/dist/src/layer/cesium/vcsTile/vcsVectorTile.d.ts +23 -0
- package/dist/src/layer/cesium/vcsTile/vcsVectorTile.js +87 -0
- package/dist/src/layer/cesium/vcsTile/vcsVectorTile.js.map +1 -0
- package/dist/src/layer/cesium/vectorCesiumImpl.js +3 -3
- package/dist/src/layer/cesium/vectorCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vectorContext.js +79 -14
- package/dist/src/layer/cesium/vectorContext.js.map +1 -1
- package/dist/src/layer/cesium/vectorTileCesiumImpl.d.ts +19 -0
- package/dist/src/layer/cesium/vectorTileCesiumImpl.js +63 -0
- package/dist/src/layer/cesium/vectorTileCesiumImpl.js.map +1 -0
- package/dist/src/layer/cesium/wmsCesiumImpl.js +1 -4
- package/dist/src/layer/cesium/wmsCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/wmtsCesiumImpl.js +1 -4
- package/dist/src/layer/cesium/wmtsCesiumImpl.js.map +1 -1
- package/dist/src/layer/layer.d.ts +5 -0
- package/dist/src/layer/layer.js +5 -0
- package/dist/src/layer/layer.js.map +1 -1
- package/dist/src/layer/openStreetMapLayer.d.ts +32 -2
- package/dist/src/layer/openStreetMapLayer.js +35 -1
- package/dist/src/layer/openStreetMapLayer.js.map +1 -1
- package/dist/src/layer/openlayers/openStreetMapOpenlayersImpl.js +2 -0
- package/dist/src/layer/openlayers/openStreetMapOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/rasterLayerOpenlayersImpl.d.ts +2 -0
- package/dist/src/layer/openlayers/rasterLayerOpenlayersImpl.js +4 -0
- package/dist/src/layer/openlayers/rasterLayerOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/singleImageOpenlayersImpl.js +2 -0
- package/dist/src/layer/openlayers/singleImageOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/tmsOpenlayersImpl.js +2 -0
- package/dist/src/layer/openlayers/tmsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.d.ts +1 -7
- package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.js +3 -35
- package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/wmsOpenlayersImpl.js +4 -0
- package/dist/src/layer/openlayers/wmsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/wmtsOpenlayersImpl.js +2 -0
- package/dist/src/layer/openlayers/wmtsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/pointCloudLayer.d.ts +0 -1
- package/dist/src/layer/pointCloudLayer.js +2 -3
- package/dist/src/layer/pointCloudLayer.js.map +1 -1
- package/dist/src/layer/rasterLayer.d.ts +44 -3
- package/dist/src/layer/rasterLayer.js +43 -0
- package/dist/src/layer/rasterLayer.js.map +1 -1
- package/dist/src/layer/tileProvider/mvtTileProvider.d.ts +0 -5
- package/dist/src/layer/tileProvider/mvtTileProvider.js +0 -12
- package/dist/src/layer/tileProvider/mvtTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/staticFeatureTileProvider.d.ts +14 -0
- package/dist/src/layer/tileProvider/staticFeatureTileProvider.js +44 -0
- package/dist/src/layer/tileProvider/staticFeatureTileProvider.js.map +1 -0
- package/dist/src/layer/tileProvider/tileProvider.d.ts +8 -2
- package/dist/src/layer/tileProvider/tileProvider.js +17 -1
- package/dist/src/layer/tileProvider/tileProvider.js.map +1 -1
- package/dist/src/layer/vectorLayer.d.ts +1 -1
- package/dist/src/layer/vectorLayer.js.map +1 -1
- package/dist/src/layer/vectorTileLayer.d.ts +13 -3
- package/dist/src/layer/vectorTileLayer.js +43 -13
- package/dist/src/layer/vectorTileLayer.js.map +1 -1
- package/dist/src/map/cesiumMap.d.ts +8 -1
- package/dist/src/map/cesiumMap.js +17 -6
- package/dist/src/map/cesiumMap.js.map +1 -1
- package/dist/src/ol/feature.js +7 -0
- package/dist/src/ol/feature.js.map +1 -1
- package/dist/src/style/declarativeStyleItem.js +2 -68
- package/dist/src/style/declarativeStyleItem.js.map +1 -1
- package/dist/src/util/displayQuality/displayQuality.d.ts +1 -0
- package/dist/src/util/displayQuality/displayQuality.js +12 -1
- package/dist/src/util/displayQuality/displayQuality.js.map +1 -1
- package/dist/src/util/editor/createFeatureSession.d.ts +8 -4
- package/dist/src/util/editor/createFeatureSession.js +35 -11
- package/dist/src/util/editor/createFeatureSession.js.map +1 -1
- package/dist/src/util/editor/editGeometrySession.d.ts +2 -1
- package/dist/src/util/editor/editGeometrySession.js +33 -12
- package/dist/src/util/editor/editGeometrySession.js.map +1 -1
- package/dist/src/util/editor/editorHelpers.d.ts +1 -0
- package/dist/src/util/editor/editorHelpers.js +6 -0
- package/dist/src/util/editor/editorHelpers.js.map +1 -1
- package/dist/src/util/editor/editorSessionHelpers.d.ts +1 -6
- package/dist/src/util/editor/editorSessionHelpers.js +5 -16
- package/dist/src/util/editor/editorSessionHelpers.js.map +1 -1
- package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.js +3 -2
- package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/removeVertexInteraction.d.ts +1 -1
- package/dist/src/util/editor/interactions/removeVertexInteraction.js +2 -2
- package/dist/src/util/editor/interactions/removeVertexInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/segmentLengthInteraction.d.ts +16 -0
- package/dist/src/util/editor/interactions/segmentLengthInteraction.js +167 -0
- package/dist/src/util/editor/interactions/segmentLengthInteraction.js.map +1 -0
- package/dist/src/util/editor/interactions/translateVertexInteraction.js +2 -6
- package/dist/src/util/editor/interactions/translateVertexInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/translationSnapping.js +3 -2
- package/dist/src/util/editor/interactions/translationSnapping.js.map +1 -1
- package/dist/src/util/featureconverter/clampedPrimitive.d.ts +2 -2
- package/dist/src/util/featureconverter/clampedPrimitive.js +24 -2
- package/dist/src/util/featureconverter/clampedPrimitive.js.map +1 -1
- package/dist/src/util/featureconverter/convert.js +12 -3
- package/dist/src/util/featureconverter/convert.js.map +1 -1
- package/dist/src/util/geometryHelpers.d.ts +9 -1
- package/dist/src/util/geometryHelpers.js +54 -4
- package/dist/src/util/geometryHelpers.js.map +1 -1
- package/dist/src/util/math.d.ts +12 -0
- package/dist/src/util/math.js +21 -0
- package/dist/src/util/math.js.map +1 -1
- package/dist/src/util/projection.js +1 -1
- package/dist/src/util/projection.js.map +1 -1
- package/dist/tests/unit/helpers/cesiumHelpers.d.ts +2 -2
- package/dist/tests/unit/helpers/cesiumHelpers.js +2 -1
- package/dist/tests/unit/helpers/cesiumHelpers.js.map +1 -1
- package/index.ts +26 -2
- package/package.json +3 -3
- package/src/cesium/cesium.d.ts +117 -0
- package/src/cesium/cesium3DTileFeature.ts +20 -1
- package/src/cesium/cesium3DTilePointFeature.ts +3 -0
- package/src/cesium/entity.ts +7 -0
- package/src/interaction/featureAtPixelInteraction.ts +8 -39
- package/src/layer/cesium/openStreetMapCesiumImpl.ts +2 -4
- package/src/layer/cesium/rasterLayerCesiumImpl.ts +19 -0
- package/src/layer/cesium/singleImageCesiumImpl.ts +2 -6
- package/src/layer/cesium/terrainCesiumImpl.ts +3 -0
- package/src/layer/cesium/tmsCesiumImpl.ts +1 -4
- package/src/layer/cesium/vcsTile/vcsChildTile.ts +31 -0
- package/src/layer/cesium/vcsTile/vcsDebugTile.ts +154 -0
- package/src/layer/cesium/vcsTile/vcsNoDataTile.ts +30 -0
- package/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.ts +290 -0
- package/src/layer/cesium/vcsTile/vcsTileHelpers.ts +134 -0
- package/src/layer/cesium/vcsTile/vcsVectorTile.ts +149 -0
- package/src/layer/cesium/vectorCesiumImpl.ts +3 -3
- package/src/layer/cesium/vectorContext.ts +124 -18
- package/src/layer/cesium/vectorTileCesiumImpl.ts +91 -0
- package/src/layer/cesium/wmsCesiumImpl.ts +1 -4
- package/src/layer/cesium/wmtsCesiumImpl.ts +1 -4
- package/src/layer/layer.ts +5 -0
- package/src/layer/openStreetMapLayer.ts +64 -2
- package/src/layer/openlayers/openStreetMapOpenlayersImpl.ts +2 -0
- package/src/layer/openlayers/rasterLayerOpenlayersImpl.ts +6 -0
- package/src/layer/openlayers/singleImageOpenlayersImpl.ts +2 -0
- package/src/layer/openlayers/tmsOpenlayersImpl.ts +2 -0
- package/src/layer/openlayers/vectorTileOpenlayersImpl.ts +3 -37
- package/src/layer/openlayers/wmsOpenlayersImpl.ts +4 -0
- package/src/layer/openlayers/wmtsOpenlayersImpl.ts +2 -0
- package/src/layer/pointCloudLayer.ts +2 -3
- package/src/layer/rasterLayer.ts +81 -2
- package/src/layer/tileProvider/mvtTileProvider.ts +0 -18
- package/src/layer/tileProvider/staticFeatureTileProvider.ts +61 -0
- package/src/layer/tileProvider/tileProvider.ts +27 -2
- package/src/layer/vectorLayer.ts +1 -1
- package/src/layer/vectorTileLayer.ts +72 -17
- package/src/map/cesiumMap.ts +28 -6
- package/src/ol/feature.ts +10 -0
- package/src/ol/ol.d.ts +1 -0
- package/src/style/declarativeStyleItem.ts +2 -72
- package/src/util/displayQuality/displayQuality.ts +13 -1
- package/src/util/editor/createFeatureSession.ts +51 -13
- package/src/util/editor/editGeometrySession.ts +41 -10
- package/src/util/editor/editorHelpers.ts +13 -0
- package/src/util/editor/editorSessionHelpers.ts +6 -20
- package/src/util/editor/interactions/editGeometryMouseOverInteraction.ts +4 -4
- package/src/util/editor/interactions/removeVertexInteraction.ts +3 -4
- package/src/util/editor/interactions/segmentLengthInteraction.ts +227 -0
- package/src/util/editor/interactions/translateVertexInteraction.ts +3 -10
- package/src/util/editor/interactions/translationSnapping.ts +4 -4
- package/src/util/featureconverter/clampedPrimitive.ts +53 -5
- package/src/util/featureconverter/convert.ts +18 -2
- package/src/util/geometryHelpers.ts +63 -4
- package/src/util/math.ts +28 -0
- package/src/util/projection.ts +1 -1
package/src/map/cesiumMap.ts
CHANGED
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
type DataSource,
|
|
38
38
|
type Visualizer,
|
|
39
39
|
type ShadowMap,
|
|
40
|
+
type ContextOptions,
|
|
40
41
|
} from '@vcmap-cesium/engine';
|
|
41
42
|
import type { Coordinate } from 'ol/coordinate.js';
|
|
42
43
|
|
|
@@ -89,6 +90,12 @@ export type CesiumMapOptions = VcsMapOptions & {
|
|
|
89
90
|
* Cesium Default is 2.0
|
|
90
91
|
*/
|
|
91
92
|
lightIntensity?: number;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* can be used to forward contextOptions to the CesiumWidget
|
|
96
|
+
* https://cesium.com/learn/cesiumjs/ref-doc/global.html#ContextOptions
|
|
97
|
+
*/
|
|
98
|
+
contextOptions?: ContextOptions;
|
|
92
99
|
};
|
|
93
100
|
|
|
94
101
|
export type CesiumMapEvent = {
|
|
@@ -297,6 +304,7 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
297
304
|
globeColor: '#3f47cc',
|
|
298
305
|
useOriginalCesiumShader: false,
|
|
299
306
|
lightIntensity: 3.0,
|
|
307
|
+
contextOptions: undefined,
|
|
300
308
|
};
|
|
301
309
|
}
|
|
302
310
|
|
|
@@ -368,6 +376,8 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
368
376
|
|
|
369
377
|
private _lightIntensity: number;
|
|
370
378
|
|
|
379
|
+
private _contextOptions: ContextOptions | undefined;
|
|
380
|
+
|
|
371
381
|
constructor(options: CesiumMapOptions) {
|
|
372
382
|
super(options);
|
|
373
383
|
|
|
@@ -438,6 +448,8 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
438
448
|
options.lightIntensity,
|
|
439
449
|
defaultOptions.lightIntensity,
|
|
440
450
|
);
|
|
451
|
+
|
|
452
|
+
this._contextOptions = structuredClone(options.contextOptions);
|
|
441
453
|
}
|
|
442
454
|
|
|
443
455
|
/**
|
|
@@ -468,6 +480,10 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
468
480
|
}
|
|
469
481
|
}
|
|
470
482
|
|
|
483
|
+
get defaultShadowMap(): ShadowMap | null {
|
|
484
|
+
return this._defaultShadowMap;
|
|
485
|
+
}
|
|
486
|
+
|
|
471
487
|
get terrainProvider(): TerrainProvider | null {
|
|
472
488
|
return this._terrainProvider;
|
|
473
489
|
}
|
|
@@ -656,6 +672,13 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
656
672
|
'Cannot activate Original Cesium Shader, flag to use VCS Shader is already set by another Cesium Map or VCMap Instance',
|
|
657
673
|
);
|
|
658
674
|
}
|
|
675
|
+
const contextOptions = {
|
|
676
|
+
...this._contextOptions,
|
|
677
|
+
webgl: {
|
|
678
|
+
...this._contextOptions?.webgl,
|
|
679
|
+
antialias: this.webGLaa,
|
|
680
|
+
},
|
|
681
|
+
};
|
|
659
682
|
this._cesiumWidget = new CesiumWidget(this.mapElement, {
|
|
660
683
|
requestRenderMode: false,
|
|
661
684
|
scene3DOnly: true,
|
|
@@ -664,12 +687,7 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
664
687
|
baseLayer: false,
|
|
665
688
|
shadows: false,
|
|
666
689
|
terrainShadows: ShadowMode.ENABLED,
|
|
667
|
-
contextOptions
|
|
668
|
-
webgl: {
|
|
669
|
-
failIfMajorPerformanceCaveat: false,
|
|
670
|
-
antialias: this.webGLaa,
|
|
671
|
-
},
|
|
672
|
-
},
|
|
690
|
+
contextOptions,
|
|
673
691
|
});
|
|
674
692
|
this._cesiumWidget.scene.globe.tileCacheSize = this.tileCacheSize;
|
|
675
693
|
this._cesiumWidget.scene.globe.baseColor = this.globeColor;
|
|
@@ -1400,6 +1418,10 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
1400
1418
|
config.useOriginalCesiumShader = this.useOriginalCesiumShader;
|
|
1401
1419
|
}
|
|
1402
1420
|
|
|
1421
|
+
if (this._contextOptions !== defaultOptions.contextOptions) {
|
|
1422
|
+
config.contextOptions = structuredClone(this._contextOptions);
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1403
1425
|
return config;
|
|
1404
1426
|
}
|
|
1405
1427
|
|
package/src/ol/feature.ts
CHANGED
|
@@ -44,6 +44,16 @@ Feature.prototype.getProperty = function getProperty(
|
|
|
44
44
|
return this.get(property);
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
+
Feature.prototype.getAttributes = function getAttributes(
|
|
48
|
+
this: Feature,
|
|
49
|
+
): Record<string, unknown> {
|
|
50
|
+
const properties = this.getProperties();
|
|
51
|
+
if (this.getGeometryName()) {
|
|
52
|
+
delete properties[this.getGeometryName()];
|
|
53
|
+
}
|
|
54
|
+
return properties;
|
|
55
|
+
};
|
|
56
|
+
|
|
47
57
|
/**
|
|
48
58
|
* To be used for cesium 3D style functions
|
|
49
59
|
* @param {string} property
|
package/src/ol/ol.d.ts
CHANGED
|
@@ -95,6 +95,7 @@ declare module 'ol/index.js' {
|
|
|
95
95
|
interface Feature<Geometry> {
|
|
96
96
|
getProperty(key: string): any;
|
|
97
97
|
getPropertyInherited(key: string): any;
|
|
98
|
+
getAttributes(): Record<string, unknown>;
|
|
98
99
|
[vcsLayerName]?: string;
|
|
99
100
|
[originalFeatureSymbol]?: Feature<Geometry>;
|
|
100
101
|
[vectorStyleSymbol]?: VectorStyleItem;
|
|
@@ -17,11 +17,7 @@ import Fill from 'ol/style/Fill.js';
|
|
|
17
17
|
import type { Feature } from 'ol/index.js';
|
|
18
18
|
|
|
19
19
|
import StyleItem, { type StyleItemOptions } from './styleItem.js';
|
|
20
|
-
import {
|
|
21
|
-
cesiumColorToColor,
|
|
22
|
-
getDefaultCondition,
|
|
23
|
-
whiteColor,
|
|
24
|
-
} from './styleHelpers.js';
|
|
20
|
+
import { cesiumColorToColor, whiteColor } from './styleHelpers.js';
|
|
25
21
|
import { originalFeatureSymbol } from '../layer/vectorSymbols.js';
|
|
26
22
|
import { styleClassRegistry } from '../classRegistry.js';
|
|
27
23
|
import { isSameOrigin } from '../util/urlHelpers.js';
|
|
@@ -507,70 +503,4 @@ styleClassRegistry.registerClass(
|
|
|
507
503
|
DeclarativeStyleItem,
|
|
508
504
|
);
|
|
509
505
|
|
|
510
|
-
export const defaultDeclarativeStyle = new DeclarativeStyleItem({
|
|
511
|
-
declarativeStyle: {
|
|
512
|
-
show: true,
|
|
513
|
-
color: {
|
|
514
|
-
conditions: getDefaultCondition('olcs_color', true),
|
|
515
|
-
},
|
|
516
|
-
scale: {
|
|
517
|
-
conditions: getDefaultCondition('olcs_scale'),
|
|
518
|
-
},
|
|
519
|
-
pointOutlineWidth: {
|
|
520
|
-
conditions: getDefaultCondition('olcs_outlineWidth'),
|
|
521
|
-
},
|
|
522
|
-
pointOutlineColor: {
|
|
523
|
-
conditions: getDefaultCondition('olcs_outlineColor', true),
|
|
524
|
-
},
|
|
525
|
-
pointSize: {
|
|
526
|
-
conditions: getDefaultCondition('olcs_pointSize'),
|
|
527
|
-
},
|
|
528
|
-
image: {
|
|
529
|
-
conditions: getDefaultCondition('olcs_image'),
|
|
530
|
-
},
|
|
531
|
-
font: {
|
|
532
|
-
conditions: getDefaultCondition('olcs_font'),
|
|
533
|
-
},
|
|
534
|
-
labelStyle: '2',
|
|
535
|
-
labelText: {
|
|
536
|
-
conditions: getDefaultCondition('olcs_labelText'),
|
|
537
|
-
},
|
|
538
|
-
labelColor: {
|
|
539
|
-
conditions: getDefaultCondition('olcs_fontColor', true),
|
|
540
|
-
},
|
|
541
|
-
labelOutlineWidth: {
|
|
542
|
-
conditions: getDefaultCondition('olcs_fontOutlineWidth'),
|
|
543
|
-
},
|
|
544
|
-
labelOutlineColor: {
|
|
545
|
-
conditions: getDefaultCondition('olcs_fontOutlineColor', true),
|
|
546
|
-
},
|
|
547
|
-
/*
|
|
548
|
-
anchorLineEnabled: {
|
|
549
|
-
conditions: [
|
|
550
|
-
[
|
|
551
|
-
defaultExtrudedHeightCondition,
|
|
552
|
-
'true',
|
|
553
|
-
],
|
|
554
|
-
['true', 'false'],
|
|
555
|
-
],
|
|
556
|
-
},
|
|
557
|
-
anchorLineColor: {
|
|
558
|
-
conditions: getDefaultCondition('olcs_anchorLineColor', true),
|
|
559
|
-
},
|
|
560
|
-
heightOffset: {
|
|
561
|
-
conditions: [
|
|
562
|
-
[
|
|
563
|
-
defaultExtrudedHeightCondition,
|
|
564
|
-
// eslint-disable-next-line no-template-curly-in-string
|
|
565
|
-
'${attributes.olcs_extrudedHeight}',
|
|
566
|
-
],
|
|
567
|
-
['true', '0'],
|
|
568
|
-
],
|
|
569
|
-
},
|
|
570
|
-
*/
|
|
571
|
-
verticalOrigin: '1',
|
|
572
|
-
horizontalOrigin: '0',
|
|
573
|
-
labelHorizontalOrigin: '0',
|
|
574
|
-
labelVerticalOrigin: '1',
|
|
575
|
-
},
|
|
576
|
-
});
|
|
506
|
+
export const defaultDeclarativeStyle = new DeclarativeStyleItem({});
|
|
@@ -20,6 +20,7 @@ export type DisplayQualityViewModelOptions = {
|
|
|
20
20
|
fogScreenSpaceErrorFactor?: number;
|
|
21
21
|
resolutionScale?: number;
|
|
22
22
|
layerSSEFactor?: number;
|
|
23
|
+
msaa?: 1 | 2 | 4 | 8;
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
export type DisplayQualityLayerModel = {
|
|
@@ -55,6 +56,7 @@ class DisplayQuality {
|
|
|
55
56
|
fogScreenSpaceErrorFactor: 6,
|
|
56
57
|
resolutionScale: 0.9,
|
|
57
58
|
layerSSEFactor: 2,
|
|
59
|
+
msaa: 1,
|
|
58
60
|
},
|
|
59
61
|
medium: {
|
|
60
62
|
sse: 2.333,
|
|
@@ -64,6 +66,7 @@ class DisplayQuality {
|
|
|
64
66
|
fogScreenSpaceErrorFactor: 4,
|
|
65
67
|
resolutionScale: 1,
|
|
66
68
|
layerSSEFactor: 1.1,
|
|
69
|
+
msaa: 1,
|
|
67
70
|
},
|
|
68
71
|
high: {
|
|
69
72
|
sse: 4 / 3,
|
|
@@ -73,6 +76,7 @@ class DisplayQuality {
|
|
|
73
76
|
fogScreenSpaceErrorFactor: 0,
|
|
74
77
|
resolutionScale: 1,
|
|
75
78
|
layerSSEFactor: 0.5,
|
|
79
|
+
msaa: 4,
|
|
76
80
|
},
|
|
77
81
|
};
|
|
78
82
|
}
|
|
@@ -172,7 +176,12 @@ class DisplayQuality {
|
|
|
172
176
|
key,
|
|
173
177
|
Object.fromEntries(
|
|
174
178
|
Object.entries(value as Record<string, unknown>).filter(
|
|
175
|
-
([, v]) =>
|
|
179
|
+
([innerKey, v]) => {
|
|
180
|
+
if (innerKey === 'msaa') {
|
|
181
|
+
return ([1, 2, 4, 8] as Array<unknown>).includes(v);
|
|
182
|
+
}
|
|
183
|
+
return v != null;
|
|
184
|
+
},
|
|
176
185
|
),
|
|
177
186
|
),
|
|
178
187
|
];
|
|
@@ -245,6 +254,9 @@ class DisplayQuality {
|
|
|
245
254
|
viewer.scene.fog.density = this._viewModel.fogDensity!;
|
|
246
255
|
viewer.scene.fog.screenSpaceErrorFactor =
|
|
247
256
|
this._viewModel.fogScreenSpaceErrorFactor!;
|
|
257
|
+
if (this._viewModel.msaa) {
|
|
258
|
+
viewer.scene.msaaSamples = this._viewModel.msaa;
|
|
259
|
+
}
|
|
248
260
|
}
|
|
249
261
|
|
|
250
262
|
if (this._currentQualityLevel !== previousLevel) {
|
|
@@ -4,7 +4,7 @@ import type { Geometry, LineString, Polygon } from 'ol/geom.js';
|
|
|
4
4
|
import { unByKey } from 'ol/Observable.js';
|
|
5
5
|
import VcsEvent from '../../vcsEvent.js';
|
|
6
6
|
import {
|
|
7
|
-
|
|
7
|
+
setupPickingBehavior,
|
|
8
8
|
EditorSession,
|
|
9
9
|
GeometryToType,
|
|
10
10
|
GeometryType,
|
|
@@ -28,6 +28,7 @@ import CreationSnapping from './interactions/creationSnapping.js';
|
|
|
28
28
|
import { syncScratchLayerVectorProperties } from './editorHelpers.js';
|
|
29
29
|
import LayerSnapping from './interactions/layerSnapping.js';
|
|
30
30
|
import { SnapType, snapTypes } from './snappingHelpers.js';
|
|
31
|
+
import SegmentLengthInteraction from './interactions/segmentLengthInteraction.js';
|
|
31
32
|
|
|
32
33
|
export type CreateFeatureSession<T extends GeometryType> =
|
|
33
34
|
EditorSession<SessionType.CREATE> & {
|
|
@@ -89,6 +90,12 @@ export interface CreateInteraction<T extends Geometry> {
|
|
|
89
90
|
destroy(): void;
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
export type CreateFeatureSessionOptions = {
|
|
94
|
+
initialSnapToLayers?: VectorLayer[];
|
|
95
|
+
snapTo?: SnapType[];
|
|
96
|
+
hideSegmentLength?: boolean;
|
|
97
|
+
};
|
|
98
|
+
|
|
92
99
|
/**
|
|
93
100
|
* Creates an editor session to create features of the given geometry type.
|
|
94
101
|
* While the session is active: Do not change the geometry on the current feature (the last created one)
|
|
@@ -96,9 +103,8 @@ export interface CreateInteraction<T extends Geometry> {
|
|
|
96
103
|
* @param app
|
|
97
104
|
* @param layer
|
|
98
105
|
* @param geometryType
|
|
99
|
-
* @param initialAltitudeMode - whether to use the layers altitude mode or set this on the feature
|
|
100
|
-
* @param [
|
|
101
|
-
* @param [snapTo] - what to snap to, by default all snaps are active
|
|
106
|
+
* @param [initialAltitudeMode] - whether to use the layers altitude mode or set this on the feature
|
|
107
|
+
* @param [options]
|
|
102
108
|
* @group Editor
|
|
103
109
|
*/
|
|
104
110
|
function startCreateFeatureSession<T extends GeometryType>(
|
|
@@ -106,13 +112,15 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
106
112
|
layer: VectorLayer,
|
|
107
113
|
geometryType: T,
|
|
108
114
|
initialAltitudeMode?: AltitudeModeType,
|
|
109
|
-
|
|
110
|
-
snapTo: SnapType[] = [...snapTypes],
|
|
115
|
+
options?: CreateFeatureSessionOptions,
|
|
111
116
|
): CreateFeatureSession<T> {
|
|
112
117
|
check(app, VcsApp);
|
|
113
118
|
check(layer, VectorLayer);
|
|
114
119
|
check(geometryType, ofEnum(GeometryType));
|
|
115
120
|
|
|
121
|
+
const snapTo = options?.snapTo ?? [...snapTypes];
|
|
122
|
+
const showSegmentLength = !options?.hideSegmentLength;
|
|
123
|
+
|
|
116
124
|
const {
|
|
117
125
|
interactionChain,
|
|
118
126
|
removed: interactionRemoved,
|
|
@@ -129,7 +137,10 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
129
137
|
let currentFeature: Feature<GeometryToType<T>> | null = null;
|
|
130
138
|
let snappingInteraction: CreationSnapping | null = null;
|
|
131
139
|
let layerSnappingInteraction: LayerSnapping | null = null;
|
|
132
|
-
let
|
|
140
|
+
let segmentLengthInteraction: SegmentLengthInteraction | null = null;
|
|
141
|
+
let snapToLayers: VectorLayer[] = options?.initialSnapToLayers?.slice() ?? [
|
|
142
|
+
layer,
|
|
143
|
+
];
|
|
133
144
|
|
|
134
145
|
/**
|
|
135
146
|
* Ture if the currently active map is an ObliqueMap. set in setupActiveMap
|
|
@@ -137,16 +148,14 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
137
148
|
let isOblique = false;
|
|
138
149
|
|
|
139
150
|
let featureAltitudeMode = initialAltitudeMode;
|
|
140
|
-
const
|
|
151
|
+
const resetPickingBehavior = setupPickingBehavior(app);
|
|
141
152
|
|
|
142
153
|
const altitudeModeChanged = (): void => {
|
|
143
154
|
const altitudeModeFeature =
|
|
144
155
|
currentFeature ?? new Feature({ olcs_altitudeMode: featureAltitudeMode });
|
|
145
|
-
const altitudeModeInUse =
|
|
146
|
-
layer.vectorProperties.getAltitudeMode(altitudeModeFeature);
|
|
147
156
|
|
|
148
|
-
scratchLayer.vectorProperties.altitudeMode =
|
|
149
|
-
|
|
157
|
+
scratchLayer.vectorProperties.altitudeMode =
|
|
158
|
+
layer.vectorProperties.getAltitudeMode(altitudeModeFeature);
|
|
150
159
|
};
|
|
151
160
|
|
|
152
161
|
const vectorPropertiesListener = syncScratchLayerVectorProperties(
|
|
@@ -179,6 +188,11 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
179
188
|
layerSnappingInteraction.destroy();
|
|
180
189
|
layerSnappingInteraction = null;
|
|
181
190
|
}
|
|
191
|
+
if (segmentLengthInteraction) {
|
|
192
|
+
interactionChain.removeInteraction(segmentLengthInteraction);
|
|
193
|
+
segmentLengthInteraction.destroy();
|
|
194
|
+
segmentLengthInteraction = null;
|
|
195
|
+
}
|
|
182
196
|
interactionListeners.forEach((cb) => {
|
|
183
197
|
cb();
|
|
184
198
|
});
|
|
@@ -201,6 +215,19 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
201
215
|
snappingInteraction = new CreationSnapping(scratchLayer, snapTo);
|
|
202
216
|
}
|
|
203
217
|
|
|
218
|
+
if (
|
|
219
|
+
showSegmentLength &&
|
|
220
|
+
(geometryType === GeometryType.Polygon ||
|
|
221
|
+
geometryType === GeometryType.LineString ||
|
|
222
|
+
geometryType === GeometryType.BBox ||
|
|
223
|
+
geometryType === GeometryType.Circle)
|
|
224
|
+
) {
|
|
225
|
+
segmentLengthInteraction = new SegmentLengthInteraction(
|
|
226
|
+
scratchLayer,
|
|
227
|
+
true,
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
204
231
|
interactionListeners = [
|
|
205
232
|
currentInteraction.created.addEventListener((geometry) => {
|
|
206
233
|
if (isOblique) {
|
|
@@ -213,6 +240,7 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
213
240
|
if (featureAltitudeMode) {
|
|
214
241
|
currentFeature.set('olcs_altitudeMode', featureAltitudeMode);
|
|
215
242
|
}
|
|
243
|
+
currentFeature.set('olcs_allowPicking', false);
|
|
216
244
|
const propChangeListener = currentFeature.on(
|
|
217
245
|
'propertychange',
|
|
218
246
|
(event) => {
|
|
@@ -229,6 +257,11 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
229
257
|
if (snappingInteraction) {
|
|
230
258
|
snappingInteraction.setGeometry(geometry as LineString | Polygon);
|
|
231
259
|
}
|
|
260
|
+
if (segmentLengthInteraction) {
|
|
261
|
+
segmentLengthInteraction.setGeometry(
|
|
262
|
+
geometry as LineString | Polygon,
|
|
263
|
+
);
|
|
264
|
+
}
|
|
232
265
|
}),
|
|
233
266
|
currentInteraction.finished.addEventListener((geometry) => {
|
|
234
267
|
if (isOblique) {
|
|
@@ -236,6 +269,7 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
236
269
|
}
|
|
237
270
|
if (currentFeature) {
|
|
238
271
|
delete currentFeature[createSync];
|
|
272
|
+
currentFeature.set('olcs_allowPicking', true);
|
|
239
273
|
if (
|
|
240
274
|
!geometry ||
|
|
241
275
|
currentFeature.getGeometry() !== geometry ||
|
|
@@ -256,11 +290,15 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
256
290
|
}
|
|
257
291
|
}),
|
|
258
292
|
];
|
|
293
|
+
|
|
259
294
|
interactionChain.addInteraction(layerSnappingInteraction);
|
|
260
295
|
if (snappingInteraction) {
|
|
261
296
|
interactionChain.addInteraction(snappingInteraction);
|
|
262
297
|
}
|
|
263
298
|
interactionChain.addInteraction(currentInteraction);
|
|
299
|
+
if (segmentLengthInteraction) {
|
|
300
|
+
interactionChain.addInteraction(segmentLengthInteraction);
|
|
301
|
+
}
|
|
264
302
|
};
|
|
265
303
|
createInteraction();
|
|
266
304
|
|
|
@@ -313,7 +351,7 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
313
351
|
destroyInteractionChain();
|
|
314
352
|
currentFeatureListener();
|
|
315
353
|
vectorPropertiesListener();
|
|
316
|
-
|
|
354
|
+
resetPickingBehavior();
|
|
317
355
|
|
|
318
356
|
stopped.raiseEvent();
|
|
319
357
|
stopped.destroy();
|
|
@@ -11,7 +11,7 @@ import type {
|
|
|
11
11
|
} from 'ol/geom.js';
|
|
12
12
|
import { EventsKey } from 'ol/events.js';
|
|
13
13
|
import {
|
|
14
|
-
|
|
14
|
+
setupPickingBehavior,
|
|
15
15
|
EditorSession,
|
|
16
16
|
GeometryType,
|
|
17
17
|
SessionType,
|
|
@@ -45,6 +45,7 @@ import { vertexIndexSymbol } from './editorSymbols.js';
|
|
|
45
45
|
import LayerSnapping from './interactions/layerSnapping.js';
|
|
46
46
|
import { EventType } from '../../interaction/interactionType.js';
|
|
47
47
|
import { SnapType, snapTypes } from './snappingHelpers.js';
|
|
48
|
+
import SegmentLengthInteraction from './interactions/segmentLengthInteraction.js';
|
|
48
49
|
|
|
49
50
|
export type EditGeometrySession = EditorSession<SessionType.EDIT_GEOMETRY> & {
|
|
50
51
|
setFeature(feature?: Feature): void;
|
|
@@ -57,11 +58,12 @@ type EditGeometryInteraction = {
|
|
|
57
58
|
destroy(): void;
|
|
58
59
|
};
|
|
59
60
|
|
|
60
|
-
type EditGeometrySessionOptions = {
|
|
61
|
+
export type EditGeometrySessionOptions = {
|
|
61
62
|
denyInsertion?: boolean;
|
|
62
63
|
denyRemoval?: boolean;
|
|
63
64
|
initialSnapToLayers?: VectorLayer[];
|
|
64
65
|
snapTo?: SnapType[];
|
|
66
|
+
hideSegmentLength?: boolean;
|
|
65
67
|
};
|
|
66
68
|
|
|
67
69
|
function createEditLineStringGeometryInteraction(
|
|
@@ -91,6 +93,12 @@ function createEditLineStringGeometryInteraction(
|
|
|
91
93
|
translateVertex,
|
|
92
94
|
];
|
|
93
95
|
|
|
96
|
+
if (!options.hideSegmentLength) {
|
|
97
|
+
const segmentLength = new SegmentLengthInteraction(scratchLayer, false);
|
|
98
|
+
segmentLength.setGeometry(geometry);
|
|
99
|
+
interactions.push(segmentLength);
|
|
100
|
+
}
|
|
101
|
+
|
|
94
102
|
if (!options.denyInsertion) {
|
|
95
103
|
const insertVertex = new InsertVertexInteraction(
|
|
96
104
|
feature,
|
|
@@ -137,6 +145,7 @@ function createEditLineStringGeometryInteraction(
|
|
|
137
145
|
function createEditCircleGeometryInteraction(
|
|
138
146
|
feature: Feature<Circle>,
|
|
139
147
|
scratchLayer: VectorLayer,
|
|
148
|
+
options: EditGeometrySessionOptions,
|
|
140
149
|
): EditGeometryInteraction {
|
|
141
150
|
const geometry =
|
|
142
151
|
feature[obliqueGeometry] ?? (feature.getGeometry() as Circle);
|
|
@@ -175,7 +184,14 @@ function createEditCircleGeometryInteraction(
|
|
|
175
184
|
}
|
|
176
185
|
});
|
|
177
186
|
|
|
178
|
-
const
|
|
187
|
+
const interactions: AbstractInteraction[] = [translateVertex];
|
|
188
|
+
if (!options.hideSegmentLength) {
|
|
189
|
+
const segmentLength = new SegmentLengthInteraction(scratchLayer, false);
|
|
190
|
+
segmentLength.setGeometry(geometry);
|
|
191
|
+
interactions.push(segmentLength);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const interactionChain = new InteractionChain(interactions);
|
|
179
195
|
|
|
180
196
|
return {
|
|
181
197
|
interactionChain,
|
|
@@ -192,6 +208,7 @@ function createEditCircleGeometryInteraction(
|
|
|
192
208
|
function createEditBBoxGeometryInteraction(
|
|
193
209
|
feature: Feature<Polygon>,
|
|
194
210
|
scratchLayer: VectorLayer,
|
|
211
|
+
options: EditGeometrySessionOptions,
|
|
195
212
|
): EditGeometryInteraction {
|
|
196
213
|
const geometry =
|
|
197
214
|
feature[obliqueGeometry] ?? (feature.getGeometry() as Polygon);
|
|
@@ -255,7 +272,16 @@ function createEditBBoxGeometryInteraction(
|
|
|
255
272
|
});
|
|
256
273
|
}
|
|
257
274
|
});
|
|
258
|
-
|
|
275
|
+
|
|
276
|
+
const interactions: AbstractInteraction[] = [translateVertex];
|
|
277
|
+
|
|
278
|
+
if (!options.hideSegmentLength) {
|
|
279
|
+
const segmentLength = new SegmentLengthInteraction(scratchLayer, false);
|
|
280
|
+
segmentLength.setGeometry(geometry);
|
|
281
|
+
interactions.push(segmentLength);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const interactionChain = new InteractionChain(interactions);
|
|
259
285
|
|
|
260
286
|
return {
|
|
261
287
|
interactionChain,
|
|
@@ -300,6 +326,12 @@ function createEditSimplePolygonInteraction(
|
|
|
300
326
|
translateVertex,
|
|
301
327
|
];
|
|
302
328
|
|
|
329
|
+
if (!options.hideSegmentLength) {
|
|
330
|
+
const segmentLength = new SegmentLengthInteraction(scratchLayer, false);
|
|
331
|
+
segmentLength.setGeometry(geometry);
|
|
332
|
+
interactions.push(segmentLength);
|
|
333
|
+
}
|
|
334
|
+
|
|
303
335
|
if (!options.denyInsertion) {
|
|
304
336
|
const insertVertex = new InsertVertexInteraction(
|
|
305
337
|
feature,
|
|
@@ -429,14 +461,11 @@ function startEditGeometrySession(
|
|
|
429
461
|
|
|
430
462
|
const snapTo = editVertexOptions?.snapTo ?? [...snapTypes];
|
|
431
463
|
|
|
432
|
-
const
|
|
464
|
+
const resetPickingBehavior = setupPickingBehavior(app);
|
|
433
465
|
const altitudeModeChanged = (): void => {
|
|
434
|
-
|
|
466
|
+
scratchLayer.vectorProperties.altitudeMode = currentFeature
|
|
435
467
|
? layer.vectorProperties.getAltitudeMode(currentFeature)
|
|
436
468
|
: layer.vectorProperties.altitudeMode;
|
|
437
|
-
|
|
438
|
-
scratchLayer.vectorProperties.altitudeMode = altitudeMode;
|
|
439
|
-
pickingBehavior.setForAltitudeMode(altitudeMode);
|
|
440
469
|
};
|
|
441
470
|
altitudeModeChanged();
|
|
442
471
|
|
|
@@ -496,6 +525,7 @@ function startEditGeometrySession(
|
|
|
496
525
|
currentInteractionSet = createEditBBoxGeometryInteraction(
|
|
497
526
|
feature as Feature<Polygon>,
|
|
498
527
|
scratchLayer,
|
|
528
|
+
editVertexOptions,
|
|
499
529
|
);
|
|
500
530
|
} else if ((geometry as Polygon).getLinearRingCount() === 1) {
|
|
501
531
|
currentInteractionSet = createEditSimplePolygonInteraction(
|
|
@@ -524,6 +554,7 @@ function startEditGeometrySession(
|
|
|
524
554
|
currentInteractionSet = createEditCircleGeometryInteraction(
|
|
525
555
|
feature as Feature<Circle>,
|
|
526
556
|
scratchLayer,
|
|
557
|
+
editVertexOptions,
|
|
527
558
|
);
|
|
528
559
|
}
|
|
529
560
|
|
|
@@ -572,7 +603,7 @@ function startEditGeometrySession(
|
|
|
572
603
|
destroyCurrentInteractionSet();
|
|
573
604
|
destroyInteractionChain();
|
|
574
605
|
vectorPropertiesChangedListener();
|
|
575
|
-
|
|
606
|
+
resetPickingBehavior();
|
|
576
607
|
stopped.raiseEvent();
|
|
577
608
|
stopped.destroy();
|
|
578
609
|
};
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
type Camera,
|
|
18
18
|
} from '@vcmap-cesium/engine';
|
|
19
19
|
|
|
20
|
+
import { getLogger } from '@vcsuite/logger';
|
|
20
21
|
import { mercatorToCartesian } from '../math.js';
|
|
21
22
|
import { getFlatCoordinateReferences } from '../geometryHelpers.js';
|
|
22
23
|
import CesiumMap from '../../map/cesiumMap.js';
|
|
@@ -123,6 +124,10 @@ export function createVertex(
|
|
|
123
124
|
return vertex;
|
|
124
125
|
}
|
|
125
126
|
|
|
127
|
+
export function isVertex(f?: unknown): f is Vertex {
|
|
128
|
+
return f instanceof Feature && !!f[vertexSymbol];
|
|
129
|
+
}
|
|
130
|
+
|
|
126
131
|
export function getCoordinatesAndLayoutFromVertices(vertices: Vertex[]): {
|
|
127
132
|
coordinates: Coordinate[];
|
|
128
133
|
layout: GeometryLayout;
|
|
@@ -363,6 +368,10 @@ export async function drapeGeometryOnTerrain(
|
|
|
363
368
|
geometry: Geometry,
|
|
364
369
|
map: VcsMap,
|
|
365
370
|
): Promise<void> {
|
|
371
|
+
getLogger('editor helpers').deprecate(
|
|
372
|
+
'drapeGeometryOnTerrain',
|
|
373
|
+
'drapeGeometryOnTerrain is deprecated and will be removed in 6.1. Use drapeGeometryOnSurface instead.',
|
|
374
|
+
);
|
|
366
375
|
if (map instanceof CesiumMap) {
|
|
367
376
|
const coordinates = geometry.getCoordinates() as any[];
|
|
368
377
|
const flats = getFlatCoordinateReferences(geometry, coordinates);
|
|
@@ -380,6 +389,10 @@ export async function placeGeometryOnTerrain(
|
|
|
380
389
|
geometry: Geometry,
|
|
381
390
|
map: VcsMap,
|
|
382
391
|
): Promise<void> {
|
|
392
|
+
getLogger('editor helpers').deprecate(
|
|
393
|
+
'placeGeometryOnTerrain',
|
|
394
|
+
'place geometry on terrain is deprecated and will be removed in 6.1. Use placeGeometryOnSurface instead.',
|
|
395
|
+
);
|
|
383
396
|
if (map instanceof CesiumMap) {
|
|
384
397
|
const coordinates = geometry.getCoordinates() as any[];
|
|
385
398
|
const flats = getFlatCoordinateReferences(geometry, coordinates);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Point, Polygon, Circle, LineString } from 'ol/geom.js';
|
|
2
|
-
import { HeightReference } from '@vcmap-cesium/engine';
|
|
3
2
|
import VectorLayer from '../../layer/vectorLayer.js';
|
|
4
3
|
import { mercatorProjection } from '../projection.js';
|
|
5
4
|
import InteractionChain from '../../interaction/interactionChain.js';
|
|
@@ -145,27 +144,14 @@ export type GeometryToType<T extends GeometryType> =
|
|
|
145
144
|
? Circle
|
|
146
145
|
: never;
|
|
147
146
|
|
|
148
|
-
export
|
|
149
|
-
setForAltitudeMode(altitudeMode: HeightReference): void;
|
|
150
|
-
reset(): void;
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
export function createPickingBehavior(app: VcsApp): PickingBehavior {
|
|
147
|
+
export function setupPickingBehavior(app: VcsApp): () => void {
|
|
154
148
|
const initialPickPosition =
|
|
155
149
|
app.maps.eventHandler.featureInteraction.pickPosition;
|
|
156
150
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
} else {
|
|
163
|
-
app.maps.eventHandler.featureInteraction.pickPosition = EventType.NONE;
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
reset(): void {
|
|
167
|
-
app.maps.eventHandler.featureInteraction.pickPosition =
|
|
168
|
-
initialPickPosition;
|
|
169
|
-
},
|
|
151
|
+
app.maps.eventHandler.featureInteraction.pickPosition =
|
|
152
|
+
EventType.CLICKMOVE | EventType.DRAGEVENTS;
|
|
153
|
+
|
|
154
|
+
return () => {
|
|
155
|
+
app.maps.eventHandler.featureInteraction.pickPosition = initialPickPosition;
|
|
170
156
|
};
|
|
171
157
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mouseOverSymbol
|
|
1
|
+
import { mouseOverSymbol } from '../editorSymbols.js';
|
|
2
2
|
import AbstractInteraction, {
|
|
3
3
|
EventAfterEventHandler,
|
|
4
4
|
} from '../../../interaction/abstractInteraction.js';
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
ModificationKeyType,
|
|
7
7
|
EventType,
|
|
8
8
|
} from '../../../interaction/interactionType.js';
|
|
9
|
-
import { Vertex } from '../editorHelpers.js';
|
|
9
|
+
import { isVertex, Vertex } from '../editorHelpers.js';
|
|
10
10
|
|
|
11
11
|
const pointerSvg = `<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" viewBox="0 0 19 19">
|
|
12
12
|
<g id="pen">
|
|
@@ -56,8 +56,8 @@ class EditGeometryMouseOverInteraction extends AbstractInteraction {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
pipe(event: EventAfterEventHandler): Promise<EventAfterEventHandler> {
|
|
59
|
-
if (
|
|
60
|
-
this._currentVertex = event.feature
|
|
59
|
+
if (isVertex(event.feature)) {
|
|
60
|
+
this._currentVertex = event.feature;
|
|
61
61
|
} else {
|
|
62
62
|
this._currentVertex = null;
|
|
63
63
|
}
|