@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
|
@@ -244,13 +244,10 @@ class FeatureVisibility {
|
|
|
244
244
|
usedStyle = fromCesiumColor(style);
|
|
245
245
|
} else if (style instanceof Style) {
|
|
246
246
|
usedStyle = new VectorStyleItem({});
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
style.getText().getText() &&
|
|
250
|
-
!Array.isArray(style.getText().getText())
|
|
251
|
-
) {
|
|
247
|
+
const text = style.getText()?.getText();
|
|
248
|
+
if (text && !Array.isArray(text)) {
|
|
252
249
|
// getText can return a rich Text string[] We do not support this at the moment.
|
|
253
|
-
usedStyle.label = String(
|
|
250
|
+
usedStyle.label = String(text);
|
|
254
251
|
}
|
|
255
252
|
usedStyle.style = style;
|
|
256
253
|
} else if (is(style, Function)) {
|
|
@@ -248,16 +248,10 @@ function readFeature(
|
|
|
248
248
|
|
|
249
249
|
if (featureObj.radius && geometry instanceof Point) {
|
|
250
250
|
const coordinates = geometry.getCoordinates();
|
|
251
|
-
|
|
252
|
-
coordinates.push(0);
|
|
253
|
-
}
|
|
254
|
-
geometry = new Circle(coordinates, featureObj.radius, 'XYZ');
|
|
251
|
+
geometry = new Circle(coordinates, featureObj.radius);
|
|
255
252
|
}
|
|
256
253
|
if (radius && geometry instanceof Point) {
|
|
257
254
|
const coordinates = geometry.getCoordinates();
|
|
258
|
-
if (coordinates.length === 2) {
|
|
259
|
-
coordinates.push(0);
|
|
260
|
-
}
|
|
261
255
|
geometry = circleFromCenterRadius(coordinates, radius);
|
|
262
256
|
}
|
|
263
257
|
if (String(options.formatOptions?.featureProjection) === 'EPSG:3857') {
|
|
@@ -467,23 +461,26 @@ export function writeGeoJSONFeature(
|
|
|
467
461
|
/**
|
|
468
462
|
* Writes all the features of the current layer to GeojsonLayer
|
|
469
463
|
*/
|
|
470
|
-
export function writeGeoJSON(
|
|
464
|
+
export function writeGeoJSON<O extends GeoJSONwriteOptions>(
|
|
471
465
|
data: GeoJSONData,
|
|
472
|
-
options
|
|
473
|
-
):
|
|
466
|
+
options?: O,
|
|
467
|
+
): O['asObject'] extends true ? FeatureCollection : string {
|
|
474
468
|
// how to handel embedded icons when they are not set on the vcsMeta but options is true?
|
|
475
469
|
const vcsMeta = data.vcsMeta || { version: vcsMetaVersion };
|
|
476
470
|
vcsMeta.version = vcsMetaVersion;
|
|
477
471
|
const featureObjs = data.features.map((feature) =>
|
|
478
472
|
writeGeoJSONFeature(feature, options, vcsMeta.embeddedIcons),
|
|
479
473
|
);
|
|
474
|
+
|
|
480
475
|
const obj: FeatureCollection = {
|
|
481
476
|
type: 'FeatureCollection',
|
|
482
477
|
features: featureObjs,
|
|
483
478
|
vcsMeta,
|
|
484
479
|
};
|
|
485
480
|
|
|
486
|
-
|
|
481
|
+
const returnValue = options?.asObject
|
|
487
482
|
? obj
|
|
488
|
-
: JSON.stringify(obj, undefined, options
|
|
483
|
+
: JSON.stringify(obj, undefined, options?.prettyPrint ? 2 : undefined);
|
|
484
|
+
|
|
485
|
+
return returnValue as O['asObject'] extends true ? FeatureCollection : string;
|
|
489
486
|
}
|
|
@@ -7,7 +7,7 @@ import type { Geometry } from 'ol/geom.js';
|
|
|
7
7
|
import type { Feature } from 'ol/index.js';
|
|
8
8
|
|
|
9
9
|
import { Cartographic, sampleTerrainMostDetailed } from '@vcmap-cesium/engine';
|
|
10
|
-
import {
|
|
10
|
+
import { cartesian2DDistanceSquared } from '../../util/math.js';
|
|
11
11
|
import Projection, {
|
|
12
12
|
mercatorProjection,
|
|
13
13
|
wgs84Projection,
|
|
@@ -19,13 +19,13 @@ import {
|
|
|
19
19
|
} from '../vectorSymbols.js';
|
|
20
20
|
import {
|
|
21
21
|
convertGeometryToPolygon,
|
|
22
|
-
|
|
22
|
+
getFlatCoordinateReferences,
|
|
23
23
|
} from '../../util/geometryHelpers.js';
|
|
24
24
|
import { transformFromImage } from '../../oblique/helpers.js';
|
|
25
25
|
import type ObliqueImage from '../../oblique/obliqueImage.js';
|
|
26
26
|
|
|
27
27
|
export function getLongestSide(coordinates: Coordinate[]): number {
|
|
28
|
-
let
|
|
28
|
+
let sideSquared = 0;
|
|
29
29
|
for (let i = 0; i < coordinates.length; i++) {
|
|
30
30
|
let j = i + 1;
|
|
31
31
|
if (j >= coordinates.length) {
|
|
@@ -33,12 +33,12 @@ export function getLongestSide(coordinates: Coordinate[]): number {
|
|
|
33
33
|
}
|
|
34
34
|
const point1 = coordinates[i];
|
|
35
35
|
const point2 = coordinates[j];
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
|
|
36
|
+
const currentSideSquared = cartesian2DDistanceSquared(point1, point2);
|
|
37
|
+
if (currentSideSquared > sideSquared) {
|
|
38
|
+
sideSquared = currentSideSquared;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
return
|
|
41
|
+
return Math.sqrt(sideSquared);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export function getResolutionOptions(
|
|
@@ -97,7 +97,7 @@ export async function mercatorGeometryToImageGeometry(
|
|
|
97
97
|
? fromCircle(inputSourceGeometry)
|
|
98
98
|
: inputSourceGeometry;
|
|
99
99
|
const coordinates = sourceGeometry.getCoordinates() as any[];
|
|
100
|
-
const flattenCoordinates =
|
|
100
|
+
const flattenCoordinates = getFlatCoordinateReferences(
|
|
101
101
|
sourceGeometry,
|
|
102
102
|
coordinates,
|
|
103
103
|
);
|
|
@@ -151,7 +151,7 @@ export function imageGeometryToMercatorGeometry(
|
|
|
151
151
|
image: ObliqueImage,
|
|
152
152
|
): Promise<Geometry> {
|
|
153
153
|
const coordinates = sourceGeometry.getCoordinates() as any[];
|
|
154
|
-
const flattenCoordinates =
|
|
154
|
+
const flattenCoordinates = getFlatCoordinateReferences(
|
|
155
155
|
sourceGeometry,
|
|
156
156
|
coordinates,
|
|
157
157
|
);
|
|
@@ -78,7 +78,7 @@ class VectorObliqueImpl
|
|
|
78
78
|
|
|
79
79
|
featureVisibility: FeatureVisibility;
|
|
80
80
|
|
|
81
|
-
olLayer: OLVectorLayer
|
|
81
|
+
olLayer: OLVectorLayer | null = null;
|
|
82
82
|
|
|
83
83
|
private _imageChangedListener: (() => void) | null | undefined = null;
|
|
84
84
|
|
|
@@ -91,7 +91,7 @@ class VectorObliqueImpl
|
|
|
91
91
|
this.featureVisibility = options.featureVisibility;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
getOLLayer(): OLVectorLayer
|
|
94
|
+
getOLLayer(): OLVectorLayer {
|
|
95
95
|
return new OLVectorLayer({
|
|
96
96
|
visible: false,
|
|
97
97
|
source: this.obliqueSource,
|
|
@@ -32,7 +32,7 @@ class VectorOpenlayersImpl
|
|
|
32
32
|
|
|
33
33
|
private _featureVisibilityListeners: (() => void)[] = [];
|
|
34
34
|
|
|
35
|
-
olLayer: OLVectorLayer
|
|
35
|
+
olLayer: OLVectorLayer | null = null;
|
|
36
36
|
|
|
37
37
|
globalHider: GlobalHider;
|
|
38
38
|
|
|
@@ -54,7 +54,7 @@ class VectorOpenlayersImpl
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
getOLLayer(): OLVectorLayer
|
|
57
|
+
getOLLayer(): OLVectorLayer {
|
|
58
58
|
const olLayer = new OLVectorLayer({
|
|
59
59
|
visible: false,
|
|
60
60
|
source: this.source,
|
|
@@ -3,6 +3,7 @@ import VectorTileSource from 'ol/source/VectorTile.js';
|
|
|
3
3
|
import TileState from 'ol/TileState.js';
|
|
4
4
|
import type { Size } from 'ol/size.js';
|
|
5
5
|
import type VectorTile from 'ol/VectorTile.js';
|
|
6
|
+
import { Feature } from 'ol';
|
|
6
7
|
import LayerOpenlayersImpl from './layerOpenlayersImpl.js';
|
|
7
8
|
import { mercatorProjection } from '../../util/projection.js';
|
|
8
9
|
import type {
|
|
@@ -31,13 +32,6 @@ class VectorTileOpenlayersImpl
|
|
|
31
32
|
|
|
32
33
|
tileSize: Size;
|
|
33
34
|
|
|
34
|
-
/**
|
|
35
|
-
* tiles to update on next TileRedraw
|
|
36
|
-
*/
|
|
37
|
-
private _tilesToUpdate: Set<string> = new Set();
|
|
38
|
-
|
|
39
|
-
private _reloadTimeout: number | undefined = undefined;
|
|
40
|
-
|
|
41
35
|
minLevel: number | undefined;
|
|
42
36
|
|
|
43
37
|
maxLevel: number | undefined;
|
|
@@ -62,22 +56,25 @@ class VectorTileOpenlayersImpl
|
|
|
62
56
|
minZoom: 0,
|
|
63
57
|
maxZoom: 26,
|
|
64
58
|
tileSize: this.tileSize,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
59
|
+
tileLoadFunction: (tile): void => {
|
|
60
|
+
this.tileProvider
|
|
61
|
+
.getFeaturesForTile(
|
|
62
|
+
tile.tileCoord[1],
|
|
63
|
+
tile.tileCoord[2],
|
|
64
|
+
tile.tileCoord[0],
|
|
65
|
+
this.headers,
|
|
66
|
+
)
|
|
67
|
+
.then((features) => {
|
|
68
|
+
if (features.length > 0) {
|
|
69
|
+
(tile as VectorTile<Feature>).setFeatures(features);
|
|
70
|
+
} else {
|
|
71
|
+
(tile as VectorTile<Feature>).setFeatures([]);
|
|
72
|
+
tile.setState(TileState.EMPTY);
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
.catch((err) => {
|
|
76
|
+
this.getLogger().error((err as Error).message);
|
|
77
|
+
});
|
|
81
78
|
},
|
|
82
79
|
// url needs to be set for the tileLoadFunction to work.
|
|
83
80
|
url: '/{z}/{x}/{y}',
|
|
@@ -103,45 +100,18 @@ class VectorTileOpenlayersImpl
|
|
|
103
100
|
}
|
|
104
101
|
|
|
105
102
|
/**
|
|
106
|
-
*
|
|
107
|
-
* rendering happens async
|
|
103
|
+
* refreshes the openlayers Layer, which will redraw the scene, seems to magically work
|
|
108
104
|
*/
|
|
109
105
|
updateTiles(tileIds: string[]): void {
|
|
110
106
|
if (tileIds.length > 0) {
|
|
111
|
-
|
|
112
|
-
this._tilesToUpdate.add(tileId);
|
|
113
|
-
});
|
|
114
|
-
if (this.source) {
|
|
115
|
-
if (!this._reloadTimeout) {
|
|
116
|
-
this._reloadTimeout = window.setTimeout(() => {
|
|
117
|
-
this._tilesToUpdate.forEach((tileId) => {
|
|
118
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
119
|
-
// @ts-ignore
|
|
120
|
-
const tCache = this.source.tileCache;
|
|
121
|
-
if (tCache.containsKey(tileId)) {
|
|
122
|
-
// change of key of tile (will trigger a reload)
|
|
123
|
-
const tile = tCache.get(tileId) as VectorTile;
|
|
124
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
125
|
-
// @ts-ignore
|
|
126
|
-
tile.key = false;
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
this.source!.changed();
|
|
130
|
-
this._tilesToUpdate.clear();
|
|
131
|
-
this._reloadTimeout = undefined;
|
|
132
|
-
}, 0);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
107
|
+
this.olLayer?.changed();
|
|
135
108
|
}
|
|
136
109
|
}
|
|
137
110
|
|
|
138
111
|
// eslint-disable-next-line no-unused-vars
|
|
139
112
|
updateStyle(_style: StyleItem, _silent?: boolean): void {
|
|
140
113
|
if (this.initialized) {
|
|
141
|
-
|
|
142
|
-
this._reloadTimeout = undefined;
|
|
143
|
-
this._tilesToUpdate.clear();
|
|
144
|
-
this.source!.refresh();
|
|
114
|
+
this.olLayer?.changed();
|
|
145
115
|
}
|
|
146
116
|
}
|
|
147
117
|
|
|
@@ -33,9 +33,7 @@ export async function tiledLayerLoaded(
|
|
|
33
33
|
): Promise<void> {
|
|
34
34
|
const impls = layer
|
|
35
35
|
.getImplementations()
|
|
36
|
-
.filter(
|
|
37
|
-
(i) => i instanceof CesiumTilesetCesiumImpl,
|
|
38
|
-
) as CesiumTilesetCesiumImpl[];
|
|
36
|
+
.filter((i) => i instanceof CesiumTilesetCesiumImpl);
|
|
39
37
|
if (!layer.active || impls.every((i) => i.cesium3DTileset?.tilesLoaded)) {
|
|
40
38
|
return;
|
|
41
39
|
}
|
|
@@ -41,7 +41,7 @@ class MVTTileProvider extends TileProvider {
|
|
|
41
41
|
|
|
42
42
|
idProperty: string | undefined;
|
|
43
43
|
|
|
44
|
-
private _MVTFormat = new MVT({ featureClass: Feature });
|
|
44
|
+
private _MVTFormat = new MVT<Feature>({ featureClass: Feature });
|
|
45
45
|
|
|
46
46
|
constructor(options: MVTTileProviderOptions) {
|
|
47
47
|
const defaultOptions = MVTTileProvider.getDefaultOptions();
|
|
@@ -80,7 +80,7 @@ class MVTTileProvider extends TileProvider {
|
|
|
80
80
|
const center = getCenter(extent);
|
|
81
81
|
const init = getInitForUrl(this.url, headers);
|
|
82
82
|
const data = await requestArrayBuffer(url, init);
|
|
83
|
-
const features = this._MVTFormat.readFeatures(data)
|
|
83
|
+
const features = this._MVTFormat.readFeatures(data);
|
|
84
84
|
const sx = (extent[2] - extent[0]) / 4096;
|
|
85
85
|
const sy = -((extent[3] - extent[1]) / 4096);
|
|
86
86
|
features.forEach((feature) => {
|
package/src/layer/vectorLayer.ts
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import VectorSource from 'ol/source/Vector.js';
|
|
2
2
|
import Style, { type StyleFunction } from 'ol/style/Style.js';
|
|
3
3
|
import Feature from 'ol/Feature.js';
|
|
4
|
-
import type { SimpleGeometry } from 'ol/geom.js';
|
|
5
|
-
import type { Coordinate } from 'ol/coordinate.js';
|
|
6
|
-
import type {
|
|
7
|
-
CircleGeometry,
|
|
8
|
-
CircleOutlineGeometry,
|
|
9
|
-
GroundPolylineGeometry,
|
|
10
|
-
HeightReference,
|
|
11
|
-
PolygonGeometry,
|
|
12
|
-
PolygonOutlineGeometry,
|
|
13
|
-
PolylineGeometry,
|
|
14
|
-
WallGeometry,
|
|
15
|
-
WallOutlineGeometry,
|
|
16
|
-
} from '@vcmap-cesium/engine';
|
|
17
4
|
|
|
18
5
|
import { v4 as uuidv4 } from 'uuid';
|
|
19
6
|
import { check, oneOf } from '@vcsuite/check';
|
|
@@ -76,64 +63,6 @@ export type VectorOptions = FeatureLayerOptions & {
|
|
|
76
63
|
vectorProperties?: VectorPropertiesOptions;
|
|
77
64
|
};
|
|
78
65
|
|
|
79
|
-
export type VectorGeometryFactoryType = {
|
|
80
|
-
getCoordinates(geom: SimpleGeometry[]): Coordinate[];
|
|
81
|
-
getGeometryOptions(
|
|
82
|
-
geom: SimpleGeometry,
|
|
83
|
-
num: number,
|
|
84
|
-
perPositionHeight: boolean,
|
|
85
|
-
groundLevelOrMinHeight: number,
|
|
86
|
-
): unknown;
|
|
87
|
-
createSolidGeometries(
|
|
88
|
-
obj: unknown,
|
|
89
|
-
num: number,
|
|
90
|
-
bool: boolean,
|
|
91
|
-
num2?: number,
|
|
92
|
-
): (PolygonGeometry | CircleGeometry | WallGeometry)[];
|
|
93
|
-
createOutlineGeometries(
|
|
94
|
-
obj: unknown,
|
|
95
|
-
num: number,
|
|
96
|
-
bool: boolean,
|
|
97
|
-
num2?: number,
|
|
98
|
-
): (CircleOutlineGeometry | WallOutlineGeometry | PolygonOutlineGeometry)[];
|
|
99
|
-
createFillGeometries(
|
|
100
|
-
obj: unknown,
|
|
101
|
-
num: number,
|
|
102
|
-
bool: boolean,
|
|
103
|
-
): (CircleGeometry | PolygonGeometry)[];
|
|
104
|
-
createGroundLineGeometries(
|
|
105
|
-
obj: unknown,
|
|
106
|
-
style: Style,
|
|
107
|
-
): GroundPolylineGeometry[];
|
|
108
|
-
createLineGeometries(obj: unknown, style: Style): PolylineGeometry[];
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export type VectorHeightInfo = {
|
|
112
|
-
/**
|
|
113
|
-
* if the object is extruded
|
|
114
|
-
*/
|
|
115
|
-
extruded: boolean;
|
|
116
|
-
/**
|
|
117
|
-
* storey heights above ground, list has the same length as storeysAboveGround
|
|
118
|
-
*/
|
|
119
|
-
storeyHeightsAboveGround: number[];
|
|
120
|
-
/**
|
|
121
|
-
* storey heights below ground, list has the same length as storeysBelowGround
|
|
122
|
-
*/
|
|
123
|
-
storeyHeightsBelowGround: number[];
|
|
124
|
-
/**
|
|
125
|
-
* the level above or below mean sea level (minZ value or ground_level or 0)
|
|
126
|
-
*/
|
|
127
|
-
groundLevel: number;
|
|
128
|
-
/**
|
|
129
|
-
* a negative height to <i>push</i> the geometry visually into the ground
|
|
130
|
-
*/
|
|
131
|
-
skirt: number;
|
|
132
|
-
perPositionHeight: boolean;
|
|
133
|
-
heightReference: HeightReference;
|
|
134
|
-
heightAboveGroundAdjustment: number;
|
|
135
|
-
};
|
|
136
|
-
|
|
137
66
|
export type VectorImplementationOptions = FeatureLayerImplementationOptions & {
|
|
138
67
|
source: VectorSource;
|
|
139
68
|
maxResolution?: number;
|
|
@@ -504,9 +433,7 @@ class VectorLayer
|
|
|
504
433
|
*/
|
|
505
434
|
getFeaturesById(ids: (string | number)[]): Feature[] {
|
|
506
435
|
check(ids, [oneOf(String, Number)]);
|
|
507
|
-
return ids
|
|
508
|
-
.map((id) => this.getFeatureById(id))
|
|
509
|
-
.filter((f) => f != null) as Feature[];
|
|
436
|
+
return ids.map((id) => this.getFeatureById(id)).filter((f) => f != null);
|
|
510
437
|
}
|
|
511
438
|
|
|
512
439
|
/**
|
|
@@ -77,7 +77,11 @@ export function vectorPropertiesOfType<T extends PrimitiveOptionsType>(
|
|
|
77
77
|
export type AltitudeModeType =
|
|
78
78
|
| 'absolute'
|
|
79
79
|
| 'relativeToGround'
|
|
80
|
-
| '
|
|
80
|
+
| 'relativeToTerrain'
|
|
81
|
+
| 'relativeTo3DTiles'
|
|
82
|
+
| 'clampToGround'
|
|
83
|
+
| 'clampToTerrain'
|
|
84
|
+
| 'clampTo3DTiles';
|
|
81
85
|
|
|
82
86
|
export type ClassificationTypeType = 'both' | 'terrain' | 'cesium3DTile';
|
|
83
87
|
|
|
@@ -197,8 +201,12 @@ export const vcsMetaVersion = '2.1';
|
|
|
197
201
|
|
|
198
202
|
export const AltitudeModeCesium: Record<AltitudeModeType, HeightReference> = {
|
|
199
203
|
clampToGround: HeightReference.CLAMP_TO_GROUND,
|
|
204
|
+
clampTo3DTiles: HeightReference.CLAMP_TO_3D_TILE,
|
|
205
|
+
clampToTerrain: HeightReference.CLAMP_TO_TERRAIN,
|
|
200
206
|
absolute: HeightReference.NONE,
|
|
201
207
|
relativeToGround: HeightReference.RELATIVE_TO_GROUND,
|
|
208
|
+
relativeTo3DTiles: HeightReference.RELATIVE_TO_3D_TILE,
|
|
209
|
+
relativeToTerrain: HeightReference.RELATIVE_TO_TERRAIN,
|
|
202
210
|
};
|
|
203
211
|
|
|
204
212
|
export const ClassificationTypeCesium: Record<
|
|
@@ -217,7 +225,7 @@ export function parseNearFarScalar(
|
|
|
217
225
|
if (Array.isArray(value)) {
|
|
218
226
|
const valid = value
|
|
219
227
|
.map((entry) => parseNumber(entry))
|
|
220
|
-
.filter((entry) => entry != null)
|
|
228
|
+
.filter((entry) => entry != null);
|
|
221
229
|
if (valid.length === 4) {
|
|
222
230
|
return new NearFarScalar(valid[0], valid[1], valid[2], valid[3]);
|
|
223
231
|
}
|
|
@@ -232,7 +240,7 @@ export function parseCartesian3(
|
|
|
232
240
|
if (Array.isArray(value)) {
|
|
233
241
|
const valid = value
|
|
234
242
|
.map((entry) => parseNumber(entry))
|
|
235
|
-
.filter((entry) => entry != null)
|
|
243
|
+
.filter((entry) => entry != null);
|
|
236
244
|
if (valid.length === 3) {
|
|
237
245
|
return new Cartesian3(valid[0], valid[1], valid[2]);
|
|
238
246
|
}
|
|
@@ -318,7 +326,7 @@ class VectorProperties {
|
|
|
318
326
|
classificationType: undefined,
|
|
319
327
|
scaleByDistance: undefined,
|
|
320
328
|
eyeOffset: undefined,
|
|
321
|
-
heightAboveGround:
|
|
329
|
+
heightAboveGround: undefined,
|
|
322
330
|
skirt: 0,
|
|
323
331
|
groundLevel: undefined,
|
|
324
332
|
extrudedHeight: 0,
|
|
@@ -350,7 +358,7 @@ class VectorProperties {
|
|
|
350
358
|
|
|
351
359
|
private _eyeOffset: Cartesian3 | undefined;
|
|
352
360
|
|
|
353
|
-
private _heightAboveGround: number;
|
|
361
|
+
private _heightAboveGround: number | undefined;
|
|
354
362
|
|
|
355
363
|
private _skirt: number;
|
|
356
364
|
|
|
@@ -608,13 +616,13 @@ class VectorProperties {
|
|
|
608
616
|
return parseCartesian3(featureValue, this.eyeOffset);
|
|
609
617
|
}
|
|
610
618
|
|
|
611
|
-
get heightAboveGround(): number {
|
|
619
|
+
get heightAboveGround(): number | undefined {
|
|
612
620
|
return this._heightAboveGround;
|
|
613
621
|
}
|
|
614
622
|
|
|
615
|
-
set heightAboveGround(value: number) {
|
|
623
|
+
set heightAboveGround(value: number | undefined) {
|
|
616
624
|
if (value !== this._heightAboveGround) {
|
|
617
|
-
check(value, Number);
|
|
625
|
+
check(value, maybe(Number));
|
|
618
626
|
this._heightAboveGround = value;
|
|
619
627
|
this.propertyChanged.raiseEvent(['heightAboveGround']);
|
|
620
628
|
}
|
|
@@ -889,10 +897,10 @@ class VectorProperties {
|
|
|
889
897
|
}
|
|
890
898
|
|
|
891
899
|
/**
|
|
892
|
-
* Get the features or the properties modelOptions.
|
|
900
|
+
* Get the features or the properties modelOptions.
|
|
893
901
|
* @param feature
|
|
894
902
|
*/
|
|
895
|
-
getModelOptions(feature: Feature): Record<string, unknown> {
|
|
903
|
+
getModelOptions(feature: Feature): Record<string, unknown> | undefined {
|
|
896
904
|
const featureValue = feature.get('olcs_modelOptions') as
|
|
897
905
|
| Record<string, unknown>
|
|
898
906
|
| undefined;
|
|
@@ -902,7 +910,7 @@ class VectorProperties {
|
|
|
902
910
|
if (this.modelOptions) {
|
|
903
911
|
return this.modelOptions;
|
|
904
912
|
}
|
|
905
|
-
return
|
|
913
|
+
return undefined;
|
|
906
914
|
}
|
|
907
915
|
|
|
908
916
|
get modelAutoScale(): boolean {
|
|
@@ -968,10 +976,11 @@ class VectorProperties {
|
|
|
968
976
|
|
|
969
977
|
private _getBaseOptions(feature: Feature): VectorPropertiesBaseOptions {
|
|
970
978
|
return {
|
|
979
|
+
// 0 is not a valid scale value and will crash cesium
|
|
971
980
|
scale: [
|
|
972
|
-
this.getModelScaleX(feature),
|
|
973
|
-
this.getModelScaleY(feature),
|
|
974
|
-
this.getModelScaleZ(feature),
|
|
981
|
+
this.getModelScaleX(feature) || 1,
|
|
982
|
+
this.getModelScaleY(feature) || 1,
|
|
983
|
+
this.getModelScaleZ(feature) || 1,
|
|
975
984
|
],
|
|
976
985
|
heading: this.getModelHeading(feature),
|
|
977
986
|
pitch: this.getModelPitch(feature),
|
|
@@ -1013,6 +1022,34 @@ class VectorProperties {
|
|
|
1013
1022
|
};
|
|
1014
1023
|
}
|
|
1015
1024
|
|
|
1025
|
+
/**
|
|
1026
|
+
* Determines if a feature (in general with a point geometry) should be rendered as a geometry (billboard & label etc) or a model or a primitive
|
|
1027
|
+
* @param feature
|
|
1028
|
+
*/
|
|
1029
|
+
renderAs(feature: Feature): 'geometry' | 'model' | 'primitive' {
|
|
1030
|
+
if (feature.get('olcs_modelUrl')) {
|
|
1031
|
+
return 'model';
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
const primitiveOptions = feature.get('olcs_primitiveOptions') as
|
|
1035
|
+
| VectorPropertiesPrimitiveOptions
|
|
1036
|
+
| undefined;
|
|
1037
|
+
|
|
1038
|
+
if (primitiveOptions?.geometryOptions) {
|
|
1039
|
+
return 'primitive';
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
if (this.modelUrl) {
|
|
1043
|
+
return 'model';
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
if (this.primitiveOptions?.geometryOptions) {
|
|
1047
|
+
return 'primitive';
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
return 'geometry';
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1016
1053
|
/**
|
|
1017
1054
|
* resets values, either given, or default Value raises propertyChanged event once;
|
|
1018
1055
|
* @param vcsMeta
|
|
@@ -1265,6 +1302,22 @@ class VectorProperties {
|
|
|
1265
1302
|
}
|
|
1266
1303
|
}
|
|
1267
1304
|
|
|
1305
|
+
if ('modelOptions' in options) {
|
|
1306
|
+
if (!deepEqual(this._modelOptions, options.modelOptions)) {
|
|
1307
|
+
this._modelOptions = options.modelOptions
|
|
1308
|
+
? structuredClone(options.modelOptions)
|
|
1309
|
+
: undefined;
|
|
1310
|
+
changedProperties.push('modelOptions');
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
if ('modelAutoScale' in options) {
|
|
1315
|
+
if (this._modelAutoScale !== options.modelAutoScale) {
|
|
1316
|
+
this._modelAutoScale = !!options.modelAutoScale;
|
|
1317
|
+
changedProperties.push('modelAutoScale');
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1268
1321
|
if ('baseUrl' in options) {
|
|
1269
1322
|
if (options.baseUrl !== this._baseUrl) {
|
|
1270
1323
|
this._baseUrl = options.baseUrl ?? '';
|
|
@@ -1272,13 +1325,22 @@ class VectorProperties {
|
|
|
1272
1325
|
}
|
|
1273
1326
|
}
|
|
1274
1327
|
|
|
1328
|
+
if ('primitiveOptions' in options) {
|
|
1329
|
+
if (!deepEqual(this._primitiveOptions, options.primitiveOptions)) {
|
|
1330
|
+
this._primitiveOptions = options.primitiveOptions
|
|
1331
|
+
? structuredClone(options.primitiveOptions)
|
|
1332
|
+
: undefined;
|
|
1333
|
+
changedProperties.push('primitiveOptions');
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1275
1337
|
if (changedProperties.length) {
|
|
1276
1338
|
this.propertyChanged.raiseEvent(changedProperties);
|
|
1277
1339
|
}
|
|
1278
1340
|
}
|
|
1279
1341
|
|
|
1280
1342
|
getValues(): VectorPropertiesOptions {
|
|
1281
|
-
|
|
1343
|
+
return {
|
|
1282
1344
|
altitudeMode: getAltitudeModeOptions(this.altitudeMode),
|
|
1283
1345
|
allowPicking: this.allowPicking,
|
|
1284
1346
|
classificationType: getClassificationTypeOptions(this.classificationType),
|
|
@@ -1299,9 +1361,11 @@ class VectorProperties {
|
|
|
1299
1361
|
modelHeading: this.modelHeading,
|
|
1300
1362
|
modelPitch: this.modelPitch,
|
|
1301
1363
|
modelRoll: this.modelRoll,
|
|
1364
|
+
modelAutoScale: this.modelAutoScale,
|
|
1365
|
+
modelOptions: this.modelOptions,
|
|
1302
1366
|
baseUrl: this.baseUrl,
|
|
1367
|
+
primitiveOptions: this.primitiveOptions,
|
|
1303
1368
|
};
|
|
1304
|
-
return values;
|
|
1305
1369
|
}
|
|
1306
1370
|
|
|
1307
1371
|
/**
|
package/src/map/baseOLMap.ts
CHANGED
|
@@ -87,7 +87,7 @@ class BaseOLMap extends VcsMap<OLLayer> {
|
|
|
87
87
|
olEvent.preventDefault();
|
|
88
88
|
}
|
|
89
89
|
olEvent.originalEvent.preventDefault();
|
|
90
|
-
const position = [olEvent.coordinate[0], olEvent.coordinate[1]
|
|
90
|
+
const position = [olEvent.coordinate[0], olEvent.coordinate[1]];
|
|
91
91
|
this.pointerInteractionEvent.raiseEvent({
|
|
92
92
|
map: this,
|
|
93
93
|
position,
|
package/src/oblique/helpers.ts
CHANGED
|
@@ -13,7 +13,10 @@ import { transform } from 'ol/proj.js';
|
|
|
13
13
|
import { Cartesian2, type CesiumTerrainProvider } from '@vcmap-cesium/engine';
|
|
14
14
|
import { ObliqueViewDirection } from './obliqueViewDirection.js';
|
|
15
15
|
import { getHeightFromTerrainProvider } from '../layer/terrainHelpers.js';
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
cartesian2DDistance,
|
|
18
|
+
cartesian2DDistanceSquared,
|
|
19
|
+
} from '../util/math.js';
|
|
17
20
|
import Projection, {
|
|
18
21
|
mercatorProjection,
|
|
19
22
|
wgs84Projection,
|
|
@@ -52,11 +55,14 @@ export function sortRealWordEdgeCoordinates(
|
|
|
52
55
|
|
|
53
56
|
let sorted = extentPoints.map((extentPoint) => {
|
|
54
57
|
let closest = 0;
|
|
55
|
-
let
|
|
58
|
+
let distanceSquared = Infinity;
|
|
56
59
|
cornerPoints.forEach((cornerPoint, cornerIndex) => {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
const currentDistanceSquared = cartesian2DDistanceSquared(
|
|
61
|
+
extentPoint,
|
|
62
|
+
cornerPoint,
|
|
63
|
+
);
|
|
64
|
+
if (currentDistanceSquared < distanceSquared) {
|
|
65
|
+
distanceSquared = currentDistanceSquared;
|
|
60
66
|
closest = cornerIndex;
|
|
61
67
|
}
|
|
62
68
|
});
|
|
@@ -3,7 +3,7 @@ import { createXYZ } from 'ol/tilegrid.js';
|
|
|
3
3
|
import type { Coordinate } from 'ol/coordinate.js';
|
|
4
4
|
import type { TileCoord } from 'ol/tilecoord.js';
|
|
5
5
|
import type { Extent } from 'ol/extent.js';
|
|
6
|
-
import {
|
|
6
|
+
import { cartesian2DDistanceSquared } from '../util/math.js';
|
|
7
7
|
import {
|
|
8
8
|
parseImageData,
|
|
9
9
|
parseImageMeta,
|
|
@@ -235,12 +235,12 @@ class ObliqueDataSet {
|
|
|
235
235
|
let minTile = null;
|
|
236
236
|
[...this._tiles.keys()].forEach((tile) => {
|
|
237
237
|
const tileCoord = tile.split('/').map(Number);
|
|
238
|
-
const
|
|
238
|
+
const squaredDist = cartesian2DDistanceSquared(
|
|
239
239
|
[actualTile[1], actualTile[2]],
|
|
240
240
|
[tileCoord[1], tileCoord[2]],
|
|
241
241
|
);
|
|
242
|
-
if (
|
|
243
|
-
minDistance =
|
|
242
|
+
if (squaredDist < minDistance) {
|
|
243
|
+
minDistance = squaredDist;
|
|
244
244
|
minTile = tileCoord;
|
|
245
245
|
}
|
|
246
246
|
});
|