@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
|
@@ -8,171 +8,505 @@ import {
|
|
|
8
8
|
MultiLineString,
|
|
9
9
|
MultiPolygon,
|
|
10
10
|
} from 'ol/geom.js';
|
|
11
|
-
import
|
|
11
|
+
import {
|
|
12
|
+
ClassificationPrimitive,
|
|
13
|
+
GroundPolylinePrimitive,
|
|
14
|
+
GroundPrimitive,
|
|
15
|
+
Model,
|
|
16
|
+
Primitive,
|
|
17
|
+
Scene,
|
|
18
|
+
} from '@vcmap-cesium/engine';
|
|
12
19
|
import Style, { type StyleLike } from 'ol/style/Style.js';
|
|
13
20
|
import type { Feature } from 'ol/index.js';
|
|
14
21
|
import GeometryCollection from 'ol/geom/GeometryCollection.js';
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
import { getPolygonGeometryFactory } from './polygonToCesium.js';
|
|
23
|
+
import { getCircleGeometryFactory } from './circleToCesium.js';
|
|
24
|
+
import {
|
|
25
|
+
getArrowHeadPrimitives,
|
|
26
|
+
getLineStringGeometryFactory,
|
|
27
|
+
} from './lineStringToCesium.js';
|
|
28
|
+
import {
|
|
29
|
+
BillboardOptions,
|
|
30
|
+
getPointPrimitives,
|
|
31
|
+
LabelOptions,
|
|
32
|
+
validatePoint,
|
|
33
|
+
} from './pointToCesium.js';
|
|
34
|
+
import { getArcGeometryFactory } from './arcToCesium.js';
|
|
35
|
+
import { featureArcStruct } from '../../style/arcStyle.js';
|
|
36
|
+
import VectorProperties from '../../layer/vectorProperties.js';
|
|
37
|
+
import { setupClampedPrimitive } from './clampedPrimitive.js';
|
|
38
|
+
import {
|
|
39
|
+
getHeightInfo,
|
|
40
|
+
isClampedHeightReference,
|
|
41
|
+
isRelativeHeightReference,
|
|
42
|
+
RelativeHeightReference,
|
|
43
|
+
VectorHeightInfo,
|
|
44
|
+
} from './vectorHeightInfo.js';
|
|
45
|
+
import {
|
|
46
|
+
CesiumGeometryOption,
|
|
47
|
+
createClassificationPrimitiveItem,
|
|
48
|
+
createGroundLinePrimitiveItem,
|
|
49
|
+
createGroundPrimitiveItem,
|
|
50
|
+
createLinePrimitiveItem,
|
|
51
|
+
createOutlinePrimitiveItem,
|
|
52
|
+
createSolidPrimitiveItem,
|
|
53
|
+
getCesiumGeometriesOptions,
|
|
54
|
+
VectorGeometryFactory,
|
|
55
|
+
} from './vectorGeometryFactory.js';
|
|
56
|
+
import ArrowStyle from '../../style/arrowStyle.js';
|
|
57
|
+
|
|
58
|
+
export type PrimitiveType =
|
|
59
|
+
| Primitive
|
|
60
|
+
| GroundPrimitive
|
|
61
|
+
| GroundPolylinePrimitive
|
|
62
|
+
| ClassificationPrimitive
|
|
63
|
+
| Model;
|
|
64
|
+
|
|
65
|
+
export type ConvertedItemType = 'primitive' | 'billboard' | 'label';
|
|
66
|
+
|
|
67
|
+
export type ConvertedItem<T extends ConvertedItemType = ConvertedItemType> =
|
|
68
|
+
T extends 'primitive'
|
|
69
|
+
? {
|
|
70
|
+
type: T;
|
|
71
|
+
item: PrimitiveType;
|
|
72
|
+
autoScale?: boolean;
|
|
73
|
+
}
|
|
74
|
+
: T extends 'billboard'
|
|
75
|
+
? {
|
|
76
|
+
type: T;
|
|
77
|
+
item: BillboardOptions;
|
|
78
|
+
}
|
|
79
|
+
: T extends 'label'
|
|
80
|
+
? {
|
|
81
|
+
type: T;
|
|
82
|
+
item: LabelOptions;
|
|
83
|
+
}
|
|
84
|
+
: never;
|
|
85
|
+
|
|
86
|
+
type SingleGeometry = Point | Polygon | LineString | Circle;
|
|
87
|
+
|
|
88
|
+
export function getStylesArray(
|
|
89
|
+
style: StyleLike,
|
|
25
90
|
feature: Feature,
|
|
91
|
+
resolution = 1,
|
|
92
|
+
): Style[] {
|
|
93
|
+
const styles = [];
|
|
94
|
+
if (typeof style === 'function') {
|
|
95
|
+
styles.push(
|
|
96
|
+
...getStylesArray(
|
|
97
|
+
style(feature, resolution) as StyleLike,
|
|
98
|
+
feature,
|
|
99
|
+
resolution,
|
|
100
|
+
),
|
|
101
|
+
);
|
|
102
|
+
} else if (Array.isArray(style)) {
|
|
103
|
+
style.forEach((currentStyle) => {
|
|
104
|
+
styles.push(...getStylesArray(currentStyle, feature, resolution));
|
|
105
|
+
});
|
|
106
|
+
} else if (style instanceof Style) {
|
|
107
|
+
styles.push(style);
|
|
108
|
+
}
|
|
109
|
+
return styles;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function getSingleGeometriesFromGeometry(
|
|
26
113
|
geometry: Geometry,
|
|
114
|
+
): SingleGeometry[] {
|
|
115
|
+
if (
|
|
116
|
+
geometry instanceof Point ||
|
|
117
|
+
geometry instanceof Polygon ||
|
|
118
|
+
geometry instanceof LineString ||
|
|
119
|
+
geometry instanceof Circle
|
|
120
|
+
) {
|
|
121
|
+
return [geometry];
|
|
122
|
+
}
|
|
123
|
+
if (geometry instanceof MultiPoint) {
|
|
124
|
+
return geometry.getPoints();
|
|
125
|
+
} else if (geometry instanceof MultiPolygon) {
|
|
126
|
+
return geometry.getPolygons();
|
|
127
|
+
} else if (geometry instanceof MultiLineString) {
|
|
128
|
+
return geometry.getLineStrings();
|
|
129
|
+
} else if (geometry instanceof GeometryCollection) {
|
|
130
|
+
return geometry
|
|
131
|
+
.getGeometriesArray()
|
|
132
|
+
.map(getSingleGeometriesFromGeometry)
|
|
133
|
+
.flat();
|
|
134
|
+
}
|
|
135
|
+
throw new Error('Not an implemented geometry');
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
async function getCesiumOptionsForSingleGeometry(
|
|
139
|
+
feature: Feature,
|
|
140
|
+
geometry: SingleGeometry,
|
|
27
141
|
style: Style,
|
|
28
142
|
vectorProperties: VectorProperties,
|
|
29
143
|
scene: Scene,
|
|
30
|
-
|
|
31
|
-
|
|
144
|
+
): Promise<(CesiumGeometryOption | ConvertedItem)[]> {
|
|
145
|
+
const heightInfo = getHeightInfo(feature, geometry, vectorProperties);
|
|
32
146
|
if (geometry instanceof Point) {
|
|
33
|
-
|
|
147
|
+
if (
|
|
148
|
+
(!style.getImage() && !style.getText()?.getText()) ||
|
|
149
|
+
!validatePoint(geometry)
|
|
150
|
+
) {
|
|
151
|
+
return [];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const pointPrimitives = await getPointPrimitives(
|
|
34
155
|
feature,
|
|
156
|
+
geometry,
|
|
35
157
|
style,
|
|
36
|
-
[geometry],
|
|
37
158
|
vectorProperties,
|
|
38
159
|
scene,
|
|
39
|
-
|
|
160
|
+
heightInfo,
|
|
40
161
|
);
|
|
41
|
-
|
|
42
|
-
|
|
162
|
+
return pointPrimitives;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
let geometryFactory: VectorGeometryFactory;
|
|
166
|
+
let arcStyle: ArrowStyle | undefined;
|
|
167
|
+
if (geometry instanceof Polygon) {
|
|
168
|
+
geometryFactory = getPolygonGeometryFactory();
|
|
169
|
+
} else if (geometry instanceof LineString) {
|
|
170
|
+
if (style instanceof ArrowStyle) {
|
|
171
|
+
if (feature[featureArcStruct]?.coordinates) {
|
|
172
|
+
geometryFactory = getArcGeometryFactory(
|
|
173
|
+
feature[featureArcStruct]?.coordinates,
|
|
174
|
+
heightInfo.heightReference,
|
|
175
|
+
);
|
|
176
|
+
} else {
|
|
177
|
+
geometryFactory = getLineStringGeometryFactory();
|
|
178
|
+
}
|
|
179
|
+
arcStyle = style;
|
|
180
|
+
} else {
|
|
181
|
+
geometryFactory = getLineStringGeometryFactory();
|
|
182
|
+
}
|
|
183
|
+
} else {
|
|
184
|
+
geometryFactory = getCircleGeometryFactory();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (
|
|
188
|
+
(!style.getFill() && !style.getStroke()) ||
|
|
189
|
+
!geometryFactory.validateGeometry(geometry)
|
|
190
|
+
) {
|
|
191
|
+
return [];
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const geometryOptions = getCesiumGeometriesOptions(
|
|
195
|
+
style,
|
|
196
|
+
geometry,
|
|
197
|
+
geometryFactory,
|
|
198
|
+
heightInfo,
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
let convertedItems: ConvertedItem[] = [];
|
|
202
|
+
if (arcStyle) {
|
|
203
|
+
convertedItems = getArrowHeadPrimitives(
|
|
43
204
|
feature,
|
|
44
|
-
|
|
45
|
-
|
|
205
|
+
arcStyle,
|
|
206
|
+
geometry as LineString,
|
|
46
207
|
vectorProperties,
|
|
47
208
|
scene,
|
|
48
|
-
|
|
209
|
+
feature[featureArcStruct]?.coordinates,
|
|
49
210
|
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return [...geometryOptions, ...convertedItems];
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
type PrimitiveBatches = {
|
|
217
|
+
classificationPrimitive: CesiumGeometryOption<'solid' | 'fill'>[];
|
|
218
|
+
groundPrimitive: CesiumGeometryOption<'solid' | 'fill'>[];
|
|
219
|
+
solidPrimitive: CesiumGeometryOption<'solid' | 'fill'>[];
|
|
220
|
+
outlinePrimitive: CesiumGeometryOption<'outline'>[];
|
|
221
|
+
linePrimitive: CesiumGeometryOption<'line'>[];
|
|
222
|
+
groundLinePrimitive: CesiumGeometryOption<'groundLine'>[];
|
|
223
|
+
clampedPrimitives: Map<
|
|
224
|
+
string,
|
|
225
|
+
CesiumGeometryOption<'solid' | 'outline' | 'line' | 'fill'>[]
|
|
226
|
+
>;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
function createPrimitiveBatches(): PrimitiveBatches {
|
|
230
|
+
return {
|
|
231
|
+
classificationPrimitive: [],
|
|
232
|
+
groundPrimitive: [],
|
|
233
|
+
solidPrimitive: [],
|
|
234
|
+
outlinePrimitive: [],
|
|
235
|
+
linePrimitive: [],
|
|
236
|
+
groundLinePrimitive: [],
|
|
237
|
+
clampedPrimitives: new Map(),
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function addRelativeGeometryOptions(
|
|
242
|
+
item: CesiumGeometryOption<'solid' | 'outline' | 'line' | 'fill'>,
|
|
243
|
+
origin: [number, number],
|
|
244
|
+
clampedPrimitivesMap: Map<
|
|
245
|
+
string,
|
|
246
|
+
CesiumGeometryOption<'solid' | 'outline' | 'line' | 'fill'>[]
|
|
247
|
+
>,
|
|
248
|
+
): void {
|
|
249
|
+
const clampOriginHash = `${origin.join(':')}:${
|
|
250
|
+
item.heightInfo.heightReference
|
|
251
|
+
}`;
|
|
252
|
+
|
|
253
|
+
if (!clampedPrimitivesMap.has(clampOriginHash)) {
|
|
254
|
+
clampedPrimitivesMap.set(clampOriginHash, []);
|
|
255
|
+
}
|
|
256
|
+
clampedPrimitivesMap.get(clampOriginHash)!.push(item);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function getPrimitiveBatches(
|
|
260
|
+
items: (CesiumGeometryOption | ConvertedItem)[],
|
|
261
|
+
feature: Feature,
|
|
262
|
+
vectorProperties: VectorProperties,
|
|
263
|
+
scene: Scene,
|
|
264
|
+
): { batches: PrimitiveBatches; convertedItems: ConvertedItem[] } {
|
|
265
|
+
const convertedItems: ConvertedItem[] = [];
|
|
266
|
+
const batches = createPrimitiveBatches();
|
|
267
|
+
const classification = vectorProperties.getClassificationType(feature);
|
|
268
|
+
const classificationSupported = ClassificationPrimitive.isSupported(scene);
|
|
269
|
+
const groundPrimitiveSupported = GroundPrimitive.isSupported(scene);
|
|
270
|
+
const groundLinePrimitiveSupported =
|
|
271
|
+
GroundPolylinePrimitive.isSupported(scene);
|
|
272
|
+
|
|
273
|
+
items.forEach((item) => {
|
|
274
|
+
if (
|
|
275
|
+
item.type === 'primitive' ||
|
|
276
|
+
item.type === 'billboard' ||
|
|
277
|
+
item.type === 'label'
|
|
278
|
+
) {
|
|
279
|
+
convertedItems.push(item);
|
|
280
|
+
} else if (item.type === 'groundLine') {
|
|
281
|
+
if (groundLinePrimitiveSupported) {
|
|
282
|
+
batches.groundLinePrimitive.push(item);
|
|
283
|
+
}
|
|
284
|
+
} else {
|
|
285
|
+
const options = item as CesiumGeometryOption<
|
|
286
|
+
'solid' | 'outline' | 'line' | 'fill'
|
|
287
|
+
>;
|
|
288
|
+
const { heightReference } = options.heightInfo;
|
|
289
|
+
if (
|
|
290
|
+
isRelativeHeightReference(heightReference) &&
|
|
291
|
+
(options.heightInfo as VectorHeightInfo<RelativeHeightReference>)
|
|
292
|
+
.clampOrigin
|
|
293
|
+
) {
|
|
294
|
+
addRelativeGeometryOptions(
|
|
295
|
+
options,
|
|
296
|
+
(options.heightInfo as VectorHeightInfo<RelativeHeightReference>)
|
|
297
|
+
.clampOrigin!,
|
|
298
|
+
batches.clampedPrimitives,
|
|
299
|
+
);
|
|
300
|
+
} else if (item.type === 'fill' || item.type === 'solid') {
|
|
301
|
+
if (isClampedHeightReference(heightReference)) {
|
|
302
|
+
if (groundPrimitiveSupported) {
|
|
303
|
+
batches.groundPrimitive.push(item);
|
|
304
|
+
}
|
|
305
|
+
} else if (classification != null) {
|
|
306
|
+
if (classificationSupported) {
|
|
307
|
+
batches.classificationPrimitive.push(item);
|
|
308
|
+
}
|
|
309
|
+
} else {
|
|
310
|
+
batches.solidPrimitive.push(item);
|
|
311
|
+
}
|
|
312
|
+
} else if (item.type === 'outline') {
|
|
313
|
+
// never clamped, never classified
|
|
314
|
+
batches.outlinePrimitive.push(item);
|
|
315
|
+
} else if (item.type === 'line') {
|
|
316
|
+
// never clamped, never classified
|
|
317
|
+
batches.linePrimitive.push(item);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
return { batches, convertedItems };
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function getClampedPrimitiveBatches(
|
|
326
|
+
options: CesiumGeometryOption<'solid' | 'outline' | 'line' | 'fill'>[],
|
|
327
|
+
): PrimitiveBatches {
|
|
328
|
+
const batches = createPrimitiveBatches();
|
|
329
|
+
|
|
330
|
+
options.forEach((item) => {
|
|
331
|
+
if (item.type === 'solid' || item.type === 'fill') {
|
|
332
|
+
batches.solidPrimitive.push(item);
|
|
333
|
+
} else if (item.type === 'outline') {
|
|
334
|
+
batches.outlinePrimitive.push(item);
|
|
335
|
+
} else if (item.type === 'line') {
|
|
336
|
+
batches.linePrimitive.push(item);
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
return batches;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function batchPrimitives(
|
|
344
|
+
batches: PrimitiveBatches,
|
|
345
|
+
feature: Feature,
|
|
346
|
+
style: Style,
|
|
347
|
+
vectorProperties: VectorProperties,
|
|
348
|
+
scene: Scene,
|
|
349
|
+
): ConvertedItem[] {
|
|
350
|
+
const convertedItems: ConvertedItem[] = [];
|
|
351
|
+
|
|
352
|
+
if (batches.classificationPrimitive.length) {
|
|
353
|
+
convertedItems.push(
|
|
354
|
+
createClassificationPrimitiveItem(
|
|
53
355
|
feature,
|
|
54
356
|
style,
|
|
55
|
-
[geometry],
|
|
56
357
|
vectorProperties,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
358
|
+
batches.classificationPrimitive,
|
|
359
|
+
),
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
if (batches.solidPrimitive.length) {
|
|
363
|
+
convertedItems.push(
|
|
364
|
+
createSolidPrimitiveItem(
|
|
62
365
|
feature,
|
|
63
366
|
style,
|
|
64
|
-
[geometry],
|
|
65
367
|
vectorProperties,
|
|
66
368
|
scene,
|
|
67
|
-
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
} else if (geometry instanceof Circle) {
|
|
71
|
-
circleToCesium(
|
|
72
|
-
feature,
|
|
73
|
-
style,
|
|
74
|
-
[geometry],
|
|
75
|
-
vectorProperties,
|
|
76
|
-
scene,
|
|
77
|
-
context,
|
|
78
|
-
);
|
|
79
|
-
} else if (geometry instanceof MultiPoint) {
|
|
80
|
-
await pointToCesium(
|
|
81
|
-
feature,
|
|
82
|
-
style,
|
|
83
|
-
geometry.getPoints(),
|
|
84
|
-
vectorProperties,
|
|
85
|
-
scene,
|
|
86
|
-
context,
|
|
369
|
+
batches.solidPrimitive,
|
|
370
|
+
),
|
|
87
371
|
);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
372
|
+
}
|
|
373
|
+
if (batches.outlinePrimitive.length) {
|
|
374
|
+
convertedItems.push(
|
|
375
|
+
createOutlinePrimitiveItem(
|
|
376
|
+
feature,
|
|
377
|
+
style,
|
|
378
|
+
vectorProperties,
|
|
379
|
+
batches.outlinePrimitive,
|
|
380
|
+
),
|
|
96
381
|
);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
382
|
+
}
|
|
383
|
+
if (batches.linePrimitive.length) {
|
|
384
|
+
convertedItems.push(
|
|
385
|
+
createLinePrimitiveItem(
|
|
386
|
+
feature,
|
|
387
|
+
style,
|
|
388
|
+
vectorProperties,
|
|
389
|
+
batches.linePrimitive,
|
|
390
|
+
),
|
|
105
391
|
);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
context,
|
|
116
|
-
);
|
|
117
|
-
}),
|
|
392
|
+
}
|
|
393
|
+
if (batches.groundLinePrimitive.length) {
|
|
394
|
+
convertedItems.push(
|
|
395
|
+
createGroundLinePrimitiveItem(
|
|
396
|
+
feature,
|
|
397
|
+
style,
|
|
398
|
+
vectorProperties,
|
|
399
|
+
batches.groundLinePrimitive,
|
|
400
|
+
),
|
|
118
401
|
);
|
|
119
402
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
style: StyleLike,
|
|
124
|
-
feature: Feature,
|
|
125
|
-
resolution = 1,
|
|
126
|
-
): Style[] {
|
|
127
|
-
const styles = [];
|
|
128
|
-
if (typeof style === 'function') {
|
|
129
|
-
styles.push(
|
|
130
|
-
...getStylesArray(
|
|
131
|
-
style(feature, resolution) as StyleLike,
|
|
403
|
+
if (batches.groundPrimitive.length) {
|
|
404
|
+
convertedItems.push(
|
|
405
|
+
createGroundPrimitiveItem(
|
|
132
406
|
feature,
|
|
133
|
-
|
|
407
|
+
style,
|
|
408
|
+
vectorProperties,
|
|
409
|
+
scene,
|
|
410
|
+
batches.groundPrimitive,
|
|
134
411
|
),
|
|
135
412
|
);
|
|
136
|
-
} else if (Array.isArray(style)) {
|
|
137
|
-
style.forEach((currentStyle) => {
|
|
138
|
-
styles.push(...getStylesArray(currentStyle, feature, resolution));
|
|
139
|
-
});
|
|
140
|
-
} else if (style instanceof Style) {
|
|
141
|
-
styles.push(style);
|
|
142
413
|
}
|
|
143
|
-
|
|
414
|
+
|
|
415
|
+
batches.clampedPrimitives.forEach((options, originHash) => {
|
|
416
|
+
const [x, y, heightReference] = originHash.split(':').map(Number);
|
|
417
|
+
const clampedBatches = getClampedPrimitiveBatches(options);
|
|
418
|
+
const clampedItems = batchPrimitives(
|
|
419
|
+
clampedBatches,
|
|
420
|
+
feature,
|
|
421
|
+
style,
|
|
422
|
+
vectorProperties,
|
|
423
|
+
scene,
|
|
424
|
+
);
|
|
425
|
+
clampedItems.forEach(({ item }) => {
|
|
426
|
+
setupClampedPrimitive(
|
|
427
|
+
scene,
|
|
428
|
+
item as Primitive | Model,
|
|
429
|
+
[x, y],
|
|
430
|
+
heightReference,
|
|
431
|
+
);
|
|
432
|
+
});
|
|
433
|
+
convertedItems.push(...clampedItems);
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
return convertedItems;
|
|
144
437
|
}
|
|
145
438
|
|
|
146
439
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
440
|
+
* Converts a feature and all its associated geometries to items which can be added to
|
|
441
|
+
* cesium collections directly: Primitives, BillboardOptions or LabelOptions. This is
|
|
442
|
+
* an internal API, typically it is enough to simple use a `VectorLayer` to handle conversions for you.
|
|
443
|
+
* 1. All styles provided by the style like are flattened.
|
|
444
|
+
* 2. All single OL geometries which should be rendered with each style are extracted
|
|
445
|
+
* 3. Cesium geometry options are extracted from each OL geometry based on the geometry, feature & vector properties
|
|
446
|
+
* 4. Cesium geometries which can be batched into a single primitive (for instance, an extruded volume would have all its solids batched and all its outlines batched
|
|
447
|
+
* In case of relativeTo* altitude modes, primitives are batched based _on the clamp origin_
|
|
448
|
+
* 5. The converted items are returned, typically to the vector context which called convert in the first place.
|
|
149
449
|
* @param feature
|
|
150
450
|
* @param style
|
|
151
451
|
* @param vectorProperties
|
|
152
|
-
* @param context
|
|
153
452
|
* @param scene
|
|
154
453
|
*/
|
|
155
454
|
export default async function convert(
|
|
156
455
|
feature: Feature,
|
|
157
456
|
style: StyleLike,
|
|
158
457
|
vectorProperties: VectorProperties,
|
|
159
|
-
context: AsyncCesiumVectorContext,
|
|
160
458
|
scene: Scene,
|
|
161
|
-
): Promise<
|
|
459
|
+
): Promise<ConvertedItem[]> {
|
|
162
460
|
const styles = getStylesArray(feature.getStyle() || style, feature, 0);
|
|
163
|
-
|
|
164
|
-
styles.map(
|
|
461
|
+
const styledGeometries: { geometries: SingleGeometry[]; style: Style }[] =
|
|
462
|
+
styles.map((currentStyle) => {
|
|
165
463
|
const geometry = currentStyle.getGeometryFunction()(feature) as Geometry;
|
|
166
464
|
if (geometry) {
|
|
167
|
-
|
|
465
|
+
return {
|
|
466
|
+
style: currentStyle,
|
|
467
|
+
geometries: getSingleGeometriesFromGeometry(geometry),
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
return {
|
|
471
|
+
style: currentStyle,
|
|
472
|
+
geometries: [],
|
|
473
|
+
};
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
return (
|
|
477
|
+
await Promise.all(
|
|
478
|
+
styledGeometries.map(async ({ geometries, style: currentStyle }) => {
|
|
479
|
+
const itemArrays = await Promise.all(
|
|
480
|
+
geometries.map((geometry) =>
|
|
481
|
+
getCesiumOptionsForSingleGeometry(
|
|
482
|
+
feature,
|
|
483
|
+
geometry,
|
|
484
|
+
currentStyle,
|
|
485
|
+
vectorProperties,
|
|
486
|
+
scene,
|
|
487
|
+
),
|
|
488
|
+
),
|
|
489
|
+
);
|
|
490
|
+
|
|
491
|
+
const items = itemArrays.flat();
|
|
492
|
+
const { batches, convertedItems } = getPrimitiveBatches(
|
|
493
|
+
items,
|
|
168
494
|
feature,
|
|
169
|
-
geometry,
|
|
170
|
-
currentStyle,
|
|
171
495
|
vectorProperties,
|
|
172
496
|
scene,
|
|
173
|
-
context,
|
|
174
497
|
);
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
498
|
+
|
|
499
|
+
convertedItems.push(
|
|
500
|
+
...batchPrimitives(
|
|
501
|
+
batches,
|
|
502
|
+
feature,
|
|
503
|
+
currentStyle,
|
|
504
|
+
vectorProperties,
|
|
505
|
+
scene,
|
|
506
|
+
),
|
|
507
|
+
);
|
|
508
|
+
return convertedItems;
|
|
509
|
+
}),
|
|
510
|
+
)
|
|
511
|
+
).flat();
|
|
178
512
|
}
|
|
@@ -7,7 +7,9 @@ import type {
|
|
|
7
7
|
} from 'ol/geom.js';
|
|
8
8
|
import type { Extent } from 'ol/extent.js';
|
|
9
9
|
import type { Coordinate } from 'ol/coordinate.js';
|
|
10
|
-
import {
|
|
10
|
+
import { HeightReference } from '@vcmap-cesium/engine';
|
|
11
|
+
|
|
12
|
+
import { VectorHeightInfo } from './vectorHeightInfo.js';
|
|
11
13
|
|
|
12
14
|
class Extent3D {
|
|
13
15
|
static fromArray(
|
|
@@ -34,7 +36,9 @@ class Extent3D {
|
|
|
34
36
|
/**
|
|
35
37
|
* @param heightInfo
|
|
36
38
|
*/
|
|
37
|
-
static fromHeightInfo(
|
|
39
|
+
static fromHeightInfo(
|
|
40
|
+
heightInfo: VectorHeightInfo<HeightReference.NONE>,
|
|
41
|
+
): Extent3D {
|
|
38
42
|
const extent = new Extent3D();
|
|
39
43
|
extent.extendWithHeightInfo(heightInfo);
|
|
40
44
|
return extent;
|
|
@@ -102,10 +106,12 @@ class Extent3D {
|
|
|
102
106
|
}
|
|
103
107
|
}
|
|
104
108
|
|
|
105
|
-
extendWithHeightInfo(
|
|
109
|
+
extendWithHeightInfo(
|
|
110
|
+
heightInfo: VectorHeightInfo<HeightReference.NONE>,
|
|
111
|
+
): void {
|
|
106
112
|
if (heightInfo.extruded) {
|
|
107
113
|
const calculatedFeatureMaxHeight =
|
|
108
|
-
heightInfo.
|
|
114
|
+
heightInfo.groundLevelOrMinHeight +
|
|
109
115
|
heightInfo.storeyHeightsAboveGround.reduce(
|
|
110
116
|
(accumulator, currentValue) => {
|
|
111
117
|
return accumulator + currentValue;
|
|
@@ -114,7 +120,7 @@ class Extent3D {
|
|
|
114
120
|
);
|
|
115
121
|
this.extendZ(calculatedFeatureMaxHeight);
|
|
116
122
|
const calculatedFeatureMinHeight =
|
|
117
|
-
heightInfo.
|
|
123
|
+
heightInfo.groundLevelOrMinHeight -
|
|
118
124
|
heightInfo.storeyHeightsBelowGround.reduce(
|
|
119
125
|
(accumulator, currentValue) => {
|
|
120
126
|
return accumulator + currentValue;
|
|
@@ -184,10 +190,11 @@ class Extent3D {
|
|
|
184
190
|
if (this.isEmpty()) {
|
|
185
191
|
return [0, 0, 0];
|
|
186
192
|
}
|
|
193
|
+
const minZ = this.minZ + (this.maxZ - this.minZ) / 2;
|
|
187
194
|
return [
|
|
188
195
|
this.minX + (this.maxX - this.minX) / 2,
|
|
189
196
|
this.minY + (this.maxY - this.minY) / 2,
|
|
190
|
-
|
|
197
|
+
Number.isFinite(minZ) ? minZ : 0,
|
|
191
198
|
];
|
|
192
199
|
}
|
|
193
200
|
|