@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
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { check, ofEnum } from '@vcsuite/check';
|
|
2
2
|
import { Feature } from 'ol';
|
|
3
|
-
import type { Geometry } from 'ol/geom.js';
|
|
3
|
+
import type { Geometry, LineString, Polygon } from 'ol/geom.js';
|
|
4
4
|
import { unByKey } from 'ol/Observable.js';
|
|
5
5
|
import VcsEvent from '../../vcsEvent.js';
|
|
6
6
|
import {
|
|
7
|
-
|
|
7
|
+
setupPickingBehavior,
|
|
8
8
|
EditorSession,
|
|
9
9
|
GeometryToType,
|
|
10
10
|
GeometryType,
|
|
11
11
|
SessionType,
|
|
12
12
|
setupInteractionChain,
|
|
13
|
+
setupScratchLayer,
|
|
13
14
|
} from './editorSessionHelpers.js';
|
|
14
15
|
import CreateLineStringInteraction from './interactions/createLineStringInteraction.js';
|
|
15
16
|
import CreateCircleInteraction from './interactions/createCircleInteraction.js';
|
|
@@ -23,6 +24,11 @@ import geometryIsValid from './validateGeoemetry.js';
|
|
|
23
24
|
import ObliqueMap from '../../map/obliqueMap.js';
|
|
24
25
|
import { cursorMap } from './interactions/editGeometryMouseOverInteraction.js';
|
|
25
26
|
import { AltitudeModeType } from '../../layer/vectorProperties.js';
|
|
27
|
+
import CreationSnapping from './interactions/creationSnapping.js';
|
|
28
|
+
import { syncScratchLayerVectorProperties } from './editorHelpers.js';
|
|
29
|
+
import LayerSnapping from './interactions/layerSnapping.js';
|
|
30
|
+
import { SnapType, snapTypes } from './snappingHelpers.js';
|
|
31
|
+
import SegmentLengthInteraction from './interactions/segmentLengthInteraction.js';
|
|
26
32
|
|
|
27
33
|
export type CreateFeatureSession<T extends GeometryType> =
|
|
28
34
|
EditorSession<SessionType.CREATE> & {
|
|
@@ -30,6 +36,7 @@ export type CreateFeatureSession<T extends GeometryType> =
|
|
|
30
36
|
featureAltitudeMode: AltitudeModeType | undefined;
|
|
31
37
|
featureCreated: VcsEvent<Feature<GeometryToType<T>>>;
|
|
32
38
|
creationFinished: VcsEvent<Feature<GeometryToType<T>> | null>;
|
|
39
|
+
snapToLayers: VectorLayer[];
|
|
33
40
|
finish(): void;
|
|
34
41
|
};
|
|
35
42
|
|
|
@@ -83,6 +90,12 @@ export interface CreateInteraction<T extends Geometry> {
|
|
|
83
90
|
destroy(): void;
|
|
84
91
|
}
|
|
85
92
|
|
|
93
|
+
export type CreateFeatureSessionOptions = {
|
|
94
|
+
initialSnapToLayers?: VectorLayer[];
|
|
95
|
+
snapTo?: SnapType[];
|
|
96
|
+
hideSegmentLength?: boolean;
|
|
97
|
+
};
|
|
98
|
+
|
|
86
99
|
/**
|
|
87
100
|
* Creates an editor session to create features of the given geometry type.
|
|
88
101
|
* While the session is active: Do not change the geometry on the current feature (the last created one)
|
|
@@ -90,7 +103,8 @@ export interface CreateInteraction<T extends Geometry> {
|
|
|
90
103
|
* @param app
|
|
91
104
|
* @param layer
|
|
92
105
|
* @param geometryType
|
|
93
|
-
* @param initialAltitudeMode - whether to use the layers altitude mode or set this on the feature
|
|
106
|
+
* @param [initialAltitudeMode] - whether to use the layers altitude mode or set this on the feature
|
|
107
|
+
* @param [options]
|
|
94
108
|
* @group Editor
|
|
95
109
|
*/
|
|
96
110
|
function startCreateFeatureSession<T extends GeometryType>(
|
|
@@ -98,16 +112,21 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
98
112
|
layer: VectorLayer,
|
|
99
113
|
geometryType: T,
|
|
100
114
|
initialAltitudeMode?: AltitudeModeType,
|
|
115
|
+
options?: CreateFeatureSessionOptions,
|
|
101
116
|
): CreateFeatureSession<T> {
|
|
102
117
|
check(app, VcsApp);
|
|
103
118
|
check(layer, VectorLayer);
|
|
104
119
|
check(geometryType, ofEnum(GeometryType));
|
|
105
120
|
|
|
121
|
+
const snapTo = options?.snapTo ?? [...snapTypes];
|
|
122
|
+
const showSegmentLength = !options?.hideSegmentLength;
|
|
123
|
+
|
|
106
124
|
const {
|
|
107
125
|
interactionChain,
|
|
108
126
|
removed: interactionRemoved,
|
|
109
127
|
destroy: destroyInteractionChain,
|
|
110
128
|
} = setupInteractionChain(app.maps.eventHandler);
|
|
129
|
+
const scratchLayer = setupScratchLayer(app.layers);
|
|
111
130
|
|
|
112
131
|
const featureCreated = new VcsEvent<Feature<GeometryToType<T>>>();
|
|
113
132
|
const creationFinished = new VcsEvent<Feature<GeometryToType<T>> | null>();
|
|
@@ -116,6 +135,12 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
116
135
|
|
|
117
136
|
let currentInteraction: InteractionOfGeometryType<T> | null = null;
|
|
118
137
|
let currentFeature: Feature<GeometryToType<T>> | null = null;
|
|
138
|
+
let snappingInteraction: CreationSnapping | null = null;
|
|
139
|
+
let layerSnappingInteraction: LayerSnapping | null = null;
|
|
140
|
+
let segmentLengthInteraction: SegmentLengthInteraction | null = null;
|
|
141
|
+
let snapToLayers: VectorLayer[] = options?.initialSnapToLayers?.slice() ?? [
|
|
142
|
+
layer,
|
|
143
|
+
];
|
|
119
144
|
|
|
120
145
|
/**
|
|
121
146
|
* Ture if the currently active map is an ObliqueMap. set in setupActiveMap
|
|
@@ -123,24 +148,25 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
123
148
|
let isOblique = false;
|
|
124
149
|
|
|
125
150
|
let featureAltitudeMode = initialAltitudeMode;
|
|
126
|
-
const
|
|
151
|
+
const resetPickingBehavior = setupPickingBehavior(app);
|
|
127
152
|
|
|
128
153
|
const altitudeModeChanged = (): void => {
|
|
129
154
|
const altitudeModeFeature =
|
|
130
155
|
currentFeature ?? new Feature({ olcs_altitudeMode: featureAltitudeMode });
|
|
131
|
-
const altitudeModeInUse =
|
|
132
|
-
layer.vectorProperties.getAltitudeMode(altitudeModeFeature);
|
|
133
156
|
|
|
134
|
-
|
|
157
|
+
scratchLayer.vectorProperties.altitudeMode =
|
|
158
|
+
layer.vectorProperties.getAltitudeMode(altitudeModeFeature);
|
|
135
159
|
};
|
|
136
160
|
|
|
137
|
-
const vectorPropertiesListener =
|
|
138
|
-
|
|
139
|
-
|
|
161
|
+
const vectorPropertiesListener = syncScratchLayerVectorProperties(
|
|
162
|
+
scratchLayer,
|
|
163
|
+
layer,
|
|
164
|
+
() => {
|
|
165
|
+
if (!featureAltitudeMode) {
|
|
140
166
|
altitudeModeChanged();
|
|
141
167
|
}
|
|
142
|
-
}
|
|
143
|
-
|
|
168
|
+
},
|
|
169
|
+
);
|
|
144
170
|
altitudeModeChanged();
|
|
145
171
|
|
|
146
172
|
let currentFeatureListener = (): void => {};
|
|
@@ -152,6 +178,21 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
152
178
|
currentInteraction.destroy();
|
|
153
179
|
currentInteraction = null;
|
|
154
180
|
}
|
|
181
|
+
if (snappingInteraction) {
|
|
182
|
+
interactionChain.removeInteraction(snappingInteraction);
|
|
183
|
+
snappingInteraction.destroy();
|
|
184
|
+
snappingInteraction = null;
|
|
185
|
+
}
|
|
186
|
+
if (layerSnappingInteraction) {
|
|
187
|
+
interactionChain.removeInteraction(layerSnappingInteraction);
|
|
188
|
+
layerSnappingInteraction.destroy();
|
|
189
|
+
layerSnappingInteraction = null;
|
|
190
|
+
}
|
|
191
|
+
if (segmentLengthInteraction) {
|
|
192
|
+
interactionChain.removeInteraction(segmentLengthInteraction);
|
|
193
|
+
segmentLengthInteraction.destroy();
|
|
194
|
+
segmentLengthInteraction = null;
|
|
195
|
+
}
|
|
155
196
|
interactionListeners.forEach((cb) => {
|
|
156
197
|
cb();
|
|
157
198
|
});
|
|
@@ -161,6 +202,31 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
161
202
|
const createInteraction = (): void => {
|
|
162
203
|
destroyCurrentInteraction();
|
|
163
204
|
currentInteraction = createInteractionForGeometryType(geometryType);
|
|
205
|
+
layerSnappingInteraction = new LayerSnapping(
|
|
206
|
+
snapToLayers,
|
|
207
|
+
scratchLayer,
|
|
208
|
+
(f) => currentFeature !== f,
|
|
209
|
+
snapTo,
|
|
210
|
+
);
|
|
211
|
+
if (
|
|
212
|
+
geometryType === GeometryType.Polygon ||
|
|
213
|
+
geometryType === GeometryType.LineString
|
|
214
|
+
) {
|
|
215
|
+
snappingInteraction = new CreationSnapping(scratchLayer, snapTo);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (
|
|
219
|
+
showSegmentLength &&
|
|
220
|
+
(geometryType === GeometryType.Polygon ||
|
|
221
|
+
geometryType === GeometryType.LineString ||
|
|
222
|
+
geometryType === GeometryType.BBox ||
|
|
223
|
+
geometryType === GeometryType.Circle)
|
|
224
|
+
) {
|
|
225
|
+
segmentLengthInteraction = new SegmentLengthInteraction(
|
|
226
|
+
scratchLayer,
|
|
227
|
+
true,
|
|
228
|
+
);
|
|
229
|
+
}
|
|
164
230
|
|
|
165
231
|
interactionListeners = [
|
|
166
232
|
currentInteraction.created.addEventListener((geometry) => {
|
|
@@ -187,6 +253,14 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
187
253
|
};
|
|
188
254
|
layer.addFeatures([currentFeature]);
|
|
189
255
|
featureCreated.raiseEvent(currentFeature);
|
|
256
|
+
if (snappingInteraction) {
|
|
257
|
+
snappingInteraction.setGeometry(geometry as LineString | Polygon);
|
|
258
|
+
}
|
|
259
|
+
if (segmentLengthInteraction) {
|
|
260
|
+
segmentLengthInteraction.setGeometry(
|
|
261
|
+
geometry as LineString | Polygon,
|
|
262
|
+
);
|
|
263
|
+
}
|
|
190
264
|
}),
|
|
191
265
|
currentInteraction.finished.addEventListener((geometry) => {
|
|
192
266
|
if (isOblique) {
|
|
@@ -214,7 +288,15 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
214
288
|
}
|
|
215
289
|
}),
|
|
216
290
|
];
|
|
291
|
+
|
|
292
|
+
interactionChain.addInteraction(layerSnappingInteraction);
|
|
293
|
+
if (snappingInteraction) {
|
|
294
|
+
interactionChain.addInteraction(snappingInteraction);
|
|
295
|
+
}
|
|
217
296
|
interactionChain.addInteraction(currentInteraction);
|
|
297
|
+
if (segmentLengthInteraction) {
|
|
298
|
+
interactionChain.addInteraction(segmentLengthInteraction);
|
|
299
|
+
}
|
|
218
300
|
};
|
|
219
301
|
createInteraction();
|
|
220
302
|
|
|
@@ -252,6 +334,9 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
252
334
|
|
|
253
335
|
const stop = (): void => {
|
|
254
336
|
isStopped = true; // setting stopped true immediately, to prevent the recreation of the interaction chain on finished
|
|
337
|
+
app.layers.remove(scratchLayer);
|
|
338
|
+
scratchLayer.destroy();
|
|
339
|
+
|
|
255
340
|
if (app.maps.target) {
|
|
256
341
|
app.maps.target.style.cursor = cursorMap.auto;
|
|
257
342
|
}
|
|
@@ -264,7 +349,7 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
264
349
|
destroyInteractionChain();
|
|
265
350
|
currentFeatureListener();
|
|
266
351
|
vectorPropertiesListener();
|
|
267
|
-
|
|
352
|
+
resetPickingBehavior();
|
|
268
353
|
|
|
269
354
|
stopped.raiseEvent();
|
|
270
355
|
stopped.destroy();
|
|
@@ -292,6 +377,15 @@ function startCreateFeatureSession<T extends GeometryType>(
|
|
|
292
377
|
}
|
|
293
378
|
}
|
|
294
379
|
},
|
|
380
|
+
get snapToLayers(): VectorLayer[] {
|
|
381
|
+
return snapToLayers.slice();
|
|
382
|
+
},
|
|
383
|
+
set snapToLayers(layers: VectorLayer[]) {
|
|
384
|
+
snapToLayers = layers.slice();
|
|
385
|
+
if (layerSnappingInteraction) {
|
|
386
|
+
layerSnappingInteraction.layers = snapToLayers;
|
|
387
|
+
}
|
|
388
|
+
},
|
|
295
389
|
featureCreated,
|
|
296
390
|
creationFinished,
|
|
297
391
|
stopped,
|
|
@@ -8,6 +8,7 @@ import type { Feature } from 'ol/index.js';
|
|
|
8
8
|
import type { EventsKey } from 'ol/events.js';
|
|
9
9
|
import { unByKey } from 'ol/Observable.js';
|
|
10
10
|
import { getLogger } from '@vcsuite/logger';
|
|
11
|
+
import { Math as CesiumMath } from '@vcmap-cesium/engine';
|
|
11
12
|
|
|
12
13
|
import VcsEvent from '../../vcsEvent.js';
|
|
13
14
|
import {
|
|
@@ -18,6 +19,7 @@ import {
|
|
|
18
19
|
} from './editorSessionHelpers.js';
|
|
19
20
|
import createTransformationHandler from './transformation/transformationHandler.js';
|
|
20
21
|
import {
|
|
22
|
+
AxisAndPlanes,
|
|
21
23
|
TransformationHandler,
|
|
22
24
|
TransformationMode,
|
|
23
25
|
} from './transformation/transformationTypes.js';
|
|
@@ -28,7 +30,7 @@ import ScaleInteraction from './transformation/scaleInteraction.js';
|
|
|
28
30
|
import { createSync, obliqueGeometry } from '../../layer/vectorSymbols.js';
|
|
29
31
|
import ExtrudeInteraction from './transformation/extrudeInteraction.js';
|
|
30
32
|
import ObliqueMap from '../../map/obliqueMap.js';
|
|
31
|
-
import {
|
|
33
|
+
import { geometryChangeKeys } from './editorHelpers.js';
|
|
32
34
|
import CesiumMap from '../../map/cesiumMap.js';
|
|
33
35
|
import EnsureHandlerSelectionInteraction from './interactions/ensureHandlerSelectionInteraction.js';
|
|
34
36
|
import EditFeaturesMouseOverInteraction from './interactions/editFeaturesMouseOverInteraction.js';
|
|
@@ -112,12 +114,18 @@ function clearCreateSync(
|
|
|
112
114
|
export type EditFeaturesSession = EditorSession<SessionType.EDIT_FEATURES> & {
|
|
113
115
|
readonly mode: TransformationMode;
|
|
114
116
|
/**
|
|
115
|
-
* Function for rotating features. Takes angle in radians as parameter.
|
|
117
|
+
* Function for rotating features. Takes angle in radians as parameter. you can provide an axis to rotate around for features & primitives
|
|
116
118
|
* @param angle - in radians
|
|
119
|
+
* @param axis - optional axis. only has effect when rotating a single model or primitive
|
|
117
120
|
*/
|
|
118
|
-
rotate(angle: number): void;
|
|
121
|
+
rotate(angle: number, axis?: AxisAndPlanes): void;
|
|
119
122
|
translate(dx: number, dy: number, dz: number): void;
|
|
120
|
-
|
|
123
|
+
/**
|
|
124
|
+
* @param sx
|
|
125
|
+
* @param sy
|
|
126
|
+
* @param sz - optional sz. only has effect when rotating a single model or primitive
|
|
127
|
+
*/
|
|
128
|
+
scale(sx: number, sy: number, sz?: number): void;
|
|
121
129
|
setMode(mode: TransformationMode): void;
|
|
122
130
|
modeChanged: VcsEvent<TransformationMode>;
|
|
123
131
|
setFeatures(features: Feature[]): void;
|
|
@@ -204,16 +212,22 @@ function startEditFeaturesSession(
|
|
|
204
212
|
let destroyTransformation = (): void => {};
|
|
205
213
|
let transformationHandler: TransformationHandler | undefined;
|
|
206
214
|
const translate = (dx: number, dy: number, dz: number): void => {
|
|
207
|
-
transformationHandler?.translate?.(dx, dy, dz);
|
|
215
|
+
transformationHandler?.translate?.(dx, dy, dz); // XXX should we changes this in 2D to change the layout to XY?
|
|
208
216
|
currentFeatures.forEach((f) => {
|
|
209
217
|
const geometry = f[obliqueGeometry] ?? f.getGeometry(); // XXX wont work in oblqiue
|
|
210
218
|
geometry!.applyTransform(
|
|
211
|
-
(
|
|
219
|
+
(
|
|
220
|
+
input: number[],
|
|
221
|
+
output: number[] | undefined,
|
|
222
|
+
stride = 2,
|
|
223
|
+
): number[] => {
|
|
212
224
|
const inputLength = input.length;
|
|
213
|
-
for (let i = 0; i < inputLength; i +=
|
|
225
|
+
for (let i = 0; i < inputLength; i += stride) {
|
|
214
226
|
output![i] = input[i] + dx;
|
|
215
227
|
output![i + 1] = input[i + 1] + dy;
|
|
216
|
-
|
|
228
|
+
if (stride > 2) {
|
|
229
|
+
output![i + 2] = input[i + 2] + dz;
|
|
230
|
+
}
|
|
217
231
|
}
|
|
218
232
|
return output!;
|
|
219
233
|
},
|
|
@@ -221,39 +235,92 @@ function startEditFeaturesSession(
|
|
|
221
235
|
});
|
|
222
236
|
};
|
|
223
237
|
|
|
224
|
-
const rotate = (
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
238
|
+
const rotate = (
|
|
239
|
+
angle: number,
|
|
240
|
+
axis: AxisAndPlanes = AxisAndPlanes.Z,
|
|
241
|
+
): void => {
|
|
242
|
+
if (
|
|
243
|
+
currentFeatures.length === 1 &&
|
|
244
|
+
currentFeatures[0].getGeometry()?.getType() === 'Point' &&
|
|
245
|
+
layer.vectorProperties.renderAs(currentFeatures[0]) !== 'geometry'
|
|
246
|
+
) {
|
|
247
|
+
if (axis === AxisAndPlanes.Z) {
|
|
248
|
+
const currentRotation = layer.vectorProperties.getModelHeading(
|
|
249
|
+
currentFeatures[0],
|
|
250
|
+
);
|
|
251
|
+
currentFeatures[0].set(
|
|
252
|
+
'olcs_modelHeading',
|
|
253
|
+
currentRotation - CesiumMath.toDegrees(angle),
|
|
254
|
+
);
|
|
255
|
+
} else if (axis === AxisAndPlanes.X) {
|
|
256
|
+
const currentRotation = layer.vectorProperties.getModelPitch(
|
|
257
|
+
currentFeatures[0],
|
|
258
|
+
);
|
|
259
|
+
currentFeatures[0].set(
|
|
260
|
+
'olcs_modelPitch',
|
|
261
|
+
currentRotation - CesiumMath.toDegrees(angle),
|
|
262
|
+
);
|
|
263
|
+
} else if (axis === AxisAndPlanes.Y) {
|
|
264
|
+
const currentRotation = layer.vectorProperties.getModelRoll(
|
|
265
|
+
currentFeatures[0],
|
|
266
|
+
);
|
|
267
|
+
currentFeatures[0].set(
|
|
268
|
+
'olcs_modelRoll',
|
|
269
|
+
currentRotation - CesiumMath.toDegrees(angle),
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
} else {
|
|
273
|
+
let center = transformationHandler?.center;
|
|
274
|
+
if (!center) {
|
|
275
|
+
const extent = createEmptyExtent();
|
|
276
|
+
currentFeatures.forEach((f) => {
|
|
277
|
+
extendExtent(extent, f.getGeometry()!.getExtent()); // XXX wont work in oblqiue
|
|
278
|
+
});
|
|
279
|
+
if (!isEmpty(extent)) {
|
|
280
|
+
center = getCenter(extent);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
228
283
|
currentFeatures.forEach((f) => {
|
|
229
|
-
|
|
284
|
+
const geometry = f[obliqueGeometry] ?? f.getGeometry(); // XXX wont work in oblqiue
|
|
285
|
+
geometry!.rotate(angle, center!);
|
|
230
286
|
});
|
|
231
|
-
if (!isEmpty(extent)) {
|
|
232
|
-
center = getCenter(extent);
|
|
233
|
-
}
|
|
234
287
|
}
|
|
235
|
-
currentFeatures.forEach((f) => {
|
|
236
|
-
const geometry = f[obliqueGeometry] ?? f.getGeometry(); // XXX wont work in oblqiue
|
|
237
|
-
geometry!.rotate(angle, center!);
|
|
238
|
-
});
|
|
239
288
|
};
|
|
240
289
|
|
|
241
|
-
const scale = (sx: number, sy: number): void => {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
290
|
+
const scale = (sx: number, sy: number, sz?: number): void => {
|
|
291
|
+
if (
|
|
292
|
+
currentFeatures.length === 1 &&
|
|
293
|
+
currentFeatures[0].getGeometry()?.getType() === 'Point' &&
|
|
294
|
+
layer.vectorProperties.renderAs(currentFeatures[0]) !== 'geometry'
|
|
295
|
+
) {
|
|
296
|
+
const feature = currentFeatures[0];
|
|
297
|
+
const scaleX = layer.vectorProperties.getModelScaleX(feature);
|
|
298
|
+
const scaleY = layer.vectorProperties.getModelScaleY(feature);
|
|
299
|
+
const scaleZ = layer.vectorProperties.getModelScaleZ(feature);
|
|
300
|
+
currentFeatures[0].set('olcs_modelScaleX', scaleX * sx);
|
|
301
|
+
currentFeatures[0].set('olcs_modelScaleY', scaleY * sy);
|
|
302
|
+
let usedSz = sz;
|
|
303
|
+
if (usedSz == null) {
|
|
304
|
+
usedSz = sx === sy ? sx : 1;
|
|
305
|
+
}
|
|
306
|
+
currentFeatures[0].set('olcs_modelScaleZ', scaleZ * usedSz);
|
|
307
|
+
} else {
|
|
308
|
+
let center = transformationHandler?.center;
|
|
309
|
+
if (!center) {
|
|
310
|
+
// XXX copy paste
|
|
311
|
+
const extent = createEmptyExtent();
|
|
312
|
+
currentFeatures.forEach((f) => {
|
|
313
|
+
extendExtent(extent, f.getGeometry()!.getExtent());
|
|
314
|
+
});
|
|
315
|
+
if (!isEmpty(extent)) {
|
|
316
|
+
center = getCenter(extent);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
246
319
|
currentFeatures.forEach((f) => {
|
|
247
|
-
|
|
320
|
+
const geometry = f[obliqueGeometry] ?? f.getGeometry();
|
|
321
|
+
geometry!.scale(sx, sy, center);
|
|
248
322
|
});
|
|
249
|
-
if (!isEmpty(extent)) {
|
|
250
|
-
center = getCenter(extent);
|
|
251
|
-
}
|
|
252
323
|
}
|
|
253
|
-
currentFeatures.forEach((f) => {
|
|
254
|
-
const geometry = f[obliqueGeometry] ?? f.getGeometry();
|
|
255
|
-
geometry!.scale(sx, sy, center);
|
|
256
|
-
});
|
|
257
324
|
};
|
|
258
325
|
|
|
259
326
|
const createTransformations = (): void => {
|
|
@@ -281,8 +348,6 @@ function startEditFeaturesSession(
|
|
|
281
348
|
interaction = new ExtrudeInteraction(transformationHandler);
|
|
282
349
|
interaction.extruded.addEventListener((dz) => {
|
|
283
350
|
currentFeatures.forEach((f) => {
|
|
284
|
-
// eslint-disable-next-line no-void
|
|
285
|
-
void ensureFeatureAbsolute(f, layer, app.maps.activeMap as CesiumMap);
|
|
286
351
|
let extrudedHeight =
|
|
287
352
|
(f.get('olcs_extrudedHeight') as number | undefined) ?? 0;
|
|
288
353
|
extrudedHeight += dz;
|
|
@@ -291,13 +356,13 @@ function startEditFeaturesSession(
|
|
|
291
356
|
});
|
|
292
357
|
} else if (mode === TransformationMode.ROTATE) {
|
|
293
358
|
interaction = new RotateInteraction(transformationHandler);
|
|
294
|
-
interaction.rotated.addEventListener(({ angle }) => {
|
|
295
|
-
rotate(angle);
|
|
359
|
+
interaction.rotated.addEventListener(({ angle, axis }) => {
|
|
360
|
+
rotate(angle, axis);
|
|
296
361
|
});
|
|
297
362
|
} else if (mode === TransformationMode.SCALE) {
|
|
298
363
|
interaction = new ScaleInteraction(transformationHandler);
|
|
299
|
-
interaction.scaled.addEventListener(([sx, sy]) => {
|
|
300
|
-
scale(sx, sy);
|
|
364
|
+
interaction.scaled.addEventListener(([sx, sy, sz]) => {
|
|
365
|
+
scale(sx, sy, sz);
|
|
301
366
|
});
|
|
302
367
|
} else {
|
|
303
368
|
throw new Error(`Unknown transformation mode ${String(mode)}`);
|
|
@@ -378,6 +443,7 @@ function startEditFeaturesSession(
|
|
|
378
443
|
});
|
|
379
444
|
allowPickingMap.clear();
|
|
380
445
|
app.layers.remove(scratchLayer);
|
|
446
|
+
scratchLayer.destroy();
|
|
381
447
|
modeChanged.destroy();
|
|
382
448
|
removeRightClickStart();
|
|
383
449
|
rightClickStart.destroy();
|