@vcmap/core 6.2.2 → 6.3.0-rc.1
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/dist/index.d.ts +3 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/src/category/category.d.ts +1 -1
- package/dist/src/category/category.js +3 -4
- package/dist/src/category/category.js.map +1 -1
- package/dist/src/featureProvider/abstractFeatureProvider.d.ts +1 -1
- package/dist/src/featureProvider/abstractFeatureProvider.js +3 -4
- package/dist/src/featureProvider/abstractFeatureProvider.js.map +1 -1
- package/dist/src/featureProvider/wmsFeatureProvider.d.ts +3 -1
- package/dist/src/featureProvider/wmsFeatureProvider.js +37 -9
- package/dist/src/featureProvider/wmsFeatureProvider.js.map +1 -1
- package/dist/src/interaction/coordinateAtPixel.js +4 -6
- package/dist/src/interaction/coordinateAtPixel.js.map +1 -1
- package/dist/src/interaction/ensurePositionInteraction.d.ts +14 -0
- package/dist/src/interaction/ensurePositionInteraction.js +42 -0
- package/dist/src/interaction/ensurePositionInteraction.js.map +1 -0
- package/dist/src/interaction/eventHandler.d.ts +3 -0
- package/dist/src/interaction/eventHandler.js +10 -1
- package/dist/src/interaction/eventHandler.js.map +1 -1
- package/dist/src/interaction/featureAtPixelInteraction.js +29 -17
- package/dist/src/interaction/featureAtPixelInteraction.js.map +1 -1
- package/dist/src/interaction/panoramaImageSelection.js +2 -2
- package/dist/src/interaction/panoramaImageSelection.js.map +1 -1
- package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.d.ts +3 -3
- package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/cogImageryProvider.d.ts +2 -2
- package/dist/src/layer/cesium/cogImageryProvider.js +6 -26
- package/dist/src/layer/cesium/cogImageryProvider.js.map +1 -1
- package/dist/src/layer/cesium/rasterLayerCesiumImpl.d.ts +3 -3
- package/dist/src/layer/cesium/rasterLayerCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/terrainCesiumImpl.d.ts +3 -3
- package/dist/src/layer/cesium/terrainCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vectorContext.js +1 -1
- package/dist/src/layer/cesium/vectorContext.js.map +1 -1
- package/dist/src/layer/cesiumTilesetLayer.d.ts +1 -1
- package/dist/src/layer/cesiumTilesetLayer.js +7 -7
- package/dist/src/layer/cesiumTilesetLayer.js.map +1 -1
- package/dist/src/layer/cogLayer.d.ts +7 -2
- package/dist/src/layer/cogLayer.js +10 -4
- package/dist/src/layer/cogLayer.js.map +1 -1
- package/dist/src/layer/czmlLayer.d.ts +1 -1
- package/dist/src/layer/czmlLayer.js +4 -4
- package/dist/src/layer/czmlLayer.js.map +1 -1
- package/dist/src/layer/featureLayer.d.ts +1 -6
- package/dist/src/layer/featureLayer.js +3 -10
- package/dist/src/layer/featureLayer.js.map +1 -1
- package/dist/src/layer/featureStoreLayer.d.ts +3 -2
- package/dist/src/layer/featureStoreLayer.js +5 -5
- package/dist/src/layer/featureStoreLayer.js.map +1 -1
- package/dist/src/layer/flatGeobufLayer.d.ts +2 -0
- package/dist/src/layer/flatGeobufLayer.js +8 -0
- package/dist/src/layer/flatGeobufLayer.js.map +1 -1
- package/dist/src/layer/geojsonLayer.d.ts +1 -1
- package/dist/src/layer/geojsonLayer.js +5 -12
- package/dist/src/layer/geojsonLayer.js.map +1 -1
- package/dist/src/layer/layer.d.ts +21 -7
- package/dist/src/layer/layer.js +107 -33
- package/dist/src/layer/layer.js.map +1 -1
- package/dist/src/layer/openStreetMapLayer.d.ts +1 -1
- package/dist/src/layer/openStreetMapLayer.js +11 -6
- package/dist/src/layer/openStreetMapLayer.js.map +1 -1
- package/dist/src/layer/panorama/vectorPanoramaImpl.d.ts +38 -0
- package/dist/src/layer/panorama/vectorPanoramaImpl.js +164 -0
- package/dist/src/layer/panorama/vectorPanoramaImpl.js.map +1 -0
- package/dist/src/layer/panoramaDatasetLayer.d.ts +5 -3
- package/dist/src/layer/panoramaDatasetLayer.js +13 -7
- package/dist/src/layer/panoramaDatasetLayer.js.map +1 -1
- package/dist/src/layer/pointCloudLayer.d.ts +1 -5
- package/dist/src/layer/pointCloudLayer.js +3 -15
- package/dist/src/layer/pointCloudLayer.js.map +1 -1
- package/dist/src/layer/rasterLayer.d.ts +1 -1
- package/dist/src/layer/rasterLayer.js +4 -4
- package/dist/src/layer/rasterLayer.js.map +1 -1
- package/dist/src/layer/singleImageLayer.d.ts +1 -1
- package/dist/src/layer/singleImageLayer.js +3 -3
- package/dist/src/layer/singleImageLayer.js.map +1 -1
- package/dist/src/layer/terrainLayer.d.ts +1 -1
- package/dist/src/layer/terrainLayer.js +8 -6
- package/dist/src/layer/terrainLayer.js.map +1 -1
- package/dist/src/layer/tileProvider/flatGeobufTileProvider.d.ts +1 -1
- package/dist/src/layer/tileProvider/flatGeobufTileProvider.js +4 -3
- package/dist/src/layer/tileProvider/flatGeobufTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/mvtTileProvider.d.ts +1 -1
- package/dist/src/layer/tileProvider/mvtTileProvider.js +3 -3
- package/dist/src/layer/tileProvider/mvtTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/staticFeatureTileProvider.d.ts +1 -1
- package/dist/src/layer/tileProvider/staticFeatureTileProvider.js +3 -3
- package/dist/src/layer/tileProvider/staticFeatureTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/staticGeojsonTileProvider.d.ts +1 -1
- package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js +7 -4
- package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/tileProvider.d.ts +1 -1
- package/dist/src/layer/tileProvider/tileProvider.js +3 -4
- package/dist/src/layer/tileProvider/tileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/urlTemplateTileProvider.d.ts +1 -1
- package/dist/src/layer/tileProvider/urlTemplateTileProvider.js +3 -3
- package/dist/src/layer/tileProvider/urlTemplateTileProvider.js.map +1 -1
- package/dist/src/layer/tmsLayer.d.ts +1 -1
- package/dist/src/layer/tmsLayer.js +3 -10
- package/dist/src/layer/tmsLayer.js.map +1 -1
- package/dist/src/layer/vectorLayer.d.ts +11 -5
- package/dist/src/layer/vectorLayer.js +19 -8
- package/dist/src/layer/vectorLayer.js.map +1 -1
- package/dist/src/layer/vectorTileLayer.d.ts +1 -1
- package/dist/src/layer/vectorTileLayer.js +4 -5
- package/dist/src/layer/vectorTileLayer.js.map +1 -1
- package/dist/src/layer/wfsLayer.d.ts +1 -1
- package/dist/src/layer/wfsLayer.js +5 -4
- package/dist/src/layer/wfsLayer.js.map +1 -1
- package/dist/src/layer/wmsLayer.d.ts +1 -1
- package/dist/src/layer/wmsLayer.js +3 -4
- package/dist/src/layer/wmsLayer.js.map +1 -1
- package/dist/src/layer/wmtsLayer.d.ts +1 -1
- package/dist/src/layer/wmtsLayer.js +3 -10
- package/dist/src/layer/wmtsLayer.js.map +1 -1
- package/dist/src/map/baseCesiumMap.d.ts +69 -0
- package/dist/src/map/baseCesiumMap.js +381 -0
- package/dist/src/map/baseCesiumMap.js.map +1 -0
- package/dist/src/map/cesiumMap.d.ts +6 -98
- package/dist/src/map/cesiumMap.js +32 -258
- package/dist/src/map/cesiumMap.js.map +1 -1
- package/dist/src/map/obliqueMap.d.ts +1 -1
- package/dist/src/map/obliqueMap.js +3 -4
- package/dist/src/map/obliqueMap.js.map +1 -1
- package/dist/src/map/openlayersMap.d.ts +1 -1
- package/dist/src/map/openlayersMap.js +3 -4
- package/dist/src/map/openlayersMap.js.map +1 -1
- package/dist/src/map/panoramaMap.d.ts +17 -29
- package/dist/src/map/panoramaMap.js +56 -100
- package/dist/src/map/panoramaMap.js.map +1 -1
- package/dist/src/map/vcsMap.d.ts +15 -2
- package/dist/src/map/vcsMap.js +26 -3
- package/dist/src/map/vcsMap.js.map +1 -1
- package/dist/src/oblique/obliqueCollection.d.ts +1 -1
- package/dist/src/oblique/obliqueCollection.js +3 -4
- package/dist/src/oblique/obliqueCollection.js.map +1 -1
- package/dist/src/panorama/panoramaCameraController.d.ts +4 -0
- package/dist/src/panorama/panoramaCameraController.js +8 -0
- package/dist/src/panorama/panoramaCameraController.js.map +1 -1
- package/dist/src/panorama/panoramaImage.d.ts +10 -1
- package/dist/src/panorama/panoramaImage.js +9 -4
- package/dist/src/panorama/panoramaImage.js.map +1 -1
- package/dist/src/panorama/panoramaImageView.d.ts +6 -1
- package/dist/src/panorama/panoramaImageView.js +11 -2
- package/dist/src/panorama/panoramaImageView.js.map +1 -1
- package/dist/src/panorama/panoramaTileMaterial.d.ts +6 -0
- package/dist/src/panorama/panoramaTileMaterial.js +14 -0
- package/dist/src/panorama/panoramaTileMaterial.js.map +1 -1
- package/dist/src/panorama/panoramaTileMaterialFS.shader.d.ts +1 -1
- package/dist/src/panorama/panoramaTileMaterialFS.shader.js +16 -1
- package/dist/src/panorama/panoramaTileMaterialFS.shader.js.map +1 -1
- package/dist/src/panorama/panoramaTilePrimitiveCollection.d.ts +6 -0
- package/dist/src/panorama/panoramaTilePrimitiveCollection.js +28 -0
- package/dist/src/panorama/panoramaTilePrimitiveCollection.js.map +1 -1
- package/dist/src/util/clipping/clippingPolygonObject.d.ts +1 -1
- package/dist/src/util/clipping/clippingPolygonObject.js +3 -4
- package/dist/src/util/clipping/clippingPolygonObject.js.map +1 -1
- package/dist/src/util/displayQuality/displayQuality.js +4 -4
- package/dist/src/util/displayQuality/displayQuality.js.map +1 -1
- package/dist/src/util/editor/createFeatureSession.js +3 -1
- package/dist/src/util/editor/createFeatureSession.js.map +1 -1
- package/dist/src/util/editor/editFeaturesSession.js +9 -2
- package/dist/src/util/editor/editFeaturesSession.js.map +1 -1
- package/dist/src/util/editor/editGeometrySession.js +3 -1
- package/dist/src/util/editor/editGeometrySession.js.map +1 -1
- package/dist/src/util/editor/editorSessionHelpers.d.ts +3 -3
- package/dist/src/util/editor/editorSessionHelpers.js +4 -2
- package/dist/src/util/editor/editorSessionHelpers.js.map +1 -1
- package/dist/src/util/editor/interactions/creationSnapping.js +4 -1
- package/dist/src/util/editor/interactions/creationSnapping.js.map +1 -1
- package/dist/src/util/editor/interactions/ensureHandlerSelectionInteraction.js +2 -2
- package/dist/src/util/editor/interactions/ensureHandlerSelectionInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/layerSnapping.js +4 -1
- package/dist/src/util/editor/interactions/layerSnapping.js.map +1 -1
- package/dist/src/util/editor/interactions/mapInteractionController.js +12 -1
- package/dist/src/util/editor/interactions/mapInteractionController.js.map +1 -1
- package/dist/src/util/editor/interactions/translationSnapping.js +4 -2
- package/dist/src/util/editor/interactions/translationSnapping.js.map +1 -1
- package/dist/src/util/editor/selectFeaturesSession.js +1 -1
- package/dist/src/util/editor/selectFeaturesSession.js.map +1 -1
- package/dist/src/util/editor/transformation/create3DHandlers.d.ts +2 -2
- package/dist/src/util/editor/transformation/create3DHandlers.js.map +1 -1
- package/dist/src/util/editor/transformation/transformationHandler.js +5 -2
- package/dist/src/util/editor/transformation/transformationHandler.js.map +1 -1
- package/dist/src/util/editor/transformation/translateInteraction.js +2 -2
- package/dist/src/util/editor/transformation/translateInteraction.js.map +1 -1
- package/dist/src/util/flight/flightInstance.d.ts +1 -1
- package/dist/src/util/flight/flightInstance.js +3 -4
- package/dist/src/util/flight/flightInstance.js.map +1 -1
- package/dist/src/util/mapCollection.d.ts +5 -0
- package/dist/src/util/mapCollection.js +14 -0
- package/dist/src/util/mapCollection.js.map +1 -1
- package/dist/src/util/renderScreenshot.js +2 -3
- package/dist/src/util/renderScreenshot.js.map +1 -1
- package/dist/src/util/viewpoint.js +1 -1
- package/dist/src/util/viewpoint.js.map +1 -1
- package/dist/src/vcsObject.d.ts +2 -1
- package/dist/src/vcsObject.js +9 -1
- package/dist/src/vcsObject.js.map +1 -1
- package/dist/src/vectorCluster/vectorClusterGroup.d.ts +1 -1
- package/dist/src/vectorCluster/vectorClusterGroup.js +3 -4
- package/dist/src/vectorCluster/vectorClusterGroup.js.map +1 -1
- package/dist/src/vectorCluster/vectorClusterStyleItem.d.ts +1 -1
- package/dist/src/vectorCluster/vectorClusterStyleItem.js +3 -4
- package/dist/src/vectorCluster/vectorClusterStyleItem.js.map +1 -1
- package/dist/tests/unit/helpers/cesiumHelpers.d.ts +11 -1
- package/dist/tests/unit/helpers/cesiumHelpers.js +19 -2
- package/dist/tests/unit/helpers/cesiumHelpers.js.map +1 -1
- package/dist/tests/unit/helpers/panoramaHelpers.js +1 -1
- package/dist/tests/unit/helpers/panoramaHelpers.js.map +1 -1
- package/index.ts +3 -5
- package/package.json +2 -2
- package/src/category/category.ts +3 -4
- package/src/featureProvider/abstractFeatureProvider.ts +5 -4
- package/src/featureProvider/wmsFeatureProvider.ts +52 -14
- package/src/global.d.ts +0 -1
- package/src/interaction/coordinateAtPixel.ts +4 -6
- package/src/interaction/ensurePositionInteraction.ts +50 -0
- package/src/interaction/eventHandler.ts +12 -1
- package/src/interaction/featureAtPixelInteraction.ts +39 -29
- package/src/interaction/panoramaImageSelection.ts +4 -2
- package/src/layer/cesium/cesiumTilesetCesiumImpl.ts +3 -3
- package/src/layer/cesium/cogImageryProvider.ts +9 -26
- package/src/layer/cesium/rasterLayerCesiumImpl.ts +3 -3
- package/src/layer/cesium/terrainCesiumImpl.ts +3 -3
- package/src/layer/cesium/vectorContext.ts +1 -1
- package/src/layer/cesiumTilesetLayer.ts +9 -7
- package/src/layer/cogLayer.ts +22 -6
- package/src/layer/czmlLayer.ts +4 -4
- package/src/layer/featureLayer.ts +5 -16
- package/src/layer/featureStoreLayer.ts +11 -5
- package/src/layer/flatGeobufLayer.ts +12 -0
- package/src/layer/geojsonLayer.ts +5 -12
- package/src/layer/layer.ts +148 -36
- package/src/layer/openStreetMapLayer.ts +13 -6
- package/src/layer/panorama/vectorPanoramaImpl.ts +238 -0
- package/src/layer/panoramaDatasetLayer.ts +25 -10
- package/src/layer/pointCloudLayer.ts +5 -20
- package/src/layer/rasterLayer.ts +4 -4
- package/src/layer/singleImageLayer.ts +5 -3
- package/src/layer/terrainLayer.ts +9 -6
- package/src/layer/tileProvider/flatGeobufTileProvider.ts +6 -3
- package/src/layer/tileProvider/mvtTileProvider.ts +7 -3
- package/src/layer/tileProvider/staticFeatureTileProvider.ts +5 -3
- package/src/layer/tileProvider/staticGeojsonTileProvider.ts +11 -4
- package/src/layer/tileProvider/tileProvider.ts +5 -4
- package/src/layer/tileProvider/urlTemplateTileProvider.ts +7 -3
- package/src/layer/tmsLayer.ts +3 -10
- package/src/layer/vectorLayer.ts +25 -9
- package/src/layer/vectorTileLayer.ts +6 -6
- package/src/layer/wfsLayer.ts +7 -4
- package/src/layer/wmsLayer.ts +3 -4
- package/src/layer/wmtsLayer.ts +3 -10
- package/src/map/baseCesiumMap.ts +576 -0
- package/src/map/cesiumMap.ts +103 -446
- package/src/map/obliqueMap.ts +3 -4
- package/src/map/openlayersMap.ts +5 -5
- package/src/map/panoramaMap.ts +74 -139
- package/src/map/vcsMap.ts +44 -4
- package/src/oblique/obliqueCollection.ts +5 -4
- package/src/panorama/panoramaCameraController.ts +13 -1
- package/src/panorama/panoramaImage.ts +17 -3
- package/src/panorama/panoramaImageView.ts +29 -3
- package/src/panorama/panoramaTileMaterial.ts +20 -0
- package/src/panorama/panoramaTileMaterialFS.glsl +16 -1
- package/src/panorama/panoramaTilePrimitiveCollection.ts +34 -0
- package/src/util/clipping/clippingPolygonObject.ts +5 -4
- package/src/util/displayQuality/displayQuality.ts +4 -4
- package/src/util/editor/createFeatureSession.ts +4 -1
- package/src/util/editor/editFeaturesSession.ts +14 -4
- package/src/util/editor/editGeometrySession.ts +3 -1
- package/src/util/editor/editorSessionHelpers.ts +5 -3
- package/src/util/editor/interactions/creationSnapping.ts +7 -1
- package/src/util/editor/interactions/ensureHandlerSelectionInteraction.ts +2 -2
- package/src/util/editor/interactions/layerSnapping.ts +7 -1
- package/src/util/editor/interactions/mapInteractionController.ts +12 -2
- package/src/util/editor/interactions/translationSnapping.ts +6 -4
- package/src/util/editor/selectFeaturesSession.ts +1 -1
- package/src/util/editor/transformation/create3DHandlers.ts +2 -2
- package/src/util/editor/transformation/transformationHandler.ts +5 -3
- package/src/util/editor/transformation/translateInteraction.ts +4 -4
- package/src/util/flight/flightInstance.ts +6 -5
- package/src/util/mapCollection.ts +18 -0
- package/src/util/renderScreenshot.ts +4 -8
- package/src/util/viewpoint.ts +2 -2
- package/src/vcsObject.ts +10 -1
- package/src/vectorCluster/vectorClusterGroup.ts +7 -4
- package/src/vectorCluster/vectorClusterStyleItem.ts +8 -4
- package/dist/src/map/cesiumMapHelpers.d.ts +0 -7
- package/dist/src/map/cesiumMapHelpers.js +0 -144
- package/dist/src/map/cesiumMapHelpers.js.map +0 -1
- package/src/map/cesiumMapHelpers.ts +0 -219
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
Camera,
|
|
3
|
+
PerspectiveFrustum,
|
|
4
|
+
Primitive,
|
|
5
|
+
Scene,
|
|
6
|
+
} from '@vcmap-cesium/engine';
|
|
7
|
+
import {
|
|
8
|
+
Cartesian2,
|
|
9
|
+
Matrix4,
|
|
10
|
+
Cartesian3,
|
|
11
|
+
Math as CesiumMath,
|
|
12
|
+
} from '@vcmap-cesium/engine';
|
|
3
13
|
import { getWidth } from 'ol/extent.js';
|
|
4
14
|
import type { Size } from 'ol/size.js';
|
|
5
15
|
import { getLogger } from '@vcsuite/logger';
|
|
@@ -26,6 +36,10 @@ export type PanoramaImageView = {
|
|
|
26
36
|
* Suspends the loading of tiles. This is used as a debug feature.
|
|
27
37
|
*/
|
|
28
38
|
suspendTileLoading: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The default field of view to set when a new image is loaded in radians.
|
|
41
|
+
*/
|
|
42
|
+
defaultFov: number;
|
|
29
43
|
/**
|
|
30
44
|
* The primitive collection that contains the panorama tiles.
|
|
31
45
|
*/
|
|
@@ -369,8 +383,12 @@ function setupEmptyImageOverlay(container: HTMLElement): () => void {
|
|
|
369
383
|
* to the panorama camera and updates the panorama tiles accordingly. Typically, you will not
|
|
370
384
|
* have to create this directly, but rather use the PanoramaMap's imageView property.
|
|
371
385
|
* @param map
|
|
386
|
+
* @param [initialFov=CesiumMath.PI_OVER_FOUR] The default field of view to set when a new image is loaded in radians
|
|
372
387
|
*/
|
|
373
|
-
export function createPanoramaImageView(
|
|
388
|
+
export function createPanoramaImageView(
|
|
389
|
+
map: PanoramaMap,
|
|
390
|
+
initialFov = CesiumMath.PI_OVER_FOUR,
|
|
391
|
+
): PanoramaImageView {
|
|
374
392
|
const { scene } = map.getCesiumWidget();
|
|
375
393
|
const primitiveCollection = scene.primitives.add(
|
|
376
394
|
new PanoramaTilePrimitiveCollection({
|
|
@@ -382,6 +400,7 @@ export function createPanoramaImageView(map: PanoramaMap): PanoramaImageView {
|
|
|
382
400
|
const defaultPosition = Cartesian3.fromDegrees(12, 53, 0);
|
|
383
401
|
|
|
384
402
|
let currentView: ImageWrapper | undefined;
|
|
403
|
+
let defaultFov = initialFov;
|
|
385
404
|
let removeOverlay: (() => void) | undefined;
|
|
386
405
|
scene.camera.setView({
|
|
387
406
|
destination: defaultPosition,
|
|
@@ -400,6 +419,7 @@ export function createPanoramaImageView(map: PanoramaMap): PanoramaImageView {
|
|
|
400
419
|
if (image) {
|
|
401
420
|
currentView = createImageWrapper(image, primitiveCollection, scene, map);
|
|
402
421
|
currentView.suspendTileLoading = suspendTileLoading;
|
|
422
|
+
(scene.camera.frustum as PerspectiveFrustum).fov = defaultFov;
|
|
403
423
|
} else {
|
|
404
424
|
currentView = undefined;
|
|
405
425
|
if (scene.canvas.parentElement) {
|
|
@@ -433,6 +453,12 @@ export function createPanoramaImageView(map: PanoramaMap): PanoramaImageView {
|
|
|
433
453
|
get tilePrimitiveCollection(): PanoramaTilePrimitiveCollection {
|
|
434
454
|
return primitiveCollection;
|
|
435
455
|
},
|
|
456
|
+
get defaultFov(): number {
|
|
457
|
+
return defaultFov;
|
|
458
|
+
},
|
|
459
|
+
set defaultFov(value: number) {
|
|
460
|
+
defaultFov = value;
|
|
461
|
+
},
|
|
436
462
|
render,
|
|
437
463
|
destroy(): void {
|
|
438
464
|
this.render = (): void => {};
|
|
@@ -52,6 +52,8 @@ export type PanoramaTileMaterialUniforms = {
|
|
|
52
52
|
u_imageReady: boolean;
|
|
53
53
|
u_intensityReady: boolean;
|
|
54
54
|
u_cursorColor: Color;
|
|
55
|
+
u_contrast: number;
|
|
56
|
+
u_brightness: number;
|
|
55
57
|
};
|
|
56
58
|
|
|
57
59
|
function createDebugCanvas(tileSize: Size, text: string): HTMLCanvasElement {
|
|
@@ -100,6 +102,8 @@ export function getDefaultPanoramaTileMaterialUniforms(): PanoramaTileMaterialUn
|
|
|
100
102
|
u_depthReady: false,
|
|
101
103
|
u_overlayNaNColor: Color.RED,
|
|
102
104
|
u_cursorColor: Color.fromCssColorString(defaultCursorColor),
|
|
105
|
+
u_contrast: 1,
|
|
106
|
+
u_brightness: 0,
|
|
103
107
|
};
|
|
104
108
|
}
|
|
105
109
|
|
|
@@ -205,6 +209,22 @@ export default class PanoramaTileMaterial extends Material {
|
|
|
205
209
|
this.uniforms.u_opacity = value;
|
|
206
210
|
}
|
|
207
211
|
|
|
212
|
+
get contrast(): number {
|
|
213
|
+
return this.uniforms.u_contrast;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
set contrast(value: number) {
|
|
217
|
+
this.uniforms.u_contrast = value;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
get brightness(): number {
|
|
221
|
+
return this.uniforms.u_brightness;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
set brightness(value: number) {
|
|
225
|
+
this.uniforms.u_brightness = value;
|
|
226
|
+
}
|
|
227
|
+
|
|
208
228
|
/**
|
|
209
229
|
* The position of the cursor in the panorama tile. Internal API to render the depth cursor.
|
|
210
230
|
* (-1, -1, -1) means no data is available.
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
* @uniform {bool} u_intensityReady - Flag indicating if intensity data is ready
|
|
23
23
|
* @uniform {bool} u_depthReady - Flag indicating if depth data is ready
|
|
24
24
|
* @uniform {vec4} u_overlayNaNColor - Color used for missing/NaN overlay values
|
|
25
|
+
* @uniform {float} u_brightness - Brightness adjustment
|
|
26
|
+
* @uniform {float} u_contrast - Contrast adjustment
|
|
25
27
|
*/
|
|
26
28
|
|
|
27
29
|
#define OVERLAY_INTENSITY 1.0
|
|
@@ -92,7 +94,20 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
92
94
|
vec2 clamped_uv = clamp(materialInput.st, u_minUV, u_maxUV);
|
|
93
95
|
vec2 scaled_uv = (clamped_uv - u_minUV) / (u_maxUV - u_minUV);
|
|
94
96
|
|
|
95
|
-
vec4 t_color = texture(u_rgb, scaled_uv);
|
|
97
|
+
vec4 t_color = czm_srgbToLinear(texture(u_rgb, scaled_uv));
|
|
98
|
+
|
|
99
|
+
if (u_brightness != 0.0)
|
|
100
|
+
{
|
|
101
|
+
t_color.rgb += u_brightness;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (u_contrast != 1.0)
|
|
105
|
+
{
|
|
106
|
+
t_color.rgb = ((t_color.rgb - 0.5) * u_contrast) + 0.5;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
clamp(t_color, 0.0, 1.0);
|
|
110
|
+
|
|
96
111
|
if (u_intensityReady && u_overlay == OVERLAY_INTENSITY)
|
|
97
112
|
{
|
|
98
113
|
float inensity_value = get_texel_value(u_intensity, scaled_uv);
|
|
@@ -28,6 +28,10 @@ export default class PanoramaTilePrimitiveCollection extends PrimitiveCollection
|
|
|
28
28
|
|
|
29
29
|
private _cursorColor: Color = Color.fromCssColorString(defaultCursorColor);
|
|
30
30
|
|
|
31
|
+
private _contrast = 1.0;
|
|
32
|
+
|
|
33
|
+
private _brightness = 0.0;
|
|
34
|
+
|
|
31
35
|
overlayChanged = new VcsEvent<PanoramaOverlayMode>();
|
|
32
36
|
|
|
33
37
|
constructor(options?: ConstructorParameters<typeof PrimitiveCollection>[0]) {
|
|
@@ -104,6 +108,34 @@ export default class PanoramaTilePrimitiveCollection extends PrimitiveCollection
|
|
|
104
108
|
}
|
|
105
109
|
}
|
|
106
110
|
|
|
111
|
+
get contrast(): number {
|
|
112
|
+
return this._contrast;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
set contrast(value: number) {
|
|
116
|
+
if (this._contrast !== value) {
|
|
117
|
+
this._contrast = value;
|
|
118
|
+
this._primitives.forEach((primitive) => {
|
|
119
|
+
(primitive.appearance.material as PanoramaTileMaterial).contrast =
|
|
120
|
+
value;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
get brightness(): number {
|
|
126
|
+
return this._brightness;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
set brightness(value: number) {
|
|
130
|
+
if (this._brightness !== value) {
|
|
131
|
+
this._brightness = value;
|
|
132
|
+
this._primitives.forEach((primitive) => {
|
|
133
|
+
(primitive.appearance.material as PanoramaTileMaterial).brightness =
|
|
134
|
+
value;
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
107
139
|
get cursorPosition(): Cartesian3 {
|
|
108
140
|
return this._cursorPosition;
|
|
109
141
|
}
|
|
@@ -152,6 +184,8 @@ export default class PanoramaTilePrimitiveCollection extends PrimitiveCollection
|
|
|
152
184
|
material.opacity = this.opacity;
|
|
153
185
|
material.cursorPosition = this.cursorPosition;
|
|
154
186
|
material.cursorColor = this.cursorColor;
|
|
187
|
+
material.brightness = this.brightness;
|
|
188
|
+
material.contrast = this.contrast;
|
|
155
189
|
|
|
156
190
|
return super.add(primitive, index) as Primitive;
|
|
157
191
|
}
|
|
@@ -82,8 +82,8 @@ class ClippingPolygonObject extends VcsObject {
|
|
|
82
82
|
terrainChanged = new VcsEvent<boolean>();
|
|
83
83
|
|
|
84
84
|
constructor(options: ClippingPolygonObjectOptions) {
|
|
85
|
-
super(options);
|
|
86
85
|
const defaultOptions = ClippingPolygonObject.getDefaultOptions();
|
|
86
|
+
super({ ...defaultOptions, ...options });
|
|
87
87
|
|
|
88
88
|
this.activeOnStartup = parseBoolean(
|
|
89
89
|
options.activeOnStartup,
|
|
@@ -190,12 +190,13 @@ class ClippingPolygonObject extends VcsObject {
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
toJSON(
|
|
193
|
+
toJSON(
|
|
194
|
+
defaultOptions = ClippingPolygonObject.getDefaultOptions(),
|
|
195
|
+
): ClippingPolygonObjectOptions {
|
|
194
196
|
const config: ClippingPolygonObjectOptions = {
|
|
195
|
-
...super.toJSON(),
|
|
197
|
+
...super.toJSON(defaultOptions),
|
|
196
198
|
coordinates: structuredClone(this._coordinates),
|
|
197
199
|
};
|
|
198
|
-
const defaultOptions = ClippingPolygonObject.getDefaultOptions();
|
|
199
200
|
|
|
200
201
|
if (!deepEqual(this._layerNames, defaultOptions.layerNames)) {
|
|
201
202
|
config.layerNames = getLayerNamesClone(this._layerNames);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { check, oneOf } from '@vcsuite/check';
|
|
2
2
|
import type VcsApp from '../../vcsApp.js';
|
|
3
3
|
import FeatureStoreLayer from '../../layer/featureStoreLayer.js';
|
|
4
|
-
import CesiumMap from '../../map/cesiumMap.js';
|
|
5
4
|
import { isMobile } from '../isMobile.js';
|
|
6
5
|
import CesiumTilesetLayer from '../../layer/cesiumTilesetLayer.js';
|
|
7
6
|
import VcsEvent from '../../vcsEvent.js';
|
|
7
|
+
import BaseCesiumMap from '../../map/baseCesiumMap.js';
|
|
8
8
|
|
|
9
9
|
export enum DisplayQualityLevel {
|
|
10
10
|
LOW = 'low',
|
|
@@ -104,7 +104,7 @@ class DisplayQuality {
|
|
|
104
104
|
this._listeners = [
|
|
105
105
|
this._app.maps.mapActivated.addEventListener(() => {
|
|
106
106
|
if (
|
|
107
|
-
this._app.maps.activeMap instanceof
|
|
107
|
+
this._app.maps.activeMap instanceof BaseCesiumMap &&
|
|
108
108
|
!this.currentQualityLevel
|
|
109
109
|
) {
|
|
110
110
|
if (isMobile()) {
|
|
@@ -115,7 +115,7 @@ class DisplayQuality {
|
|
|
115
115
|
}
|
|
116
116
|
}),
|
|
117
117
|
this._app.layers.stateChanged.addEventListener((layer) => {
|
|
118
|
-
if (layer.active && this._app.maps.activeMap instanceof
|
|
118
|
+
if (layer.active && this._app.maps.activeMap instanceof BaseCesiumMap) {
|
|
119
119
|
this._setLayerQuality(layer.name);
|
|
120
120
|
}
|
|
121
121
|
}),
|
|
@@ -222,7 +222,7 @@ class DisplayQuality {
|
|
|
222
222
|
),
|
|
223
223
|
);
|
|
224
224
|
|
|
225
|
-
if (!(this._app.maps.activeMap instanceof
|
|
225
|
+
if (!(this._app.maps.activeMap instanceof BaseCesiumMap)) {
|
|
226
226
|
this._currentQualityLevel = undefined;
|
|
227
227
|
this._viewModelSettings.startingQualityLevel = level;
|
|
228
228
|
this._viewModelSettings.startingMobileQualityLevel = level;
|
|
@@ -126,7 +126,7 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
126
126
|
interactionChain,
|
|
127
127
|
removed: interactionRemoved,
|
|
128
128
|
destroy: destroyInteractionChain,
|
|
129
|
-
} = setupInteractionChain(app.maps
|
|
129
|
+
} = setupInteractionChain(app.maps);
|
|
130
130
|
const { layer: scratchLayer, destroy: destroyScratchLayer } =
|
|
131
131
|
setupScratchLayer(app.layers, app.maps.eventHandler.featureInteraction);
|
|
132
132
|
|
|
@@ -340,6 +340,7 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
340
340
|
if (app.maps.target) {
|
|
341
341
|
app.maps.target.style.cursor = cursorMap.edit;
|
|
342
342
|
}
|
|
343
|
+
app.maps.pausePanoramaImageSelection = true;
|
|
343
344
|
|
|
344
345
|
const stop = (): void => {
|
|
345
346
|
isStopped = true; // setting stopped true immediately, to prevent the recreation of the interaction chain on finished
|
|
@@ -348,6 +349,8 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
348
349
|
if (app.maps.target) {
|
|
349
350
|
app.maps.target.style.cursor = cursorMap.auto;
|
|
350
351
|
}
|
|
352
|
+
app.maps.pausePanoramaImageSelection = false;
|
|
353
|
+
|
|
351
354
|
mapChangedListener();
|
|
352
355
|
obliqueImageChangedListener();
|
|
353
356
|
if (currentInteraction) {
|
|
@@ -39,6 +39,7 @@ import type VcsApp from '../../vcsApp.js';
|
|
|
39
39
|
import type VectorLayer from '../../layer/vectorLayer.js';
|
|
40
40
|
import type VcsMap from '../../map/vcsMap.js';
|
|
41
41
|
import RightClickInteraction from './interactions/rightClickInteraction.js';
|
|
42
|
+
import BaseCesiumMap from '../../map/baseCesiumMap.js';
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
45
|
* Saves the original allowPicking settings and sets them to false if CTRL is not pressed.
|
|
@@ -189,7 +190,7 @@ function startEditFeaturesSession(
|
|
|
189
190
|
interactionChain,
|
|
190
191
|
removed: interactionRemoved,
|
|
191
192
|
destroy: destroyInteractionChain,
|
|
192
|
-
} = setupInteractionChain(app.maps
|
|
193
|
+
} = setupInteractionChain(app.maps, interactionId);
|
|
193
194
|
|
|
194
195
|
const { exclusiveInteractionId } = app.maps.eventHandler;
|
|
195
196
|
const removeRightClickStart = app.maps.eventHandler.addExclusiveInteraction(
|
|
@@ -328,7 +329,9 @@ function startEditFeaturesSession(
|
|
|
328
329
|
|
|
329
330
|
const createTransformations = (): void => {
|
|
330
331
|
destroyTransformation();
|
|
331
|
-
|
|
332
|
+
const currentEnsurePositionActive =
|
|
333
|
+
app.maps.eventHandler.ensurePositionInteraction.active;
|
|
334
|
+
app.maps.eventHandler.ensurePositionInteraction.setActive(false);
|
|
332
335
|
transformationHandler = createTransformationHandler(
|
|
333
336
|
app.maps.activeMap!,
|
|
334
337
|
layer,
|
|
@@ -374,6 +377,9 @@ function startEditFeaturesSession(
|
|
|
374
377
|
interactionChain.addInteraction(interaction);
|
|
375
378
|
|
|
376
379
|
destroyTransformation = (): void => {
|
|
380
|
+
app.maps.eventHandler.ensurePositionInteraction.setActive(
|
|
381
|
+
currentEnsurePositionActive,
|
|
382
|
+
);
|
|
377
383
|
interactionChain.removeInteraction(interaction);
|
|
378
384
|
interaction.destroy();
|
|
379
385
|
transformationHandler?.destroy();
|
|
@@ -410,7 +416,10 @@ function startEditFeaturesSession(
|
|
|
410
416
|
} else {
|
|
411
417
|
obliqueImageChangedListener = (): void => {};
|
|
412
418
|
}
|
|
413
|
-
if (
|
|
419
|
+
if (
|
|
420
|
+
mode === TransformationMode.EXTRUDE &&
|
|
421
|
+
!(map instanceof BaseCesiumMap)
|
|
422
|
+
) {
|
|
414
423
|
setMode(TransformationMode.TRANSLATE);
|
|
415
424
|
} else {
|
|
416
425
|
createTransformations();
|
|
@@ -432,7 +441,7 @@ function startEditFeaturesSession(
|
|
|
432
441
|
};
|
|
433
442
|
|
|
434
443
|
const originalCreateSyncMap = new Map<string | number, boolean>();
|
|
435
|
-
|
|
444
|
+
app.maps.pausePanoramaImageSelection = true;
|
|
436
445
|
const stop = (): void => {
|
|
437
446
|
destroyTransformation();
|
|
438
447
|
destroyInteractionChain();
|
|
@@ -440,6 +449,7 @@ function startEditFeaturesSession(
|
|
|
440
449
|
mapChangedListener();
|
|
441
450
|
modifierChangedListener();
|
|
442
451
|
unByKey(featureListeners);
|
|
452
|
+
app.maps.pausePanoramaImageSelection = false;
|
|
443
453
|
currentFeatures.forEach((feature) => {
|
|
444
454
|
clearAllowPicking(feature, allowPickingMap);
|
|
445
455
|
clearCreateSync(feature, originalCreateSyncMap);
|
|
@@ -456,7 +456,7 @@ function startEditGeometrySession(
|
|
|
456
456
|
interactionChain,
|
|
457
457
|
removed: interactionRemoved,
|
|
458
458
|
destroy: destroyInteractionChain,
|
|
459
|
-
} = setupInteractionChain(app.maps
|
|
459
|
+
} = setupInteractionChain(app.maps, interactionId);
|
|
460
460
|
|
|
461
461
|
const { layer: scratchLayer, destroy: destroyScratchLayer } =
|
|
462
462
|
setupScratchLayer(app.layers, app.maps.eventHandler.featureInteraction);
|
|
@@ -617,6 +617,7 @@ function startEditGeometrySession(
|
|
|
617
617
|
const mapActivatedListener =
|
|
618
618
|
app.maps.mapActivated.addEventListener(setupActiveMap);
|
|
619
619
|
setupActiveMap();
|
|
620
|
+
app.maps.pausePanoramaImageSelection = true;
|
|
620
621
|
|
|
621
622
|
const stop = (): void => {
|
|
622
623
|
destroyScratchLayer();
|
|
@@ -624,6 +625,7 @@ function startEditGeometrySession(
|
|
|
624
625
|
unByKey(featureListener);
|
|
625
626
|
}
|
|
626
627
|
mapActivatedListener();
|
|
628
|
+
app.maps.pausePanoramaImageSelection = false;
|
|
627
629
|
mapInteractionController.reset();
|
|
628
630
|
mouseOverInteraction.reset();
|
|
629
631
|
destroyCurrentInteractionSet();
|
|
@@ -10,10 +10,10 @@ import type LayerCollection from '../layerCollection.js';
|
|
|
10
10
|
import { maxZIndex } from '../layerCollection.js';
|
|
11
11
|
import { markVolatile } from '../../vcsModule.js';
|
|
12
12
|
import { PrimitiveOptionsType } from '../../layer/vectorProperties.js';
|
|
13
|
-
import type EventHandler from '../../interaction/eventHandler.js';
|
|
14
13
|
import type VcsApp from '../../vcsApp.js';
|
|
15
14
|
import type { InteractionEvent } from '../../interaction/abstractInteraction.js';
|
|
16
15
|
import type FeatureAtPixelInteraction from '../../interaction/featureAtPixelInteraction.js';
|
|
16
|
+
import type MapCollection from '../mapCollection.js';
|
|
17
17
|
|
|
18
18
|
export const alreadySnapped = Symbol('alreadySnapped');
|
|
19
19
|
|
|
@@ -50,6 +50,7 @@ export function setupScratchLayer(
|
|
|
50
50
|
): { layer: VectorLayer; destroy: () => void } {
|
|
51
51
|
// IDEA pass in stopped and cleanup ourselves?
|
|
52
52
|
const layer = new VectorLayer({
|
|
53
|
+
ignoreMapLayerTypes: true,
|
|
53
54
|
projection: mercatorProjection.toJSON(),
|
|
54
55
|
vectorProperties: {
|
|
55
56
|
altitudeMode: 'clampToGround',
|
|
@@ -110,18 +111,19 @@ export function setupScratchLayer(
|
|
|
110
111
|
* Sets up the default interaction chain for the editors. This will set the provided event handlers
|
|
111
112
|
* feature interaction to be active on CLICKMOVE & DRAGSTART. Destroying the setup will reset the interaction
|
|
112
113
|
* to its previous active state.
|
|
113
|
-
* @param
|
|
114
|
+
* @param maps
|
|
114
115
|
* @param [interactionId]
|
|
115
116
|
* @private
|
|
116
117
|
*/
|
|
117
118
|
export function setupInteractionChain(
|
|
118
|
-
|
|
119
|
+
maps: MapCollection,
|
|
119
120
|
interactionId?: string,
|
|
120
121
|
): {
|
|
121
122
|
interactionChain: InteractionChain;
|
|
122
123
|
removed: VcsEvent<void>;
|
|
123
124
|
destroy(this: void): void;
|
|
124
125
|
} {
|
|
126
|
+
const { eventHandler } = maps;
|
|
125
127
|
const interactionChain = new InteractionChain();
|
|
126
128
|
const removed = new VcsEvent<void>();
|
|
127
129
|
const listener = eventHandler.addExclusiveInteraction(
|
|
@@ -19,6 +19,7 @@ import type VectorLayer from '../../../layer/vectorLayer.js';
|
|
|
19
19
|
import { validityPlaceholder } from './createPolygonInteraction.js';
|
|
20
20
|
import type { SnappingInteractionEvent } from '../editorSessionHelpers.js';
|
|
21
21
|
import { alreadySnapped } from '../editorSessionHelpers.js';
|
|
22
|
+
import PanoramaMap from '../../../map/panoramaMap.js';
|
|
22
23
|
|
|
23
24
|
function getBearings(coordinates: Coordinate[]): number[] {
|
|
24
25
|
// we dont want to take into account the last bearing, since that would be our own
|
|
@@ -143,9 +144,14 @@ export default class CreationSnapping extends AbstractInteraction {
|
|
|
143
144
|
this._coordinatesDirty = true;
|
|
144
145
|
});
|
|
145
146
|
}
|
|
147
|
+
|
|
148
|
+
const ctrlKey = event.key === ModificationKeyType.CTRL;
|
|
149
|
+
const useSnapping =
|
|
150
|
+
event.map.className === PanoramaMap.className ? ctrlKey : !ctrlKey;
|
|
151
|
+
|
|
146
152
|
if (
|
|
147
153
|
!event[alreadySnapped] &&
|
|
148
|
-
|
|
154
|
+
useSnapping &&
|
|
149
155
|
this._coordinates.length >= 3
|
|
150
156
|
) {
|
|
151
157
|
const results = new Array<SnapResult | undefined>(2);
|
|
@@ -4,7 +4,7 @@ import type { EventAfterEventHandler } from '../../../interaction/abstractIntera
|
|
|
4
4
|
import AbstractInteraction from '../../../interaction/abstractInteraction.js';
|
|
5
5
|
import { EventType } from '../../../interaction/interactionType.js';
|
|
6
6
|
import { handlerSymbol } from '../editorSymbols.js';
|
|
7
|
-
import
|
|
7
|
+
import BaseCesiumMap from '../../../map/baseCesiumMap.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* This interaction ensure a potential handler is dragged in 3D when it is obscured by a transparent feature.
|
|
@@ -28,7 +28,7 @@ class EnsureHandlerSelectionInteraction extends AbstractInteraction {
|
|
|
28
28
|
event.feature &&
|
|
29
29
|
this._featureSelection.length > 0 &&
|
|
30
30
|
!(event.feature as Feature)[handlerSymbol] &&
|
|
31
|
-
event.map instanceof
|
|
31
|
+
event.map instanceof BaseCesiumMap
|
|
32
32
|
) {
|
|
33
33
|
const scene = event.map.getScene() as Scene;
|
|
34
34
|
const drillPicks = scene.drillPick(
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
setSnappingFeatures,
|
|
17
17
|
getGeometrySnapResult,
|
|
18
18
|
} from '../snappingHelpers.js';
|
|
19
|
+
import PanoramaMap from '../../../map/panoramaMap.js';
|
|
19
20
|
|
|
20
21
|
export default class LayerSnapping extends AbstractInteraction {
|
|
21
22
|
private _removeFeatures: (() => void) | undefined;
|
|
@@ -59,7 +60,12 @@ export default class LayerSnapping extends AbstractInteraction {
|
|
|
59
60
|
|
|
60
61
|
pipe(event: SnappingInteractionEvent): Promise<SnappingInteractionEvent> {
|
|
61
62
|
this._removeFeatures?.();
|
|
62
|
-
|
|
63
|
+
|
|
64
|
+
const ctrlKey = event.key === ModificationKeyType.CTRL;
|
|
65
|
+
const useSnapping =
|
|
66
|
+
event.map.className === PanoramaMap.className ? ctrlKey : !ctrlKey;
|
|
67
|
+
|
|
68
|
+
if (useSnapping) {
|
|
63
69
|
const coordinate = event.positionOrPixel!;
|
|
64
70
|
const bufferDistance = event.map.getCurrentResolution(coordinate) * 12;
|
|
65
71
|
const maxDistanceSquared = bufferDistance ** 2;
|
|
@@ -9,7 +9,8 @@ import { handlerSymbol, vertexSymbol } from '../editorSymbols.js';
|
|
|
9
9
|
import type { EventAfterEventHandler } from '../../../interaction/abstractInteraction.js';
|
|
10
10
|
import AbstractInteraction from '../../../interaction/abstractInteraction.js';
|
|
11
11
|
import type BaseOLMap from '../../../map/baseOLMap.js';
|
|
12
|
-
import
|
|
12
|
+
import CesiumMap from '../../../map/cesiumMap.js';
|
|
13
|
+
import PanoramaMap from '../../../map/panoramaMap.js';
|
|
13
14
|
|
|
14
15
|
function suspendOpenlayerMap(map: BaseOLMap): () => void {
|
|
15
16
|
const dragPan = map
|
|
@@ -26,6 +27,13 @@ function suspendOpenlayerMap(map: BaseOLMap): () => void {
|
|
|
26
27
|
return () => {};
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
function suspendPanoramaMap(map: PanoramaMap): () => void {
|
|
31
|
+
map.panoramaCameraController.enabled = false;
|
|
32
|
+
return () => {
|
|
33
|
+
map.panoramaCameraController.enabled = true;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
29
37
|
type CachedScreenSpaceCameraControllerKeys =
|
|
30
38
|
| 'lookEventTypes'
|
|
31
39
|
| 'tiltEventTypes'
|
|
@@ -99,8 +107,10 @@ class MapInteractionController extends AbstractInteraction {
|
|
|
99
107
|
((event.feature as Feature)[vertexSymbol] ||
|
|
100
108
|
(event.feature as Feature)[handlerSymbol])
|
|
101
109
|
) {
|
|
102
|
-
if (event.map.className ===
|
|
110
|
+
if (event.map.className === CesiumMap.className) {
|
|
103
111
|
this._clear = suspendCesiumMap(event.map as CesiumMap);
|
|
112
|
+
} else if (event.map.className === PanoramaMap.className) {
|
|
113
|
+
this._clear = suspendPanoramaMap(event.map as PanoramaMap);
|
|
104
114
|
} else {
|
|
105
115
|
this._clear = suspendOpenlayerMap(event.map as BaseOLMap);
|
|
106
116
|
}
|
|
@@ -19,6 +19,7 @@ import { vertexIndexSymbol } from '../editorSymbols.js';
|
|
|
19
19
|
import { isVertex } from '../editorHelpers.js';
|
|
20
20
|
import type { SnappingInteractionEvent } from '../editorSessionHelpers.js';
|
|
21
21
|
import { alreadySnapped } from '../editorSessionHelpers.js';
|
|
22
|
+
import PanoramaMap from '../../../map/panoramaMap.js';
|
|
22
23
|
|
|
23
24
|
function getBearings(coordinates: Coordinate[], isPolygon: boolean): number[] {
|
|
24
25
|
const length = isPolygon ? coordinates.length : coordinates.length - 1;
|
|
@@ -141,13 +142,14 @@ export default class TranslationSnapping extends AbstractInteraction {
|
|
|
141
142
|
return Promise.resolve(event);
|
|
142
143
|
}
|
|
143
144
|
|
|
145
|
+
const ctrlKey = event.key === ModificationKeyType.CTRL;
|
|
146
|
+
const useSnapping =
|
|
147
|
+
event.map.className === PanoramaMap.className ? ctrlKey : !ctrlKey;
|
|
148
|
+
|
|
144
149
|
if (event.type === EventType.DRAGEND && this._lastCoordinate) {
|
|
145
150
|
event.positionOrPixel = this._lastCoordinate;
|
|
146
151
|
this._lastCoordinate = undefined;
|
|
147
|
-
} else if (
|
|
148
|
-
event.key !== ModificationKeyType.CTRL &&
|
|
149
|
-
isVertex(event.feature)
|
|
150
|
-
) {
|
|
152
|
+
} else if (useSnapping && isVertex(event.feature)) {
|
|
151
153
|
const index = event.feature[vertexIndexSymbol];
|
|
152
154
|
if (event.type === EventType.DRAGSTART) {
|
|
153
155
|
this._setCoordinates(index);
|
|
@@ -160,7 +160,7 @@ function startSelectFeaturesSession(
|
|
|
160
160
|
interactionChain,
|
|
161
161
|
removed: interactionRemoved,
|
|
162
162
|
destroy: destroyInteractionChain,
|
|
163
|
-
} = setupInteractionChain(app.maps
|
|
163
|
+
} = setupInteractionChain(app.maps, interactionId);
|
|
164
164
|
|
|
165
165
|
const highlightManager = createHighlightManager(layer, highlightStyle);
|
|
166
166
|
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
} from './transformationTypes.js';
|
|
36
36
|
import Projection from '../../projection.js';
|
|
37
37
|
import { mercatorToCartesian } from '../../math.js';
|
|
38
|
-
import type
|
|
38
|
+
import type BaseCesiumMap from '../../../map/baseCesiumMap.js';
|
|
39
39
|
|
|
40
40
|
function setFeatureOnPrimitive(primitive: Primitive): void {
|
|
41
41
|
if (primitive[handlerSymbol]) {
|
|
@@ -545,7 +545,7 @@ function createShowShadowPrimitive(
|
|
|
545
545
|
* @param mode
|
|
546
546
|
*/
|
|
547
547
|
export default function create3DHandlers(
|
|
548
|
-
map:
|
|
548
|
+
map: BaseCesiumMap,
|
|
549
549
|
mode: TransformationMode,
|
|
550
550
|
): Handlers {
|
|
551
551
|
const primitiveCollection = new PrimitiveCollection();
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
} from 'ol/extent.js';
|
|
9
9
|
import { HeightReference } from '@vcmap-cesium/engine';
|
|
10
10
|
import Extent3D from '../../featureconverter/extent3D.js';
|
|
11
|
-
import CesiumMap from '../../../map/cesiumMap.js';
|
|
12
11
|
import BaseOLMap from '../../../map/baseOLMap.js';
|
|
13
12
|
import create3DHandlers from './create3DHandlers.js';
|
|
14
13
|
import create2DHandlers from './create2DHandlers.js';
|
|
@@ -28,6 +27,7 @@ import {
|
|
|
28
27
|
} from '../../featureconverter/vectorHeightInfo.js';
|
|
29
28
|
import { mercatorToCartographic } from '../../math.js';
|
|
30
29
|
import { is2DLayout } from '../../geometryHelpers.js';
|
|
30
|
+
import BaseCesiumMap from '../../../map/baseCesiumMap.js';
|
|
31
31
|
|
|
32
32
|
type FeatureCenterInfo = {
|
|
33
33
|
center: Coordinate;
|
|
@@ -126,7 +126,7 @@ export default function createTransformationHandler(
|
|
|
126
126
|
let handlerFeatures: Handlers;
|
|
127
127
|
let center: Coordinate = [0, 0, 0];
|
|
128
128
|
let getCenterFromFeatures: (features: Feature[]) => FeatureCenterInfo;
|
|
129
|
-
let cesiumMap:
|
|
129
|
+
let cesiumMap: BaseCesiumMap | null = null;
|
|
130
130
|
|
|
131
131
|
const setFeatures = (features: Feature[]): void => {
|
|
132
132
|
const show = features.length > 0;
|
|
@@ -168,13 +168,15 @@ export default function createTransformationHandler(
|
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
|
|
171
|
-
if (map instanceof
|
|
171
|
+
if (map instanceof BaseCesiumMap) {
|
|
172
172
|
handlerFeatures = create3DHandlers(map, mode);
|
|
173
173
|
getCenterFromFeatures = getCenterFromFeatures3D.bind(null, layer, mode);
|
|
174
174
|
cesiumMap = map;
|
|
175
175
|
} else if (map instanceof BaseOLMap) {
|
|
176
176
|
handlerFeatures = create2DHandlers(map, scratchLayer, mode);
|
|
177
177
|
getCenterFromFeatures = getCenterFromFeatures2D;
|
|
178
|
+
} else {
|
|
179
|
+
throw new Error('unsupported map type for transformation handler');
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
return {
|
|
@@ -17,7 +17,7 @@ import Projection, { mercatorProjection } from '../../projection.js';
|
|
|
17
17
|
import { cartographicToWgs84, mercatorToCartesian } from '../../math.js';
|
|
18
18
|
import type { TransformationHandler } from './transformationTypes.js';
|
|
19
19
|
import { AxisAndPlanes, is1DAxis, is2DAxis } from './transformationTypes.js';
|
|
20
|
-
import
|
|
20
|
+
import BaseCesiumMap from '../../../map/baseCesiumMap.js';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Of type [dx, dy, dz];
|
|
@@ -66,7 +66,7 @@ class TranslateInteraction extends AbstractInteraction {
|
|
|
66
66
|
const axis = (event.feature as Feature)[handlerSymbol] as AxisAndPlanes;
|
|
67
67
|
if (axis !== AxisAndPlanes.NONE) {
|
|
68
68
|
this._transformationHandler!.showAxis = axis;
|
|
69
|
-
if (event.map instanceof
|
|
69
|
+
if (event.map instanceof BaseCesiumMap) {
|
|
70
70
|
if (is1DAxis(axis)) {
|
|
71
71
|
this._getTranslateEvent = this._dragAlongAxis3D(axis, event);
|
|
72
72
|
} else if (is2DAxis(axis)) {
|
|
@@ -86,7 +86,7 @@ class TranslateInteraction extends AbstractInteraction {
|
|
|
86
86
|
axis: AxisAndPlanes,
|
|
87
87
|
event: EventAfterEventHandler,
|
|
88
88
|
): GetTranslateEvent {
|
|
89
|
-
const scene = (event.map as
|
|
89
|
+
const scene = (event.map as BaseCesiumMap).getScene() as Scene;
|
|
90
90
|
if (axis !== AxisAndPlanes.Z) {
|
|
91
91
|
const center = mercatorToCartesian(this._transformationHandler!.center);
|
|
92
92
|
let plane = Plane.clone(Plane.ORIGIN_XY_PLANE);
|
|
@@ -147,7 +147,7 @@ class TranslateInteraction extends AbstractInteraction {
|
|
|
147
147
|
axis: AxisAndPlanes,
|
|
148
148
|
event: EventAfterEventHandler,
|
|
149
149
|
): GetTranslateEvent {
|
|
150
|
-
const scene = (event.map as
|
|
150
|
+
const scene = (event.map as BaseCesiumMap).getScene() as Scene;
|
|
151
151
|
const center = mercatorToCartesian(this._transformationHandler!.center);
|
|
152
152
|
let plane: Plane;
|
|
153
153
|
if (axis === AxisAndPlanes.YZ) {
|