@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
package/src/map/cesiumMap.ts
CHANGED
|
@@ -1,38 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
BillboardVisualizer,
|
|
3
|
+
BoundingSphere,
|
|
4
|
+
Camera,
|
|
5
|
+
Cartesian3,
|
|
6
|
+
type CesiumTerrainProvider,
|
|
7
|
+
CesiumWidget,
|
|
3
8
|
Clock,
|
|
4
|
-
DataSourceClock,
|
|
5
9
|
Color,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
type ContextOptions,
|
|
11
|
+
CustomDataSource,
|
|
12
|
+
type DataSource,
|
|
13
|
+
DataSourceClock,
|
|
9
14
|
DataSourceCollection,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
DataSourceDisplay,
|
|
16
|
+
type EntityCluster,
|
|
17
|
+
type EntityCollection,
|
|
18
|
+
type Event as CesiumEvent,
|
|
19
|
+
Intersect,
|
|
20
|
+
JulianDate,
|
|
16
21
|
LabelVisualizer,
|
|
22
|
+
Math as CesiumMath,
|
|
17
23
|
PointVisualizer,
|
|
18
|
-
CustomDataSource,
|
|
19
|
-
BoundingSphere,
|
|
20
|
-
Intersect,
|
|
21
|
-
ImageryLayer,
|
|
22
|
-
PrimitiveCollection,
|
|
23
24
|
type Scene,
|
|
24
|
-
type ImageryLayerCollection,
|
|
25
|
-
type Cesium3DTileset,
|
|
26
|
-
type TerrainProvider,
|
|
27
|
-
type Event as CesiumEvent,
|
|
28
|
-
type CzmlDataSource,
|
|
29
|
-
type CesiumTerrainProvider,
|
|
30
|
-
type EntityCollection,
|
|
31
|
-
type EntityCluster,
|
|
32
|
-
type DataSource,
|
|
33
|
-
type Visualizer,
|
|
34
25
|
type ShadowMap,
|
|
35
|
-
|
|
26
|
+
ShadowMode,
|
|
27
|
+
type Visualizer,
|
|
36
28
|
} from '@vcmap-cesium/engine';
|
|
37
29
|
import type { Coordinate } from 'ol/coordinate.js';
|
|
38
30
|
import { check, maybe } from '@vcsuite/check';
|
|
@@ -46,102 +38,12 @@ import type { CameraLimiterOptions } from './cameraLimiter.js';
|
|
|
46
38
|
import CameraLimiter from './cameraLimiter.js';
|
|
47
39
|
import { mapClassRegistry } from '../classRegistry.js';
|
|
48
40
|
import type LayerCollection from '../util/layerCollection.js';
|
|
49
|
-
import type Layer from '../layer/layer.js';
|
|
50
41
|
import VcsEvent from '../vcsEvent.js';
|
|
51
42
|
import type { DisableMapControlOptions } from '../util/mapCollection.js';
|
|
52
43
|
import { vectorClusterGroupName } from '../vectorCluster/vectorClusterSymbols.js';
|
|
53
|
-
import {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
setupCesiumInteractions,
|
|
57
|
-
} from './cesiumMapHelpers.js';
|
|
58
|
-
|
|
59
|
-
export type CesiumMapOptions = VcsMapOptions & {
|
|
60
|
-
/**
|
|
61
|
-
* if true, lighting will be activated.
|
|
62
|
-
*/
|
|
63
|
-
enableLightning?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* the tilecache size of cesium terrain and tile layer
|
|
66
|
-
*/
|
|
67
|
-
tileCacheSize?: number;
|
|
68
|
-
/**
|
|
69
|
-
* activates webGL antialiasing (not every Browser respects this value)
|
|
70
|
-
*/
|
|
71
|
-
webGLaa?: boolean;
|
|
72
|
-
cameraLimiter?: CameraLimiterOptions;
|
|
73
|
-
/**
|
|
74
|
-
* the color of the globe, if no image is provided
|
|
75
|
-
*/
|
|
76
|
-
globeColor?: string;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* use Original Cesium Shader, otherwise the VCS Customized Shader will be used.
|
|
80
|
-
* This is a global Setting for all VCMap Instances on the same page.
|
|
81
|
-
*/
|
|
82
|
-
useOriginalCesiumShader?: boolean;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* changes the default Cesium Sunlight Intensity (default is 3.0)
|
|
86
|
-
* Cesium Default is 2.0
|
|
87
|
-
*/
|
|
88
|
-
lightIntensity?: number;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* can be used to forward contextOptions to the CesiumWidget
|
|
92
|
-
* https://cesium.com/learn/cesiumjs/ref-doc/global.html#ContextOptions
|
|
93
|
-
*/
|
|
94
|
-
contextOptions?: ContextOptions;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export type CesiumMapEvent = {
|
|
98
|
-
scene: Scene;
|
|
99
|
-
time: JulianDate;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Ensures, a primitive/imageryLayer/entity is part of a collection and placed at the correct location
|
|
104
|
-
* @param cesiumCollection
|
|
105
|
-
* @param item
|
|
106
|
-
* @param layerCollection
|
|
107
|
-
* @private
|
|
108
|
-
*/
|
|
109
|
-
export function ensureInCollection<
|
|
110
|
-
T extends PrimitiveCollection | ImageryLayerCollection,
|
|
111
|
-
>(
|
|
112
|
-
cesiumCollection: T,
|
|
113
|
-
item: T extends PrimitiveCollection
|
|
114
|
-
? PrimitiveCollection | Cesium3DTileset
|
|
115
|
-
: ImageryLayer,
|
|
116
|
-
layerCollection: LayerCollection,
|
|
117
|
-
): void {
|
|
118
|
-
const targetIndex = layerCollection.indexOfKey(item[vcsLayerName]) as number;
|
|
119
|
-
if (targetIndex > -1) {
|
|
120
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
121
|
-
// @ts-ignore
|
|
122
|
-
if (!cesiumCollection.contains(item)) {
|
|
123
|
-
const primitivesLength = cesiumCollection.length;
|
|
124
|
-
let index = primitivesLength;
|
|
125
|
-
for (let i = 0; i < primitivesLength; i++) {
|
|
126
|
-
const collectionItem = cesiumCollection.get(
|
|
127
|
-
i,
|
|
128
|
-
) as T extends PrimitiveCollection
|
|
129
|
-
? PrimitiveCollection | Cesium3DTileset
|
|
130
|
-
: ImageryLayer;
|
|
131
|
-
if (
|
|
132
|
-
(layerCollection.indexOfKey(collectionItem[vcsLayerName]) as number) >
|
|
133
|
-
targetIndex
|
|
134
|
-
) {
|
|
135
|
-
index = i;
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
140
|
-
// @ts-ignore
|
|
141
|
-
cesiumCollection.add(item, index);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
44
|
+
import BaseCesiumMap, {
|
|
45
|
+
type CesiumVisualisationType,
|
|
46
|
+
} from './baseCesiumMap.js';
|
|
145
47
|
|
|
146
48
|
/**
|
|
147
49
|
* @param dataSourceCollection
|
|
@@ -149,7 +51,7 @@ export function ensureInCollection<
|
|
|
149
51
|
* @param layerCollection
|
|
150
52
|
* @private
|
|
151
53
|
*/
|
|
152
|
-
|
|
54
|
+
async function ensureInDataSourceCollection(
|
|
153
55
|
dataSourceCollection: DataSourceCollection,
|
|
154
56
|
dataSource: CustomDataSource,
|
|
155
57
|
layerCollection: LayerCollection,
|
|
@@ -199,46 +101,13 @@ export async function ensureInDataSourceCollection(
|
|
|
199
101
|
}
|
|
200
102
|
}
|
|
201
103
|
|
|
202
|
-
/**
|
|
203
|
-
* @param primitiveCollection
|
|
204
|
-
* @param item
|
|
205
|
-
* @param layerCollection
|
|
206
|
-
* @private
|
|
207
|
-
*/
|
|
208
|
-
export function indexChangedOnPrimitive(
|
|
209
|
-
primitiveCollection: PrimitiveCollection,
|
|
210
|
-
item: PrimitiveCollection,
|
|
211
|
-
layerCollection: LayerCollection,
|
|
212
|
-
): void {
|
|
213
|
-
const { destroyPrimitives } = primitiveCollection;
|
|
214
|
-
primitiveCollection.destroyPrimitives = false;
|
|
215
|
-
primitiveCollection.remove(item);
|
|
216
|
-
ensureInCollection(primitiveCollection, item, layerCollection);
|
|
217
|
-
primitiveCollection.destroyPrimitives = destroyPrimitives;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* @param imageryLayerCollection
|
|
222
|
-
* @param item
|
|
223
|
-
* @param layerCollection
|
|
224
|
-
* @private
|
|
225
|
-
*/
|
|
226
|
-
export function indexChangedOnImageryLayer(
|
|
227
|
-
imageryLayerCollection: ImageryLayerCollection,
|
|
228
|
-
item: ImageryLayer,
|
|
229
|
-
layerCollection: LayerCollection,
|
|
230
|
-
): void {
|
|
231
|
-
imageryLayerCollection.remove(item, false);
|
|
232
|
-
ensureInCollection(imageryLayerCollection, item, layerCollection);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
104
|
/**
|
|
236
105
|
* @param dataSourceCollection
|
|
237
106
|
* @param item
|
|
238
107
|
* @param layerCollection
|
|
239
108
|
* @private
|
|
240
109
|
*/
|
|
241
|
-
|
|
110
|
+
function indexChangedOnDataSource(
|
|
242
111
|
dataSourceCollection: DataSourceCollection,
|
|
243
112
|
item: CustomDataSource,
|
|
244
113
|
layerCollection: LayerCollection,
|
|
@@ -251,6 +120,49 @@ export function indexChangedOnDataSource(
|
|
|
251
120
|
);
|
|
252
121
|
}
|
|
253
122
|
|
|
123
|
+
export type CesiumMapOptions = VcsMapOptions & {
|
|
124
|
+
/**
|
|
125
|
+
* if true, lighting will be activated.
|
|
126
|
+
*/
|
|
127
|
+
enableLightning?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* the tilecache size of cesium terrain and tile layer
|
|
130
|
+
*/
|
|
131
|
+
tileCacheSize?: number;
|
|
132
|
+
/**
|
|
133
|
+
* activates webGL antialiasing (not every Browser respects this value)
|
|
134
|
+
*/
|
|
135
|
+
webGLaa?: boolean;
|
|
136
|
+
cameraLimiter?: CameraLimiterOptions;
|
|
137
|
+
/**
|
|
138
|
+
* the color of the globe, if no image is provided
|
|
139
|
+
*/
|
|
140
|
+
globeColor?: string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* use Original Cesium Shader, otherwise the VCS Customized Shader will be used.
|
|
144
|
+
* This is a global Setting for all VCMap Instances on the same page.
|
|
145
|
+
*/
|
|
146
|
+
useOriginalCesiumShader?: boolean;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* changes the default Cesium Sunlight Intensity (default is 3.0)
|
|
150
|
+
* Cesium Default is 2.0
|
|
151
|
+
*/
|
|
152
|
+
lightIntensity?: number;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* can be used to forward contextOptions to the CesiumWidget
|
|
156
|
+
* https://cesium.com/learn/cesiumjs/ref-doc/global.html#ContextOptions
|
|
157
|
+
*/
|
|
158
|
+
contextOptions?: ContextOptions;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export type CesiumMapEvent = {
|
|
162
|
+
scene: Scene;
|
|
163
|
+
time: JulianDate;
|
|
164
|
+
};
|
|
165
|
+
|
|
254
166
|
/**
|
|
255
167
|
* @param source
|
|
256
168
|
* @param target
|
|
@@ -280,18 +192,11 @@ export function synchronizeClock(
|
|
|
280
192
|
);
|
|
281
193
|
}
|
|
282
194
|
|
|
283
|
-
export type CesiumVisualisationType =
|
|
284
|
-
| CustomDataSource
|
|
285
|
-
| CzmlDataSource
|
|
286
|
-
| PrimitiveCollection
|
|
287
|
-
| Cesium3DTileset
|
|
288
|
-
| ImageryLayer;
|
|
289
|
-
|
|
290
195
|
/**
|
|
291
196
|
* Cesium Globe Map Class (3D map)
|
|
292
197
|
* @group Map
|
|
293
198
|
*/
|
|
294
|
-
class CesiumMap extends
|
|
199
|
+
class CesiumMap extends BaseCesiumMap {
|
|
295
200
|
static get className(): string {
|
|
296
201
|
return 'CesiumMap';
|
|
297
202
|
}
|
|
@@ -310,8 +215,6 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
310
215
|
};
|
|
311
216
|
}
|
|
312
217
|
|
|
313
|
-
private _cesiumWidget: CesiumWidget | null = null;
|
|
314
|
-
|
|
315
218
|
dataSourceDisplay: DataSourceDisplay | null = null;
|
|
316
219
|
|
|
317
220
|
/**
|
|
@@ -334,10 +237,6 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
334
237
|
|
|
335
238
|
tileCacheSize: number;
|
|
336
239
|
|
|
337
|
-
screenSpaceEventHandler: ScreenSpaceEventHandler | null = null;
|
|
338
|
-
|
|
339
|
-
private _screenSpaceListener: (() => void) | undefined;
|
|
340
|
-
|
|
341
240
|
defaultJDate: JulianDate;
|
|
342
241
|
|
|
343
242
|
/**
|
|
@@ -358,10 +257,6 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
358
257
|
|
|
359
258
|
private _clusterDataSourceDisplay: DataSourceDisplay | undefined;
|
|
360
259
|
|
|
361
|
-
private _terrainProvider: TerrainProvider | null = null;
|
|
362
|
-
|
|
363
|
-
defaultTerrainProvider: TerrainProvider | null = null;
|
|
364
|
-
|
|
365
260
|
useOriginalCesiumShader: boolean;
|
|
366
261
|
|
|
367
262
|
private _cameraLimiter: CameraLimiter | null = null;
|
|
@@ -372,16 +267,14 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
372
267
|
|
|
373
268
|
private _clockSyncListener: (() => void) | undefined;
|
|
374
269
|
|
|
375
|
-
private _listeners: (() => void)[] = [];
|
|
376
|
-
|
|
377
270
|
private _lightIntensity: number;
|
|
378
271
|
|
|
379
272
|
private _contextOptions: ContextOptions | undefined;
|
|
380
273
|
|
|
381
274
|
constructor(options: CesiumMapOptions) {
|
|
382
|
-
super(options);
|
|
383
|
-
|
|
384
275
|
const defaultOptions = CesiumMap.getDefaultOptions();
|
|
276
|
+
super({ ...defaultOptions, ...options });
|
|
277
|
+
|
|
385
278
|
this.dataSourceDisplayClock = new Clock({ shouldAnimate: true });
|
|
386
279
|
|
|
387
280
|
const defaultClock = new DataSourceClock();
|
|
@@ -454,10 +347,6 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
454
347
|
return this._defaultShadowMap;
|
|
455
348
|
}
|
|
456
349
|
|
|
457
|
-
get terrainProvider(): TerrainProvider | null {
|
|
458
|
-
return this._terrainProvider;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
350
|
/**
|
|
462
351
|
* A camera limit to not allow the camera to get too close to the globe.
|
|
463
352
|
*/
|
|
@@ -506,6 +395,7 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
506
395
|
'Cannot activate Original Cesium Shader, flag to use VCS Shader is already set by another Cesium Map or VCMap Instance',
|
|
507
396
|
);
|
|
508
397
|
}
|
|
398
|
+
|
|
509
399
|
const contextOptions = {
|
|
510
400
|
...this._contextOptions,
|
|
511
401
|
webgl: {
|
|
@@ -513,7 +403,8 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
513
403
|
antialias: this.webGLaa,
|
|
514
404
|
},
|
|
515
405
|
};
|
|
516
|
-
|
|
406
|
+
|
|
407
|
+
const cesiumWidget = new CesiumWidget(this.mapElement, {
|
|
517
408
|
requestRenderMode: false,
|
|
518
409
|
scene3DOnly: true,
|
|
519
410
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -523,21 +414,20 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
523
414
|
terrainShadows: ShadowMode.ENABLED,
|
|
524
415
|
contextOptions,
|
|
525
416
|
});
|
|
526
|
-
|
|
527
|
-
|
|
417
|
+
|
|
418
|
+
cesiumWidget.scene.globe.tileCacheSize = this.tileCacheSize;
|
|
419
|
+
cesiumWidget.scene.globe.baseColor = this.globeColor;
|
|
528
420
|
|
|
529
421
|
this.dataSourceDisplay = new DataSourceDisplay({
|
|
530
|
-
scene:
|
|
422
|
+
scene: cesiumWidget.scene,
|
|
531
423
|
dataSourceCollection: new DataSourceCollection(),
|
|
532
424
|
});
|
|
533
425
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
this._cesiumWidget.scene.frameState.creditDisplay.endFrame =
|
|
538
|
-
(): void => {};
|
|
426
|
+
cesiumWidget.scene.frameState.creditDisplay.update = (): void => {};
|
|
427
|
+
cesiumWidget.scene.frameState.creditDisplay.beginFrame = (): void => {};
|
|
428
|
+
cesiumWidget.scene.frameState.creditDisplay.endFrame = (): void => {};
|
|
539
429
|
|
|
540
|
-
const { clock } =
|
|
430
|
+
const { clock } = cesiumWidget;
|
|
541
431
|
clock.shouldAnimate = true;
|
|
542
432
|
this._listeners.push(
|
|
543
433
|
clock.onTick.addEventListener(() => {
|
|
@@ -547,21 +437,15 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
547
437
|
}),
|
|
548
438
|
);
|
|
549
439
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
this._cesiumWidget.scene.highDynamicRange = false;
|
|
558
|
-
// this._cesiumWidget.scene.logarithmicDepthBuffer = false; // TODO observe this
|
|
559
|
-
this._cesiumWidget.scene.splitPosition = this.splitPosition;
|
|
560
|
-
this._cesiumWidget.scene.light.intensity = this._lightIntensity;
|
|
440
|
+
cesiumWidget.scene.shadowMap.maximumDistance = 5000.0;
|
|
441
|
+
cesiumWidget.scene.shadowMap.darkness = 0.6;
|
|
442
|
+
cesiumWidget.scene.globe.depthTestAgainstTerrain = true;
|
|
443
|
+
cesiumWidget.scene.highDynamicRange = false;
|
|
444
|
+
// cesiumWidget.scene.logarithmicDepthBuffer = false; // TODO observe this
|
|
445
|
+
cesiumWidget.scene.splitPosition = this.splitPosition;
|
|
446
|
+
cesiumWidget.scene.light.intensity = this._lightIntensity;
|
|
561
447
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
this.setDay(this.defaultJDate);
|
|
448
|
+
cesiumWidget.scene.globe.enableLighting = this.enableLightning;
|
|
565
449
|
|
|
566
450
|
// hide default cesium credits container
|
|
567
451
|
const creditsContainer = document.getElementsByClassName(
|
|
@@ -574,6 +458,9 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
574
458
|
}
|
|
575
459
|
}
|
|
576
460
|
|
|
461
|
+
this.initialized = true;
|
|
462
|
+
this._initializeCesiumWidget(cesiumWidget);
|
|
463
|
+
|
|
577
464
|
if (this._cameraLimiterOptions && !this._cameraLimiter) {
|
|
578
465
|
this._cameraLimiter = new CameraLimiter(this._cameraLimiterOptions);
|
|
579
466
|
}
|
|
@@ -581,36 +468,8 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
581
468
|
if (this._cameraLimiter) {
|
|
582
469
|
this._setupPreUpdateListener();
|
|
583
470
|
}
|
|
584
|
-
this.screenSpaceEventHandler = new ScreenSpaceEventHandler(
|
|
585
|
-
this._cesiumWidget.scene.canvas,
|
|
586
|
-
);
|
|
587
|
-
this._screenSpaceListener = setupCesiumInteractions(
|
|
588
|
-
this,
|
|
589
|
-
this._cesiumWidget.scene,
|
|
590
|
-
this.screenSpaceEventHandler,
|
|
591
|
-
);
|
|
592
|
-
this.initialized = true;
|
|
593
471
|
|
|
594
|
-
this.
|
|
595
|
-
this._terrainProvider = this.defaultTerrainProvider;
|
|
596
|
-
this._listeners.push(
|
|
597
|
-
this._cesiumWidget.scene.terrainProviderChanged.addEventListener(
|
|
598
|
-
this._terrainProviderChanged.bind(this),
|
|
599
|
-
),
|
|
600
|
-
);
|
|
601
|
-
|
|
602
|
-
this._listeners.push(
|
|
603
|
-
this._cesiumWidget.scene.postRender.addEventListener(
|
|
604
|
-
(eventScene: Scene, time: JulianDate) => {
|
|
605
|
-
this.postRender.raiseEvent({
|
|
606
|
-
map: this,
|
|
607
|
-
originalEvent: { scene: eventScene, time },
|
|
608
|
-
});
|
|
609
|
-
},
|
|
610
|
-
),
|
|
611
|
-
);
|
|
612
|
-
|
|
613
|
-
this._defaultShadowMap = this._cesiumWidget.scene.shadowMap;
|
|
472
|
+
this._defaultShadowMap = cesiumWidget.scene.shadowMap;
|
|
614
473
|
|
|
615
474
|
if (this._initialShadowMap) {
|
|
616
475
|
this.setShadowMap(this._initialShadowMap);
|
|
@@ -620,21 +479,6 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
620
479
|
return Promise.resolve();
|
|
621
480
|
}
|
|
622
481
|
|
|
623
|
-
async activate(): Promise<void> {
|
|
624
|
-
await super.activate();
|
|
625
|
-
if (this.active && this._cesiumWidget) {
|
|
626
|
-
this._cesiumWidget.useDefaultRenderLoop = true;
|
|
627
|
-
this._cesiumWidget.resize();
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
deactivate(): void {
|
|
632
|
-
super.deactivate();
|
|
633
|
-
if (this._cesiumWidget) {
|
|
634
|
-
this._cesiumWidget.useDefaultRenderLoop = false;
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
|
|
638
482
|
/**
|
|
639
483
|
* getHeight for coordinates
|
|
640
484
|
* @param positions - in web mercator
|
|
@@ -656,17 +500,6 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
656
500
|
return Promise.resolve(positions);
|
|
657
501
|
}
|
|
658
502
|
|
|
659
|
-
getViewpoint(): Promise<null | Viewpoint> {
|
|
660
|
-
return Promise.resolve(this.getViewpointSync());
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
getViewpointSync(): Viewpoint | null {
|
|
664
|
-
if (!this._cesiumWidget || !this._cesiumWidget.scene || !this.target) {
|
|
665
|
-
return null;
|
|
666
|
-
}
|
|
667
|
-
return getViewpointFromScene(this._cesiumWidget.scene);
|
|
668
|
-
}
|
|
669
|
-
|
|
670
503
|
async gotoViewpoint(
|
|
671
504
|
viewpoint: Viewpoint,
|
|
672
505
|
optMaximumHeight?: number,
|
|
@@ -763,39 +596,6 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
763
596
|
}
|
|
764
597
|
}
|
|
765
598
|
|
|
766
|
-
private _getCurrentResolutionFromCartesianLatitude(
|
|
767
|
-
cartesian: Cartesian3,
|
|
768
|
-
latitude?: number,
|
|
769
|
-
): number {
|
|
770
|
-
if (!this._cesiumWidget) {
|
|
771
|
-
return 1;
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
return getResolution(
|
|
775
|
-
cartesian,
|
|
776
|
-
this._cesiumWidget.camera,
|
|
777
|
-
this.mapElement,
|
|
778
|
-
latitude,
|
|
779
|
-
);
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
getCurrentResolution(coordinate: Coordinate): number {
|
|
783
|
-
const wgs84Coordinate = Projection.mercatorToWgs84(coordinate);
|
|
784
|
-
const cartesian = Cartesian3.fromDegrees(
|
|
785
|
-
wgs84Coordinate[0],
|
|
786
|
-
wgs84Coordinate[1],
|
|
787
|
-
wgs84Coordinate[2],
|
|
788
|
-
);
|
|
789
|
-
return this._getCurrentResolutionFromCartesianLatitude(
|
|
790
|
-
cartesian,
|
|
791
|
-
CesiumMath.toRadians(wgs84Coordinate[1]),
|
|
792
|
-
);
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
getCurrentResolutionFromCartesian(cartesian: Cartesian3): number {
|
|
796
|
-
return this._getCurrentResolutionFromCartesianLatitude(cartesian);
|
|
797
|
-
}
|
|
798
|
-
|
|
799
599
|
disableMovement(prevent: boolean | DisableMapControlOptions): void {
|
|
800
600
|
super.disableMovement(prevent);
|
|
801
601
|
|
|
@@ -902,13 +702,6 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
902
702
|
this.setShadowMap(this._defaultShadowMap);
|
|
903
703
|
}
|
|
904
704
|
|
|
905
|
-
/**
|
|
906
|
-
* returns the cesium Widget Object
|
|
907
|
-
*/
|
|
908
|
-
getCesiumWidget(): CesiumWidget | null {
|
|
909
|
-
return this._cesiumWidget;
|
|
910
|
-
}
|
|
911
|
-
|
|
912
705
|
/**
|
|
913
706
|
* returns the Entities Collection
|
|
914
707
|
*/
|
|
@@ -967,91 +760,20 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
967
760
|
return dataSourceCollection;
|
|
968
761
|
}
|
|
969
762
|
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
if (viz) {
|
|
973
|
-
viz.forEach((item) => {
|
|
974
|
-
if (item instanceof PrimitiveCollection) {
|
|
975
|
-
indexChangedOnPrimitive(
|
|
976
|
-
(this.getScene() as Scene).primitives,
|
|
977
|
-
item,
|
|
978
|
-
this.layerCollection,
|
|
979
|
-
);
|
|
980
|
-
} else if (item instanceof ImageryLayer) {
|
|
981
|
-
indexChangedOnImageryLayer(
|
|
982
|
-
(this.getScene() as Scene).imageryLayers,
|
|
983
|
-
item,
|
|
984
|
-
this.layerCollection,
|
|
985
|
-
);
|
|
986
|
-
} else if (item instanceof CustomDataSource) {
|
|
987
|
-
indexChangedOnDataSource(
|
|
988
|
-
(this.dataSourceDisplay as DataSourceDisplay).dataSources,
|
|
989
|
-
item,
|
|
990
|
-
this.layerCollection,
|
|
991
|
-
);
|
|
992
|
-
}
|
|
993
|
-
});
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
/**
|
|
998
|
-
* Internal API used to register visualizations from layer implementations
|
|
999
|
-
* @param primitiveCollection
|
|
1000
|
-
*/
|
|
1001
|
-
addPrimitiveCollection(
|
|
1002
|
-
primitiveCollection: PrimitiveCollection | Cesium3DTileset,
|
|
1003
|
-
): void {
|
|
1004
|
-
if (!this._cesiumWidget) {
|
|
1005
|
-
throw new Error('Cannot add primitive to uninitialized map');
|
|
1006
|
-
}
|
|
1007
|
-
if (this.validateVisualization(primitiveCollection)) {
|
|
1008
|
-
this.addVisualization(primitiveCollection);
|
|
1009
|
-
ensureInCollection(
|
|
1010
|
-
this._cesiumWidget.scene.primitives,
|
|
1011
|
-
primitiveCollection,
|
|
1012
|
-
this.layerCollection,
|
|
1013
|
-
);
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
/**
|
|
1018
|
-
* Internal API to unregister the visualization for a layers implementation
|
|
1019
|
-
* @param primitiveCollection
|
|
1020
|
-
*/
|
|
1021
|
-
removePrimitiveCollection(
|
|
1022
|
-
primitiveCollection: PrimitiveCollection | Cesium3DTileset,
|
|
763
|
+
protected override _indexChangedOnVisualization(
|
|
764
|
+
vis: CesiumVisualisationType,
|
|
1023
765
|
): void {
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
/**
|
|
1030
|
-
* Internal API used to register visualizations from layer implementations
|
|
1031
|
-
* @param imageryLayer
|
|
1032
|
-
*/
|
|
1033
|
-
addImageryLayer(imageryLayer: ImageryLayer): void {
|
|
1034
|
-
if (!this._cesiumWidget) {
|
|
1035
|
-
throw new Error('Cannot add primitive to uninitialized map');
|
|
1036
|
-
}
|
|
1037
|
-
if (this.validateVisualization(imageryLayer)) {
|
|
1038
|
-
this.addVisualization(imageryLayer);
|
|
1039
|
-
ensureInCollection(
|
|
1040
|
-
this._cesiumWidget.scene.imageryLayers,
|
|
1041
|
-
imageryLayer,
|
|
766
|
+
if (vis instanceof CustomDataSource) {
|
|
767
|
+
indexChangedOnDataSource(
|
|
768
|
+
(this.dataSourceDisplay as DataSourceDisplay).dataSources,
|
|
769
|
+
vis,
|
|
1042
770
|
this.layerCollection,
|
|
1043
771
|
);
|
|
772
|
+
} else {
|
|
773
|
+
super._indexChangedOnVisualization(vis);
|
|
1044
774
|
}
|
|
1045
775
|
}
|
|
1046
776
|
|
|
1047
|
-
/**
|
|
1048
|
-
* Internal API used to unregister visualizations from layer implementations
|
|
1049
|
-
*/
|
|
1050
|
-
removeImageryLayer(imageryLayer: ImageryLayer): void {
|
|
1051
|
-
this.removeVisualization(imageryLayer);
|
|
1052
|
-
this.getScene()?.imageryLayers.remove(imageryLayer);
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
777
|
/**
|
|
1056
778
|
* Internal API used to register visualizations from layer implementations
|
|
1057
779
|
*/
|
|
@@ -1109,27 +831,6 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
1109
831
|
}
|
|
1110
832
|
}
|
|
1111
833
|
|
|
1112
|
-
/**
|
|
1113
|
-
* set the cesium TerrainProvider
|
|
1114
|
-
*/
|
|
1115
|
-
setTerrainProvider(terrainProvider: TerrainProvider): void {
|
|
1116
|
-
if (this.terrainProvider !== terrainProvider && this._cesiumWidget) {
|
|
1117
|
-
this._cesiumWidget.scene.terrainProvider = terrainProvider;
|
|
1118
|
-
}
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
/**
|
|
1122
|
-
* unsets the TerrainProvider (changes to the default TerrainProvider if the given terranProvider is currently active)
|
|
1123
|
-
*/
|
|
1124
|
-
unsetTerrainProvider(terrainProvider: TerrainProvider): void {
|
|
1125
|
-
if (this.terrainProvider === terrainProvider) {
|
|
1126
|
-
this._terrainProvider = this.defaultTerrainProvider;
|
|
1127
|
-
if (this._cesiumWidget && this.defaultTerrainProvider) {
|
|
1128
|
-
this._cesiumWidget.scene.terrainProvider = this.defaultTerrainProvider;
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
834
|
/**
|
|
1134
835
|
* returns the cesium DataSourceDisplay Object
|
|
1135
836
|
*/
|
|
@@ -1137,13 +838,6 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
1137
838
|
return this.dataSourceDisplay;
|
|
1138
839
|
}
|
|
1139
840
|
|
|
1140
|
-
/**
|
|
1141
|
-
* returns the cesium Scene Object, returns null on non initialized or destroyed maps
|
|
1142
|
-
*/
|
|
1143
|
-
getScene(): Scene | undefined {
|
|
1144
|
-
return this._cesiumWidget?.scene;
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
841
|
pointIsVisible(coords: Coordinate): boolean {
|
|
1148
842
|
if (!this._cesiumWidget) {
|
|
1149
843
|
return false;
|
|
@@ -1165,22 +859,6 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
1165
859
|
return false;
|
|
1166
860
|
}
|
|
1167
861
|
|
|
1168
|
-
/**
|
|
1169
|
-
* is called when the cesium Terrainprovider changes. Sets the .terrainProvider and deactivates currently
|
|
1170
|
-
* active TerrainLayer layer if necessary
|
|
1171
|
-
*/
|
|
1172
|
-
private _terrainProviderChanged(terrainProvider: TerrainProvider): void {
|
|
1173
|
-
if (this.terrainProvider !== terrainProvider) {
|
|
1174
|
-
const layer = this.layerCollection.getByKey(
|
|
1175
|
-
this?.terrainProvider?.[vcsLayerName],
|
|
1176
|
-
);
|
|
1177
|
-
this._terrainProvider = terrainProvider;
|
|
1178
|
-
if (layer) {
|
|
1179
|
-
layer.deactivate();
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
862
|
/**
|
|
1185
863
|
* returns true if the WEBGL Extension WEBGL_depth_texture is supported. (Is used for picking)
|
|
1186
864
|
*/
|
|
@@ -1201,9 +879,8 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
1201
879
|
return this._cesiumWidget?.scene.context.fragmentDepth ?? false;
|
|
1202
880
|
}
|
|
1203
881
|
|
|
1204
|
-
toJSON(): CesiumMapOptions {
|
|
1205
|
-
const config: CesiumMapOptions = super.toJSON();
|
|
1206
|
-
const defaultOptions = CesiumMap.getDefaultOptions();
|
|
882
|
+
toJSON(defaultOptions = CesiumMap.getDefaultOptions()): CesiumMapOptions {
|
|
883
|
+
const config: CesiumMapOptions = super.toJSON(defaultOptions);
|
|
1207
884
|
|
|
1208
885
|
if (this.enableLightning !== defaultOptions.enableLightning) {
|
|
1209
886
|
config.enableLightning = this.enableLightning;
|
|
@@ -1248,18 +925,6 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
1248
925
|
if (this.dataSourceDisplay && !this.dataSourceDisplay.isDestroyed()) {
|
|
1249
926
|
this.dataSourceDisplay.destroy();
|
|
1250
927
|
}
|
|
1251
|
-
this._screenSpaceListener?.();
|
|
1252
|
-
if (this.screenSpaceEventHandler) {
|
|
1253
|
-
this.screenSpaceEventHandler.destroy();
|
|
1254
|
-
this.screenSpaceEventHandler = null;
|
|
1255
|
-
}
|
|
1256
|
-
this._listeners.forEach((cb) => {
|
|
1257
|
-
cb();
|
|
1258
|
-
});
|
|
1259
|
-
this._listeners = [];
|
|
1260
|
-
|
|
1261
|
-
this._terrainProvider = null;
|
|
1262
|
-
this.defaultTerrainProvider = null;
|
|
1263
928
|
|
|
1264
929
|
if (this._clockSyncListener) {
|
|
1265
930
|
this._clockSyncListener();
|
|
@@ -1275,17 +940,9 @@ class CesiumMap extends VcsMap<CesiumVisualisationType> {
|
|
|
1275
940
|
this._cameraLimiter = null;
|
|
1276
941
|
}
|
|
1277
942
|
|
|
1278
|
-
[...this.layerCollection].forEach((l) => {
|
|
1279
|
-
l.removedFromMap(this);
|
|
1280
|
-
});
|
|
1281
|
-
|
|
1282
943
|
if (this._clusterDataSourceDisplay) {
|
|
1283
944
|
this._clusterDataSourceDisplay.destroy();
|
|
1284
945
|
}
|
|
1285
|
-
if (this._cesiumWidget) {
|
|
1286
|
-
this._cesiumWidget.destroy();
|
|
1287
|
-
this._cesiumWidget = null;
|
|
1288
|
-
}
|
|
1289
946
|
|
|
1290
947
|
this._initialShadowMap = undefined;
|
|
1291
948
|
this._defaultShadowMap = null;
|