@vcmap/core 5.3.3 → 6.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cesium.d.ts +12 -0
- package/dist/index.d.ts +27 -19
- package/dist/index.js +22 -14
- package/dist/index.js.map +1 -1
- package/dist/ol.d.ts +15 -2
- package/dist/src/category/category.d.ts +5 -4
- package/dist/src/category/category.js +2 -1
- package/dist/src/category/category.js.map +1 -1
- package/dist/src/category/categoryCollection.js.map +1 -1
- package/dist/src/cesium/cesiumVcsCameraPrimitive.d.ts +1 -0
- package/dist/src/cesium/cesiumVcsCameraPrimitive.js +4 -0
- package/dist/src/cesium/cesiumVcsCameraPrimitive.js.map +1 -1
- package/dist/src/classRegistry.d.ts +4 -3
- package/dist/src/classRegistry.js +2 -0
- package/dist/src/classRegistry.js.map +1 -1
- package/dist/src/featureProvider/abstractFeatureProvider.js.map +1 -1
- package/dist/src/featureProvider/wmsFeatureProvider.js.map +1 -1
- package/dist/src/interaction/abstractInteraction.js.map +1 -1
- package/dist/src/interaction/coordinateAtPixel.js.map +1 -1
- package/dist/src/interaction/eventHandler.js.map +1 -1
- package/dist/src/interaction/featureAtPixelInteraction.d.ts +4 -12
- package/dist/src/interaction/featureAtPixelInteraction.js +5 -21
- package/dist/src/interaction/featureAtPixelInteraction.js.map +1 -1
- package/dist/src/interaction/featureProviderInteraction.js.map +1 -1
- package/dist/src/interaction/interactionChain.js.map +1 -1
- package/dist/src/interaction/interactionType.js +4 -4
- package/dist/src/interaction/interactionType.js.map +1 -1
- package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/clusterContext.d.ts +12 -16
- package/dist/src/layer/cesium/clusterContext.js +75 -43
- package/dist/src/layer/cesium/clusterContext.js.map +1 -1
- package/dist/src/layer/cesium/dataSourceCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/rasterLayerCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/resourceHelper.js.map +1 -1
- package/dist/src/layer/cesium/singleImageCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/terrainCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/tmsCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vectorCesiumImpl.d.ts +2 -3
- package/dist/src/layer/cesium/vectorCesiumImpl.js +16 -10
- package/dist/src/layer/cesium/vectorCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vectorContext.d.ts +11 -54
- package/dist/src/layer/cesium/vectorContext.js +154 -171
- package/dist/src/layer/cesium/vectorContext.js.map +1 -1
- package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vectorTileImageryProvider.js.map +1 -1
- package/dist/src/layer/cesium/wmsCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesiumTilesetLayer.js.map +1 -1
- package/dist/src/layer/czmlLayer.js.map +1 -1
- package/dist/src/layer/dataSourceLayer.js.map +1 -1
- package/dist/src/layer/featureLayer.js.map +1 -1
- package/dist/src/layer/featureStoreFeatureVisibility.js.map +1 -1
- package/dist/src/layer/featureStoreLayer.js.map +1 -1
- package/dist/src/layer/featureStoreLayerChanges.js.map +1 -1
- package/dist/src/layer/featureVisibility.js +4 -5
- package/dist/src/layer/featureVisibility.js.map +1 -1
- package/dist/src/layer/geojsonHelpers.d.ts +1 -1
- package/dist/src/layer/geojsonHelpers.js +5 -10
- package/dist/src/layer/geojsonHelpers.js.map +1 -1
- package/dist/src/layer/geojsonLayer.js.map +1 -1
- package/dist/src/layer/globalHider.js.map +1 -1
- package/dist/src/layer/layer.js.map +1 -1
- package/dist/src/layer/layerImplementation.js.map +1 -1
- package/dist/src/layer/oblique/layerObliqueImpl.js.map +1 -1
- package/dist/src/layer/oblique/obliqueHelpers.js +9 -9
- package/dist/src/layer/oblique/obliqueHelpers.js.map +1 -1
- package/dist/src/layer/oblique/vectorObliqueImpl.d.ts +3 -3
- package/dist/src/layer/oblique/vectorObliqueImpl.js.map +1 -1
- package/dist/src/layer/openStreetMapLayer.js.map +1 -1
- package/dist/src/layer/openlayers/layerOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/rasterLayerOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/singleImageOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/tmsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/vectorOpenlayersImpl.d.ts +2 -2
- package/dist/src/layer/openlayers/vectorOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.d.ts +1 -7
- package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.js +18 -47
- package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/wmsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/wmtsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/pointCloudLayer.js.map +1 -1
- package/dist/src/layer/rasterLayer.js +1 -1
- package/dist/src/layer/rasterLayer.js.map +1 -1
- package/dist/src/layer/singleImageLayer.js.map +1 -1
- package/dist/src/layer/terrainHelpers.js.map +1 -1
- package/dist/src/layer/terrainLayer.js.map +1 -1
- package/dist/src/layer/tileLoadedHelper.js.map +1 -1
- package/dist/src/layer/tileProvider/mvtTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/tileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/urlTemplateTileProvider.js.map +1 -1
- package/dist/src/layer/tmsLayer.js.map +1 -1
- package/dist/src/layer/vectorHelpers.js.map +1 -1
- package/dist/src/layer/vectorLayer.d.ts +0 -37
- package/dist/src/layer/vectorLayer.js +1 -3
- package/dist/src/layer/vectorLayer.js.map +1 -1
- package/dist/src/layer/vectorProperties.d.ts +10 -5
- package/dist/src/layer/vectorProperties.js +59 -10
- package/dist/src/layer/vectorProperties.js.map +1 -1
- package/dist/src/layer/vectorTileLayer.js.map +1 -1
- package/dist/src/layer/wfsLayer.js.map +1 -1
- package/dist/src/layer/wmsHelpers.js.map +1 -1
- package/dist/src/layer/wmsLayer.js.map +1 -1
- package/dist/src/layer/wmtsLayer.js.map +1 -1
- package/dist/src/map/baseOLMap.js +1 -1
- package/dist/src/map/baseOLMap.js.map +1 -1
- package/dist/src/map/cameraLimiter.js +1 -1
- package/dist/src/map/cameraLimiter.js.map +1 -1
- package/dist/src/map/cesiumMap.js.map +1 -1
- package/dist/src/map/obliqueMap.js.map +1 -1
- package/dist/src/map/openlayersMap.js +1 -1
- package/dist/src/map/openlayersMap.js.map +1 -1
- package/dist/src/map/vcsMap.js.map +1 -1
- package/dist/src/oblique/helpers.js +5 -5
- package/dist/src/oblique/helpers.js.map +1 -1
- package/dist/src/oblique/obliqueCollection.js.map +1 -1
- package/dist/src/oblique/obliqueDataSet.js +5 -5
- package/dist/src/oblique/obliqueDataSet.js.map +1 -1
- package/dist/src/oblique/obliqueImage.js.map +1 -1
- package/dist/src/oblique/obliqueImageMeta.js.map +1 -1
- package/dist/src/oblique/obliqueProvider.js.map +1 -1
- package/dist/src/oblique/obliqueView.js.map +1 -1
- package/dist/src/oblique/obliqueViewDirection.js +1 -1
- package/dist/src/oblique/obliqueViewDirection.js.map +1 -1
- package/dist/src/oblique/parseImageJson.js.map +1 -1
- package/dist/src/ol/feature.js.map +1 -1
- package/dist/src/ol/geom/geometryCollection.js +80 -6
- package/dist/src/ol/geom/geometryCollection.js.map +1 -1
- package/dist/src/ol/render/canvas/canvasTileRenderer.js.map +1 -1
- package/dist/src/ol/source/ClusterEnhancedVectorSource.js.map +1 -1
- package/dist/src/ol/source/VcsCluster.js.map +1 -1
- package/dist/src/overrideClassRegistry.d.ts +2 -2
- package/dist/src/overrideClassRegistry.js +5 -3
- package/dist/src/overrideClassRegistry.js.map +1 -1
- package/dist/src/style/arcStyle.js +1 -0
- package/dist/src/style/arcStyle.js.map +1 -1
- package/dist/src/style/arrowStyle.js +6 -6
- package/dist/src/style/arrowStyle.js.map +1 -1
- package/dist/src/style/declarativeStyleItem.js.map +1 -1
- package/dist/src/style/shapesCategory.js.map +1 -1
- package/dist/src/style/styleFactory.js.map +1 -1
- package/dist/src/style/styleHelpers.js +4 -2
- package/dist/src/style/styleHelpers.js.map +1 -1
- package/dist/src/style/styleItem.js.map +1 -1
- package/dist/src/style/vectorStyleItem.js +9 -9
- package/dist/src/style/vectorStyleItem.js.map +1 -1
- package/dist/src/style/writeStyle.js.map +1 -1
- package/dist/src/util/clipping/clippingObject.js.map +1 -1
- package/dist/src/util/clipping/clippingObjectManager.js.map +1 -1
- package/dist/src/util/clipping/clippingPlaneHelper.js +2 -2
- package/dist/src/util/clipping/clippingPlaneHelper.js.map +1 -1
- package/dist/src/util/collection.js.map +1 -1
- package/dist/src/util/displayQuality/displayQuality.d.ts +1 -0
- package/dist/src/util/displayQuality/displayQuality.js +13 -2
- package/dist/src/util/displayQuality/displayQuality.js.map +1 -1
- package/dist/src/util/editor/createFeatureSession.d.ts +10 -2
- package/dist/src/util/editor/createFeatureSession.js +75 -9
- package/dist/src/util/editor/createFeatureSession.js.map +1 -1
- package/dist/src/util/editor/editFeaturesSession.d.ts +10 -4
- package/dist/src/util/editor/editFeaturesSession.js +74 -37
- package/dist/src/util/editor/editFeaturesSession.js.map +1 -1
- package/dist/src/util/editor/editGeometrySession.d.ts +7 -2
- package/dist/src/util/editor/editGeometrySession.js +109 -66
- package/dist/src/util/editor/editGeometrySession.js.map +1 -1
- package/dist/src/util/editor/editorHelpers.d.ts +13 -6
- package/dist/src/util/editor/editorHelpers.js +53 -23
- package/dist/src/util/editor/editorHelpers.js.map +1 -1
- package/dist/src/util/editor/editorSessionHelpers.d.ts +6 -6
- package/dist/src/util/editor/editorSessionHelpers.js +8 -18
- package/dist/src/util/editor/editorSessionHelpers.js.map +1 -1
- package/dist/src/util/editor/editorSymbols.d.ts +1 -1
- package/dist/src/util/editor/editorSymbols.js +1 -1
- package/dist/src/util/editor/editorSymbols.js.map +1 -1
- package/dist/src/util/editor/interactions/createBBoxInteraction.d.ts +1 -0
- package/dist/src/util/editor/interactions/createBBoxInteraction.js +20 -16
- package/dist/src/util/editor/interactions/createBBoxInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/createCircleInteraction.js +1 -1
- package/dist/src/util/editor/interactions/createCircleInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/createLineStringInteraction.js +3 -3
- package/dist/src/util/editor/interactions/createLineStringInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/createPointInteraction.js +1 -1
- package/dist/src/util/editor/interactions/createPointInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/createPolygonInteraction.d.ts +4 -0
- package/dist/src/util/editor/interactions/createPolygonInteraction.js +9 -3
- package/dist/src/util/editor/interactions/createPolygonInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/creationSnapping.d.ts +26 -0
- package/dist/src/util/editor/interactions/creationSnapping.js +139 -0
- package/dist/src/util/editor/interactions/creationSnapping.js.map +1 -0
- package/dist/src/util/editor/interactions/editFeaturesMouseOverInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.js +11 -9
- package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/ensureHandlerSelectionInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/insertVertexInteraction.d.ts +3 -1
- package/dist/src/util/editor/interactions/insertVertexInteraction.js +14 -6
- package/dist/src/util/editor/interactions/insertVertexInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/layerSnapping.d.ts +19 -0
- package/dist/src/util/editor/interactions/layerSnapping.js +87 -0
- package/dist/src/util/editor/interactions/layerSnapping.js.map +1 -0
- package/dist/src/util/editor/interactions/mapInteractionController.js.map +1 -1
- package/dist/src/util/editor/interactions/removeVertexInteraction.d.ts +1 -1
- package/dist/src/util/editor/interactions/removeVertexInteraction.js +2 -2
- package/dist/src/util/editor/interactions/removeVertexInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/segmentLengthInteraction.d.ts +16 -0
- package/dist/src/util/editor/interactions/segmentLengthInteraction.js +167 -0
- package/dist/src/util/editor/interactions/segmentLengthInteraction.js.map +1 -0
- package/dist/src/util/editor/interactions/selectFeatureMouseOverInteraction.js +1 -1
- package/dist/src/util/editor/interactions/selectFeatureMouseOverInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/selectMultiFeatureInteraction.d.ts +1 -1
- package/dist/src/util/editor/interactions/selectMultiFeatureInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/selectSingleFeatureInteraction.d.ts +1 -1
- package/dist/src/util/editor/interactions/selectSingleFeatureInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/translateVertexInteraction.js +4 -8
- package/dist/src/util/editor/interactions/translateVertexInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/translationSnapping.d.ts +25 -0
- package/dist/src/util/editor/interactions/translationSnapping.js +180 -0
- package/dist/src/util/editor/interactions/translationSnapping.js.map +1 -0
- package/dist/src/util/editor/selectFeaturesSession.js.map +1 -1
- package/dist/src/util/editor/snappingHelpers.d.ts +44 -0
- package/dist/src/util/editor/snappingHelpers.js +329 -0
- package/dist/src/util/editor/snappingHelpers.js.map +1 -0
- package/dist/src/util/editor/transformation/create2DHandlers.js +26 -26
- package/dist/src/util/editor/transformation/create2DHandlers.js.map +1 -1
- package/dist/src/util/editor/transformation/create3DHandlers.js +65 -14
- package/dist/src/util/editor/transformation/create3DHandlers.js.map +1 -1
- package/dist/src/util/editor/transformation/extrudeInteraction.js.map +1 -1
- package/dist/src/util/editor/transformation/rotateInteraction.js.map +1 -1
- package/dist/src/util/editor/transformation/scaleInteraction.js +27 -5
- package/dist/src/util/editor/transformation/scaleInteraction.js.map +1 -1
- package/dist/src/util/editor/transformation/transformationHandler.js +56 -38
- package/dist/src/util/editor/transformation/transformationHandler.js.map +1 -1
- package/dist/src/util/editor/transformation/transformationTypes.d.ts +2 -0
- package/dist/src/util/editor/transformation/transformationTypes.js +6 -2
- package/dist/src/util/editor/transformation/transformationTypes.js.map +1 -1
- package/dist/src/util/editor/transformation/translateInteraction.js.map +1 -1
- package/dist/src/util/editor/validateGeoemetry.js.map +1 -1
- package/dist/src/util/exclusiveManager.js.map +1 -1
- package/dist/src/util/extent.js.map +1 -1
- package/dist/src/util/featureconverter/arcToCesium.d.ts +5 -19
- package/dist/src/util/featureconverter/arcToCesium.js +15 -42
- package/dist/src/util/featureconverter/arcToCesium.js.map +1 -1
- package/dist/src/util/featureconverter/circleToCesium.d.ts +2 -27
- package/dist/src/util/featureconverter/circleToCesium.js +85 -64
- package/dist/src/util/featureconverter/circleToCesium.js.map +1 -1
- package/dist/src/util/featureconverter/clampedPrimitive.d.ts +2 -0
- package/dist/src/util/featureconverter/clampedPrimitive.js +29 -0
- package/dist/src/util/featureconverter/clampedPrimitive.js.map +1 -0
- package/dist/src/util/featureconverter/convert.d.ts +30 -7
- package/dist/src/util/featureconverter/convert.js +221 -44
- package/dist/src/util/featureconverter/convert.js.map +1 -1
- package/dist/src/util/featureconverter/extent3D.d.ts +4 -3
- package/dist/src/util/featureconverter/extent3D.js +4 -3
- package/dist/src/util/featureconverter/extent3D.js.map +1 -1
- package/dist/src/util/featureconverter/lineStringToCesium.d.ts +12 -27
- package/dist/src/util/featureconverter/lineStringToCesium.js +85 -107
- package/dist/src/util/featureconverter/lineStringToCesium.js.map +1 -1
- package/dist/src/util/featureconverter/pointHelpers.d.ts +8 -11
- package/dist/src/util/featureconverter/pointHelpers.js +141 -121
- package/dist/src/util/featureconverter/pointHelpers.js.map +1 -1
- package/dist/src/util/featureconverter/pointToCesium.d.ts +14 -17
- package/dist/src/util/featureconverter/pointToCesium.js +50 -98
- package/dist/src/util/featureconverter/pointToCesium.js.map +1 -1
- package/dist/src/util/featureconverter/polygonToCesium.d.ts +2 -26
- package/dist/src/util/featureconverter/polygonToCesium.js +63 -73
- package/dist/src/util/featureconverter/polygonToCesium.js.map +1 -1
- package/dist/src/util/featureconverter/storeyHelpers.d.ts +17 -0
- package/dist/src/util/featureconverter/storeyHelpers.js +78 -0
- package/dist/src/util/featureconverter/storeyHelpers.js.map +1 -0
- package/dist/src/util/featureconverter/vectorGeometryFactory.d.ts +54 -0
- package/dist/src/util/featureconverter/vectorGeometryFactory.js +278 -0
- package/dist/src/util/featureconverter/vectorGeometryFactory.js.map +1 -0
- package/dist/src/util/featureconverter/vectorHeightInfo.d.ts +86 -0
- package/dist/src/util/featureconverter/vectorHeightInfo.js +240 -0
- package/dist/src/util/featureconverter/vectorHeightInfo.js.map +1 -0
- package/dist/src/util/fetch.js.map +1 -1
- package/dist/src/util/flight/flightAnchor.js.map +1 -1
- package/dist/src/util/flight/flightCollection.js.map +1 -1
- package/dist/src/util/flight/flightHelpers.js.map +1 -1
- package/dist/src/util/flight/flightInstance.js.map +1 -1
- package/dist/src/util/flight/flightPlayer.d.ts +11 -6
- package/dist/src/util/flight/flightPlayer.js +52 -16
- package/dist/src/util/flight/flightPlayer.js.map +1 -1
- package/dist/src/util/flight/flightVisualizer.js.map +1 -1
- package/dist/src/util/geometryHelpers.d.ts +34 -2
- package/dist/src/util/geometryHelpers.js +172 -4
- package/dist/src/util/geometryHelpers.js.map +1 -1
- package/dist/src/util/hiddenObjects.js.map +1 -1
- package/dist/src/util/indexedCollection.js.map +1 -1
- package/dist/src/util/layerCollection.js.map +1 -1
- package/dist/src/util/locale.js.map +1 -1
- package/dist/src/util/mapCollection.js.map +1 -1
- package/dist/src/util/math.d.ts +18 -2
- package/dist/src/util/math.js +55 -12
- package/dist/src/util/math.js.map +1 -1
- package/dist/src/util/overrideCollection.d.ts +7 -7
- package/dist/src/util/overrideCollection.js +10 -7
- package/dist/src/util/overrideCollection.js.map +1 -1
- package/dist/src/util/projection.js.map +1 -1
- package/dist/src/util/urlHelpers.js.map +1 -1
- package/dist/src/util/viewpoint.js.map +1 -1
- package/dist/src/vcsApp.d.ts +3 -3
- package/dist/src/vcsApp.js +1 -0
- package/dist/src/vcsApp.js.map +1 -1
- package/dist/src/vcsEvent.js.map +1 -1
- package/dist/src/vcsModule.js.map +1 -1
- package/dist/src/vcsModuleHelpers.d.ts +1 -0
- package/dist/src/vcsModuleHelpers.js +16 -2
- package/dist/src/vcsModuleHelpers.js.map +1 -1
- package/dist/src/vcsObject.js.map +1 -1
- package/dist/tests/unit/helpers/cesiumHelpers.d.ts +11 -11
- package/dist/tests/unit/helpers/cesiumHelpers.js +6 -1
- package/dist/tests/unit/helpers/cesiumHelpers.js.map +1 -1
- package/dist/tests/unit/helpers/helpers.d.ts +2 -9
- package/dist/tests/unit/helpers/helpers.js +4 -10
- package/dist/tests/unit/helpers/helpers.js.map +1 -1
- package/dist/tests/unit/helpers/importJSON.js.map +1 -1
- package/dist/tests/unit/helpers/obliqueHelpers.js.map +1 -1
- package/index.ts +84 -36
- package/package.json +21 -21
- package/src/category/category.ts +11 -9
- package/src/category/categoryCollection.ts +1 -1
- package/src/cesium/cesium.d.ts +12 -0
- package/src/cesium/cesiumVcsCameraPrimitive.ts +5 -0
- package/src/classRegistry.ts +7 -4
- package/src/featureProvider/wmsFeatureProvider.ts +1 -1
- package/src/global.d.ts +6 -1
- package/src/interaction/featureAtPixelInteraction.ts +7 -26
- package/src/layer/cesium/clusterContext.ts +97 -93
- package/src/layer/cesium/vectorCesiumImpl.ts +17 -11
- package/src/layer/cesium/vectorContext.ts +229 -348
- package/src/layer/featureVisibility.ts +3 -6
- package/src/layer/geojsonHelpers.ts +9 -12
- package/src/layer/oblique/obliqueHelpers.ts +9 -9
- package/src/layer/oblique/vectorObliqueImpl.ts +2 -2
- package/src/layer/openlayers/vectorOpenlayersImpl.ts +2 -2
- package/src/layer/openlayers/vectorTileOpenlayersImpl.ts +23 -53
- package/src/layer/tileLoadedHelper.ts +1 -3
- package/src/layer/tileProvider/mvtTileProvider.ts +2 -2
- package/src/layer/vectorLayer.ts +1 -74
- package/src/layer/vectorProperties.ts +80 -16
- package/src/map/baseOLMap.ts +1 -1
- package/src/oblique/helpers.ts +11 -5
- package/src/oblique/obliqueDataSet.ts +4 -4
- package/src/ol/geom/geometryCollection.js +96 -6
- package/src/ol/ol.d.ts +15 -2
- package/src/overrideClassRegistry.ts +13 -7
- package/src/style/arcStyle.ts +1 -0
- package/src/style/arrowStyle.ts +7 -7
- package/src/style/declarativeStyleItem.ts +2 -2
- package/src/style/styleHelpers.ts +15 -13
- package/src/style/vectorStyleItem.ts +14 -14
- package/src/util/clipping/clippingObject.ts +1 -3
- package/src/util/clipping/clippingPlaneHelper.ts +3 -4
- package/src/util/displayQuality/displayQuality.ts +13 -1
- package/src/util/editor/createFeatureSession.ts +107 -13
- package/src/util/editor/editFeaturesSession.ts +105 -39
- package/src/util/editor/editGeometrySession.ts +157 -83
- package/src/util/editor/editorHelpers.ts +85 -33
- package/src/util/editor/editorSessionHelpers.ts +13 -20
- package/src/util/editor/editorSymbols.ts +1 -1
- package/src/util/editor/interactions/createBBoxInteraction.ts +25 -16
- package/src/util/editor/interactions/createCircleInteraction.ts +1 -1
- package/src/util/editor/interactions/createLineStringInteraction.ts +9 -3
- package/src/util/editor/interactions/createPointInteraction.ts +1 -1
- package/src/util/editor/interactions/createPolygonInteraction.ts +16 -3
- package/src/util/editor/interactions/creationSnapping.ts +226 -0
- package/src/util/editor/interactions/editGeometryMouseOverInteraction.ts +7 -6
- package/src/util/editor/interactions/insertVertexInteraction.ts +27 -7
- package/src/util/editor/interactions/layerSnapping.ts +136 -0
- package/src/util/editor/interactions/removeVertexInteraction.ts +3 -4
- package/src/util/editor/interactions/segmentLengthInteraction.ts +227 -0
- package/src/util/editor/interactions/translateVertexInteraction.ts +11 -12
- package/src/util/editor/interactions/translationSnapping.ts +302 -0
- package/src/util/editor/snappingHelpers.ts +490 -0
- package/src/util/editor/transformation/create2DHandlers.ts +38 -26
- package/src/util/editor/transformation/create3DHandlers.ts +84 -22
- package/src/util/editor/transformation/scaleInteraction.ts +28 -5
- package/src/util/editor/transformation/transformationHandler.ts +72 -41
- package/src/util/editor/transformation/transformationTypes.ts +5 -0
- package/src/util/featureconverter/arcToCesium.ts +25 -95
- package/src/util/featureconverter/circleToCesium.ts +128 -114
- package/src/util/featureconverter/clampedPrimitive.ts +70 -0
- package/src/util/featureconverter/convert.ts +447 -113
- package/src/util/featureconverter/extent3D.ts +13 -6
- package/src/util/featureconverter/lineStringToCesium.ts +134 -181
- package/src/util/featureconverter/pointHelpers.ts +285 -219
- package/src/util/featureconverter/pointToCesium.ts +117 -177
- package/src/util/featureconverter/polygonToCesium.ts +99 -118
- package/src/util/featureconverter/storeyHelpers.ts +104 -0
- package/src/util/featureconverter/vectorGeometryFactory.ts +601 -0
- package/src/util/featureconverter/vectorHeightInfo.ts +392 -0
- package/src/util/flight/flightPlayer.ts +64 -22
- package/src/util/geometryHelpers.ts +239 -9
- package/src/util/hiddenObjects.ts +4 -4
- package/src/util/math.ts +87 -12
- package/src/util/overrideCollection.ts +33 -21
- package/src/vcsApp.ts +11 -4
- package/src/vcsModuleHelpers.ts +25 -2
- package/dist/src/util/featureconverter/featureconverterHelper.d.ts +0 -35
- package/dist/src/util/featureconverter/featureconverterHelper.js +0 -403
- package/dist/src/util/featureconverter/featureconverterHelper.js.map +0 -1
- package/src/util/featureconverter/featureconverterHelper.ts +0 -668
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HeightReference } from '@vcmap-cesium/engine';
|
|
2
|
+
import { RelativeHeightReference, VectorHeightInfo } from './vectorHeightInfo.js';
|
|
3
|
+
/**
|
|
4
|
+
* @param extrudedHeight should be a number > 0
|
|
5
|
+
* @param storeyHeights
|
|
6
|
+
* @param storeyNumber
|
|
7
|
+
*/
|
|
8
|
+
export declare function getStoreyHeights(extrudedHeight: number, storeyHeights: number[], storeyNumber: number): number[];
|
|
9
|
+
export declare function validateStoreys(storeys: number, storeyHeights: number[]): void;
|
|
10
|
+
export type StoreyOptions = {
|
|
11
|
+
currentHeight: number;
|
|
12
|
+
extrudedHeight: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function getStoreyOptions(heightInfo: VectorHeightInfo<RelativeHeightReference | HeightReference.NONE>, geometryHeight: number): {
|
|
15
|
+
storeys: StoreyOptions[];
|
|
16
|
+
skirtLevel: number;
|
|
17
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param extrudedHeight should be a number > 0
|
|
3
|
+
* @param storeyHeights
|
|
4
|
+
* @param storeyNumber
|
|
5
|
+
*/
|
|
6
|
+
export function getStoreyHeights(extrudedHeight, storeyHeights, storeyNumber) {
|
|
7
|
+
const positiveExtrudedHeight = Math.abs(extrudedHeight);
|
|
8
|
+
const fittedStoreyHeights = [];
|
|
9
|
+
if (storeyHeights.length) {
|
|
10
|
+
let height = 0;
|
|
11
|
+
for (let i = 0; i < storeyHeights.length; i++) {
|
|
12
|
+
height += storeyHeights[i];
|
|
13
|
+
if (height < positiveExtrudedHeight) {
|
|
14
|
+
fittedStoreyHeights.push(storeyHeights[i]);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
fittedStoreyHeights.push(storeyHeights[i] - (height - positiveExtrudedHeight));
|
|
18
|
+
return fittedStoreyHeights;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const lastStoreyHeight = storeyHeights[storeyHeights.length - 1];
|
|
22
|
+
while (height < positiveExtrudedHeight) {
|
|
23
|
+
height += lastStoreyHeight;
|
|
24
|
+
if (height < positiveExtrudedHeight) {
|
|
25
|
+
fittedStoreyHeights.push(lastStoreyHeight);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
fittedStoreyHeights.push(lastStoreyHeight - (height - positiveExtrudedHeight));
|
|
29
|
+
return fittedStoreyHeights;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else if (storeyNumber) {
|
|
34
|
+
return new Array(storeyNumber).fill(positiveExtrudedHeight / storeyNumber);
|
|
35
|
+
}
|
|
36
|
+
// case no predefined storeyHeights
|
|
37
|
+
return [positiveExtrudedHeight];
|
|
38
|
+
}
|
|
39
|
+
export function validateStoreys(storeys, storeyHeights) {
|
|
40
|
+
if (storeys && storeyHeights.length) {
|
|
41
|
+
const missingStoreyHeights = storeys - storeyHeights.length;
|
|
42
|
+
if (missingStoreyHeights > 0) {
|
|
43
|
+
storeyHeights.push(...new Array(missingStoreyHeights).fill(storeyHeights[storeyHeights.length - 1]));
|
|
44
|
+
}
|
|
45
|
+
else if (missingStoreyHeights < 0) {
|
|
46
|
+
storeyHeights.splice(storeyHeights.length + missingStoreyHeights);
|
|
47
|
+
}
|
|
48
|
+
if (storeys > 100) {
|
|
49
|
+
storeyHeights.splice(100);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
storeyHeights.splice(0);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export function getStoreyOptions(heightInfo, geometryHeight) {
|
|
57
|
+
const options = [];
|
|
58
|
+
let currentHeight = geometryHeight;
|
|
59
|
+
heightInfo.storeyHeightsAboveGround.forEach((storeyHeight) => {
|
|
60
|
+
const extrudedHeight = currentHeight + storeyHeight;
|
|
61
|
+
options.push({
|
|
62
|
+
currentHeight,
|
|
63
|
+
extrudedHeight,
|
|
64
|
+
});
|
|
65
|
+
currentHeight = extrudedHeight;
|
|
66
|
+
});
|
|
67
|
+
currentHeight = geometryHeight;
|
|
68
|
+
heightInfo.storeyHeightsBelowGround.forEach((storeyHeight) => {
|
|
69
|
+
const extrudedHeight = currentHeight - storeyHeight;
|
|
70
|
+
options.push({
|
|
71
|
+
currentHeight,
|
|
72
|
+
extrudedHeight,
|
|
73
|
+
});
|
|
74
|
+
currentHeight = extrudedHeight;
|
|
75
|
+
});
|
|
76
|
+
return { storeys: options, skirtLevel: currentHeight };
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=storeyHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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;QACH,aAAa,GAAG,cAAc,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,aAAa,GAAG,cAAc,CAAC;IAC/B,UAAU,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;QAC3D,MAAM,cAAc,GAAG,aAAa,GAAG,YAAY,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC;YACX,aAAa;YACb,cAAc;SACf,CAAC,CAAC;QACH,aAAa,GAAG,cAAc,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Feature } from 'ol';
|
|
2
|
+
import type { Fill, Style } from 'ol/style.js';
|
|
3
|
+
import { Circle, LineString, Polygon } from 'ol/geom.js';
|
|
4
|
+
import { type CircleGeometry, type CircleOutlineGeometry, type GroundPolylineGeometry, MaterialAppearance, type PolygonGeometry, type PolygonOutlineGeometry, type PolylineGeometry, type Scene, type WallGeometry, type WallOutlineGeometry } from '@vcmap-cesium/engine';
|
|
5
|
+
import type VectorProperties from '../../layer/vectorProperties.js';
|
|
6
|
+
import type { ConvertedItem } from './convert.js';
|
|
7
|
+
import { VectorHeightInfo } from './vectorHeightInfo.js';
|
|
8
|
+
export type PolygonGeometryOptions = ConstructorParameters<typeof PolygonGeometry>[0];
|
|
9
|
+
export type PolylineGeometryOptions = ConstructorParameters<typeof PolylineGeometry>[0];
|
|
10
|
+
export type CircleGeometryOptions = ConstructorParameters<typeof CircleGeometry>[0];
|
|
11
|
+
export type GeometryFactoryType = 'polygon' | 'lineString' | 'circle' | 'arc';
|
|
12
|
+
type GeometryOptionsForFactoryType<T extends GeometryFactoryType> = T extends 'polygon' ? PolygonGeometryOptions : T extends 'lineString' | 'arc' ? PolylineGeometryOptions : T extends 'circle' ? CircleGeometryOptions : never;
|
|
13
|
+
export type GeometryForFactoryType<T extends GeometryFactoryType> = T extends 'polygon' ? Polygon : T extends 'lineString' | 'arc' ? LineString : T extends 'circle' ? Circle : never;
|
|
14
|
+
export type VectorGeometryFactory<T extends GeometryFactoryType = GeometryFactoryType> = {
|
|
15
|
+
type: T;
|
|
16
|
+
getGeometryOptions(geom: GeometryForFactoryType<T>, heightInfo: VectorHeightInfo): GeometryOptionsForFactoryType<T>;
|
|
17
|
+
createSolidGeometries(geometryOptions: GeometryOptionsForFactoryType<T>, heightInfo: VectorHeightInfo, height: number, perPositionHeight: boolean, extrudedHeight?: number): CesiumGeometryOption<'solid'>[];
|
|
18
|
+
createOutlineGeometries(geometryOptions: GeometryOptionsForFactoryType<T>, heightInfo: VectorHeightInfo, height: number, perPositionHeight: boolean, extrudedHeight?: number): CesiumGeometryOption<'outline'>[];
|
|
19
|
+
createFillGeometries(geometryOptions: GeometryOptionsForFactoryType<T>, heightInfo: VectorHeightInfo, height: number, perPositionHeight: boolean): CesiumGeometryOption<'fill'>[];
|
|
20
|
+
createGroundLineGeometries(geometryOptions: GeometryOptionsForFactoryType<T>, heightInfo: VectorHeightInfo, style: Style): CesiumGeometryOption<'groundLine'>[];
|
|
21
|
+
createLineGeometries(geometryOptions: GeometryOptionsForFactoryType<T>, heightInfo: VectorHeightInfo, style: Style): CesiumGeometryOption<'line'>[];
|
|
22
|
+
validateGeometry(geom: GeometryForFactoryType<T>): boolean;
|
|
23
|
+
};
|
|
24
|
+
export type CesiumGeometryOptionType = 'solid' | 'fill' | 'outline' | 'line' | 'groundLine';
|
|
25
|
+
export type CesiumGeometryOption<T extends CesiumGeometryOptionType = CesiumGeometryOptionType> = T extends 'solid' ? {
|
|
26
|
+
type: T;
|
|
27
|
+
geometry: PolygonGeometry | WallGeometry | CircleGeometry;
|
|
28
|
+
heightInfo: VectorHeightInfo;
|
|
29
|
+
} : T extends 'fill' ? {
|
|
30
|
+
type: T;
|
|
31
|
+
geometry: PolygonGeometry | CircleGeometry;
|
|
32
|
+
heightInfo: VectorHeightInfo;
|
|
33
|
+
} : T extends 'outline' ? {
|
|
34
|
+
type: T;
|
|
35
|
+
geometry: PolygonOutlineGeometry | WallOutlineGeometry | CircleOutlineGeometry;
|
|
36
|
+
heightInfo: VectorHeightInfo;
|
|
37
|
+
} : T extends 'line' ? {
|
|
38
|
+
type: T;
|
|
39
|
+
geometry: PolylineGeometry;
|
|
40
|
+
heightInfo: VectorHeightInfo;
|
|
41
|
+
} : T extends 'groundLine' ? {
|
|
42
|
+
type: T;
|
|
43
|
+
geometry: GroundPolylineGeometry;
|
|
44
|
+
heightInfo: VectorHeightInfo;
|
|
45
|
+
} : never;
|
|
46
|
+
export declare function getMaterialAppearance(scene: Scene, fill: Fill, feature: Feature): MaterialAppearance;
|
|
47
|
+
export declare function createClassificationPrimitiveItem(feature: Feature, style: Style, vectorProperties: VectorProperties, geometries: CesiumGeometryOption<'fill' | 'solid'>[]): ConvertedItem<'primitive'>;
|
|
48
|
+
export declare function createSolidPrimitiveItem(feature: Feature, style: Style, vectorProperties: VectorProperties, scene: Scene, geometries: CesiumGeometryOption<'fill' | 'solid'>[]): ConvertedItem<'primitive'>;
|
|
49
|
+
export declare function createGroundPrimitiveItem(feature: Feature, style: Style, vectorProperties: VectorProperties, scene: Scene, geometries: CesiumGeometryOption<'fill' | 'solid'>[]): ConvertedItem<'primitive'>;
|
|
50
|
+
export declare function createOutlinePrimitiveItem(feature: Feature, style: Style, vectorProperties: VectorProperties, geometries: CesiumGeometryOption<'outline'>[]): ConvertedItem<'primitive'>;
|
|
51
|
+
export declare function createLinePrimitiveItem(feature: Feature, style: Style, vectorProperties: VectorProperties, geometries: CesiumGeometryOption<'line'>[]): ConvertedItem<'primitive'>;
|
|
52
|
+
export declare function createGroundLinePrimitiveItem(feature: Feature, style: Style, vectorProperties: VectorProperties, geometries: CesiumGeometryOption<'groundLine'>[]): ConvertedItem<'primitive'>;
|
|
53
|
+
export declare function getCesiumGeometriesOptions<T extends GeometryFactoryType>(style: Style, geometry: GeometryForFactoryType<T>, geometryFactory: VectorGeometryFactory<T>, heightInfo: VectorHeightInfo): CesiumGeometryOption[];
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { getBottomLeft } from 'ol/extent.js';
|
|
2
|
+
import { Cartesian3, ClassificationPrimitive, ClassificationType, Color, ColorGeometryInstanceAttribute, GeometryInstance, GroundPolylinePrimitive, GroundPrimitive, HeightReference, Material, MaterialAppearance, PerInstanceColorAppearance, PolylineMaterialAppearance, Primitive, SceneTransforms, ShadowMode, } from '@vcmap-cesium/engine';
|
|
3
|
+
import { getCesiumColor } from '../../style/styleHelpers.js';
|
|
4
|
+
import { createSync } from '../../layer/vectorSymbols.js';
|
|
5
|
+
import { getGeometryHeight, isClampedHeightReference, } from './vectorHeightInfo.js';
|
|
6
|
+
import { getStoreyOptions } from './storeyHelpers.js';
|
|
7
|
+
export function getMaterialAppearance(scene, fill, feature) {
|
|
8
|
+
const options = {
|
|
9
|
+
flat: true,
|
|
10
|
+
renderState: {
|
|
11
|
+
depthTest: {
|
|
12
|
+
enabled: true,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
const fillColor = fill.getColor();
|
|
17
|
+
if (fillColor instanceof CanvasPattern) {
|
|
18
|
+
const canvas = document.createElement('canvas');
|
|
19
|
+
const ctx = canvas.getContext('2d');
|
|
20
|
+
ctx.fillStyle = fillColor;
|
|
21
|
+
ctx.fillRect(0, 0, 300, 300);
|
|
22
|
+
options.material = Material.fromType('Wallpaper', {
|
|
23
|
+
image: canvas,
|
|
24
|
+
anchor: SceneTransforms.worldToDrawingBufferCoordinates(scene, Cartesian3.fromDegreesArray(getBottomLeft(feature.getGeometry().getExtent()))[0]),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
const color = getCesiumColor(fillColor, [0, 0, 0, 1]);
|
|
29
|
+
options.material = Material.fromType('Color', {
|
|
30
|
+
color,
|
|
31
|
+
});
|
|
32
|
+
options.translucent = color.alpha !== 1;
|
|
33
|
+
}
|
|
34
|
+
return new MaterialAppearance(options);
|
|
35
|
+
}
|
|
36
|
+
function getClassificationForHeightReference(heightReference) {
|
|
37
|
+
if (heightReference === HeightReference.CLAMP_TO_TERRAIN) {
|
|
38
|
+
return ClassificationType.TERRAIN;
|
|
39
|
+
}
|
|
40
|
+
if (heightReference === HeightReference.CLAMP_TO_3D_TILE) {
|
|
41
|
+
return ClassificationType.CESIUM_3D_TILE;
|
|
42
|
+
}
|
|
43
|
+
return ClassificationType.BOTH;
|
|
44
|
+
}
|
|
45
|
+
export function createClassificationPrimitiveItem(feature, style, vectorProperties, geometries) {
|
|
46
|
+
const classificationType = vectorProperties.getClassificationType(feature);
|
|
47
|
+
const allowPicking = vectorProperties.getAllowPicking(feature);
|
|
48
|
+
const color = getCesiumColor(style.getFill().getColor(), // XXX PatternDescriptor
|
|
49
|
+
[0, 0, 0, 1]);
|
|
50
|
+
const geometryInstances = geometries.map(({ geometry }) => new GeometryInstance({
|
|
51
|
+
geometry,
|
|
52
|
+
attributes: {
|
|
53
|
+
color: ColorGeometryInstanceAttribute.fromColor(color),
|
|
54
|
+
},
|
|
55
|
+
}));
|
|
56
|
+
const appearance = new PerInstanceColorAppearance({
|
|
57
|
+
flat: false,
|
|
58
|
+
renderState: {
|
|
59
|
+
depthTest: {
|
|
60
|
+
enabled: true,
|
|
61
|
+
},
|
|
62
|
+
lineWidth: 1,
|
|
63
|
+
},
|
|
64
|
+
translucent: color.alpha !== 1,
|
|
65
|
+
});
|
|
66
|
+
return {
|
|
67
|
+
type: 'primitive',
|
|
68
|
+
item: new ClassificationPrimitive({
|
|
69
|
+
allowPicking,
|
|
70
|
+
asynchronous: !feature[createSync],
|
|
71
|
+
classificationType,
|
|
72
|
+
geometryInstances,
|
|
73
|
+
appearance,
|
|
74
|
+
}),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export function createSolidPrimitiveItem(feature, style, vectorProperties, scene, geometries) {
|
|
78
|
+
const allowPicking = vectorProperties.getAllowPicking(feature);
|
|
79
|
+
const geometryInstances = geometries.map(({ geometry }) => new GeometryInstance({
|
|
80
|
+
geometry,
|
|
81
|
+
}));
|
|
82
|
+
const appearance = getMaterialAppearance(scene, style.getFill(), feature);
|
|
83
|
+
return {
|
|
84
|
+
type: 'primitive',
|
|
85
|
+
item: new Primitive({
|
|
86
|
+
shadows: ShadowMode.ENABLED,
|
|
87
|
+
allowPicking,
|
|
88
|
+
asynchronous: !feature[createSync],
|
|
89
|
+
geometryInstances,
|
|
90
|
+
appearance,
|
|
91
|
+
}),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export function createGroundPrimitiveItem(feature, style, vectorProperties, scene, geometries) {
|
|
95
|
+
const allowPicking = vectorProperties.getAllowPicking(feature);
|
|
96
|
+
const geometryInstances = geometries.map(({ geometry }) => new GeometryInstance({
|
|
97
|
+
geometry,
|
|
98
|
+
}));
|
|
99
|
+
const appearance = getMaterialAppearance(scene, style.getFill(), feature);
|
|
100
|
+
const classificationType = vectorProperties.getClassificationType(feature) ??
|
|
101
|
+
getClassificationForHeightReference(geometries[0].heightInfo.heightReference);
|
|
102
|
+
return {
|
|
103
|
+
type: 'primitive',
|
|
104
|
+
item: new GroundPrimitive({
|
|
105
|
+
classificationType,
|
|
106
|
+
allowPicking,
|
|
107
|
+
asynchronous: !feature[createSync],
|
|
108
|
+
geometryInstances,
|
|
109
|
+
appearance,
|
|
110
|
+
}),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
export function createOutlinePrimitiveItem(feature, style, vectorProperties, geometries) {
|
|
114
|
+
const allowPicking = vectorProperties.getAllowPicking(feature);
|
|
115
|
+
const color = getCesiumColor(style.getStroke().getColor(), [0, 0, 0, 1]);
|
|
116
|
+
const instances = geometries.map(({ geometry }) => new GeometryInstance({
|
|
117
|
+
geometry,
|
|
118
|
+
attributes: {
|
|
119
|
+
color: ColorGeometryInstanceAttribute.fromColor(color),
|
|
120
|
+
},
|
|
121
|
+
}));
|
|
122
|
+
const appearance = new PerInstanceColorAppearance({
|
|
123
|
+
flat: true,
|
|
124
|
+
renderState: {
|
|
125
|
+
depthTest: {
|
|
126
|
+
enabled: true,
|
|
127
|
+
},
|
|
128
|
+
lineWidth: 1,
|
|
129
|
+
},
|
|
130
|
+
translucent: color.alpha !== 1,
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
type: 'primitive',
|
|
134
|
+
item: new Primitive({
|
|
135
|
+
geometryInstances: instances,
|
|
136
|
+
appearance,
|
|
137
|
+
shadows: ShadowMode.ENABLED,
|
|
138
|
+
allowPicking,
|
|
139
|
+
asynchronous: !feature[createSync],
|
|
140
|
+
}),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
export function createLinePrimitiveItem(feature, style, vectorProperties, geometries) {
|
|
144
|
+
const allowPicking = vectorProperties.getAllowPicking(feature);
|
|
145
|
+
const instances = geometries.map(({ geometry }) => new GeometryInstance({
|
|
146
|
+
geometry,
|
|
147
|
+
}));
|
|
148
|
+
const color = getCesiumColor(style.getStroke().getColor(), [0, 0, 0, 1]);
|
|
149
|
+
let material;
|
|
150
|
+
if (style.getStroke()?.getLineDash()) {
|
|
151
|
+
material = Material.fromType('Stripe', {
|
|
152
|
+
horizontal: false,
|
|
153
|
+
repeat: 500,
|
|
154
|
+
evenColor: color,
|
|
155
|
+
oddColor: new Color(0, 0, 0, 0), // transparent
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
material = Material.fromType('Color', { color });
|
|
160
|
+
}
|
|
161
|
+
const appearance = new PolylineMaterialAppearance({
|
|
162
|
+
renderState: {
|
|
163
|
+
depthTest: {
|
|
164
|
+
enabled: true,
|
|
165
|
+
},
|
|
166
|
+
lineWidth: 1,
|
|
167
|
+
},
|
|
168
|
+
translucent: color.alpha !== 1,
|
|
169
|
+
material,
|
|
170
|
+
});
|
|
171
|
+
return {
|
|
172
|
+
type: 'primitive',
|
|
173
|
+
item: new Primitive({
|
|
174
|
+
geometryInstances: instances,
|
|
175
|
+
appearance,
|
|
176
|
+
shadows: ShadowMode.ENABLED,
|
|
177
|
+
allowPicking,
|
|
178
|
+
asynchronous: !feature[createSync],
|
|
179
|
+
}),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
export function createGroundLinePrimitiveItem(feature, style, vectorProperties, geometries) {
|
|
183
|
+
const allowPicking = vectorProperties.getAllowPicking(feature);
|
|
184
|
+
const instances = geometries.map(({ geometry }) => new GeometryInstance({
|
|
185
|
+
geometry,
|
|
186
|
+
}));
|
|
187
|
+
const color = getCesiumColor(style.getStroke().getColor(), [0, 0, 0, 1]);
|
|
188
|
+
let material;
|
|
189
|
+
if (style.getStroke()?.getLineDash()) {
|
|
190
|
+
material = Material.fromType('Stripe', {
|
|
191
|
+
horizontal: false,
|
|
192
|
+
repeat: 500,
|
|
193
|
+
evenColor: color,
|
|
194
|
+
oddColor: new Color(0, 0, 0, 0), // transparent
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
material = Material.fromType('Color', { color });
|
|
199
|
+
}
|
|
200
|
+
const appearance = new PolylineMaterialAppearance({
|
|
201
|
+
renderState: {
|
|
202
|
+
depthTest: {
|
|
203
|
+
enabled: true,
|
|
204
|
+
},
|
|
205
|
+
lineWidth: 1,
|
|
206
|
+
},
|
|
207
|
+
translucent: color.alpha !== 1,
|
|
208
|
+
material,
|
|
209
|
+
});
|
|
210
|
+
const classificationType = vectorProperties.getClassificationType(feature) ??
|
|
211
|
+
getClassificationForHeightReference(geometries[0].heightInfo.heightReference);
|
|
212
|
+
return {
|
|
213
|
+
type: 'primitive',
|
|
214
|
+
item: new GroundPolylinePrimitive({
|
|
215
|
+
classificationType,
|
|
216
|
+
geometryInstances: instances,
|
|
217
|
+
appearance,
|
|
218
|
+
allowPicking,
|
|
219
|
+
asynchronous: !feature[createSync],
|
|
220
|
+
}),
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
export function getCesiumGeometriesOptions(style, geometry, geometryFactory, heightInfo) {
|
|
224
|
+
const hasFill = !!style.getFill();
|
|
225
|
+
const hasStroke = !!style.getStroke();
|
|
226
|
+
const cesiumGeometryOptions = [];
|
|
227
|
+
const geometryOptions = geometryFactory.getGeometryOptions(geometry, heightInfo);
|
|
228
|
+
if (isClampedHeightReference(heightInfo.heightReference)) {
|
|
229
|
+
if (hasFill) {
|
|
230
|
+
cesiumGeometryOptions.push(...geometryFactory.createFillGeometries(geometryOptions, heightInfo, 0, false));
|
|
231
|
+
}
|
|
232
|
+
if (hasStroke) {
|
|
233
|
+
cesiumGeometryOptions.push(...geometryFactory.createGroundLineGeometries(geometryOptions, heightInfo, style));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
const nonClampedHeightInfo = heightInfo;
|
|
238
|
+
const { extruded, perPositionHeight } = nonClampedHeightInfo;
|
|
239
|
+
const geometryHeight = getGeometryHeight(geometry, nonClampedHeightInfo);
|
|
240
|
+
if (extruded) {
|
|
241
|
+
const storeyOptions = getStoreyOptions(nonClampedHeightInfo, geometryHeight);
|
|
242
|
+
if (hasFill) {
|
|
243
|
+
storeyOptions.storeys.forEach((options) => {
|
|
244
|
+
cesiumGeometryOptions.push(...geometryFactory.createSolidGeometries(geometryOptions, heightInfo, options.currentHeight, perPositionHeight, options.extrudedHeight));
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
if (hasStroke) {
|
|
248
|
+
storeyOptions.storeys.forEach((options) => {
|
|
249
|
+
cesiumGeometryOptions.push(...geometryFactory.createOutlineGeometries(geometryOptions, heightInfo, options.currentHeight, perPositionHeight, options.extrudedHeight));
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
if (nonClampedHeightInfo.skirt) {
|
|
253
|
+
const currentHeight = storeyOptions.skirtLevel;
|
|
254
|
+
const extrudedHeight = currentHeight - nonClampedHeightInfo.skirt;
|
|
255
|
+
const skirtPositionHeight = nonClampedHeightInfo
|
|
256
|
+
.storeyHeightsBelowGround.length
|
|
257
|
+
? false
|
|
258
|
+
: perPositionHeight;
|
|
259
|
+
if (hasFill) {
|
|
260
|
+
cesiumGeometryOptions.push(...geometryFactory.createSolidGeometries(geometryOptions, heightInfo, currentHeight, skirtPositionHeight, extrudedHeight));
|
|
261
|
+
}
|
|
262
|
+
if (hasStroke) {
|
|
263
|
+
cesiumGeometryOptions.push(...geometryFactory.createOutlineGeometries(geometryOptions, heightInfo, currentHeight, skirtPositionHeight, extrudedHeight));
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
if (hasFill) {
|
|
269
|
+
cesiumGeometryOptions.push(...geometryFactory.createFillGeometries(geometryOptions, heightInfo, geometryHeight, perPositionHeight));
|
|
270
|
+
}
|
|
271
|
+
if (hasStroke) {
|
|
272
|
+
cesiumGeometryOptions.push(...geometryFactory.createLineGeometries(geometryOptions, heightInfo, style));
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return cesiumGeometryOptions;
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=vectorGeometryFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vectorGeometryFactory.js","sourceRoot":"","sources":["../../../../src/util/featureconverter/vectorGeometryFactory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EACL,UAAU,EAGV,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,EACL,8BAA8B,EAC9B,gBAAgB,EAEhB,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,QAAQ,EACR,kBAAkB,EAClB,0BAA0B,EAI1B,0BAA0B,EAC1B,SAAS,EAET,eAAe,EACf,UAAU,GAGX,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,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,EAAE,CAAC;oBACZ,qBAAqB,CAAC,IAAI,CACxB,GAAG,eAAe,CAAC,qBAAqB,CACtC,eAAe,EACf,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,cAAc,CACf,CACF,CAAC;gBACJ,CAAC;gBACD,IAAI,SAAS,EAAE,CAAC;oBACd,qBAAqB,CAAC,IAAI,CACxB,GAAG,eAAe,CAAC,uBAAuB,CACxC,eAAe,EACf,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,cAAc,CACf,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,OAAO,EAAE,CAAC;gBACZ,qBAAqB,CAAC,IAAI,CACxB,GAAG,eAAe,CAAC,oBAAoB,CACrC,eAAe,EACf,UAAU,EACV,cAAc,EACd,iBAAiB,CAClB,CACF,CAAC;YACJ,CAAC;YACD,IAAI,SAAS,EAAE,CAAC;gBACd,qBAAqB,CAAC,IAAI,CACxB,GAAG,eAAe,CAAC,oBAAoB,CACrC,eAAe,EACf,UAAU,EACV,KAAK,CACN,CACF,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,qBAAqB,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Geometry, SimpleGeometry } from 'ol/geom.js';
|
|
2
|
+
import type { Coordinate } from 'ol/coordinate.js';
|
|
3
|
+
import { Cartesian3, HeightReference } from '@vcmap-cesium/engine';
|
|
4
|
+
import { GeometryLayout } from 'ol/geom/Geometry.js';
|
|
5
|
+
import type { Feature } from 'ol';
|
|
6
|
+
import type VectorProperties from '../../layer/vectorProperties.js';
|
|
7
|
+
export type ExtrusionHeightInfo = {
|
|
8
|
+
/**
|
|
9
|
+
* if the object is extruded
|
|
10
|
+
*/
|
|
11
|
+
extruded: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* storey heights above ground, list has the same length as storeysAboveGround
|
|
14
|
+
*/
|
|
15
|
+
storeyHeightsAboveGround: number[];
|
|
16
|
+
/**
|
|
17
|
+
* storey heights below ground, list has the same length as storeysBelowGround
|
|
18
|
+
*/
|
|
19
|
+
storeyHeightsBelowGround: number[];
|
|
20
|
+
/**
|
|
21
|
+
* a negative height to <i>push</i> the geometry visually into the ground
|
|
22
|
+
*/
|
|
23
|
+
skirt: number;
|
|
24
|
+
};
|
|
25
|
+
export type ClampedHeightReference = HeightReference.CLAMP_TO_GROUND | HeightReference.CLAMP_TO_TERRAIN | HeightReference.CLAMP_TO_3D_TILE;
|
|
26
|
+
export type RelativeHeightReference = HeightReference.RELATIVE_TO_GROUND | HeightReference.RELATIVE_TO_TERRAIN | HeightReference.RELATIVE_TO_3D_TILE;
|
|
27
|
+
export type VectorHeightInfo<T extends HeightReference = HeightReference, L extends GeometryLayout = GeometryLayout> = T extends ClampedHeightReference ? {
|
|
28
|
+
heightReference: T;
|
|
29
|
+
layout: L;
|
|
30
|
+
} : T extends RelativeHeightReference ? {
|
|
31
|
+
heightReference: T;
|
|
32
|
+
layout: L;
|
|
33
|
+
clampOrigin?: [number, number];
|
|
34
|
+
heightAboveGround?: number;
|
|
35
|
+
/**
|
|
36
|
+
* the level above or below mean sea level
|
|
37
|
+
*/
|
|
38
|
+
groundLevel?: number;
|
|
39
|
+
/**
|
|
40
|
+
* true if not all z values are identical, e.g no height above ground was provided and no or only one storey was provided
|
|
41
|
+
*/
|
|
42
|
+
perPositionHeight: boolean;
|
|
43
|
+
} & ExtrusionHeightInfo : T extends HeightReference.NONE ? {
|
|
44
|
+
heightReference: T;
|
|
45
|
+
layout: L;
|
|
46
|
+
/**
|
|
47
|
+
* the level above or below mean sea level (minZ value or ground_level or 0)
|
|
48
|
+
*/
|
|
49
|
+
groundLevelOrMinHeight: number;
|
|
50
|
+
/**
|
|
51
|
+
* true if not all z values are identical, e.g no ground level was provided and no or only one storey was provided
|
|
52
|
+
*/
|
|
53
|
+
perPositionHeight: boolean;
|
|
54
|
+
} & ExtrusionHeightInfo : never;
|
|
55
|
+
export declare function isClampedHeightReference(heightReference: HeightReference): heightReference is ClampedHeightReference;
|
|
56
|
+
export declare function isRelativeHeightReference(heightReference: HeightReference): heightReference is RelativeHeightReference;
|
|
57
|
+
export declare function isAbsoluteHeightReference(heightReference: HeightReference): heightReference is HeightReference.NONE;
|
|
58
|
+
export declare function getRelativeEquivalent(clampedHeightReference: ClampedHeightReference): RelativeHeightReference;
|
|
59
|
+
export declare function getExtrusionHeightInfo(feature: Feature, vectorProperties: VectorProperties): ExtrusionHeightInfo;
|
|
60
|
+
/**
|
|
61
|
+
* @param geometry - feature must return simple geometry
|
|
62
|
+
* @retruns the center of mass
|
|
63
|
+
*/
|
|
64
|
+
export declare function getClampOrigin(geometry: SimpleGeometry): [number, number];
|
|
65
|
+
/**
|
|
66
|
+
* the minimum height of a geometry with a 3D layout
|
|
67
|
+
* @param geometry - with an XYZ layout
|
|
68
|
+
* @returns the minimum height
|
|
69
|
+
*/
|
|
70
|
+
export declare function getMinHeight(geometry: Geometry): number;
|
|
71
|
+
export declare function getHeightInfo(feature: Feature, geometry: SimpleGeometry, vectorProperties: VectorProperties): VectorHeightInfo;
|
|
72
|
+
/**
|
|
73
|
+
* Returns the geometry height (as used in the cesium geometry options) depending on the height info. 0 for clamped, groundLevelOrMinHeight for absolute & heightAboveGround + groundLevel (if present) for relative
|
|
74
|
+
* If you pass "with extrusion" the height will be returned including the extrusion, otherwise you get the height of the actual geometry
|
|
75
|
+
*/
|
|
76
|
+
export declare function getGeometryHeight(geometry: SimpleGeometry, heightInfo: VectorHeightInfo): number;
|
|
77
|
+
/**
|
|
78
|
+
* @param {VectorHeightInfo} heightInfo
|
|
79
|
+
* @returns a callback function accepting a mercator coordinate. it will return a wgs84coordinate with its Z value adjusted according to the height info
|
|
80
|
+
*/
|
|
81
|
+
export declare function mercatorToWgs84TransformerForHeightInfo(heightInfo: VectorHeightInfo): (coord: Coordinate) => Coordinate;
|
|
82
|
+
/**
|
|
83
|
+
* @param {VectorHeightInfo} heightInfo
|
|
84
|
+
* @returns a callback function accepting a mercator coordinate. it will return a Cartesian3 with its Z value adjusted according to the height info
|
|
85
|
+
*/
|
|
86
|
+
export declare function mercatorToCartesianTransformerForHeightInfo(heightInfo: VectorHeightInfo): (coord: Coordinate) => Cartesian3;
|