@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,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Clock, Color, type ContextOptions, CustomDataSource, DataSourceClock, DataSourceCollection, DataSourceDisplay, type EntityCollection, type Event as CesiumEvent, JulianDate, type Scene, type ShadowMap } from '@vcmap-cesium/engine';
|
|
2
2
|
import type { Coordinate } from 'ol/coordinate.js';
|
|
3
|
-
import
|
|
3
|
+
import { type VcsMapOptions } from './vcsMap.js';
|
|
4
4
|
import type Viewpoint from '../util/viewpoint.js';
|
|
5
5
|
import type { CameraLimiterOptions } from './cameraLimiter.js';
|
|
6
6
|
import CameraLimiter from './cameraLimiter.js';
|
|
7
|
-
import type LayerCollection from '../util/layerCollection.js';
|
|
8
|
-
import type Layer from '../layer/layer.js';
|
|
9
7
|
import VcsEvent from '../vcsEvent.js';
|
|
10
8
|
import type { DisableMapControlOptions } from '../util/mapCollection.js';
|
|
9
|
+
import BaseCesiumMap, { type CesiumVisualisationType } from './baseCesiumMap.js';
|
|
11
10
|
export type CesiumMapOptions = VcsMapOptions & {
|
|
12
11
|
/**
|
|
13
12
|
* if true, lighting will be activated.
|
|
@@ -46,57 +45,19 @@ export type CesiumMapEvent = {
|
|
|
46
45
|
scene: Scene;
|
|
47
46
|
time: JulianDate;
|
|
48
47
|
};
|
|
49
|
-
/**
|
|
50
|
-
* Ensures, a primitive/imageryLayer/entity is part of a collection and placed at the correct location
|
|
51
|
-
* @param cesiumCollection
|
|
52
|
-
* @param item
|
|
53
|
-
* @param layerCollection
|
|
54
|
-
* @private
|
|
55
|
-
*/
|
|
56
|
-
export declare function ensureInCollection<T extends PrimitiveCollection | ImageryLayerCollection>(cesiumCollection: T, item: T extends PrimitiveCollection ? PrimitiveCollection | Cesium3DTileset : ImageryLayer, layerCollection: LayerCollection): void;
|
|
57
|
-
/**
|
|
58
|
-
* @param dataSourceCollection
|
|
59
|
-
* @param dataSource
|
|
60
|
-
* @param layerCollection
|
|
61
|
-
* @private
|
|
62
|
-
*/
|
|
63
|
-
export declare function ensureInDataSourceCollection(dataSourceCollection: DataSourceCollection, dataSource: CustomDataSource, layerCollection: LayerCollection): Promise<void>;
|
|
64
|
-
/**
|
|
65
|
-
* @param primitiveCollection
|
|
66
|
-
* @param item
|
|
67
|
-
* @param layerCollection
|
|
68
|
-
* @private
|
|
69
|
-
*/
|
|
70
|
-
export declare function indexChangedOnPrimitive(primitiveCollection: PrimitiveCollection, item: PrimitiveCollection, layerCollection: LayerCollection): void;
|
|
71
|
-
/**
|
|
72
|
-
* @param imageryLayerCollection
|
|
73
|
-
* @param item
|
|
74
|
-
* @param layerCollection
|
|
75
|
-
* @private
|
|
76
|
-
*/
|
|
77
|
-
export declare function indexChangedOnImageryLayer(imageryLayerCollection: ImageryLayerCollection, item: ImageryLayer, layerCollection: LayerCollection): void;
|
|
78
|
-
/**
|
|
79
|
-
* @param dataSourceCollection
|
|
80
|
-
* @param item
|
|
81
|
-
* @param layerCollection
|
|
82
|
-
* @private
|
|
83
|
-
*/
|
|
84
|
-
export declare function indexChangedOnDataSource(dataSourceCollection: DataSourceCollection, item: CustomDataSource, layerCollection: LayerCollection): void;
|
|
85
48
|
/**
|
|
86
49
|
* @param source
|
|
87
50
|
* @param target
|
|
88
51
|
* @private
|
|
89
52
|
*/
|
|
90
53
|
export declare function synchronizeClock(source: DataSourceClock, target: Clock): CesiumEvent.RemoveCallback;
|
|
91
|
-
export type CesiumVisualisationType = CustomDataSource | CzmlDataSource | PrimitiveCollection | Cesium3DTileset | ImageryLayer;
|
|
92
54
|
/**
|
|
93
55
|
* Cesium Globe Map Class (3D map)
|
|
94
56
|
* @group Map
|
|
95
57
|
*/
|
|
96
|
-
declare class CesiumMap extends
|
|
58
|
+
declare class CesiumMap extends BaseCesiumMap {
|
|
97
59
|
static get className(): string;
|
|
98
60
|
static getDefaultOptions(): CesiumMapOptions;
|
|
99
|
-
private _cesiumWidget;
|
|
100
61
|
dataSourceDisplay: DataSourceDisplay | null;
|
|
101
62
|
/**
|
|
102
63
|
* clock for animated data
|
|
@@ -113,8 +74,6 @@ declare class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
113
74
|
private _dataSourceClocks;
|
|
114
75
|
enableLightning: boolean;
|
|
115
76
|
tileCacheSize: number;
|
|
116
|
-
screenSpaceEventHandler: ScreenSpaceEventHandler | null;
|
|
117
|
-
private _screenSpaceListener;
|
|
118
77
|
defaultJDate: JulianDate;
|
|
119
78
|
/**
|
|
120
79
|
* The defaultShadowMap which is created when calling the constructor of the CesiumWidet in {@link initialize}. This is a reference, not a clone.
|
|
@@ -128,14 +87,11 @@ declare class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
128
87
|
webGLaa: boolean;
|
|
129
88
|
globeColor: Color;
|
|
130
89
|
private _clusterDataSourceDisplay;
|
|
131
|
-
private _terrainProvider;
|
|
132
|
-
defaultTerrainProvider: TerrainProvider | null;
|
|
133
90
|
useOriginalCesiumShader: boolean;
|
|
134
91
|
private _cameraLimiter;
|
|
135
92
|
private _cameraLimiterOptions;
|
|
136
93
|
private _preUpdateListener;
|
|
137
94
|
private _clockSyncListener;
|
|
138
|
-
private _listeners;
|
|
139
95
|
private _lightIntensity;
|
|
140
96
|
private _contextOptions;
|
|
141
97
|
constructor(options: CesiumMapOptions);
|
|
@@ -150,7 +106,6 @@ declare class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
150
106
|
get splitPosition(): number;
|
|
151
107
|
set splitPosition(position: number);
|
|
152
108
|
get defaultShadowMap(): ShadowMap | null;
|
|
153
|
-
get terrainProvider(): TerrainProvider | null;
|
|
154
109
|
/**
|
|
155
110
|
* A camera limit to not allow the camera to get too close to the globe.
|
|
156
111
|
*/
|
|
@@ -158,20 +113,13 @@ declare class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
158
113
|
set cameraLimiter(limiter: CameraLimiter | null);
|
|
159
114
|
private _setupPreUpdateListener;
|
|
160
115
|
initialize(): Promise<void>;
|
|
161
|
-
activate(): Promise<void>;
|
|
162
|
-
deactivate(): void;
|
|
163
116
|
/**
|
|
164
117
|
* getHeight for coordinates
|
|
165
118
|
* @param positions - in web mercator
|
|
166
119
|
* @returns the array of coordinates with heights updated in place
|
|
167
120
|
*/
|
|
168
121
|
getHeightFromTerrain(positions: Coordinate[]): Promise<Coordinate[]>;
|
|
169
|
-
getViewpoint(): Promise<null | Viewpoint>;
|
|
170
|
-
getViewpointSync(): Viewpoint | null;
|
|
171
122
|
gotoViewpoint(viewpoint: Viewpoint, optMaximumHeight?: number): Promise<void>;
|
|
172
|
-
private _getCurrentResolutionFromCartesianLatitude;
|
|
173
|
-
getCurrentResolution(coordinate: Coordinate): number;
|
|
174
|
-
getCurrentResolutionFromCartesian(cartesian: Cartesian3): number;
|
|
175
123
|
disableMovement(prevent: boolean | DisableMapControlOptions): void;
|
|
176
124
|
/**
|
|
177
125
|
* set dataSource clock as display clock to visualize time dependent animation
|
|
@@ -199,10 +147,6 @@ declare class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
199
147
|
* Sets the default shadow map.
|
|
200
148
|
*/
|
|
201
149
|
setDefaultShadowMap(): void;
|
|
202
|
-
/**
|
|
203
|
-
* returns the cesium Widget Object
|
|
204
|
-
*/
|
|
205
|
-
getCesiumWidget(): CesiumWidget | null;
|
|
206
150
|
/**
|
|
207
151
|
* returns the Entities Collection
|
|
208
152
|
*/
|
|
@@ -216,26 +160,7 @@ declare class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
216
160
|
* This datasource can only handle Entities with Billboards, Labels or Points.
|
|
217
161
|
*/
|
|
218
162
|
getClusterDatasources(): DataSourceCollection;
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Internal API used to register visualizations from layer implementations
|
|
222
|
-
* @param primitiveCollection
|
|
223
|
-
*/
|
|
224
|
-
addPrimitiveCollection(primitiveCollection: PrimitiveCollection | Cesium3DTileset): void;
|
|
225
|
-
/**
|
|
226
|
-
* Internal API to unregister the visualization for a layers implementation
|
|
227
|
-
* @param primitiveCollection
|
|
228
|
-
*/
|
|
229
|
-
removePrimitiveCollection(primitiveCollection: PrimitiveCollection | Cesium3DTileset): void;
|
|
230
|
-
/**
|
|
231
|
-
* Internal API used to register visualizations from layer implementations
|
|
232
|
-
* @param imageryLayer
|
|
233
|
-
*/
|
|
234
|
-
addImageryLayer(imageryLayer: ImageryLayer): void;
|
|
235
|
-
/**
|
|
236
|
-
* Internal API used to unregister visualizations from layer implementations
|
|
237
|
-
*/
|
|
238
|
-
removeImageryLayer(imageryLayer: ImageryLayer): void;
|
|
163
|
+
protected _indexChangedOnVisualization(vis: CesiumVisualisationType): void;
|
|
239
164
|
/**
|
|
240
165
|
* Internal API used to register visualizations from layer implementations
|
|
241
166
|
*/
|
|
@@ -246,28 +171,11 @@ declare class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
246
171
|
removeDataSource(dataSource: CustomDataSource): void;
|
|
247
172
|
addClusterDataSource(dataSource: CustomDataSource): Promise<void>;
|
|
248
173
|
removeClusterDataSource(dataSource: CustomDataSource): void;
|
|
249
|
-
/**
|
|
250
|
-
* set the cesium TerrainProvider
|
|
251
|
-
*/
|
|
252
|
-
setTerrainProvider(terrainProvider: TerrainProvider): void;
|
|
253
|
-
/**
|
|
254
|
-
* unsets the TerrainProvider (changes to the default TerrainProvider if the given terranProvider is currently active)
|
|
255
|
-
*/
|
|
256
|
-
unsetTerrainProvider(terrainProvider: TerrainProvider): void;
|
|
257
174
|
/**
|
|
258
175
|
* returns the cesium DataSourceDisplay Object
|
|
259
176
|
*/
|
|
260
177
|
getDataSourceDisplay(): DataSourceDisplay | null;
|
|
261
|
-
/**
|
|
262
|
-
* returns the cesium Scene Object, returns null on non initialized or destroyed maps
|
|
263
|
-
*/
|
|
264
|
-
getScene(): Scene | undefined;
|
|
265
178
|
pointIsVisible(coords: Coordinate): boolean;
|
|
266
|
-
/**
|
|
267
|
-
* is called when the cesium Terrainprovider changes. Sets the .terrainProvider and deactivates currently
|
|
268
|
-
* active TerrainLayer layer if necessary
|
|
269
|
-
*/
|
|
270
|
-
private _terrainProviderChanged;
|
|
271
179
|
/**
|
|
272
180
|
* returns true if the WEBGL Extension WEBGL_depth_texture is supported. (Is used for picking)
|
|
273
181
|
*/
|
|
@@ -276,7 +184,7 @@ declare class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
276
184
|
* returns true if the WEBGL Extension EXT_frag_depth is supported. (Is used for GroundPoloygons)
|
|
277
185
|
*/
|
|
278
186
|
isGroundPrimitiveSupported(): boolean;
|
|
279
|
-
toJSON(): CesiumMapOptions;
|
|
187
|
+
toJSON(defaultOptions?: CesiumMapOptions): CesiumMapOptions;
|
|
280
188
|
destroy(): void;
|
|
281
189
|
}
|
|
282
190
|
export default CesiumMap;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BillboardVisualizer, BoundingSphere, Camera, Cartesian3, CesiumWidget, Clock, Color, CustomDataSource, DataSourceClock, DataSourceCollection, DataSourceDisplay, Intersect, JulianDate, LabelVisualizer, Math as CesiumMath, PointVisualizer, ShadowMode, } from '@vcmap-cesium/engine';
|
|
2
2
|
import { check, maybe } from '@vcsuite/check';
|
|
3
3
|
import { parseBoolean, parseInteger, parseNumber } from '@vcsuite/parsers';
|
|
4
4
|
import VcsMap from './vcsMap.js';
|
|
@@ -9,43 +9,14 @@ import CameraLimiter from './cameraLimiter.js';
|
|
|
9
9
|
import { mapClassRegistry } from '../classRegistry.js';
|
|
10
10
|
import VcsEvent from '../vcsEvent.js';
|
|
11
11
|
import { vectorClusterGroupName } from '../vectorCluster/vectorClusterSymbols.js';
|
|
12
|
-
import
|
|
13
|
-
/**
|
|
14
|
-
* Ensures, a primitive/imageryLayer/entity is part of a collection and placed at the correct location
|
|
15
|
-
* @param cesiumCollection
|
|
16
|
-
* @param item
|
|
17
|
-
* @param layerCollection
|
|
18
|
-
* @private
|
|
19
|
-
*/
|
|
20
|
-
export function ensureInCollection(cesiumCollection, item, layerCollection) {
|
|
21
|
-
const targetIndex = layerCollection.indexOfKey(item[vcsLayerName]);
|
|
22
|
-
if (targetIndex > -1) {
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
24
|
-
// @ts-ignore
|
|
25
|
-
if (!cesiumCollection.contains(item)) {
|
|
26
|
-
const primitivesLength = cesiumCollection.length;
|
|
27
|
-
let index = primitivesLength;
|
|
28
|
-
for (let i = 0; i < primitivesLength; i++) {
|
|
29
|
-
const collectionItem = cesiumCollection.get(i);
|
|
30
|
-
if (layerCollection.indexOfKey(collectionItem[vcsLayerName]) >
|
|
31
|
-
targetIndex) {
|
|
32
|
-
index = i;
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
37
|
-
// @ts-ignore
|
|
38
|
-
cesiumCollection.add(item, index);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
12
|
+
import BaseCesiumMap from './baseCesiumMap.js';
|
|
42
13
|
/**
|
|
43
14
|
* @param dataSourceCollection
|
|
44
15
|
* @param dataSource
|
|
45
16
|
* @param layerCollection
|
|
46
17
|
* @private
|
|
47
18
|
*/
|
|
48
|
-
|
|
19
|
+
async function ensureInDataSourceCollection(dataSourceCollection, dataSource, layerCollection) {
|
|
49
20
|
let targetIndex = -1;
|
|
50
21
|
if (dataSource[vectorClusterGroupName]) {
|
|
51
22
|
targetIndex = layerCollection.size;
|
|
@@ -85,36 +56,13 @@ export async function ensureInDataSourceCollection(dataSourceCollection, dataSou
|
|
|
85
56
|
}
|
|
86
57
|
}
|
|
87
58
|
}
|
|
88
|
-
/**
|
|
89
|
-
* @param primitiveCollection
|
|
90
|
-
* @param item
|
|
91
|
-
* @param layerCollection
|
|
92
|
-
* @private
|
|
93
|
-
*/
|
|
94
|
-
export function indexChangedOnPrimitive(primitiveCollection, item, layerCollection) {
|
|
95
|
-
const { destroyPrimitives } = primitiveCollection;
|
|
96
|
-
primitiveCollection.destroyPrimitives = false;
|
|
97
|
-
primitiveCollection.remove(item);
|
|
98
|
-
ensureInCollection(primitiveCollection, item, layerCollection);
|
|
99
|
-
primitiveCollection.destroyPrimitives = destroyPrimitives;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* @param imageryLayerCollection
|
|
103
|
-
* @param item
|
|
104
|
-
* @param layerCollection
|
|
105
|
-
* @private
|
|
106
|
-
*/
|
|
107
|
-
export function indexChangedOnImageryLayer(imageryLayerCollection, item, layerCollection) {
|
|
108
|
-
imageryLayerCollection.remove(item, false);
|
|
109
|
-
ensureInCollection(imageryLayerCollection, item, layerCollection);
|
|
110
|
-
}
|
|
111
59
|
/**
|
|
112
60
|
* @param dataSourceCollection
|
|
113
61
|
* @param item
|
|
114
62
|
* @param layerCollection
|
|
115
63
|
* @private
|
|
116
64
|
*/
|
|
117
|
-
|
|
65
|
+
function indexChangedOnDataSource(dataSourceCollection, item, layerCollection) {
|
|
118
66
|
// eslint-disable-next-line no-void
|
|
119
67
|
void ensureInDataSourceCollection(dataSourceCollection, item, layerCollection);
|
|
120
68
|
}
|
|
@@ -143,7 +91,7 @@ export function synchronizeClock(source, target) {
|
|
|
143
91
|
* Cesium Globe Map Class (3D map)
|
|
144
92
|
* @group Map
|
|
145
93
|
*/
|
|
146
|
-
class CesiumMap extends
|
|
94
|
+
class CesiumMap extends BaseCesiumMap {
|
|
147
95
|
static get className() {
|
|
148
96
|
return 'CesiumMap';
|
|
149
97
|
}
|
|
@@ -160,7 +108,6 @@ class CesiumMap extends VcsMap {
|
|
|
160
108
|
contextOptions: undefined,
|
|
161
109
|
};
|
|
162
110
|
}
|
|
163
|
-
_cesiumWidget = null;
|
|
164
111
|
dataSourceDisplay = null;
|
|
165
112
|
/**
|
|
166
113
|
* clock for animated data
|
|
@@ -177,8 +124,6 @@ class CesiumMap extends VcsMap {
|
|
|
177
124
|
_dataSourceClocks = [];
|
|
178
125
|
enableLightning;
|
|
179
126
|
tileCacheSize;
|
|
180
|
-
screenSpaceEventHandler = null;
|
|
181
|
-
_screenSpaceListener;
|
|
182
127
|
defaultJDate;
|
|
183
128
|
/**
|
|
184
129
|
* The defaultShadowMap which is created when calling the constructor of the CesiumWidet in {@link initialize}. This is a reference, not a clone.
|
|
@@ -192,19 +137,16 @@ class CesiumMap extends VcsMap {
|
|
|
192
137
|
webGLaa;
|
|
193
138
|
globeColor;
|
|
194
139
|
_clusterDataSourceDisplay;
|
|
195
|
-
_terrainProvider = null;
|
|
196
|
-
defaultTerrainProvider = null;
|
|
197
140
|
useOriginalCesiumShader;
|
|
198
141
|
_cameraLimiter = null;
|
|
199
142
|
_cameraLimiterOptions;
|
|
200
143
|
_preUpdateListener;
|
|
201
144
|
_clockSyncListener;
|
|
202
|
-
_listeners = [];
|
|
203
145
|
_lightIntensity;
|
|
204
146
|
_contextOptions;
|
|
205
147
|
constructor(options) {
|
|
206
|
-
super(options);
|
|
207
148
|
const defaultOptions = CesiumMap.getDefaultOptions();
|
|
149
|
+
super({ ...defaultOptions, ...options });
|
|
208
150
|
this.dataSourceDisplayClock = new Clock({ shouldAnimate: true });
|
|
209
151
|
const defaultClock = new DataSourceClock();
|
|
210
152
|
defaultClock.currentTime = this.dataSourceDisplayClock.currentTime;
|
|
@@ -247,9 +189,6 @@ class CesiumMap extends VcsMap {
|
|
|
247
189
|
get defaultShadowMap() {
|
|
248
190
|
return this._defaultShadowMap;
|
|
249
191
|
}
|
|
250
|
-
get terrainProvider() {
|
|
251
|
-
return this._terrainProvider;
|
|
252
|
-
}
|
|
253
192
|
/**
|
|
254
193
|
* A camera limit to not allow the camera to get too close to the globe.
|
|
255
194
|
*/
|
|
@@ -297,7 +236,7 @@ class CesiumMap extends VcsMap {
|
|
|
297
236
|
antialias: this.webGLaa,
|
|
298
237
|
},
|
|
299
238
|
};
|
|
300
|
-
|
|
239
|
+
const cesiumWidget = new CesiumWidget(this.mapElement, {
|
|
301
240
|
requestRenderMode: false,
|
|
302
241
|
scene3DOnly: true,
|
|
303
242
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -307,36 +246,30 @@ class CesiumMap extends VcsMap {
|
|
|
307
246
|
terrainShadows: ShadowMode.ENABLED,
|
|
308
247
|
contextOptions,
|
|
309
248
|
});
|
|
310
|
-
|
|
311
|
-
|
|
249
|
+
cesiumWidget.scene.globe.tileCacheSize = this.tileCacheSize;
|
|
250
|
+
cesiumWidget.scene.globe.baseColor = this.globeColor;
|
|
312
251
|
this.dataSourceDisplay = new DataSourceDisplay({
|
|
313
|
-
scene:
|
|
252
|
+
scene: cesiumWidget.scene,
|
|
314
253
|
dataSourceCollection: new DataSourceCollection(),
|
|
315
254
|
});
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
() => { };
|
|
321
|
-
const { clock } = this._cesiumWidget;
|
|
255
|
+
cesiumWidget.scene.frameState.creditDisplay.update = () => { };
|
|
256
|
+
cesiumWidget.scene.frameState.creditDisplay.beginFrame = () => { };
|
|
257
|
+
cesiumWidget.scene.frameState.creditDisplay.endFrame = () => { };
|
|
258
|
+
const { clock } = cesiumWidget;
|
|
322
259
|
clock.shouldAnimate = true;
|
|
323
260
|
this._listeners.push(clock.onTick.addEventListener(() => {
|
|
324
261
|
this.dataSourceDisplayClock.tick();
|
|
325
262
|
const time = this.dataSourceDisplayClock.currentTime;
|
|
326
263
|
this.dataSourceDisplay?.update?.(time);
|
|
327
264
|
}));
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
this._cesiumWidget.scene.splitPosition = this.splitPosition;
|
|
337
|
-
this._cesiumWidget.scene.light.intensity = this._lightIntensity;
|
|
338
|
-
this._cesiumWidget.scene.globe.enableLighting = this.enableLightning;
|
|
339
|
-
this.setDay(this.defaultJDate);
|
|
265
|
+
cesiumWidget.scene.shadowMap.maximumDistance = 5000.0;
|
|
266
|
+
cesiumWidget.scene.shadowMap.darkness = 0.6;
|
|
267
|
+
cesiumWidget.scene.globe.depthTestAgainstTerrain = true;
|
|
268
|
+
cesiumWidget.scene.highDynamicRange = false;
|
|
269
|
+
// cesiumWidget.scene.logarithmicDepthBuffer = false; // TODO observe this
|
|
270
|
+
cesiumWidget.scene.splitPosition = this.splitPosition;
|
|
271
|
+
cesiumWidget.scene.light.intensity = this._lightIntensity;
|
|
272
|
+
cesiumWidget.scene.globe.enableLighting = this.enableLightning;
|
|
340
273
|
// hide default cesium credits container
|
|
341
274
|
const creditsContainer = document.getElementsByClassName('cesium-widget-credits');
|
|
342
275
|
if (creditsContainer) {
|
|
@@ -345,25 +278,15 @@ class CesiumMap extends VcsMap {
|
|
|
345
278
|
element.style.display = 'none';
|
|
346
279
|
}
|
|
347
280
|
}
|
|
281
|
+
this.initialized = true;
|
|
282
|
+
this._initializeCesiumWidget(cesiumWidget);
|
|
348
283
|
if (this._cameraLimiterOptions && !this._cameraLimiter) {
|
|
349
284
|
this._cameraLimiter = new CameraLimiter(this._cameraLimiterOptions);
|
|
350
285
|
}
|
|
351
286
|
if (this._cameraLimiter) {
|
|
352
287
|
this._setupPreUpdateListener();
|
|
353
288
|
}
|
|
354
|
-
this.
|
|
355
|
-
this._screenSpaceListener = setupCesiumInteractions(this, this._cesiumWidget.scene, this.screenSpaceEventHandler);
|
|
356
|
-
this.initialized = true;
|
|
357
|
-
this.defaultTerrainProvider = this._cesiumWidget.scene.terrainProvider;
|
|
358
|
-
this._terrainProvider = this.defaultTerrainProvider;
|
|
359
|
-
this._listeners.push(this._cesiumWidget.scene.terrainProviderChanged.addEventListener(this._terrainProviderChanged.bind(this)));
|
|
360
|
-
this._listeners.push(this._cesiumWidget.scene.postRender.addEventListener((eventScene, time) => {
|
|
361
|
-
this.postRender.raiseEvent({
|
|
362
|
-
map: this,
|
|
363
|
-
originalEvent: { scene: eventScene, time },
|
|
364
|
-
});
|
|
365
|
-
}));
|
|
366
|
-
this._defaultShadowMap = this._cesiumWidget.scene.shadowMap;
|
|
289
|
+
this._defaultShadowMap = cesiumWidget.scene.shadowMap;
|
|
367
290
|
if (this._initialShadowMap) {
|
|
368
291
|
this.setShadowMap(this._initialShadowMap);
|
|
369
292
|
this._initialShadowMap = undefined;
|
|
@@ -371,19 +294,6 @@ class CesiumMap extends VcsMap {
|
|
|
371
294
|
}
|
|
372
295
|
return Promise.resolve();
|
|
373
296
|
}
|
|
374
|
-
async activate() {
|
|
375
|
-
await super.activate();
|
|
376
|
-
if (this.active && this._cesiumWidget) {
|
|
377
|
-
this._cesiumWidget.useDefaultRenderLoop = true;
|
|
378
|
-
this._cesiumWidget.resize();
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
deactivate() {
|
|
382
|
-
super.deactivate();
|
|
383
|
-
if (this._cesiumWidget) {
|
|
384
|
-
this._cesiumWidget.useDefaultRenderLoop = false;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
297
|
/**
|
|
388
298
|
* getHeight for coordinates
|
|
389
299
|
* @param positions - in web mercator
|
|
@@ -399,15 +309,6 @@ class CesiumMap extends VcsMap {
|
|
|
399
309
|
}
|
|
400
310
|
return Promise.resolve(positions);
|
|
401
311
|
}
|
|
402
|
-
getViewpoint() {
|
|
403
|
-
return Promise.resolve(this.getViewpointSync());
|
|
404
|
-
}
|
|
405
|
-
getViewpointSync() {
|
|
406
|
-
if (!this._cesiumWidget || !this._cesiumWidget.scene || !this.target) {
|
|
407
|
-
return null;
|
|
408
|
-
}
|
|
409
|
-
return getViewpointFromScene(this._cesiumWidget.scene);
|
|
410
|
-
}
|
|
411
312
|
async gotoViewpoint(viewpoint, optMaximumHeight) {
|
|
412
313
|
if (this.movementApiCallsDisabled ||
|
|
413
314
|
!viewpoint.isValid() ||
|
|
@@ -487,20 +388,6 @@ class CesiumMap extends VcsMap {
|
|
|
487
388
|
});
|
|
488
389
|
}
|
|
489
390
|
}
|
|
490
|
-
_getCurrentResolutionFromCartesianLatitude(cartesian, latitude) {
|
|
491
|
-
if (!this._cesiumWidget) {
|
|
492
|
-
return 1;
|
|
493
|
-
}
|
|
494
|
-
return getResolution(cartesian, this._cesiumWidget.camera, this.mapElement, latitude);
|
|
495
|
-
}
|
|
496
|
-
getCurrentResolution(coordinate) {
|
|
497
|
-
const wgs84Coordinate = Projection.mercatorToWgs84(coordinate);
|
|
498
|
-
const cartesian = Cartesian3.fromDegrees(wgs84Coordinate[0], wgs84Coordinate[1], wgs84Coordinate[2]);
|
|
499
|
-
return this._getCurrentResolutionFromCartesianLatitude(cartesian, CesiumMath.toRadians(wgs84Coordinate[1]));
|
|
500
|
-
}
|
|
501
|
-
getCurrentResolutionFromCartesian(cartesian) {
|
|
502
|
-
return this._getCurrentResolutionFromCartesianLatitude(cartesian);
|
|
503
|
-
}
|
|
504
391
|
disableMovement(prevent) {
|
|
505
392
|
super.disableMovement(prevent);
|
|
506
393
|
if (this._cesiumWidget) {
|
|
@@ -587,12 +474,6 @@ class CesiumMap extends VcsMap {
|
|
|
587
474
|
}
|
|
588
475
|
this.setShadowMap(this._defaultShadowMap);
|
|
589
476
|
}
|
|
590
|
-
/**
|
|
591
|
-
* returns the cesium Widget Object
|
|
592
|
-
*/
|
|
593
|
-
getCesiumWidget() {
|
|
594
|
-
return this._cesiumWidget;
|
|
595
|
-
}
|
|
596
477
|
/**
|
|
597
478
|
* returns the Entities Collection
|
|
598
479
|
*/
|
|
@@ -635,64 +516,14 @@ class CesiumMap extends VcsMap {
|
|
|
635
516
|
}));
|
|
636
517
|
return dataSourceCollection;
|
|
637
518
|
}
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
viz.forEach((item) => {
|
|
642
|
-
if (item instanceof PrimitiveCollection) {
|
|
643
|
-
indexChangedOnPrimitive(this.getScene().primitives, item, this.layerCollection);
|
|
644
|
-
}
|
|
645
|
-
else if (item instanceof ImageryLayer) {
|
|
646
|
-
indexChangedOnImageryLayer(this.getScene().imageryLayers, item, this.layerCollection);
|
|
647
|
-
}
|
|
648
|
-
else if (item instanceof CustomDataSource) {
|
|
649
|
-
indexChangedOnDataSource(this.dataSourceDisplay.dataSources, item, this.layerCollection);
|
|
650
|
-
}
|
|
651
|
-
});
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
/**
|
|
655
|
-
* Internal API used to register visualizations from layer implementations
|
|
656
|
-
* @param primitiveCollection
|
|
657
|
-
*/
|
|
658
|
-
addPrimitiveCollection(primitiveCollection) {
|
|
659
|
-
if (!this._cesiumWidget) {
|
|
660
|
-
throw new Error('Cannot add primitive to uninitialized map');
|
|
661
|
-
}
|
|
662
|
-
if (this.validateVisualization(primitiveCollection)) {
|
|
663
|
-
this.addVisualization(primitiveCollection);
|
|
664
|
-
ensureInCollection(this._cesiumWidget.scene.primitives, primitiveCollection, this.layerCollection);
|
|
519
|
+
_indexChangedOnVisualization(vis) {
|
|
520
|
+
if (vis instanceof CustomDataSource) {
|
|
521
|
+
indexChangedOnDataSource(this.dataSourceDisplay.dataSources, vis, this.layerCollection);
|
|
665
522
|
}
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
* Internal API to unregister the visualization for a layers implementation
|
|
669
|
-
* @param primitiveCollection
|
|
670
|
-
*/
|
|
671
|
-
removePrimitiveCollection(primitiveCollection) {
|
|
672
|
-
// XXX add destroy as boolean?
|
|
673
|
-
this.removeVisualization(primitiveCollection);
|
|
674
|
-
this.getScene()?.primitives.remove(primitiveCollection);
|
|
675
|
-
}
|
|
676
|
-
/**
|
|
677
|
-
* Internal API used to register visualizations from layer implementations
|
|
678
|
-
* @param imageryLayer
|
|
679
|
-
*/
|
|
680
|
-
addImageryLayer(imageryLayer) {
|
|
681
|
-
if (!this._cesiumWidget) {
|
|
682
|
-
throw new Error('Cannot add primitive to uninitialized map');
|
|
683
|
-
}
|
|
684
|
-
if (this.validateVisualization(imageryLayer)) {
|
|
685
|
-
this.addVisualization(imageryLayer);
|
|
686
|
-
ensureInCollection(this._cesiumWidget.scene.imageryLayers, imageryLayer, this.layerCollection);
|
|
523
|
+
else {
|
|
524
|
+
super._indexChangedOnVisualization(vis);
|
|
687
525
|
}
|
|
688
526
|
}
|
|
689
|
-
/**
|
|
690
|
-
* Internal API used to unregister visualizations from layer implementations
|
|
691
|
-
*/
|
|
692
|
-
removeImageryLayer(imageryLayer) {
|
|
693
|
-
this.removeVisualization(imageryLayer);
|
|
694
|
-
this.getScene()?.imageryLayers.remove(imageryLayer);
|
|
695
|
-
}
|
|
696
527
|
/**
|
|
697
528
|
* Internal API used to register visualizations from layer implementations
|
|
698
529
|
*/
|
|
@@ -734,37 +565,12 @@ class CesiumMap extends VcsMap {
|
|
|
734
565
|
this._clusterDataSourceDisplay.dataSources.remove(dataSource);
|
|
735
566
|
}
|
|
736
567
|
}
|
|
737
|
-
/**
|
|
738
|
-
* set the cesium TerrainProvider
|
|
739
|
-
*/
|
|
740
|
-
setTerrainProvider(terrainProvider) {
|
|
741
|
-
if (this.terrainProvider !== terrainProvider && this._cesiumWidget) {
|
|
742
|
-
this._cesiumWidget.scene.terrainProvider = terrainProvider;
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
/**
|
|
746
|
-
* unsets the TerrainProvider (changes to the default TerrainProvider if the given terranProvider is currently active)
|
|
747
|
-
*/
|
|
748
|
-
unsetTerrainProvider(terrainProvider) {
|
|
749
|
-
if (this.terrainProvider === terrainProvider) {
|
|
750
|
-
this._terrainProvider = this.defaultTerrainProvider;
|
|
751
|
-
if (this._cesiumWidget && this.defaultTerrainProvider) {
|
|
752
|
-
this._cesiumWidget.scene.terrainProvider = this.defaultTerrainProvider;
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
568
|
/**
|
|
757
569
|
* returns the cesium DataSourceDisplay Object
|
|
758
570
|
*/
|
|
759
571
|
getDataSourceDisplay() {
|
|
760
572
|
return this.dataSourceDisplay;
|
|
761
573
|
}
|
|
762
|
-
/**
|
|
763
|
-
* returns the cesium Scene Object, returns null on non initialized or destroyed maps
|
|
764
|
-
*/
|
|
765
|
-
getScene() {
|
|
766
|
-
return this._cesiumWidget?.scene;
|
|
767
|
-
}
|
|
768
574
|
pointIsVisible(coords) {
|
|
769
575
|
if (!this._cesiumWidget) {
|
|
770
576
|
return false;
|
|
@@ -778,19 +584,6 @@ class CesiumMap extends VcsMap {
|
|
|
778
584
|
}
|
|
779
585
|
return false;
|
|
780
586
|
}
|
|
781
|
-
/**
|
|
782
|
-
* is called when the cesium Terrainprovider changes. Sets the .terrainProvider and deactivates currently
|
|
783
|
-
* active TerrainLayer layer if necessary
|
|
784
|
-
*/
|
|
785
|
-
_terrainProviderChanged(terrainProvider) {
|
|
786
|
-
if (this.terrainProvider !== terrainProvider) {
|
|
787
|
-
const layer = this.layerCollection.getByKey(this?.terrainProvider?.[vcsLayerName]);
|
|
788
|
-
this._terrainProvider = terrainProvider;
|
|
789
|
-
if (layer) {
|
|
790
|
-
layer.deactivate();
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
587
|
/**
|
|
795
588
|
* returns true if the WEBGL Extension WEBGL_depth_texture is supported. (Is used for picking)
|
|
796
589
|
*/
|
|
@@ -809,9 +602,8 @@ class CesiumMap extends VcsMap {
|
|
|
809
602
|
}
|
|
810
603
|
return this._cesiumWidget?.scene.context.fragmentDepth ?? false;
|
|
811
604
|
}
|
|
812
|
-
toJSON() {
|
|
813
|
-
const config = super.toJSON();
|
|
814
|
-
const defaultOptions = CesiumMap.getDefaultOptions();
|
|
605
|
+
toJSON(defaultOptions = CesiumMap.getDefaultOptions()) {
|
|
606
|
+
const config = super.toJSON(defaultOptions);
|
|
815
607
|
if (this.enableLightning !== defaultOptions.enableLightning) {
|
|
816
608
|
config.enableLightning = this.enableLightning;
|
|
817
609
|
}
|
|
@@ -845,17 +637,6 @@ class CesiumMap extends VcsMap {
|
|
|
845
637
|
if (this.dataSourceDisplay && !this.dataSourceDisplay.isDestroyed()) {
|
|
846
638
|
this.dataSourceDisplay.destroy();
|
|
847
639
|
}
|
|
848
|
-
this._screenSpaceListener?.();
|
|
849
|
-
if (this.screenSpaceEventHandler) {
|
|
850
|
-
this.screenSpaceEventHandler.destroy();
|
|
851
|
-
this.screenSpaceEventHandler = null;
|
|
852
|
-
}
|
|
853
|
-
this._listeners.forEach((cb) => {
|
|
854
|
-
cb();
|
|
855
|
-
});
|
|
856
|
-
this._listeners = [];
|
|
857
|
-
this._terrainProvider = null;
|
|
858
|
-
this.defaultTerrainProvider = null;
|
|
859
640
|
if (this._clockSyncListener) {
|
|
860
641
|
this._clockSyncListener();
|
|
861
642
|
this._clockSyncListener = undefined;
|
|
@@ -867,16 +648,9 @@ class CesiumMap extends VcsMap {
|
|
|
867
648
|
if (this._cameraLimiter) {
|
|
868
649
|
this._cameraLimiter = null;
|
|
869
650
|
}
|
|
870
|
-
[...this.layerCollection].forEach((l) => {
|
|
871
|
-
l.removedFromMap(this);
|
|
872
|
-
});
|
|
873
651
|
if (this._clusterDataSourceDisplay) {
|
|
874
652
|
this._clusterDataSourceDisplay.destroy();
|
|
875
653
|
}
|
|
876
|
-
if (this._cesiumWidget) {
|
|
877
|
-
this._cesiumWidget.destroy();
|
|
878
|
-
this._cesiumWidget = null;
|
|
879
|
-
}
|
|
880
654
|
this._initialShadowMap = undefined;
|
|
881
655
|
this._defaultShadowMap = null;
|
|
882
656
|
this.shadowMapChanged.destroy();
|