@vcmap/core 5.3.3 → 6.0.0-rc.10
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/cesium.d.ts +12 -0
- package/dist/index.d.ts +27 -19
- package/dist/index.js +22 -14
- package/dist/index.js.map +1 -1
- package/dist/ol.d.ts +15 -2
- package/dist/src/category/category.d.ts +5 -4
- package/dist/src/category/category.js +2 -1
- package/dist/src/category/category.js.map +1 -1
- package/dist/src/category/categoryCollection.js.map +1 -1
- package/dist/src/cesium/cesiumVcsCameraPrimitive.d.ts +1 -0
- package/dist/src/cesium/cesiumVcsCameraPrimitive.js +4 -0
- package/dist/src/cesium/cesiumVcsCameraPrimitive.js.map +1 -1
- package/dist/src/classRegistry.d.ts +4 -3
- package/dist/src/classRegistry.js +2 -0
- package/dist/src/classRegistry.js.map +1 -1
- package/dist/src/featureProvider/abstractFeatureProvider.js.map +1 -1
- package/dist/src/featureProvider/wmsFeatureProvider.js.map +1 -1
- package/dist/src/interaction/abstractInteraction.js.map +1 -1
- package/dist/src/interaction/coordinateAtPixel.js.map +1 -1
- package/dist/src/interaction/eventHandler.js.map +1 -1
- package/dist/src/interaction/featureAtPixelInteraction.d.ts +4 -12
- package/dist/src/interaction/featureAtPixelInteraction.js +5 -21
- package/dist/src/interaction/featureAtPixelInteraction.js.map +1 -1
- package/dist/src/interaction/featureProviderInteraction.js.map +1 -1
- package/dist/src/interaction/interactionChain.js.map +1 -1
- package/dist/src/interaction/interactionType.js +4 -4
- package/dist/src/interaction/interactionType.js.map +1 -1
- package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/clusterContext.d.ts +12 -16
- package/dist/src/layer/cesium/clusterContext.js +75 -43
- package/dist/src/layer/cesium/clusterContext.js.map +1 -1
- package/dist/src/layer/cesium/dataSourceCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/rasterLayerCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/resourceHelper.js.map +1 -1
- package/dist/src/layer/cesium/singleImageCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/terrainCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/tmsCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vectorCesiumImpl.d.ts +2 -3
- package/dist/src/layer/cesium/vectorCesiumImpl.js +16 -10
- package/dist/src/layer/cesium/vectorCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vectorContext.d.ts +11 -54
- package/dist/src/layer/cesium/vectorContext.js +154 -171
- package/dist/src/layer/cesium/vectorContext.js.map +1 -1
- package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vectorTileImageryProvider.js.map +1 -1
- package/dist/src/layer/cesium/wmsCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesiumTilesetLayer.js.map +1 -1
- package/dist/src/layer/czmlLayer.js.map +1 -1
- package/dist/src/layer/dataSourceLayer.js.map +1 -1
- package/dist/src/layer/featureLayer.js.map +1 -1
- package/dist/src/layer/featureStoreFeatureVisibility.js.map +1 -1
- package/dist/src/layer/featureStoreLayer.js.map +1 -1
- package/dist/src/layer/featureStoreLayerChanges.js.map +1 -1
- package/dist/src/layer/featureVisibility.js +4 -5
- package/dist/src/layer/featureVisibility.js.map +1 -1
- package/dist/src/layer/geojsonHelpers.d.ts +1 -1
- package/dist/src/layer/geojsonHelpers.js +5 -10
- package/dist/src/layer/geojsonHelpers.js.map +1 -1
- package/dist/src/layer/geojsonLayer.js.map +1 -1
- package/dist/src/layer/globalHider.js.map +1 -1
- package/dist/src/layer/layer.js.map +1 -1
- package/dist/src/layer/layerImplementation.js.map +1 -1
- package/dist/src/layer/oblique/layerObliqueImpl.js.map +1 -1
- package/dist/src/layer/oblique/obliqueHelpers.js +9 -9
- package/dist/src/layer/oblique/obliqueHelpers.js.map +1 -1
- package/dist/src/layer/oblique/vectorObliqueImpl.d.ts +3 -3
- package/dist/src/layer/oblique/vectorObliqueImpl.js.map +1 -1
- package/dist/src/layer/openStreetMapLayer.js.map +1 -1
- package/dist/src/layer/openlayers/layerOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/rasterLayerOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/singleImageOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/tmsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/vectorOpenlayersImpl.d.ts +2 -2
- package/dist/src/layer/openlayers/vectorOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.d.ts +1 -7
- package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.js +18 -47
- package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/wmsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/wmtsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/pointCloudLayer.js.map +1 -1
- package/dist/src/layer/rasterLayer.js +1 -1
- package/dist/src/layer/rasterLayer.js.map +1 -1
- package/dist/src/layer/singleImageLayer.js.map +1 -1
- package/dist/src/layer/terrainHelpers.js.map +1 -1
- package/dist/src/layer/terrainLayer.js.map +1 -1
- package/dist/src/layer/tileLoadedHelper.js.map +1 -1
- package/dist/src/layer/tileProvider/mvtTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/tileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/urlTemplateTileProvider.js.map +1 -1
- package/dist/src/layer/tmsLayer.js.map +1 -1
- package/dist/src/layer/vectorHelpers.js.map +1 -1
- package/dist/src/layer/vectorLayer.d.ts +0 -37
- package/dist/src/layer/vectorLayer.js +1 -3
- package/dist/src/layer/vectorLayer.js.map +1 -1
- package/dist/src/layer/vectorProperties.d.ts +10 -5
- package/dist/src/layer/vectorProperties.js +59 -10
- package/dist/src/layer/vectorProperties.js.map +1 -1
- package/dist/src/layer/vectorTileLayer.js.map +1 -1
- package/dist/src/layer/wfsLayer.js.map +1 -1
- package/dist/src/layer/wmsHelpers.js.map +1 -1
- package/dist/src/layer/wmsLayer.js.map +1 -1
- package/dist/src/layer/wmtsLayer.js.map +1 -1
- package/dist/src/map/baseOLMap.js +1 -1
- package/dist/src/map/baseOLMap.js.map +1 -1
- package/dist/src/map/cameraLimiter.js +1 -1
- package/dist/src/map/cameraLimiter.js.map +1 -1
- package/dist/src/map/cesiumMap.js.map +1 -1
- package/dist/src/map/obliqueMap.js.map +1 -1
- package/dist/src/map/openlayersMap.js +1 -1
- package/dist/src/map/openlayersMap.js.map +1 -1
- package/dist/src/map/vcsMap.js.map +1 -1
- package/dist/src/oblique/helpers.js +5 -5
- package/dist/src/oblique/helpers.js.map +1 -1
- package/dist/src/oblique/obliqueCollection.js.map +1 -1
- package/dist/src/oblique/obliqueDataSet.js +5 -5
- package/dist/src/oblique/obliqueDataSet.js.map +1 -1
- package/dist/src/oblique/obliqueImage.js.map +1 -1
- package/dist/src/oblique/obliqueImageMeta.js.map +1 -1
- package/dist/src/oblique/obliqueProvider.js.map +1 -1
- package/dist/src/oblique/obliqueView.js.map +1 -1
- package/dist/src/oblique/obliqueViewDirection.js +1 -1
- package/dist/src/oblique/obliqueViewDirection.js.map +1 -1
- package/dist/src/oblique/parseImageJson.js.map +1 -1
- package/dist/src/ol/feature.js.map +1 -1
- package/dist/src/ol/geom/geometryCollection.js +80 -6
- package/dist/src/ol/geom/geometryCollection.js.map +1 -1
- package/dist/src/ol/render/canvas/canvasTileRenderer.js.map +1 -1
- package/dist/src/ol/source/ClusterEnhancedVectorSource.js.map +1 -1
- package/dist/src/ol/source/VcsCluster.js.map +1 -1
- package/dist/src/overrideClassRegistry.d.ts +2 -2
- package/dist/src/overrideClassRegistry.js +5 -3
- package/dist/src/overrideClassRegistry.js.map +1 -1
- package/dist/src/style/arcStyle.js +1 -0
- package/dist/src/style/arcStyle.js.map +1 -1
- package/dist/src/style/arrowStyle.js +6 -6
- package/dist/src/style/arrowStyle.js.map +1 -1
- package/dist/src/style/declarativeStyleItem.js.map +1 -1
- package/dist/src/style/shapesCategory.js.map +1 -1
- package/dist/src/style/styleFactory.js.map +1 -1
- package/dist/src/style/styleHelpers.js +4 -2
- package/dist/src/style/styleHelpers.js.map +1 -1
- package/dist/src/style/styleItem.js.map +1 -1
- package/dist/src/style/vectorStyleItem.js +9 -9
- package/dist/src/style/vectorStyleItem.js.map +1 -1
- package/dist/src/style/writeStyle.js.map +1 -1
- package/dist/src/util/clipping/clippingObject.js.map +1 -1
- package/dist/src/util/clipping/clippingObjectManager.js.map +1 -1
- package/dist/src/util/clipping/clippingPlaneHelper.js +2 -2
- package/dist/src/util/clipping/clippingPlaneHelper.js.map +1 -1
- package/dist/src/util/collection.js.map +1 -1
- package/dist/src/util/displayQuality/displayQuality.d.ts +1 -0
- package/dist/src/util/displayQuality/displayQuality.js +13 -2
- package/dist/src/util/displayQuality/displayQuality.js.map +1 -1
- package/dist/src/util/editor/createFeatureSession.d.ts +10 -2
- package/dist/src/util/editor/createFeatureSession.js +75 -9
- package/dist/src/util/editor/createFeatureSession.js.map +1 -1
- package/dist/src/util/editor/editFeaturesSession.d.ts +10 -4
- package/dist/src/util/editor/editFeaturesSession.js +74 -37
- package/dist/src/util/editor/editFeaturesSession.js.map +1 -1
- package/dist/src/util/editor/editGeometrySession.d.ts +7 -2
- package/dist/src/util/editor/editGeometrySession.js +109 -66
- package/dist/src/util/editor/editGeometrySession.js.map +1 -1
- package/dist/src/util/editor/editorHelpers.d.ts +13 -6
- package/dist/src/util/editor/editorHelpers.js +53 -23
- package/dist/src/util/editor/editorHelpers.js.map +1 -1
- package/dist/src/util/editor/editorSessionHelpers.d.ts +6 -6
- package/dist/src/util/editor/editorSessionHelpers.js +8 -18
- package/dist/src/util/editor/editorSessionHelpers.js.map +1 -1
- package/dist/src/util/editor/editorSymbols.d.ts +1 -1
- package/dist/src/util/editor/editorSymbols.js +1 -1
- package/dist/src/util/editor/editorSymbols.js.map +1 -1
- package/dist/src/util/editor/interactions/createBBoxInteraction.d.ts +1 -0
- package/dist/src/util/editor/interactions/createBBoxInteraction.js +20 -16
- package/dist/src/util/editor/interactions/createBBoxInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/createCircleInteraction.js +1 -1
- package/dist/src/util/editor/interactions/createCircleInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/createLineStringInteraction.js +3 -3
- package/dist/src/util/editor/interactions/createLineStringInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/createPointInteraction.js +1 -1
- package/dist/src/util/editor/interactions/createPointInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/createPolygonInteraction.d.ts +4 -0
- package/dist/src/util/editor/interactions/createPolygonInteraction.js +9 -3
- package/dist/src/util/editor/interactions/createPolygonInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/creationSnapping.d.ts +26 -0
- package/dist/src/util/editor/interactions/creationSnapping.js +139 -0
- package/dist/src/util/editor/interactions/creationSnapping.js.map +1 -0
- package/dist/src/util/editor/interactions/editFeaturesMouseOverInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.js +11 -9
- package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/ensureHandlerSelectionInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/insertVertexInteraction.d.ts +3 -1
- package/dist/src/util/editor/interactions/insertVertexInteraction.js +14 -6
- package/dist/src/util/editor/interactions/insertVertexInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/layerSnapping.d.ts +19 -0
- package/dist/src/util/editor/interactions/layerSnapping.js +87 -0
- package/dist/src/util/editor/interactions/layerSnapping.js.map +1 -0
- package/dist/src/util/editor/interactions/mapInteractionController.js.map +1 -1
- package/dist/src/util/editor/interactions/removeVertexInteraction.d.ts +1 -1
- package/dist/src/util/editor/interactions/removeVertexInteraction.js +2 -2
- package/dist/src/util/editor/interactions/removeVertexInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/segmentLengthInteraction.d.ts +16 -0
- package/dist/src/util/editor/interactions/segmentLengthInteraction.js +167 -0
- package/dist/src/util/editor/interactions/segmentLengthInteraction.js.map +1 -0
- package/dist/src/util/editor/interactions/selectFeatureMouseOverInteraction.js +1 -1
- package/dist/src/util/editor/interactions/selectFeatureMouseOverInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/selectMultiFeatureInteraction.d.ts +1 -1
- package/dist/src/util/editor/interactions/selectMultiFeatureInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/selectSingleFeatureInteraction.d.ts +1 -1
- package/dist/src/util/editor/interactions/selectSingleFeatureInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/translateVertexInteraction.js +4 -8
- package/dist/src/util/editor/interactions/translateVertexInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/translationSnapping.d.ts +25 -0
- package/dist/src/util/editor/interactions/translationSnapping.js +180 -0
- package/dist/src/util/editor/interactions/translationSnapping.js.map +1 -0
- package/dist/src/util/editor/selectFeaturesSession.js.map +1 -1
- package/dist/src/util/editor/snappingHelpers.d.ts +44 -0
- package/dist/src/util/editor/snappingHelpers.js +329 -0
- package/dist/src/util/editor/snappingHelpers.js.map +1 -0
- package/dist/src/util/editor/transformation/create2DHandlers.js +26 -26
- package/dist/src/util/editor/transformation/create2DHandlers.js.map +1 -1
- package/dist/src/util/editor/transformation/create3DHandlers.js +65 -14
- package/dist/src/util/editor/transformation/create3DHandlers.js.map +1 -1
- package/dist/src/util/editor/transformation/extrudeInteraction.js.map +1 -1
- package/dist/src/util/editor/transformation/rotateInteraction.js.map +1 -1
- package/dist/src/util/editor/transformation/scaleInteraction.js +27 -5
- package/dist/src/util/editor/transformation/scaleInteraction.js.map +1 -1
- package/dist/src/util/editor/transformation/transformationHandler.js +56 -38
- package/dist/src/util/editor/transformation/transformationHandler.js.map +1 -1
- package/dist/src/util/editor/transformation/transformationTypes.d.ts +2 -0
- package/dist/src/util/editor/transformation/transformationTypes.js +6 -2
- package/dist/src/util/editor/transformation/transformationTypes.js.map +1 -1
- package/dist/src/util/editor/transformation/translateInteraction.js.map +1 -1
- package/dist/src/util/editor/validateGeoemetry.js.map +1 -1
- package/dist/src/util/exclusiveManager.js.map +1 -1
- package/dist/src/util/extent.js.map +1 -1
- package/dist/src/util/featureconverter/arcToCesium.d.ts +5 -19
- package/dist/src/util/featureconverter/arcToCesium.js +15 -42
- package/dist/src/util/featureconverter/arcToCesium.js.map +1 -1
- package/dist/src/util/featureconverter/circleToCesium.d.ts +2 -27
- package/dist/src/util/featureconverter/circleToCesium.js +85 -64
- package/dist/src/util/featureconverter/circleToCesium.js.map +1 -1
- package/dist/src/util/featureconverter/clampedPrimitive.d.ts +2 -0
- package/dist/src/util/featureconverter/clampedPrimitive.js +29 -0
- package/dist/src/util/featureconverter/clampedPrimitive.js.map +1 -0
- package/dist/src/util/featureconverter/convert.d.ts +30 -7
- package/dist/src/util/featureconverter/convert.js +221 -44
- package/dist/src/util/featureconverter/convert.js.map +1 -1
- package/dist/src/util/featureconverter/extent3D.d.ts +4 -3
- package/dist/src/util/featureconverter/extent3D.js +4 -3
- package/dist/src/util/featureconverter/extent3D.js.map +1 -1
- package/dist/src/util/featureconverter/lineStringToCesium.d.ts +12 -27
- package/dist/src/util/featureconverter/lineStringToCesium.js +85 -107
- package/dist/src/util/featureconverter/lineStringToCesium.js.map +1 -1
- package/dist/src/util/featureconverter/pointHelpers.d.ts +8 -11
- package/dist/src/util/featureconverter/pointHelpers.js +141 -121
- package/dist/src/util/featureconverter/pointHelpers.js.map +1 -1
- package/dist/src/util/featureconverter/pointToCesium.d.ts +14 -17
- package/dist/src/util/featureconverter/pointToCesium.js +50 -98
- package/dist/src/util/featureconverter/pointToCesium.js.map +1 -1
- package/dist/src/util/featureconverter/polygonToCesium.d.ts +2 -26
- package/dist/src/util/featureconverter/polygonToCesium.js +63 -73
- package/dist/src/util/featureconverter/polygonToCesium.js.map +1 -1
- package/dist/src/util/featureconverter/storeyHelpers.d.ts +17 -0
- package/dist/src/util/featureconverter/storeyHelpers.js +78 -0
- package/dist/src/util/featureconverter/storeyHelpers.js.map +1 -0
- package/dist/src/util/featureconverter/vectorGeometryFactory.d.ts +54 -0
- package/dist/src/util/featureconverter/vectorGeometryFactory.js +278 -0
- package/dist/src/util/featureconverter/vectorGeometryFactory.js.map +1 -0
- package/dist/src/util/featureconverter/vectorHeightInfo.d.ts +86 -0
- package/dist/src/util/featureconverter/vectorHeightInfo.js +240 -0
- package/dist/src/util/featureconverter/vectorHeightInfo.js.map +1 -0
- package/dist/src/util/fetch.js.map +1 -1
- package/dist/src/util/flight/flightAnchor.js.map +1 -1
- package/dist/src/util/flight/flightCollection.js.map +1 -1
- package/dist/src/util/flight/flightHelpers.js.map +1 -1
- package/dist/src/util/flight/flightInstance.js.map +1 -1
- package/dist/src/util/flight/flightPlayer.d.ts +11 -6
- package/dist/src/util/flight/flightPlayer.js +52 -16
- package/dist/src/util/flight/flightPlayer.js.map +1 -1
- package/dist/src/util/flight/flightVisualizer.js.map +1 -1
- package/dist/src/util/geometryHelpers.d.ts +34 -2
- package/dist/src/util/geometryHelpers.js +172 -4
- package/dist/src/util/geometryHelpers.js.map +1 -1
- package/dist/src/util/hiddenObjects.js.map +1 -1
- package/dist/src/util/indexedCollection.js.map +1 -1
- package/dist/src/util/layerCollection.js.map +1 -1
- package/dist/src/util/locale.js.map +1 -1
- package/dist/src/util/mapCollection.js.map +1 -1
- package/dist/src/util/math.d.ts +18 -2
- package/dist/src/util/math.js +55 -12
- package/dist/src/util/math.js.map +1 -1
- package/dist/src/util/overrideCollection.d.ts +7 -7
- package/dist/src/util/overrideCollection.js +10 -7
- package/dist/src/util/overrideCollection.js.map +1 -1
- package/dist/src/util/projection.js.map +1 -1
- package/dist/src/util/urlHelpers.js.map +1 -1
- package/dist/src/util/viewpoint.js.map +1 -1
- package/dist/src/vcsApp.d.ts +3 -3
- package/dist/src/vcsApp.js +1 -0
- package/dist/src/vcsApp.js.map +1 -1
- package/dist/src/vcsEvent.js.map +1 -1
- package/dist/src/vcsModule.js.map +1 -1
- package/dist/src/vcsModuleHelpers.d.ts +1 -0
- package/dist/src/vcsModuleHelpers.js +16 -2
- package/dist/src/vcsModuleHelpers.js.map +1 -1
- package/dist/src/vcsObject.js.map +1 -1
- package/dist/tests/unit/helpers/cesiumHelpers.d.ts +11 -11
- package/dist/tests/unit/helpers/cesiumHelpers.js +6 -1
- package/dist/tests/unit/helpers/cesiumHelpers.js.map +1 -1
- package/dist/tests/unit/helpers/helpers.d.ts +2 -9
- package/dist/tests/unit/helpers/helpers.js +4 -10
- package/dist/tests/unit/helpers/helpers.js.map +1 -1
- package/dist/tests/unit/helpers/importJSON.js.map +1 -1
- package/dist/tests/unit/helpers/obliqueHelpers.js.map +1 -1
- package/index.ts +84 -36
- package/package.json +21 -21
- package/src/category/category.ts +11 -9
- package/src/category/categoryCollection.ts +1 -1
- package/src/cesium/cesium.d.ts +12 -0
- package/src/cesium/cesiumVcsCameraPrimitive.ts +5 -0
- package/src/classRegistry.ts +7 -4
- package/src/featureProvider/wmsFeatureProvider.ts +1 -1
- package/src/global.d.ts +6 -1
- package/src/interaction/featureAtPixelInteraction.ts +7 -26
- package/src/layer/cesium/clusterContext.ts +97 -93
- package/src/layer/cesium/vectorCesiumImpl.ts +17 -11
- package/src/layer/cesium/vectorContext.ts +229 -348
- package/src/layer/featureVisibility.ts +3 -6
- package/src/layer/geojsonHelpers.ts +9 -12
- package/src/layer/oblique/obliqueHelpers.ts +9 -9
- package/src/layer/oblique/vectorObliqueImpl.ts +2 -2
- package/src/layer/openlayers/vectorOpenlayersImpl.ts +2 -2
- package/src/layer/openlayers/vectorTileOpenlayersImpl.ts +23 -53
- package/src/layer/tileLoadedHelper.ts +1 -3
- package/src/layer/tileProvider/mvtTileProvider.ts +2 -2
- package/src/layer/vectorLayer.ts +1 -74
- package/src/layer/vectorProperties.ts +80 -16
- package/src/map/baseOLMap.ts +1 -1
- package/src/oblique/helpers.ts +11 -5
- package/src/oblique/obliqueDataSet.ts +4 -4
- package/src/ol/geom/geometryCollection.js +96 -6
- package/src/ol/ol.d.ts +15 -2
- package/src/overrideClassRegistry.ts +13 -7
- package/src/style/arcStyle.ts +1 -0
- package/src/style/arrowStyle.ts +7 -7
- package/src/style/declarativeStyleItem.ts +2 -2
- package/src/style/styleHelpers.ts +15 -13
- package/src/style/vectorStyleItem.ts +14 -14
- package/src/util/clipping/clippingObject.ts +1 -3
- package/src/util/clipping/clippingPlaneHelper.ts +3 -4
- package/src/util/displayQuality/displayQuality.ts +13 -1
- package/src/util/editor/createFeatureSession.ts +107 -13
- package/src/util/editor/editFeaturesSession.ts +105 -39
- package/src/util/editor/editGeometrySession.ts +157 -83
- package/src/util/editor/editorHelpers.ts +85 -33
- package/src/util/editor/editorSessionHelpers.ts +13 -20
- package/src/util/editor/editorSymbols.ts +1 -1
- package/src/util/editor/interactions/createBBoxInteraction.ts +25 -16
- package/src/util/editor/interactions/createCircleInteraction.ts +1 -1
- package/src/util/editor/interactions/createLineStringInteraction.ts +9 -3
- package/src/util/editor/interactions/createPointInteraction.ts +1 -1
- package/src/util/editor/interactions/createPolygonInteraction.ts +16 -3
- package/src/util/editor/interactions/creationSnapping.ts +226 -0
- package/src/util/editor/interactions/editGeometryMouseOverInteraction.ts +7 -6
- package/src/util/editor/interactions/insertVertexInteraction.ts +27 -7
- package/src/util/editor/interactions/layerSnapping.ts +136 -0
- package/src/util/editor/interactions/removeVertexInteraction.ts +3 -4
- package/src/util/editor/interactions/segmentLengthInteraction.ts +227 -0
- package/src/util/editor/interactions/translateVertexInteraction.ts +11 -12
- package/src/util/editor/interactions/translationSnapping.ts +302 -0
- package/src/util/editor/snappingHelpers.ts +490 -0
- package/src/util/editor/transformation/create2DHandlers.ts +38 -26
- package/src/util/editor/transformation/create3DHandlers.ts +84 -22
- package/src/util/editor/transformation/scaleInteraction.ts +28 -5
- package/src/util/editor/transformation/transformationHandler.ts +72 -41
- package/src/util/editor/transformation/transformationTypes.ts +5 -0
- package/src/util/featureconverter/arcToCesium.ts +25 -95
- package/src/util/featureconverter/circleToCesium.ts +128 -114
- package/src/util/featureconverter/clampedPrimitive.ts +70 -0
- package/src/util/featureconverter/convert.ts +447 -113
- package/src/util/featureconverter/extent3D.ts +13 -6
- package/src/util/featureconverter/lineStringToCesium.ts +134 -181
- package/src/util/featureconverter/pointHelpers.ts +285 -219
- package/src/util/featureconverter/pointToCesium.ts +117 -177
- package/src/util/featureconverter/polygonToCesium.ts +99 -118
- package/src/util/featureconverter/storeyHelpers.ts +104 -0
- package/src/util/featureconverter/vectorGeometryFactory.ts +601 -0
- package/src/util/featureconverter/vectorHeightInfo.ts +392 -0
- package/src/util/flight/flightPlayer.ts +64 -22
- package/src/util/geometryHelpers.ts +239 -9
- package/src/util/hiddenObjects.ts +4 -4
- package/src/util/math.ts +87 -12
- package/src/util/overrideCollection.ts +33 -21
- package/src/vcsApp.ts +11 -4
- package/src/vcsModuleHelpers.ts +25 -2
- package/dist/src/util/featureconverter/featureconverterHelper.d.ts +0 -35
- package/dist/src/util/featureconverter/featureconverterHelper.js +0 -403
- package/dist/src/util/featureconverter/featureconverterHelper.js.map +0 -1
- package/src/util/featureconverter/featureconverterHelper.ts +0 -668
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { Geometry, SimpleGeometry } from 'ol/geom.js';
|
|
2
|
+
import type { Coordinate } from 'ol/coordinate.js';
|
|
3
|
+
import { Cartesian3, HeightReference } from '@vcmap-cesium/engine';
|
|
4
|
+
import { GeometryLayout } from 'ol/geom/Geometry.js';
|
|
5
|
+
import type { Feature } from 'ol';
|
|
6
|
+
import type VectorProperties from '../../layer/vectorProperties.js';
|
|
7
|
+
import { is2DLayout } from '../geometryHelpers.js';
|
|
8
|
+
import { getStoreyHeights, validateStoreys } from './storeyHelpers.js';
|
|
9
|
+
import Projection from '../projection.js';
|
|
10
|
+
|
|
11
|
+
export type ExtrusionHeightInfo = {
|
|
12
|
+
/**
|
|
13
|
+
* if the object is extruded
|
|
14
|
+
*/
|
|
15
|
+
extruded: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* storey heights above ground, list has the same length as storeysAboveGround
|
|
18
|
+
*/
|
|
19
|
+
storeyHeightsAboveGround: number[];
|
|
20
|
+
/**
|
|
21
|
+
* storey heights below ground, list has the same length as storeysBelowGround
|
|
22
|
+
*/
|
|
23
|
+
storeyHeightsBelowGround: number[];
|
|
24
|
+
/**
|
|
25
|
+
* a negative height to <i>push</i> the geometry visually into the ground
|
|
26
|
+
*/
|
|
27
|
+
skirt: number;
|
|
28
|
+
};
|
|
29
|
+
export type ClampedHeightReference =
|
|
30
|
+
| HeightReference.CLAMP_TO_GROUND
|
|
31
|
+
| HeightReference.CLAMP_TO_TERRAIN
|
|
32
|
+
| HeightReference.CLAMP_TO_3D_TILE;
|
|
33
|
+
export type RelativeHeightReference =
|
|
34
|
+
| HeightReference.RELATIVE_TO_GROUND
|
|
35
|
+
| HeightReference.RELATIVE_TO_TERRAIN
|
|
36
|
+
| HeightReference.RELATIVE_TO_3D_TILE;
|
|
37
|
+
export type VectorHeightInfo<
|
|
38
|
+
T extends HeightReference = HeightReference,
|
|
39
|
+
L extends GeometryLayout = GeometryLayout,
|
|
40
|
+
> = T extends ClampedHeightReference
|
|
41
|
+
? {
|
|
42
|
+
heightReference: T;
|
|
43
|
+
layout: L;
|
|
44
|
+
}
|
|
45
|
+
: T extends RelativeHeightReference
|
|
46
|
+
? {
|
|
47
|
+
heightReference: T;
|
|
48
|
+
layout: L;
|
|
49
|
+
clampOrigin?: [number, number];
|
|
50
|
+
heightAboveGround?: number;
|
|
51
|
+
/**
|
|
52
|
+
* the level above or below mean sea level
|
|
53
|
+
*/
|
|
54
|
+
groundLevel?: number;
|
|
55
|
+
/**
|
|
56
|
+
* true if not all z values are identical, e.g no height above ground was provided and no or only one storey was provided
|
|
57
|
+
*/
|
|
58
|
+
perPositionHeight: boolean;
|
|
59
|
+
} & ExtrusionHeightInfo
|
|
60
|
+
: T extends HeightReference.NONE
|
|
61
|
+
? {
|
|
62
|
+
heightReference: T;
|
|
63
|
+
layout: L;
|
|
64
|
+
/**
|
|
65
|
+
* the level above or below mean sea level (minZ value or ground_level or 0)
|
|
66
|
+
*/
|
|
67
|
+
groundLevelOrMinHeight: number;
|
|
68
|
+
/**
|
|
69
|
+
* true if not all z values are identical, e.g no ground level was provided and no or only one storey was provided
|
|
70
|
+
*/
|
|
71
|
+
perPositionHeight: boolean;
|
|
72
|
+
} & ExtrusionHeightInfo
|
|
73
|
+
: never;
|
|
74
|
+
|
|
75
|
+
export function isClampedHeightReference(
|
|
76
|
+
heightReference: HeightReference,
|
|
77
|
+
): heightReference is ClampedHeightReference {
|
|
78
|
+
return (
|
|
79
|
+
heightReference === HeightReference.CLAMP_TO_GROUND ||
|
|
80
|
+
heightReference === HeightReference.CLAMP_TO_TERRAIN ||
|
|
81
|
+
heightReference === HeightReference.CLAMP_TO_3D_TILE
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function isRelativeHeightReference(
|
|
86
|
+
heightReference: HeightReference,
|
|
87
|
+
): heightReference is RelativeHeightReference {
|
|
88
|
+
return (
|
|
89
|
+
heightReference === HeightReference.RELATIVE_TO_GROUND ||
|
|
90
|
+
heightReference === HeightReference.RELATIVE_TO_TERRAIN ||
|
|
91
|
+
heightReference === HeightReference.RELATIVE_TO_3D_TILE
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function isAbsoluteHeightReference(
|
|
96
|
+
heightReference: HeightReference,
|
|
97
|
+
): heightReference is HeightReference.NONE {
|
|
98
|
+
return heightReference === HeightReference.NONE;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function getRelativeEquivalent(
|
|
102
|
+
clampedHeightReference: ClampedHeightReference,
|
|
103
|
+
): RelativeHeightReference {
|
|
104
|
+
if (clampedHeightReference === HeightReference.CLAMP_TO_GROUND) {
|
|
105
|
+
return HeightReference.RELATIVE_TO_GROUND;
|
|
106
|
+
}
|
|
107
|
+
if (clampedHeightReference === HeightReference.CLAMP_TO_TERRAIN) {
|
|
108
|
+
return HeightReference.RELATIVE_TO_TERRAIN;
|
|
109
|
+
}
|
|
110
|
+
return HeightReference.RELATIVE_TO_3D_TILE;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function getExtrusionHeightInfo(
|
|
114
|
+
feature: Feature,
|
|
115
|
+
vectorProperties: VectorProperties,
|
|
116
|
+
): ExtrusionHeightInfo {
|
|
117
|
+
const extrudedHeight = vectorProperties.getExtrudedHeight(feature);
|
|
118
|
+
|
|
119
|
+
let storeysAboveGround = vectorProperties.getStoreysAboveGround(feature);
|
|
120
|
+
let storeysBelowGround = vectorProperties.getStoreysBelowGround(feature);
|
|
121
|
+
let storeyHeightsAboveGround =
|
|
122
|
+
vectorProperties.getStoreyHeightsAboveGround(feature);
|
|
123
|
+
let storeyHeightsBelowGround =
|
|
124
|
+
vectorProperties.getStoreyHeightsBelowGround(feature);
|
|
125
|
+
if (extrudedHeight) {
|
|
126
|
+
// current Case only extrudedHeight
|
|
127
|
+
if (extrudedHeight > 0) {
|
|
128
|
+
storeyHeightsAboveGround = getStoreyHeights(
|
|
129
|
+
extrudedHeight,
|
|
130
|
+
storeyHeightsAboveGround,
|
|
131
|
+
storeysAboveGround,
|
|
132
|
+
);
|
|
133
|
+
storeysAboveGround = storeyHeightsAboveGround.length;
|
|
134
|
+
storeyHeightsBelowGround = [];
|
|
135
|
+
storeysBelowGround = 0;
|
|
136
|
+
} else if (extrudedHeight < 0) {
|
|
137
|
+
storeyHeightsBelowGround = getStoreyHeights(
|
|
138
|
+
extrudedHeight,
|
|
139
|
+
storeyHeightsBelowGround,
|
|
140
|
+
storeysBelowGround,
|
|
141
|
+
);
|
|
142
|
+
storeysBelowGround = storeyHeightsBelowGround.length;
|
|
143
|
+
storeyHeightsAboveGround = [];
|
|
144
|
+
storeysAboveGround = 0;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
validateStoreys(storeysAboveGround, storeyHeightsAboveGround);
|
|
149
|
+
validateStoreys(storeysBelowGround, storeyHeightsBelowGround);
|
|
150
|
+
|
|
151
|
+
const skirt = vectorProperties.getSkirt(feature);
|
|
152
|
+
const extruded = !!(
|
|
153
|
+
storeyHeightsAboveGround.length ||
|
|
154
|
+
storeyHeightsBelowGround.length ||
|
|
155
|
+
skirt
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
extruded,
|
|
160
|
+
storeyHeightsAboveGround,
|
|
161
|
+
storeyHeightsBelowGround,
|
|
162
|
+
skirt,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @param geometry - feature must return simple geometry
|
|
168
|
+
* @retruns the center of mass
|
|
169
|
+
*/
|
|
170
|
+
export function getClampOrigin(geometry: SimpleGeometry): [number, number] {
|
|
171
|
+
const stride = geometry.getStride();
|
|
172
|
+
const coordinates = geometry.getFlatCoordinates();
|
|
173
|
+
let x = 0;
|
|
174
|
+
let y = 0;
|
|
175
|
+
for (let i = 0; i < coordinates.length; i += stride) {
|
|
176
|
+
// calculates center of mass, maybe add
|
|
177
|
+
x += coordinates[i];
|
|
178
|
+
y += coordinates[i + 1];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const numberOfPoints = coordinates.length / stride;
|
|
182
|
+
|
|
183
|
+
return [x / numberOfPoints, y / numberOfPoints];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* the minimum height of a geometry with a 3D layout
|
|
188
|
+
* @param geometry - with an XYZ layout
|
|
189
|
+
* @returns the minimum height
|
|
190
|
+
*/
|
|
191
|
+
export function getMinHeight(geometry: Geometry): number {
|
|
192
|
+
if (is2DLayout(geometry.getLayout())) {
|
|
193
|
+
throw new Error('expected geometry to have an YXZ geometry layout');
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const stride = geometry.getStride();
|
|
197
|
+
const coordinates = geometry.getFlatCoordinates();
|
|
198
|
+
|
|
199
|
+
let minZ = Infinity;
|
|
200
|
+
for (let i = 0; i < coordinates.length; i += stride) {
|
|
201
|
+
const Z = coordinates[i + 2];
|
|
202
|
+
minZ = Z < minZ ? Z : minZ;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return minZ;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export function getHeightInfo(
|
|
209
|
+
feature: Feature,
|
|
210
|
+
geometry: SimpleGeometry,
|
|
211
|
+
vectorProperties: VectorProperties,
|
|
212
|
+
): VectorHeightInfo {
|
|
213
|
+
const extrusionHeightInfo = getExtrusionHeightInfo(feature, vectorProperties);
|
|
214
|
+
|
|
215
|
+
let heightReference = vectorProperties.getAltitudeMode(feature);
|
|
216
|
+
let heightAboveGround: number | undefined;
|
|
217
|
+
|
|
218
|
+
const layout = geometry.getLayout();
|
|
219
|
+
const groundLevel = vectorProperties.getGroundLevel(feature);
|
|
220
|
+
|
|
221
|
+
// we cannot render a two D coordinate absolutely without having a Z value (ground level)
|
|
222
|
+
// switch altitude mode to clamp
|
|
223
|
+
if (
|
|
224
|
+
is2DLayout(layout) &&
|
|
225
|
+
isAbsoluteHeightReference(heightReference) &&
|
|
226
|
+
groundLevel == null
|
|
227
|
+
) {
|
|
228
|
+
heightReference = HeightReference.CLAMP_TO_GROUND;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (isClampedHeightReference(heightReference)) {
|
|
232
|
+
const geometryType = geometry.getType();
|
|
233
|
+
let pointAsPrimitive = false;
|
|
234
|
+
if (geometryType === 'Point' || geometryType === 'MultiPoint') {
|
|
235
|
+
pointAsPrimitive = vectorProperties.renderAs(feature) !== 'geometry';
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// clamped extrusions or primitives get rendered relative to ground with a height above ground of 0;
|
|
239
|
+
if (extrusionHeightInfo.extruded || pointAsPrimitive) {
|
|
240
|
+
heightReference = getRelativeEquivalent(heightReference);
|
|
241
|
+
heightAboveGround = 0;
|
|
242
|
+
} else {
|
|
243
|
+
return {
|
|
244
|
+
heightReference,
|
|
245
|
+
layout,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (isRelativeHeightReference(heightReference)) {
|
|
251
|
+
heightAboveGround =
|
|
252
|
+
vectorProperties.getHeightAboveGround(feature) ??
|
|
253
|
+
heightAboveGround ??
|
|
254
|
+
(is2DLayout(layout) ? 0 : undefined);
|
|
255
|
+
|
|
256
|
+
// we only need a clamp origin, if we dont already have a ground level
|
|
257
|
+
const clampOrigin =
|
|
258
|
+
groundLevel != null ? undefined : getClampOrigin(geometry);
|
|
259
|
+
|
|
260
|
+
// true if not all z values are identical. in case of relative geometries, we set Z to height above ground, not ground level
|
|
261
|
+
const perPositionHeight =
|
|
262
|
+
!is2DLayout(layout) &&
|
|
263
|
+
heightAboveGround == null &&
|
|
264
|
+
(!extrusionHeightInfo.extruded ||
|
|
265
|
+
(extrusionHeightInfo.extruded &&
|
|
266
|
+
extrusionHeightInfo.storeyHeightsAboveGround.length +
|
|
267
|
+
extrusionHeightInfo.storeyHeightsBelowGround.length ===
|
|
268
|
+
1));
|
|
269
|
+
|
|
270
|
+
return {
|
|
271
|
+
...extrusionHeightInfo,
|
|
272
|
+
heightReference,
|
|
273
|
+
layout,
|
|
274
|
+
heightAboveGround,
|
|
275
|
+
clampOrigin,
|
|
276
|
+
groundLevel,
|
|
277
|
+
perPositionHeight,
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// true if not all z values are identical. if ground level is provided, all z values are equal to ground level.
|
|
282
|
+
const perPositionHeight =
|
|
283
|
+
!is2DLayout(layout) &&
|
|
284
|
+
groundLevel == null &&
|
|
285
|
+
(!extrusionHeightInfo.extruded ||
|
|
286
|
+
(extrusionHeightInfo.extruded &&
|
|
287
|
+
extrusionHeightInfo.storeyHeightsAboveGround.length +
|
|
288
|
+
extrusionHeightInfo.storeyHeightsBelowGround.length ===
|
|
289
|
+
1));
|
|
290
|
+
|
|
291
|
+
return {
|
|
292
|
+
...extrusionHeightInfo,
|
|
293
|
+
groundLevelOrMinHeight: groundLevel ?? getMinHeight(geometry),
|
|
294
|
+
perPositionHeight,
|
|
295
|
+
heightReference,
|
|
296
|
+
layout,
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Returns the geometry height (as used in the cesium geometry options) depending on the height info. 0 for clamped, groundLevelOrMinHeight for absolute & heightAboveGround + groundLevel (if present) for relative
|
|
302
|
+
* If you pass "with extrusion" the height will be returned including the extrusion, otherwise you get the height of the actual geometry
|
|
303
|
+
*/
|
|
304
|
+
export function getGeometryHeight(
|
|
305
|
+
geometry: SimpleGeometry,
|
|
306
|
+
heightInfo: VectorHeightInfo,
|
|
307
|
+
): number {
|
|
308
|
+
let height = 0;
|
|
309
|
+
if (heightInfo.heightReference === HeightReference.NONE) {
|
|
310
|
+
height = heightInfo.groundLevelOrMinHeight;
|
|
311
|
+
} else if (isRelativeHeightReference(heightInfo.heightReference)) {
|
|
312
|
+
const relativeHeightInfo =
|
|
313
|
+
heightInfo as VectorHeightInfo<RelativeHeightReference>;
|
|
314
|
+
if (relativeHeightInfo.heightAboveGround != null) {
|
|
315
|
+
height = relativeHeightInfo.heightAboveGround;
|
|
316
|
+
} else {
|
|
317
|
+
// height info ensures this can only be a 3D layout
|
|
318
|
+
height = getMinHeight(geometry);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
if (relativeHeightInfo.groundLevel) {
|
|
322
|
+
height += relativeHeightInfo.groundLevel;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
return height;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @param {VectorHeightInfo} heightInfo
|
|
331
|
+
* @returns a callback function accepting a mercator coordinate. it will return a wgs84coordinate with its Z value adjusted according to the height info
|
|
332
|
+
*/
|
|
333
|
+
export function mercatorToWgs84TransformerForHeightInfo(
|
|
334
|
+
heightInfo: VectorHeightInfo,
|
|
335
|
+
): (coord: Coordinate) => Coordinate {
|
|
336
|
+
if (isClampedHeightReference(heightInfo.heightReference)) {
|
|
337
|
+
const layoutIs2D = is2DLayout(heightInfo.layout);
|
|
338
|
+
return (coord: Coordinate) => {
|
|
339
|
+
const wgs84Coords = Projection.mercatorToWgs84(coord);
|
|
340
|
+
wgs84Coords[2] = layoutIs2D ? 0 : wgs84Coords[2];
|
|
341
|
+
return wgs84Coords;
|
|
342
|
+
};
|
|
343
|
+
} else if (isRelativeHeightReference(heightInfo.heightReference)) {
|
|
344
|
+
const { heightAboveGround, groundLevel } =
|
|
345
|
+
heightInfo as VectorHeightInfo<RelativeHeightReference>;
|
|
346
|
+
|
|
347
|
+
return (coord: Coordinate) => {
|
|
348
|
+
// disregard layout, since height info guarantees either height above ground OR 3D layout
|
|
349
|
+
const wgs84Coords = Projection.mercatorToWgs84(coord);
|
|
350
|
+
if (heightAboveGround != null) {
|
|
351
|
+
wgs84Coords[2] = heightAboveGround;
|
|
352
|
+
}
|
|
353
|
+
if (groundLevel) {
|
|
354
|
+
wgs84Coords[2] += groundLevel;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
return wgs84Coords;
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
const { groundLevelOrMinHeight, perPositionHeight } =
|
|
362
|
+
heightInfo as VectorHeightInfo<HeightReference.NONE>;
|
|
363
|
+
|
|
364
|
+
return (coord: Coordinate) => {
|
|
365
|
+
// disregard layout, since height info guarantees ground level OR 3D layout
|
|
366
|
+
const wgs84Coords = Projection.mercatorToWgs84(coord);
|
|
367
|
+
if (!perPositionHeight && groundLevelOrMinHeight) {
|
|
368
|
+
wgs84Coords[2] = groundLevelOrMinHeight;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
return wgs84Coords;
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* @param {VectorHeightInfo} heightInfo
|
|
377
|
+
* @returns a callback function accepting a mercator coordinate. it will return a Cartesian3 with its Z value adjusted according to the height info
|
|
378
|
+
*/
|
|
379
|
+
export function mercatorToCartesianTransformerForHeightInfo(
|
|
380
|
+
heightInfo: VectorHeightInfo,
|
|
381
|
+
): (coord: Coordinate) => Cartesian3 {
|
|
382
|
+
const toWgs84 = mercatorToWgs84TransformerForHeightInfo(heightInfo);
|
|
383
|
+
|
|
384
|
+
return (coord) => {
|
|
385
|
+
const wgs84Coords = toWgs84(coord);
|
|
386
|
+
return Cartesian3.fromDegrees(
|
|
387
|
+
wgs84Coords[0],
|
|
388
|
+
wgs84Coords[1],
|
|
389
|
+
wgs84Coords[2],
|
|
390
|
+
);
|
|
391
|
+
};
|
|
392
|
+
}
|
|
@@ -15,21 +15,26 @@ import VcsEvent from '../../vcsEvent.js';
|
|
|
15
15
|
import VcsApp from '../../vcsApp.js';
|
|
16
16
|
|
|
17
17
|
export type FlightPlayerClock = {
|
|
18
|
-
startTime: number;
|
|
19
|
-
endTime: number;
|
|
20
|
-
currentTime: number;
|
|
21
|
-
times: number[];
|
|
22
|
-
currentSystemTime
|
|
18
|
+
readonly startTime: number;
|
|
19
|
+
readonly endTime: number;
|
|
20
|
+
readonly currentTime: number;
|
|
21
|
+
readonly times: number[];
|
|
22
|
+
currentSystemTime: undefined | number;
|
|
23
|
+
readonly changed: VcsEvent<FlightPlayerClock>;
|
|
24
|
+
setCurrentTime(this: FlightPlayerClock, time: number): number;
|
|
25
|
+
reset(this: FlightPlayerClock): void;
|
|
26
|
+
setTimes(this: FlightPlayerClock, times: number[]): void;
|
|
27
|
+
destroy(this: FlightPlayerClock): void;
|
|
23
28
|
};
|
|
24
29
|
|
|
25
30
|
export type FlightPlayerState = 'playing' | 'paused' | 'stopped';
|
|
26
31
|
|
|
27
32
|
export type FlightPlayer = {
|
|
28
33
|
readonly flightInstanceName: string;
|
|
34
|
+
readonly clock: FlightPlayerClock;
|
|
29
35
|
readonly state: FlightPlayerState;
|
|
30
36
|
readonly stateChanged: VcsEvent<FlightPlayerState>;
|
|
31
37
|
readonly destroyed: VcsEvent<void>;
|
|
32
|
-
clock: FlightPlayerClock;
|
|
33
38
|
play(): void;
|
|
34
39
|
stop(): void;
|
|
35
40
|
pause(): void;
|
|
@@ -43,12 +48,47 @@ export type FlightPlayer = {
|
|
|
43
48
|
destroy(): void;
|
|
44
49
|
};
|
|
45
50
|
|
|
46
|
-
function
|
|
51
|
+
function createFlightPlayerClock(): FlightPlayerClock {
|
|
52
|
+
let currentTime = 0;
|
|
53
|
+
let startTime = 0;
|
|
54
|
+
let endTime = 0;
|
|
55
|
+
let times: number[] = [];
|
|
56
|
+
|
|
47
57
|
return {
|
|
48
|
-
startTime:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
get startTime(): number {
|
|
59
|
+
return startTime;
|
|
60
|
+
},
|
|
61
|
+
get endTime(): number {
|
|
62
|
+
return endTime;
|
|
63
|
+
},
|
|
64
|
+
get currentTime(): number {
|
|
65
|
+
return currentTime;
|
|
66
|
+
},
|
|
67
|
+
get times(): number[] {
|
|
68
|
+
return times;
|
|
69
|
+
},
|
|
70
|
+
currentSystemTime: undefined,
|
|
71
|
+
changed: new VcsEvent<FlightPlayerClock>(),
|
|
72
|
+
setCurrentTime(time: number): number {
|
|
73
|
+
currentTime = time;
|
|
74
|
+
this.changed.raiseEvent(this);
|
|
75
|
+
return this.currentTime;
|
|
76
|
+
},
|
|
77
|
+
reset(): void {
|
|
78
|
+
currentTime = 0;
|
|
79
|
+
startTime = 0;
|
|
80
|
+
endTime = 0;
|
|
81
|
+
times = [];
|
|
82
|
+
this.changed.raiseEvent(this);
|
|
83
|
+
},
|
|
84
|
+
setTimes(newTimes: number[]): void {
|
|
85
|
+
times = newTimes.slice();
|
|
86
|
+
endTime = times[times.length - 1];
|
|
87
|
+
this.changed.raiseEvent(this);
|
|
88
|
+
},
|
|
89
|
+
destroy(): void {
|
|
90
|
+
this.changed.destroy();
|
|
91
|
+
},
|
|
52
92
|
};
|
|
53
93
|
}
|
|
54
94
|
|
|
@@ -68,7 +108,7 @@ export async function createFlightPlayer(
|
|
|
68
108
|
}
|
|
69
109
|
await instance.initialize();
|
|
70
110
|
|
|
71
|
-
const clock: FlightPlayerClock =
|
|
111
|
+
const clock: FlightPlayerClock = createFlightPlayerClock();
|
|
72
112
|
|
|
73
113
|
let playerState: FlightPlayerState = 'stopped';
|
|
74
114
|
|
|
@@ -103,22 +143,21 @@ export async function createFlightPlayer(
|
|
|
103
143
|
|
|
104
144
|
setState('stopped');
|
|
105
145
|
|
|
106
|
-
clock.currentTime = 0;
|
|
107
146
|
clock.currentSystemTime = undefined;
|
|
147
|
+
clock.setCurrentTime(0);
|
|
108
148
|
}
|
|
109
149
|
};
|
|
110
150
|
|
|
111
151
|
const updateSplines = (): void => {
|
|
112
152
|
if (!instance.isValid()) {
|
|
113
153
|
stop();
|
|
114
|
-
|
|
154
|
+
clock.reset();
|
|
115
155
|
} else {
|
|
116
156
|
const splines = getSplineAndTimesForInstance(instance);
|
|
117
157
|
|
|
118
158
|
({ destinationSpline, quaternionSpline } = splines);
|
|
119
159
|
const { times } = splines;
|
|
120
|
-
clock.
|
|
121
|
-
clock.times = times;
|
|
160
|
+
clock.setTimes(times);
|
|
122
161
|
}
|
|
123
162
|
};
|
|
124
163
|
updateSplines();
|
|
@@ -174,20 +213,20 @@ export async function createFlightPlayer(
|
|
|
174
213
|
return;
|
|
175
214
|
}
|
|
176
215
|
|
|
177
|
-
clock.currentTime
|
|
216
|
+
clock.setCurrentTime(clock.currentTime + seconds * instance.multiplier);
|
|
178
217
|
if (clock.currentTime > clock.endTime) {
|
|
179
218
|
if (instance.loop && clock.endTime > 0) {
|
|
180
219
|
while (clock.currentTime > clock.endTime) {
|
|
181
|
-
clock.currentTime
|
|
220
|
+
clock.setCurrentTime(clock.currentTime - clock.endTime);
|
|
182
221
|
}
|
|
183
222
|
} else {
|
|
184
223
|
stop();
|
|
185
224
|
}
|
|
186
225
|
} else if (clock.currentTime < clock.startTime) {
|
|
187
226
|
if (instance.loop) {
|
|
188
|
-
clock.
|
|
227
|
+
clock.setCurrentTime(clock.endTime + clock.currentTime);
|
|
189
228
|
} else {
|
|
190
|
-
clock.
|
|
229
|
+
clock.setCurrentTime(clock.startTime);
|
|
191
230
|
return;
|
|
192
231
|
}
|
|
193
232
|
}
|
|
@@ -256,8 +295,8 @@ export async function createFlightPlayer(
|
|
|
256
295
|
getLogger('FlightPlayer').warning(`time: ${time} out of range`);
|
|
257
296
|
return;
|
|
258
297
|
}
|
|
259
|
-
clock.currentTime = time;
|
|
260
298
|
clock.currentSystemTime = undefined;
|
|
299
|
+
clock.setCurrentTime(time);
|
|
261
300
|
if (playerState !== 'playing') {
|
|
262
301
|
const view = getView(clock.currentTime);
|
|
263
302
|
if (view) {
|
|
@@ -284,6 +323,7 @@ export async function createFlightPlayer(
|
|
|
284
323
|
listeners.forEach((cb) => {
|
|
285
324
|
cb();
|
|
286
325
|
});
|
|
326
|
+
clock.destroy();
|
|
287
327
|
stateChanged.destroy();
|
|
288
328
|
destroyed.raiseEvent();
|
|
289
329
|
destroyed.destroy();
|
|
@@ -303,10 +343,12 @@ export async function createFlightPlayer(
|
|
|
303
343
|
);
|
|
304
344
|
|
|
305
345
|
return {
|
|
306
|
-
clock,
|
|
307
346
|
get flightInstanceName(): string {
|
|
308
347
|
return instance.name;
|
|
309
348
|
},
|
|
349
|
+
get clock(): FlightPlayerClock {
|
|
350
|
+
return clock;
|
|
351
|
+
},
|
|
310
352
|
get state(): FlightPlayerState {
|
|
311
353
|
return playerState;
|
|
312
354
|
},
|