@vcmap/core 6.2.4 → 6.3.0-rc.2
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 +13 -3
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/ol.d.ts +13 -2
- package/dist/src/category/category.d.ts +1 -1
- package/dist/src/category/category.js +3 -4
- package/dist/src/category/category.js.map +1 -1
- package/dist/src/cesium/cesium3DTileFeature.d.ts +1 -0
- package/dist/src/cesium/cesium3DTileFeature.js +14 -3
- package/dist/src/cesium/cesium3DTileFeature.js.map +1 -1
- package/dist/src/cesium/cesium3DTilePointFeature.js +2 -1
- package/dist/src/cesium/cesium3DTilePointFeature.js.map +1 -1
- package/dist/src/classRegistry.d.ts +7 -1
- package/dist/src/classRegistry.js.map +1 -1
- package/dist/src/featureProvider/abstractAttributeProvider.d.ts +62 -0
- package/dist/src/featureProvider/abstractAttributeProvider.js +129 -0
- package/dist/src/featureProvider/abstractAttributeProvider.js.map +1 -0
- package/dist/src/featureProvider/abstractFeatureProvider.d.ts +10 -19
- package/dist/src/featureProvider/abstractFeatureProvider.js +10 -42
- package/dist/src/featureProvider/abstractFeatureProvider.js.map +1 -1
- package/dist/src/featureProvider/compositeFeatureProvider.d.ts +27 -0
- package/dist/src/featureProvider/compositeFeatureProvider.js +53 -0
- package/dist/src/featureProvider/compositeFeatureProvider.js.map +1 -0
- package/dist/src/featureProvider/csvAttributeProvider.d.ts +41 -0
- package/dist/src/featureProvider/csvAttributeProvider.js +126 -0
- package/dist/src/featureProvider/csvAttributeProvider.js.map +1 -0
- package/dist/src/featureProvider/featureProviderFactory.d.ts +3 -0
- package/dist/src/featureProvider/featureProviderFactory.js +17 -0
- package/dist/src/featureProvider/featureProviderFactory.js.map +1 -0
- package/dist/src/featureProvider/i3sAttributeProvider.d.ts +7 -0
- package/dist/src/featureProvider/i3sAttributeProvider.js +43 -0
- package/dist/src/featureProvider/i3sAttributeProvider.js.map +1 -0
- package/dist/src/featureProvider/jsonAttributeProvider.d.ts +26 -0
- package/dist/src/featureProvider/jsonAttributeProvider.js +73 -0
- package/dist/src/featureProvider/jsonAttributeProvider.js.map +1 -0
- package/dist/src/featureProvider/tileProviderFeatureProvider.d.ts +4 -6
- package/dist/src/featureProvider/tileProviderFeatureProvider.js +9 -11
- package/dist/src/featureProvider/tileProviderFeatureProvider.js.map +1 -1
- package/dist/src/featureProvider/urlIdAttributeProvider.d.ts +28 -0
- package/dist/src/featureProvider/urlIdAttributeProvider.js +50 -0
- package/dist/src/featureProvider/urlIdAttributeProvider.js.map +1 -0
- package/dist/src/featureProvider/wmsFeatureProvider.d.ts +13 -4
- package/dist/src/featureProvider/wmsFeatureProvider.js +19 -9
- package/dist/src/featureProvider/wmsFeatureProvider.js.map +1 -1
- package/dist/src/interaction/coordinateAtPixel.js +4 -6
- package/dist/src/interaction/coordinateAtPixel.js.map +1 -1
- package/dist/src/interaction/ensurePositionInteraction.d.ts +14 -0
- package/dist/src/interaction/ensurePositionInteraction.js +42 -0
- package/dist/src/interaction/ensurePositionInteraction.js.map +1 -0
- package/dist/src/interaction/eventHandler.d.ts +3 -0
- package/dist/src/interaction/eventHandler.js +10 -1
- package/dist/src/interaction/eventHandler.js.map +1 -1
- package/dist/src/interaction/featureAtPixelInteraction.d.ts +15 -3
- package/dist/src/interaction/featureAtPixelInteraction.js +70 -18
- package/dist/src/interaction/featureAtPixelInteraction.js.map +1 -1
- package/dist/src/interaction/featureProviderInteraction.js +42 -26
- package/dist/src/interaction/featureProviderInteraction.js.map +1 -1
- package/dist/src/interaction/panoramaImageSelection.js +2 -2
- package/dist/src/interaction/panoramaImageSelection.js.map +1 -1
- package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.d.ts +17 -9
- package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js +244 -165
- package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/i3sCesiumImpl.d.ts +33 -0
- package/dist/src/layer/cesium/i3sCesiumImpl.js +107 -0
- package/dist/src/layer/cesium/i3sCesiumImpl.js.map +1 -0
- package/dist/src/layer/cesium/rasterLayerCesiumImpl.d.ts +3 -3
- package/dist/src/layer/cesium/rasterLayerCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/terrainCesiumImpl.d.ts +3 -3
- package/dist/src/layer/cesium/terrainCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.js +2 -1
- package/dist/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.js.map +1 -1
- package/dist/src/layer/cesium/vectorContext.js +1 -1
- package/dist/src/layer/cesium/vectorContext.js.map +1 -1
- package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js +7 -6
- package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vectorTileImageryProvider.js +2 -2
- package/dist/src/layer/cesium/vectorTileImageryProvider.js.map +1 -1
- package/dist/src/layer/cesiumTilesetLayer.d.ts +10 -1
- package/dist/src/layer/cesiumTilesetLayer.js +33 -8
- package/dist/src/layer/cesiumTilesetLayer.js.map +1 -1
- package/dist/src/layer/cogLayer.d.ts +1 -1
- package/dist/src/layer/cogLayer.js +3 -4
- package/dist/src/layer/cogLayer.js.map +1 -1
- package/dist/src/layer/czmlLayer.d.ts +1 -1
- package/dist/src/layer/czmlLayer.js +4 -4
- package/dist/src/layer/czmlLayer.js.map +1 -1
- package/dist/src/layer/featureLayer.d.ts +1 -6
- package/dist/src/layer/featureLayer.js +3 -10
- package/dist/src/layer/featureLayer.js.map +1 -1
- package/dist/src/layer/featureStoreLayer.d.ts +3 -2
- package/dist/src/layer/featureStoreLayer.js +5 -5
- package/dist/src/layer/featureStoreLayer.js.map +1 -1
- package/dist/src/layer/flatGeobufLayer.d.ts +2 -0
- package/dist/src/layer/flatGeobufLayer.js +8 -0
- package/dist/src/layer/flatGeobufLayer.js.map +1 -1
- package/dist/src/layer/geojsonLayer.d.ts +1 -1
- package/dist/src/layer/geojsonLayer.js +5 -12
- package/dist/src/layer/geojsonLayer.js.map +1 -1
- package/dist/src/layer/i3sLayer.d.ts +80 -0
- package/dist/src/layer/i3sLayer.js +242 -0
- package/dist/src/layer/i3sLayer.js.map +1 -0
- package/dist/src/layer/layer.d.ts +29 -10
- package/dist/src/layer/layer.js +114 -34
- package/dist/src/layer/layer.js.map +1 -1
- package/dist/src/layer/layerSymbols.d.ts +4 -0
- package/dist/src/layer/layerSymbols.js +4 -0
- package/dist/src/layer/layerSymbols.js.map +1 -1
- package/dist/src/layer/openStreetMapLayer.d.ts +1 -1
- package/dist/src/layer/openStreetMapLayer.js +11 -6
- package/dist/src/layer/openStreetMapLayer.js.map +1 -1
- package/dist/src/layer/panorama/vectorPanoramaImpl.d.ts +38 -0
- package/dist/src/layer/panorama/vectorPanoramaImpl.js +164 -0
- package/dist/src/layer/panorama/vectorPanoramaImpl.js.map +1 -0
- package/dist/src/layer/panoramaDatasetLayer.d.ts +7 -3
- package/dist/src/layer/panoramaDatasetLayer.js +46 -20
- package/dist/src/layer/panoramaDatasetLayer.js.map +1 -1
- package/dist/src/layer/pointCloudLayer.d.ts +1 -5
- package/dist/src/layer/pointCloudLayer.js +3 -15
- package/dist/src/layer/pointCloudLayer.js.map +1 -1
- package/dist/src/layer/rasterLayer.d.ts +1 -1
- package/dist/src/layer/rasterLayer.js +4 -4
- package/dist/src/layer/rasterLayer.js.map +1 -1
- package/dist/src/layer/singleImageLayer.d.ts +1 -1
- package/dist/src/layer/singleImageLayer.js +3 -3
- package/dist/src/layer/singleImageLayer.js.map +1 -1
- package/dist/src/layer/terrainLayer.d.ts +1 -1
- package/dist/src/layer/terrainLayer.js +8 -6
- package/dist/src/layer/terrainLayer.js.map +1 -1
- package/dist/src/layer/tileProvider/flatGeobufTileProvider.d.ts +1 -1
- package/dist/src/layer/tileProvider/flatGeobufTileProvider.js +7 -5
- package/dist/src/layer/tileProvider/flatGeobufTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/mvtTileProvider.d.ts +1 -1
- package/dist/src/layer/tileProvider/mvtTileProvider.js +6 -5
- package/dist/src/layer/tileProvider/mvtTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/staticFeatureTileProvider.d.ts +1 -1
- package/dist/src/layer/tileProvider/staticFeatureTileProvider.js +3 -3
- package/dist/src/layer/tileProvider/staticFeatureTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/staticGeojsonTileProvider.d.ts +1 -1
- package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js +7 -4
- package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/tileProvider.d.ts +7 -1
- package/dist/src/layer/tileProvider/tileProvider.js +15 -5
- package/dist/src/layer/tileProvider/tileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/urlTemplateTileProvider.d.ts +1 -1
- package/dist/src/layer/tileProvider/urlTemplateTileProvider.js +3 -3
- package/dist/src/layer/tileProvider/urlTemplateTileProvider.js.map +1 -1
- package/dist/src/layer/tmsLayer.d.ts +1 -1
- package/dist/src/layer/tmsLayer.js +3 -10
- package/dist/src/layer/tmsLayer.js.map +1 -1
- package/dist/src/layer/vectorLayer.d.ts +11 -5
- package/dist/src/layer/vectorLayer.js +21 -10
- package/dist/src/layer/vectorLayer.js.map +1 -1
- package/dist/src/layer/vectorProperties.js +10 -1
- package/dist/src/layer/vectorProperties.js.map +1 -1
- package/dist/src/layer/vectorTileLayer.d.ts +14 -5
- package/dist/src/layer/vectorTileLayer.js +82 -31
- package/dist/src/layer/vectorTileLayer.js.map +1 -1
- package/dist/src/layer/wfsLayer.d.ts +1 -1
- package/dist/src/layer/wfsLayer.js +5 -4
- package/dist/src/layer/wfsLayer.js.map +1 -1
- package/dist/src/layer/wmsLayer.d.ts +4 -1
- package/dist/src/layer/wmsLayer.js +65 -36
- package/dist/src/layer/wmsLayer.js.map +1 -1
- package/dist/src/layer/wmtsLayer.d.ts +1 -1
- package/dist/src/layer/wmtsLayer.js +3 -10
- package/dist/src/layer/wmtsLayer.js.map +1 -1
- package/dist/src/map/baseCesiumMap.d.ts +69 -0
- package/dist/src/map/baseCesiumMap.js +393 -0
- package/dist/src/map/baseCesiumMap.js.map +1 -0
- package/dist/src/map/cesiumMap.d.ts +6 -98
- package/dist/src/map/cesiumMap.js +29 -266
- package/dist/src/map/cesiumMap.js.map +1 -1
- package/dist/src/map/obliqueMap.d.ts +1 -1
- package/dist/src/map/obliqueMap.js +14 -8
- package/dist/src/map/obliqueMap.js.map +1 -1
- package/dist/src/map/openlayersMap.d.ts +1 -1
- package/dist/src/map/openlayersMap.js +3 -4
- package/dist/src/map/openlayersMap.js.map +1 -1
- package/dist/src/map/panoramaMap.d.ts +17 -29
- package/dist/src/map/panoramaMap.js +56 -100
- package/dist/src/map/panoramaMap.js.map +1 -1
- package/dist/src/map/vcsMap.d.ts +15 -2
- package/dist/src/map/vcsMap.js +26 -3
- package/dist/src/map/vcsMap.js.map +1 -1
- package/dist/src/oblique/obliqueCollection.d.ts +1 -1
- package/dist/src/oblique/obliqueCollection.js +3 -4
- package/dist/src/oblique/obliqueCollection.js.map +1 -1
- package/dist/src/panorama/panoramaCameraController.d.ts +4 -0
- package/dist/src/panorama/panoramaCameraController.js +8 -0
- package/dist/src/panorama/panoramaCameraController.js.map +1 -1
- package/dist/src/panorama/panoramaImage.d.ts +10 -1
- package/dist/src/panorama/panoramaImage.js +15 -9
- package/dist/src/panorama/panoramaImage.js.map +1 -1
- package/dist/src/panorama/panoramaImageView.d.ts +6 -1
- package/dist/src/panorama/panoramaImageView.js +11 -2
- package/dist/src/panorama/panoramaImageView.js.map +1 -1
- package/dist/src/panorama/panoramaTileMaterial.d.ts +6 -0
- package/dist/src/panorama/panoramaTileMaterial.js +14 -0
- package/dist/src/panorama/panoramaTileMaterial.js.map +1 -1
- package/dist/src/panorama/panoramaTileMaterialFS.shader.d.ts +1 -1
- package/dist/src/panorama/panoramaTileMaterialFS.shader.js +16 -1
- package/dist/src/panorama/panoramaTileMaterialFS.shader.js.map +1 -1
- package/dist/src/panorama/panoramaTilePrimitiveCollection.d.ts +6 -0
- package/dist/src/panorama/panoramaTilePrimitiveCollection.js +28 -0
- package/dist/src/panorama/panoramaTilePrimitiveCollection.js.map +1 -1
- package/dist/src/style/declarativeStyleItem.js +7 -8
- package/dist/src/style/declarativeStyleItem.js.map +1 -1
- package/dist/src/util/clipping/clippingPolygonObject.d.ts +1 -1
- package/dist/src/util/clipping/clippingPolygonObject.js +3 -4
- package/dist/src/util/clipping/clippingPolygonObject.js.map +1 -1
- package/dist/src/util/displayQuality/displayQuality.js +4 -4
- package/dist/src/util/displayQuality/displayQuality.js.map +1 -1
- package/dist/src/util/editor/createFeatureSession.js +3 -1
- package/dist/src/util/editor/createFeatureSession.js.map +1 -1
- package/dist/src/util/editor/editFeaturesSession.js +9 -2
- package/dist/src/util/editor/editFeaturesSession.js.map +1 -1
- package/dist/src/util/editor/editGeometrySession.js +3 -1
- package/dist/src/util/editor/editGeometrySession.js.map +1 -1
- package/dist/src/util/editor/editorSessionHelpers.d.ts +3 -3
- package/dist/src/util/editor/editorSessionHelpers.js +4 -2
- package/dist/src/util/editor/editorSessionHelpers.js.map +1 -1
- package/dist/src/util/editor/interactions/creationSnapping.js +4 -1
- package/dist/src/util/editor/interactions/creationSnapping.js.map +1 -1
- package/dist/src/util/editor/interactions/ensureHandlerSelectionInteraction.js +2 -2
- package/dist/src/util/editor/interactions/ensureHandlerSelectionInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/layerSnapping.js +4 -1
- package/dist/src/util/editor/interactions/layerSnapping.js.map +1 -1
- package/dist/src/util/editor/interactions/mapInteractionController.js +12 -1
- package/dist/src/util/editor/interactions/mapInteractionController.js.map +1 -1
- package/dist/src/util/editor/interactions/translationSnapping.js +4 -2
- package/dist/src/util/editor/interactions/translationSnapping.js.map +1 -1
- package/dist/src/util/editor/selectFeaturesSession.js +1 -1
- package/dist/src/util/editor/selectFeaturesSession.js.map +1 -1
- package/dist/src/util/editor/transformation/create3DHandlers.d.ts +2 -2
- package/dist/src/util/editor/transformation/create3DHandlers.js.map +1 -1
- package/dist/src/util/editor/transformation/transformationHandler.js +5 -2
- package/dist/src/util/editor/transformation/transformationHandler.js.map +1 -1
- package/dist/src/util/editor/transformation/translateInteraction.js +2 -2
- package/dist/src/util/editor/transformation/translateInteraction.js.map +1 -1
- package/dist/src/util/fetch.d.ts +7 -0
- package/dist/src/util/fetch.js +7 -0
- package/dist/src/util/fetch.js.map +1 -1
- package/dist/src/util/flight/flightInstance.d.ts +1 -1
- package/dist/src/util/flight/flightInstance.js +3 -4
- package/dist/src/util/flight/flightInstance.js.map +1 -1
- package/dist/src/util/mapCollection.d.ts +5 -0
- package/dist/src/util/mapCollection.js +14 -0
- package/dist/src/util/mapCollection.js.map +1 -1
- package/dist/src/util/renderScreenshot.js +2 -3
- package/dist/src/util/renderScreenshot.js.map +1 -1
- package/dist/src/util/viewpoint.js +1 -1
- package/dist/src/util/viewpoint.js.map +1 -1
- package/dist/src/vcsApp.d.ts +2 -3
- package/dist/src/vcsApp.js.map +1 -1
- package/dist/src/vcsModuleHelpers.d.ts +5 -2
- package/dist/src/vcsModuleHelpers.js +27 -1
- package/dist/src/vcsModuleHelpers.js.map +1 -1
- package/dist/src/vcsObject.d.ts +2 -1
- package/dist/src/vcsObject.js +9 -1
- package/dist/src/vcsObject.js.map +1 -1
- package/dist/src/vectorCluster/vectorClusterGroup.d.ts +1 -1
- package/dist/src/vectorCluster/vectorClusterGroup.js +3 -4
- package/dist/src/vectorCluster/vectorClusterGroup.js.map +1 -1
- package/dist/src/vectorCluster/vectorClusterStyleItem.d.ts +1 -1
- package/dist/src/vectorCluster/vectorClusterStyleItem.js +3 -4
- package/dist/src/vectorCluster/vectorClusterStyleItem.js.map +1 -1
- package/dist/tests/unit/helpers/cesiumHelpers.d.ts +11 -1
- package/dist/tests/unit/helpers/cesiumHelpers.js +26 -3
- package/dist/tests/unit/helpers/cesiumHelpers.js.map +1 -1
- package/dist/tests/unit/helpers/panoramaHelpers.js +1 -1
- package/dist/tests/unit/helpers/panoramaHelpers.js.map +1 -1
- package/index.ts +30 -5
- package/package.json +3 -3
- package/src/category/category.ts +3 -4
- package/src/cesium/cesium.d.ts +12 -0
- package/src/cesium/cesium3DTileFeature.ts +23 -3
- package/src/cesium/cesium3DTilePointFeature.ts +3 -1
- package/src/classRegistry.ts +8 -3
- package/src/featureProvider/abstractAttributeProvider.ts +201 -0
- package/src/featureProvider/abstractFeatureProvider.ts +32 -51
- package/src/featureProvider/compositeFeatureProvider.ts +103 -0
- package/src/featureProvider/csvAttributeProvider.ts +186 -0
- package/src/featureProvider/featureProviderFactory.ts +31 -0
- package/src/featureProvider/i3sAttributeProvider.ts +60 -0
- package/src/featureProvider/jsonAttributeProvider.ts +109 -0
- package/src/featureProvider/tileProviderFeatureProvider.ts +13 -14
- package/src/featureProvider/urlIdAttributeProvider.ts +82 -0
- package/src/featureProvider/wmsFeatureProvider.ts +31 -10
- package/src/global.d.ts +2 -0
- package/src/interaction/coordinateAtPixel.ts +4 -6
- package/src/interaction/ensurePositionInteraction.ts +50 -0
- package/src/interaction/eventHandler.ts +12 -1
- package/src/interaction/featureAtPixelInteraction.ts +92 -32
- package/src/interaction/featureProviderInteraction.ts +59 -38
- package/src/interaction/panoramaImageSelection.ts +4 -2
- package/src/layer/cesium/cesiumTilesetCesiumImpl.ts +297 -197
- package/src/layer/cesium/i3sCesiumImpl.ts +141 -0
- package/src/layer/cesium/rasterLayerCesiumImpl.ts +3 -3
- package/src/layer/cesium/terrainCesiumImpl.ts +3 -3
- package/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.ts +4 -3
- package/src/layer/cesium/vectorContext.ts +1 -1
- package/src/layer/cesium/vectorRasterTileCesiumImpl.ts +7 -6
- package/src/layer/cesium/vectorTileImageryProvider.ts +2 -2
- package/src/layer/cesiumTilesetLayer.ts +60 -8
- package/src/layer/cogLayer.ts +5 -5
- package/src/layer/czmlLayer.ts +4 -4
- package/src/layer/featureLayer.ts +5 -16
- package/src/layer/featureStoreLayer.ts +11 -5
- package/src/layer/flatGeobufLayer.ts +12 -0
- package/src/layer/geojsonLayer.ts +5 -12
- package/src/layer/i3sLayer.ts +343 -0
- package/src/layer/layer.ts +178 -39
- package/src/layer/layerSymbols.ts +5 -0
- package/src/layer/openStreetMapLayer.ts +13 -6
- package/src/layer/panorama/vectorPanoramaImpl.ts +238 -0
- package/src/layer/panoramaDatasetLayer.ts +69 -23
- package/src/layer/pointCloudLayer.ts +5 -20
- package/src/layer/rasterLayer.ts +4 -4
- package/src/layer/singleImageLayer.ts +5 -3
- package/src/layer/terrainLayer.ts +9 -6
- package/src/layer/tileProvider/flatGeobufTileProvider.ts +9 -5
- package/src/layer/tileProvider/mvtTileProvider.ts +10 -5
- package/src/layer/tileProvider/staticFeatureTileProvider.ts +5 -3
- package/src/layer/tileProvider/staticGeojsonTileProvider.ts +11 -4
- package/src/layer/tileProvider/tileProvider.ts +18 -5
- package/src/layer/tileProvider/urlTemplateTileProvider.ts +7 -3
- package/src/layer/tmsLayer.ts +3 -10
- package/src/layer/vectorLayer.ts +29 -11
- package/src/layer/vectorProperties.ts +10 -1
- package/src/layer/vectorTileLayer.ts +141 -53
- package/src/layer/wfsLayer.ts +7 -4
- package/src/layer/wmsLayer.ts +80 -48
- package/src/layer/wmtsLayer.ts +3 -10
- package/src/map/baseCesiumMap.ts +600 -0
- package/src/map/cesiumMap.ts +99 -457
- package/src/map/obliqueMap.ts +16 -10
- package/src/map/openlayersMap.ts +5 -5
- package/src/map/panoramaMap.ts +74 -139
- package/src/map/vcsMap.ts +44 -4
- package/src/oblique/obliqueCollection.ts +5 -4
- package/src/ol/ol.d.ts +13 -2
- package/src/panorama/panoramaCameraController.ts +13 -1
- package/src/panorama/panoramaImage.ts +25 -8
- package/src/panorama/panoramaImageView.ts +29 -3
- package/src/panorama/panoramaTileMaterial.ts +20 -0
- package/src/panorama/panoramaTileMaterialFS.glsl +16 -1
- package/src/panorama/panoramaTilePrimitiveCollection.ts +34 -0
- package/src/style/declarativeStyleItem.ts +7 -9
- package/src/util/clipping/clippingPolygonObject.ts +5 -4
- package/src/util/displayQuality/displayQuality.ts +4 -4
- package/src/util/editor/createFeatureSession.ts +4 -1
- package/src/util/editor/editFeaturesSession.ts +14 -4
- package/src/util/editor/editGeometrySession.ts +3 -1
- package/src/util/editor/editorSessionHelpers.ts +5 -3
- package/src/util/editor/interactions/creationSnapping.ts +7 -1
- package/src/util/editor/interactions/ensureHandlerSelectionInteraction.ts +2 -2
- package/src/util/editor/interactions/layerSnapping.ts +7 -1
- package/src/util/editor/interactions/mapInteractionController.ts +12 -2
- package/src/util/editor/interactions/translationSnapping.ts +6 -4
- package/src/util/editor/selectFeaturesSession.ts +1 -1
- package/src/util/editor/transformation/create3DHandlers.ts +2 -2
- package/src/util/editor/transformation/transformationHandler.ts +5 -3
- package/src/util/editor/transformation/translateInteraction.ts +4 -4
- package/src/util/fetch.ts +7 -0
- package/src/util/flight/flightInstance.ts +6 -5
- package/src/util/mapCollection.ts +18 -0
- package/src/util/renderScreenshot.ts +4 -8
- package/src/util/viewpoint.ts +2 -2
- package/src/vcsApp.ts +7 -8
- package/src/vcsModuleHelpers.ts +62 -4
- package/src/vcsObject.ts +10 -1
- package/src/vectorCluster/vectorClusterGroup.ts +7 -4
- package/src/vectorCluster/vectorClusterStyleItem.ts +8 -4
- package/dist/src/map/cesiumMapHelpers.d.ts +0 -7
- package/dist/src/map/cesiumMapHelpers.js +0 -144
- package/dist/src/map/cesiumMapHelpers.js.map +0 -1
- package/src/map/cesiumMapHelpers.ts +0 -219
|
@@ -3,8 +3,8 @@ import type { Feature } from 'ol/index.js';
|
|
|
3
3
|
import AbstractFeatureProvider, {
|
|
4
4
|
type AbstractFeatureProviderOptions,
|
|
5
5
|
} from './abstractFeatureProvider.js';
|
|
6
|
-
import { featureProviderClassRegistry } from '../classRegistry.js';
|
|
7
6
|
import type TileProvider from '../layer/tileProvider/tileProvider.js';
|
|
7
|
+
import type Layer from '../layer/layer.js';
|
|
8
8
|
|
|
9
9
|
export type TileProviderFeatureProviderOptions =
|
|
10
10
|
AbstractFeatureProviderOptions & {
|
|
@@ -18,26 +18,21 @@ class TileProviderFeatureProvider extends AbstractFeatureProvider {
|
|
|
18
18
|
|
|
19
19
|
tileProvider: TileProvider;
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
* @param options
|
|
24
|
-
*/
|
|
25
|
-
constructor(layerName: string, options: TileProviderFeatureProviderOptions) {
|
|
26
|
-
super(layerName, options);
|
|
21
|
+
constructor(options: TileProviderFeatureProviderOptions) {
|
|
22
|
+
super({ ...options, mapTypes: ['CesiumMap'] });
|
|
27
23
|
|
|
28
|
-
this.mapTypes = ['CesiumMap'];
|
|
29
24
|
this.tileProvider = options.tileProvider;
|
|
30
25
|
}
|
|
31
26
|
|
|
32
27
|
async getFeaturesByCoordinate(
|
|
33
28
|
coordinate: Coordinate,
|
|
34
29
|
resolution: number,
|
|
35
|
-
|
|
30
|
+
layer: Layer,
|
|
36
31
|
): Promise<Feature[]> {
|
|
37
32
|
const features = await this.tileProvider.getFeaturesByCoordinate(
|
|
38
33
|
coordinate,
|
|
39
34
|
resolution,
|
|
40
|
-
headers,
|
|
35
|
+
layer.headers,
|
|
41
36
|
);
|
|
42
37
|
const checkShow = (feature: Feature): boolean =>
|
|
43
38
|
this.style ? !!this.style.cesiumStyle.show.evaluate(feature) : true;
|
|
@@ -48,6 +43,14 @@ class TileProviderFeatureProvider extends AbstractFeatureProvider {
|
|
|
48
43
|
});
|
|
49
44
|
}
|
|
50
45
|
|
|
46
|
+
toJSON(
|
|
47
|
+
defaultOptions: AbstractFeatureProviderOptions = AbstractFeatureProvider.getDefaultOptions(),
|
|
48
|
+
): AbstractFeatureProviderOptions {
|
|
49
|
+
const options = super.toJSON(defaultOptions);
|
|
50
|
+
delete options.mapTypes;
|
|
51
|
+
return options;
|
|
52
|
+
}
|
|
53
|
+
|
|
51
54
|
destroy(): void {
|
|
52
55
|
this.tileProvider.destroy();
|
|
53
56
|
super.destroy();
|
|
@@ -55,7 +58,3 @@ class TileProviderFeatureProvider extends AbstractFeatureProvider {
|
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
export default TileProviderFeatureProvider;
|
|
58
|
-
featureProviderClassRegistry.registerClass(
|
|
59
|
-
TileProviderFeatureProvider.className,
|
|
60
|
-
TileProviderFeatureProvider,
|
|
61
|
-
);
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import AbstractAttributeProvider from './abstractAttributeProvider.js';
|
|
2
|
+
import type { VcsObjectOptions } from '../vcsObject.js';
|
|
3
|
+
import { getInitForUrl, requestJson } from '../util/fetch.js';
|
|
4
|
+
import { featureProviderClassRegistry } from '../classRegistry.js';
|
|
5
|
+
|
|
6
|
+
export type UrlIdAttributeProviderOptions = VcsObjectOptions & {
|
|
7
|
+
urlTemplate: string;
|
|
8
|
+
headers?: Record<string, string>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Provides attributes for features by fetching data from a URL based on feature IDs.
|
|
13
|
+
* The URL template should contain a {id} placeholder that will be replaced with the encoded feature ID.
|
|
14
|
+
* urlTemplate: 'https://api.example.com/features/{id}'
|
|
15
|
+
* For a feature with ID "123", this would request: https://api.example.com/features/123
|
|
16
|
+
*
|
|
17
|
+
* The backend should return a JSON object with attribute key-value pairs.
|
|
18
|
+
* {
|
|
19
|
+
* "name": "Feature Name",
|
|
20
|
+
* "description": "Feature description",
|
|
21
|
+
* "value": 42
|
|
22
|
+
* }
|
|
23
|
+
* If the request fails or returns invalid data, the provider returns undefined.
|
|
24
|
+
*/
|
|
25
|
+
export default class UrlIdAttributeProvider extends AbstractAttributeProvider {
|
|
26
|
+
static get className(): string {
|
|
27
|
+
return 'UrlIdAttributeProvider';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
private _urlTemplate: string;
|
|
31
|
+
|
|
32
|
+
private _headers?: Record<string, string> | undefined;
|
|
33
|
+
|
|
34
|
+
constructor(options: UrlIdAttributeProviderOptions) {
|
|
35
|
+
super(options);
|
|
36
|
+
|
|
37
|
+
this._urlTemplate = options.urlTemplate;
|
|
38
|
+
|
|
39
|
+
this._headers = options.headers
|
|
40
|
+
? structuredClone(options.headers)
|
|
41
|
+
: undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
protected async _getAttributes(
|
|
45
|
+
id: string,
|
|
46
|
+
): Promise<Record<string, unknown> | undefined> {
|
|
47
|
+
const url = this._urlTemplate.replace(
|
|
48
|
+
'{id}',
|
|
49
|
+
encodeURIComponent(String(id)),
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
return await requestJson<Record<string, unknown>>(
|
|
54
|
+
url,
|
|
55
|
+
getInitForUrl(url, this._headers),
|
|
56
|
+
);
|
|
57
|
+
} catch {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
override toJSON(
|
|
63
|
+
_defaultOptions?: UrlIdAttributeProviderOptions,
|
|
64
|
+
): UrlIdAttributeProviderOptions {
|
|
65
|
+
const config: Partial<UrlIdAttributeProviderOptions> = super.toJSON(
|
|
66
|
+
_defaultOptions,
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
config.urlTemplate = this._urlTemplate;
|
|
70
|
+
|
|
71
|
+
if (this._headers) {
|
|
72
|
+
config.headers = structuredClone(this._headers);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return config as UrlIdAttributeProviderOptions;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
featureProviderClassRegistry.registerClass(
|
|
80
|
+
UrlIdAttributeProvider.className,
|
|
81
|
+
UrlIdAttributeProvider,
|
|
82
|
+
);
|
|
@@ -16,7 +16,7 @@ import type { Options as WMSGetFeatureInfoOptions } from 'ol/format/WMSGetFeatur
|
|
|
16
16
|
import { containsCoordinate } from 'ol/extent.js';
|
|
17
17
|
import { parseInteger } from '@vcsuite/parsers';
|
|
18
18
|
import { getLogger } from '@vcsuite/logger';
|
|
19
|
-
import type
|
|
19
|
+
import { type AbstractFeatureProviderOptions } from './abstractFeatureProvider.js';
|
|
20
20
|
import AbstractFeatureProvider from './abstractFeatureProvider.js';
|
|
21
21
|
import type { ProjectionOptions } from '../util/projection.js';
|
|
22
22
|
import Projection, { mercatorProjection } from '../util/projection.js';
|
|
@@ -27,6 +27,7 @@ import Extent from '../util/extent.js';
|
|
|
27
27
|
import { getInitForUrl, requestUrl } from '../util/fetch.js';
|
|
28
28
|
import { featureProviderClassRegistry } from '../classRegistry.js';
|
|
29
29
|
import { TilingScheme } from '../layer/rasterLayer.js';
|
|
30
|
+
import type Layer from '../layer/layer.js';
|
|
30
31
|
|
|
31
32
|
export type FormatOptions = GeoJSONOptions &
|
|
32
33
|
GMLOptions &
|
|
@@ -78,6 +79,10 @@ export type WMSFeatureProviderOptions = AbstractFeatureProviderOptions & {
|
|
|
78
79
|
*/
|
|
79
80
|
version?: string;
|
|
80
81
|
htmlPositionFeatureTitle?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Optional headers to include in GetFeatureInfo requests. Overrides layer headers.
|
|
84
|
+
*/
|
|
85
|
+
headers?: Record<string, string>;
|
|
81
86
|
};
|
|
82
87
|
|
|
83
88
|
const gmlFormats = { GML: GML3, GML2, GML3, GML32 };
|
|
@@ -191,6 +196,7 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
|
|
|
191
196
|
tileSize: [256, 256],
|
|
192
197
|
parameters: {},
|
|
193
198
|
extent: undefined,
|
|
199
|
+
headers: undefined,
|
|
194
200
|
};
|
|
195
201
|
}
|
|
196
202
|
|
|
@@ -233,9 +239,14 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
|
|
|
233
239
|
|
|
234
240
|
htmlPositionFeatureTitle?: string;
|
|
235
241
|
|
|
236
|
-
|
|
237
|
-
|
|
242
|
+
/**
|
|
243
|
+
* Optional headers to include in GetFeatureInfo requests.
|
|
244
|
+
*/
|
|
245
|
+
headers?: Record<string, string>;
|
|
246
|
+
|
|
247
|
+
constructor(options: WMSFeatureProviderOptions) {
|
|
238
248
|
const defaultOptions = WMSFeatureProvider.getDefaultOptions();
|
|
249
|
+
super({ ...defaultOptions, ...options });
|
|
239
250
|
|
|
240
251
|
if (options.extent) {
|
|
241
252
|
if (options.extent instanceof Extent) {
|
|
@@ -271,6 +282,9 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
|
|
|
271
282
|
? new Projection(options.projection)
|
|
272
283
|
: undefined;
|
|
273
284
|
this.htmlPositionFeatureTitle = options.htmlPositionFeatureTitle;
|
|
285
|
+
this.headers = options.headers
|
|
286
|
+
? structuredClone(options.headers)
|
|
287
|
+
: undefined;
|
|
274
288
|
}
|
|
275
289
|
|
|
276
290
|
get wmsSource(): TileWMS {
|
|
@@ -324,7 +338,7 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
|
|
|
324
338
|
async getFeaturesByCoordinate(
|
|
325
339
|
coordinate: Coordinate,
|
|
326
340
|
resolution: number,
|
|
327
|
-
|
|
341
|
+
layer: Layer,
|
|
328
342
|
): Promise<Feature[]> {
|
|
329
343
|
if (
|
|
330
344
|
this.extent?.isValid() &&
|
|
@@ -354,10 +368,10 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
|
|
|
354
368
|
|
|
355
369
|
if (this.featureInfoResponseType === 'text/html') {
|
|
356
370
|
return this.featureResponseCallback(null, coordinate).map((f) =>
|
|
357
|
-
this.getProviderFeature(f),
|
|
371
|
+
this.getProviderFeature(f, layer),
|
|
358
372
|
);
|
|
359
373
|
} else if (url) {
|
|
360
|
-
const init = getInitForUrl(url, headers);
|
|
374
|
+
const init = getInitForUrl(url, this.headers ?? layer.headers);
|
|
361
375
|
let data: string;
|
|
362
376
|
try {
|
|
363
377
|
const response = await requestUrl(url, init);
|
|
@@ -367,15 +381,19 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
|
|
|
367
381
|
return [];
|
|
368
382
|
}
|
|
369
383
|
return this.featureResponseCallback(data, coordinate).map((f) =>
|
|
370
|
-
this.getProviderFeature(f),
|
|
384
|
+
this.getProviderFeature(f, layer),
|
|
371
385
|
);
|
|
372
386
|
}
|
|
373
387
|
return [];
|
|
374
388
|
}
|
|
375
389
|
|
|
376
|
-
toJSON(
|
|
377
|
-
|
|
378
|
-
|
|
390
|
+
toJSON(
|
|
391
|
+
defaultOptions = WMSFeatureProvider.getDefaultOptions(),
|
|
392
|
+
): WMSFeatureProviderOptions {
|
|
393
|
+
const config: Partial<WMSFeatureProviderOptions> = super.toJSON(
|
|
394
|
+
defaultOptions,
|
|
395
|
+
);
|
|
396
|
+
|
|
379
397
|
if (this.featureInfoResponseType !== defaultOptions.responseType) {
|
|
380
398
|
config.responseType = this.featureInfoResponseType;
|
|
381
399
|
}
|
|
@@ -423,6 +441,9 @@ class WMSFeatureProvider extends AbstractFeatureProvider {
|
|
|
423
441
|
if (this.htmlPositionFeatureTitle) {
|
|
424
442
|
config.htmlPositionFeatureTitle = this.htmlPositionFeatureTitle;
|
|
425
443
|
}
|
|
444
|
+
if (this.headers) {
|
|
445
|
+
config.headers = structuredClone(this.headers);
|
|
446
|
+
}
|
|
426
447
|
|
|
427
448
|
return config as WMSFeatureProviderOptions;
|
|
428
449
|
}
|
package/src/global.d.ts
CHANGED
|
@@ -27,7 +27,8 @@ async function getCoordinateFromPanoramaMap(
|
|
|
27
27
|
event: InteractionEvent,
|
|
28
28
|
): Promise<InteractionEvent> {
|
|
29
29
|
const image = map.currentPanoramaImage;
|
|
30
|
-
|
|
30
|
+
event.ray = map.getCesiumWidget().camera.getPickRay(event.windowPosition);
|
|
31
|
+
let position;
|
|
31
32
|
if (image) {
|
|
32
33
|
const { camera } = map.getCesiumWidget();
|
|
33
34
|
const imageCoordinate = windowPositionToImageSpherical(
|
|
@@ -36,8 +37,6 @@ async function getCoordinateFromPanoramaMap(
|
|
|
36
37
|
image.invModelMatrix,
|
|
37
38
|
);
|
|
38
39
|
|
|
39
|
-
event.positionOrPixel = imageCoordinate;
|
|
40
|
-
|
|
41
40
|
if (imageCoordinate) {
|
|
42
41
|
const cartesian = await image.getPositionAtImageCoordinate(
|
|
43
42
|
imageCoordinate,
|
|
@@ -50,6 +49,7 @@ async function getCoordinateFromPanoramaMap(
|
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
event.position = position;
|
|
52
|
+
event.positionOrPixel = position;
|
|
53
53
|
return event;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -93,9 +93,7 @@ class CoordinateAtPixel extends AbstractInteraction {
|
|
|
93
93
|
scene,
|
|
94
94
|
this._scratchCartesian,
|
|
95
95
|
);
|
|
96
|
-
if (
|
|
97
|
-
event.position = [0, 0, 0];
|
|
98
|
-
} else {
|
|
96
|
+
if (pickResult) {
|
|
99
97
|
this._scratchCartographic = Cartographic.fromCartesian(
|
|
100
98
|
pickResult,
|
|
101
99
|
scene.globe.ellipsoid,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Coordinate } from 'ol/coordinate.js';
|
|
2
|
+
import AbstractInteraction, {
|
|
3
|
+
type InteractionEvent,
|
|
4
|
+
} from './abstractInteraction.js';
|
|
5
|
+
import {
|
|
6
|
+
EventType,
|
|
7
|
+
ModificationKeyType,
|
|
8
|
+
PointerKeyType,
|
|
9
|
+
} from './interactionType.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* An interaction that ensures events without a position are stopped.
|
|
13
|
+
* It will set event.stopPropagation = true if event.position is undefined.
|
|
14
|
+
* Furthermore, it ensures the integrity of drag events by: a) remembering the last position
|
|
15
|
+
* on DRAGSTART and reusing it on DRAGEND if no position is provided and b) stopping propagation of drag events, if
|
|
16
|
+
* drag start did not provide a position.
|
|
17
|
+
*/
|
|
18
|
+
class EnsurePositionInteraction extends AbstractInteraction {
|
|
19
|
+
private _lastDragPosition: Coordinate | undefined;
|
|
20
|
+
|
|
21
|
+
constructor() {
|
|
22
|
+
super(EventType.ALL, ModificationKeyType.ALL, PointerKeyType.ALL);
|
|
23
|
+
|
|
24
|
+
this.setActive();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
pipe(event: InteractionEvent): Promise<InteractionEvent> {
|
|
28
|
+
if (event.type & EventType.DRAGSTART) {
|
|
29
|
+
this._lastDragPosition = event.position?.slice();
|
|
30
|
+
} else if (event.type & EventType.DRAG) {
|
|
31
|
+
if (this._lastDragPosition && event.position) {
|
|
32
|
+
this._lastDragPosition = event.position.slice();
|
|
33
|
+
} else if (!this._lastDragPosition) {
|
|
34
|
+
event.stopPropagation = true;
|
|
35
|
+
}
|
|
36
|
+
} else if (event.type & EventType.DRAGEND) {
|
|
37
|
+
if (this._lastDragPosition && !event.position) {
|
|
38
|
+
event.position = this._lastDragPosition;
|
|
39
|
+
} else if (!this._lastDragPosition) {
|
|
40
|
+
event.stopPropagation = true;
|
|
41
|
+
}
|
|
42
|
+
this._lastDragPosition = undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
event.stopPropagation = event.stopPropagation || !event.position;
|
|
46
|
+
return Promise.resolve(event);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default EnsurePositionInteraction;
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
PointerEventType,
|
|
14
14
|
} from './interactionType.js';
|
|
15
15
|
import FeatureProviderInteraction from './featureProviderInteraction.js';
|
|
16
|
+
import EnsurePositionInteraction from './ensurePositionInteraction.js';
|
|
16
17
|
import VcsEvent from '../vcsEvent.js';
|
|
17
18
|
|
|
18
19
|
type EventHandlerExclusiveInteraction = {
|
|
@@ -35,6 +36,8 @@ class EventHandler {
|
|
|
35
36
|
|
|
36
37
|
private _featureInteraction: FeatureAtPixelInteraction;
|
|
37
38
|
|
|
39
|
+
private _ensurePositionInteraction: EnsurePositionInteraction;
|
|
40
|
+
|
|
38
41
|
private _featureProviderInteraction: FeatureProviderInteraction;
|
|
39
42
|
|
|
40
43
|
private _interactionChain: InteractionChain;
|
|
@@ -72,10 +75,12 @@ class EventHandler {
|
|
|
72
75
|
constructor() {
|
|
73
76
|
this._positionInteraction = new CoordinateAtPixel();
|
|
74
77
|
this._featureInteraction = new FeatureAtPixelInteraction();
|
|
78
|
+
this._ensurePositionInteraction = new EnsurePositionInteraction();
|
|
75
79
|
this._featureProviderInteraction = new FeatureProviderInteraction();
|
|
76
80
|
this._interactionChain = new InteractionChain([
|
|
77
81
|
this._positionInteraction,
|
|
78
82
|
this._featureInteraction,
|
|
83
|
+
this._ensurePositionInteraction,
|
|
79
84
|
this._featureProviderInteraction,
|
|
80
85
|
]);
|
|
81
86
|
|
|
@@ -126,6 +131,10 @@ class EventHandler {
|
|
|
126
131
|
return this._featureInteraction;
|
|
127
132
|
}
|
|
128
133
|
|
|
134
|
+
get ensurePositionInteraction(): EnsurePositionInteraction {
|
|
135
|
+
return this._ensurePositionInteraction;
|
|
136
|
+
}
|
|
137
|
+
|
|
129
138
|
get featureProviderInteraction(): FeatureProviderInteraction {
|
|
130
139
|
return this._featureProviderInteraction;
|
|
131
140
|
}
|
|
@@ -255,7 +264,7 @@ class EventHandler {
|
|
|
255
264
|
*/
|
|
256
265
|
addPersistentInteraction(
|
|
257
266
|
interaction: AbstractInteraction,
|
|
258
|
-
index =
|
|
267
|
+
index = 4,
|
|
259
268
|
): () => number {
|
|
260
269
|
check(interaction, AbstractInteraction);
|
|
261
270
|
check(index, Number);
|
|
@@ -440,6 +449,8 @@ class EventHandler {
|
|
|
440
449
|
this._interactionChain.destroy();
|
|
441
450
|
this._positionInteraction.destroy();
|
|
442
451
|
this._featureInteraction.destroy();
|
|
452
|
+
this._ensurePositionInteraction.destroy();
|
|
453
|
+
this._featureProviderInteraction.destroy();
|
|
443
454
|
this._eventQueue = [];
|
|
444
455
|
window.removeEventListener('keydown', this._boundKeyListener);
|
|
445
456
|
window.removeEventListener('keyup', this._boundKeyListener);
|
|
@@ -4,6 +4,8 @@ import type {
|
|
|
4
4
|
Ray,
|
|
5
5
|
Billboard,
|
|
6
6
|
Label,
|
|
7
|
+
I3SNode,
|
|
8
|
+
I3SDataProvider,
|
|
7
9
|
} from '@vcmap-cesium/engine';
|
|
8
10
|
import {
|
|
9
11
|
Cartesian3,
|
|
@@ -12,7 +14,9 @@ import {
|
|
|
12
14
|
Entity,
|
|
13
15
|
} from '@vcmap-cesium/engine';
|
|
14
16
|
import type OLMap from 'ol/Map.js';
|
|
15
|
-
import
|
|
17
|
+
import Feature from 'ol/Feature.js';
|
|
18
|
+
import { Point } from 'ol/geom.js';
|
|
19
|
+
import { v4 as uuid } from 'uuid';
|
|
16
20
|
import AbstractInteraction, {
|
|
17
21
|
type EventFeature,
|
|
18
22
|
type InteractionEvent,
|
|
@@ -22,15 +26,16 @@ import {
|
|
|
22
26
|
ModificationKeyType,
|
|
23
27
|
PointerKeyType,
|
|
24
28
|
} from './interactionType.js';
|
|
25
|
-
import { allowPicking, vcsLayerName } from '../layer/layerSymbols.js';
|
|
29
|
+
import { allowPicking, i3sData, vcsLayerName } from '../layer/layerSymbols.js';
|
|
26
30
|
import { originalFeatureSymbol, primitives } from '../layer/vectorSymbols.js';
|
|
27
31
|
import type OpenlayersMap from '../map/openlayersMap.js';
|
|
28
32
|
import type ObliqueMap from '../map/obliqueMap.js';
|
|
29
|
-
import type CesiumMap from '../map/cesiumMap.js';
|
|
30
33
|
import { vectorClusterGroupName } from '../vectorCluster/vectorClusterSymbols.js';
|
|
31
|
-
import { cartesianToMercator } from '../util/math.js';
|
|
34
|
+
import { cartesian3DDistance, cartesianToMercator } from '../util/math.js';
|
|
32
35
|
import type { PrimitiveType } from '../util/featureconverter/convert.js';
|
|
36
|
+
import type BaseCesiumMap from '../map/baseCesiumMap.js';
|
|
33
37
|
import type PanoramaMap from '../map/panoramaMap.js';
|
|
38
|
+
import { isProvidedFeature } from '../featureProvider/featureProviderSymbols.js';
|
|
34
39
|
|
|
35
40
|
/**
|
|
36
41
|
* This is the return from cesium scene.pick and scene.drillPick, which returns "any". We cast to this type.
|
|
@@ -45,6 +50,11 @@ type CesiumPickObject = {
|
|
|
45
50
|
olFeature?: Feature;
|
|
46
51
|
[vcsLayerName]?: string;
|
|
47
52
|
};
|
|
53
|
+
content?: {
|
|
54
|
+
tile?: {
|
|
55
|
+
i3sNode: I3SNode;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
48
58
|
};
|
|
49
59
|
|
|
50
60
|
function getFeatureFromOlMap(
|
|
@@ -81,6 +91,12 @@ function getFeatureFromOlMap(
|
|
|
81
91
|
return feature;
|
|
82
92
|
}
|
|
83
93
|
|
|
94
|
+
export function isI3SFeature(f: EventFeature): f is Feature & {
|
|
95
|
+
[i3sData]: { i3sNode: I3SNode; cartesianPosition?: Cartesian3 };
|
|
96
|
+
} {
|
|
97
|
+
return !!(f != null && (f as Feature)[i3sData]);
|
|
98
|
+
}
|
|
99
|
+
|
|
84
100
|
export function getFeatureFromPickObject(
|
|
85
101
|
object: CesiumPickObject,
|
|
86
102
|
): EventFeature | undefined {
|
|
@@ -114,8 +130,24 @@ export function getFeatureFromPickObject(
|
|
|
114
130
|
) {
|
|
115
131
|
// entity
|
|
116
132
|
feature = object.id;
|
|
133
|
+
} else if (object.content?.tile?.i3sNode) {
|
|
134
|
+
// i3s feature
|
|
135
|
+
const dataProvider =
|
|
136
|
+
// @ts-expect-error eslint-disable-next-line no-underscore-dangle, @typescript-eslint/ban-ts-comment
|
|
137
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
138
|
+
object.content.tile.i3sNode._dataProvider as I3SDataProvider;
|
|
139
|
+
const layername = dataProvider[vcsLayerName];
|
|
140
|
+
if (object instanceof Cesium3DTileFeature) {
|
|
141
|
+
feature = object;
|
|
142
|
+
feature[vcsLayerName] = layername;
|
|
143
|
+
} else if (dataProvider[allowPicking] !== false) {
|
|
144
|
+
feature = new Feature({});
|
|
145
|
+
feature.setId(uuid());
|
|
146
|
+
feature[vcsLayerName] = layername;
|
|
147
|
+
feature[i3sData] = { i3sNode: object.content.tile.i3sNode };
|
|
148
|
+
feature[isProvidedFeature] = true;
|
|
149
|
+
}
|
|
117
150
|
}
|
|
118
|
-
|
|
119
151
|
return feature;
|
|
120
152
|
}
|
|
121
153
|
|
|
@@ -283,7 +315,7 @@ class FeatureAtPixelInteraction extends AbstractInteraction {
|
|
|
283
315
|
}
|
|
284
316
|
|
|
285
317
|
private _cesiumHandler(event: InteractionEvent): Promise<InteractionEvent> {
|
|
286
|
-
const cesiumMap = event.map as
|
|
318
|
+
const cesiumMap = event.map as BaseCesiumMap;
|
|
287
319
|
const { scene } = cesiumMap.getCesiumWidget()!;
|
|
288
320
|
|
|
289
321
|
if (!scene) {
|
|
@@ -301,14 +333,10 @@ class FeatureAtPixelInteraction extends AbstractInteraction {
|
|
|
301
333
|
}
|
|
302
334
|
|
|
303
335
|
const { pickTranslucentDepth } = scene;
|
|
304
|
-
if (!(event.type & this.pickPosition)) {
|
|
305
|
-
return Promise.resolve(event);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
336
|
if (
|
|
337
|
+
!!(event.type & this.pickPosition) &&
|
|
309
338
|
pickObject &&
|
|
310
|
-
scene.pickPositionSupported
|
|
311
|
-
event.map.className === 'CesiumMap'
|
|
339
|
+
scene.pickPositionSupported
|
|
312
340
|
) {
|
|
313
341
|
if (this.pickTranslucent) {
|
|
314
342
|
scene.pickTranslucentDepth = true;
|
|
@@ -334,30 +362,62 @@ class FeatureAtPixelInteraction extends AbstractInteraction {
|
|
|
334
362
|
);
|
|
335
363
|
|
|
336
364
|
if (
|
|
337
|
-
|
|
338
|
-
Cartesian3.equals(cartesianPosition, Cartesian3.ZERO)
|
|
365
|
+
cartesianPosition &&
|
|
366
|
+
!Cartesian3.equals(cartesianPosition, Cartesian3.ZERO)
|
|
339
367
|
) {
|
|
340
|
-
|
|
341
|
-
|
|
368
|
+
if (this.pullPickedPosition && event.ray) {
|
|
369
|
+
const pulledCartesian = Cartesian3.multiplyByScalar(
|
|
370
|
+
event.ray.direction,
|
|
371
|
+
this.pullPickedPosition,
|
|
372
|
+
new Cartesian3(),
|
|
373
|
+
);
|
|
374
|
+
|
|
375
|
+
Cartesian3.subtract(
|
|
376
|
+
cartesianPosition,
|
|
377
|
+
pulledCartesian,
|
|
378
|
+
cartesianPosition,
|
|
379
|
+
);
|
|
380
|
+
}
|
|
342
381
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
event.
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
382
|
+
if (event.map.className === 'CesiumMap') {
|
|
383
|
+
event.position = cartesianToMercator(cartesianPosition);
|
|
384
|
+
event.positionOrPixel = event.position.slice();
|
|
385
|
+
if (
|
|
386
|
+
feature instanceof Feature &&
|
|
387
|
+
feature[isProvidedFeature] &&
|
|
388
|
+
isI3SFeature(feature)
|
|
389
|
+
) {
|
|
390
|
+
feature.setGeometry(new Point(event.position));
|
|
391
|
+
feature.set('olcs_altitudeMode', 'absolute');
|
|
392
|
+
feature[i3sData].cartesianPosition = cartesianPosition;
|
|
393
|
+
}
|
|
394
|
+
} else {
|
|
395
|
+
const currentImage = (event.map as PanoramaMap).currentPanoramaImage;
|
|
396
|
+
if (currentImage) {
|
|
397
|
+
const imageCenter = cartesianToMercator(currentImage.position);
|
|
398
|
+
const newPosition = cartesianToMercator(cartesianPosition);
|
|
399
|
+
const newDistance = cartesian3DDistance(imageCenter, newPosition);
|
|
400
|
+
const currentDistance = event.position
|
|
401
|
+
? cartesian3DDistance(imageCenter, event.position)
|
|
402
|
+
: undefined;
|
|
403
|
+
|
|
404
|
+
if (currentDistance == null || newDistance < currentDistance) {
|
|
405
|
+
event.position = newPosition;
|
|
406
|
+
event.positionOrPixel = event.position.slice();
|
|
407
|
+
if (
|
|
408
|
+
feature instanceof Feature &&
|
|
409
|
+
feature[isProvidedFeature] &&
|
|
410
|
+
isI3SFeature(feature)
|
|
411
|
+
) {
|
|
412
|
+
feature.setGeometry(new Point(event.position));
|
|
413
|
+
feature.set('olcs_altitudeMode', 'absolute');
|
|
414
|
+
feature[i3sData].cartesianPosition = cartesianPosition;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
355
419
|
}
|
|
356
|
-
|
|
357
|
-
event.position = cartesianToMercator(cartesianPosition);
|
|
358
|
-
event.positionOrPixel = event.position.slice();
|
|
359
420
|
scene.pickTranslucentDepth = pickTranslucentDepth;
|
|
360
|
-
return Promise.resolve(event);
|
|
361
421
|
}
|
|
362
422
|
|
|
363
423
|
return Promise.resolve(event);
|