@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,6 +3,8 @@ import type {
|
|
|
3
3
|
Cesium3DTileContent,
|
|
4
4
|
SplitDirection,
|
|
5
5
|
CustomShader,
|
|
6
|
+
TileBoundingVolume,
|
|
7
|
+
BoundingSphere,
|
|
6
8
|
} from '@vcmap-cesium/engine';
|
|
7
9
|
import {
|
|
8
10
|
Composite3DTileContent,
|
|
@@ -26,7 +28,6 @@ import {
|
|
|
26
28
|
highlightFeature,
|
|
27
29
|
originalStyle,
|
|
28
30
|
updateOriginalStyle,
|
|
29
|
-
FeatureVisibilityAction,
|
|
30
31
|
} from '../featureVisibility.js';
|
|
31
32
|
import Projection from '../../util/projection.js';
|
|
32
33
|
import { circleFromCenterRadius } from '../../util/geometryHelpers.js';
|
|
@@ -34,11 +35,13 @@ import type {
|
|
|
34
35
|
CesiumTilesetImplementationOptions,
|
|
35
36
|
CesiumTilesetTilesetProperties,
|
|
36
37
|
} from '../cesiumTilesetLayer.js';
|
|
37
|
-
import type CesiumMap from '../../map/cesiumMap.js';
|
|
38
38
|
import type { FeatureLayerImplementation } from '../featureLayer.js';
|
|
39
39
|
import type StyleItem from '../../style/styleItem.js';
|
|
40
40
|
import type GlobalHider from '../globalHider.js';
|
|
41
41
|
import { getResourceOrUrl } from './resourceHelper.js';
|
|
42
|
+
import type BaseCesiumMap from '../../map/baseCesiumMap.js';
|
|
43
|
+
import type { AttributeProvider } from '../../featureProvider/abstractAttributeProvider.js';
|
|
44
|
+
import type I3SCesiumImpl from './i3sCesiumImpl.js';
|
|
42
45
|
|
|
43
46
|
export const cesiumTilesetLastUpdated: unique symbol = Symbol(
|
|
44
47
|
'cesiumTilesetLastUpdated',
|
|
@@ -48,13 +51,11 @@ export const updateFeatureOverride: unique symbol = Symbol(
|
|
|
48
51
|
'updateFeatureOverride',
|
|
49
52
|
);
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
function getExtentFromBoundingVolume(
|
|
55
|
+
boundingVolume: TileBoundingVolume,
|
|
56
|
+
boundingSphere: BoundingSphere,
|
|
53
57
|
): OLExtent {
|
|
54
|
-
|
|
55
|
-
return createEmpty();
|
|
56
|
-
}
|
|
57
|
-
const { rectangle } = cesium3DTileset.root.boundingVolume;
|
|
58
|
+
const { rectangle } = boundingVolume;
|
|
58
59
|
if (rectangle) {
|
|
59
60
|
const scratchSW = Rectangle.southwest(rectangle);
|
|
60
61
|
const scratchNE = Rectangle.northeast(rectangle);
|
|
@@ -70,7 +71,7 @@ export function getExtentFromTileset(
|
|
|
70
71
|
return [mercatorSW[0], mercatorSW[1], mercatorNE[0], mercatorNE[1]];
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
const { center, radius } =
|
|
74
|
+
const { center, radius } = boundingSphere;
|
|
74
75
|
const cart = Cartographic.fromCartesian(center);
|
|
75
76
|
const mercatorCenter = Projection.wgs84ToMercator([
|
|
76
77
|
CesiumMath.toDegrees(cart.longitude),
|
|
@@ -81,11 +82,279 @@ export function getExtentFromTileset(
|
|
|
81
82
|
return circle.getExtent();
|
|
82
83
|
}
|
|
83
84
|
|
|
85
|
+
export function getExtentFromTileset(
|
|
86
|
+
cesium3DTileset?: Cesium3DTileset,
|
|
87
|
+
): OLExtent {
|
|
88
|
+
if (!cesium3DTileset) {
|
|
89
|
+
return createEmpty();
|
|
90
|
+
}
|
|
91
|
+
return getExtentFromBoundingVolume(
|
|
92
|
+
cesium3DTileset.root.boundingVolume,
|
|
93
|
+
cesium3DTileset.boundingSphere,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function createCesiumStylingContext(
|
|
98
|
+
impl: CesiumTilesetCesiumImpl | I3SCesiumImpl,
|
|
99
|
+
): {
|
|
100
|
+
styleContent: (content: Cesium3DTileContent) => void;
|
|
101
|
+
updateStyle: (style: StyleItem) => void;
|
|
102
|
+
applyStyle: (tile: Cesium3DTile) => void;
|
|
103
|
+
destroy: () => void;
|
|
104
|
+
} {
|
|
105
|
+
let styleLastUpdated = 0;
|
|
106
|
+
let onStyleChangeRemover: (() => void) | null = null;
|
|
107
|
+
let onFeatureVisibilityChangeRemover: (() => void) | null = null;
|
|
108
|
+
|
|
109
|
+
function styleContent(content: Cesium3DTileContent): void {
|
|
110
|
+
const styleHasChanged =
|
|
111
|
+
styleLastUpdated > (content[cesiumTilesetLastUpdated] ?? 0);
|
|
112
|
+
|
|
113
|
+
if (
|
|
114
|
+
!content[cesiumTilesetLastUpdated] ||
|
|
115
|
+
content[cesiumTilesetLastUpdated] < impl.featureVisibility.lastUpdated ||
|
|
116
|
+
content[cesiumTilesetLastUpdated] <
|
|
117
|
+
(impl.globalHider?.lastUpdated ?? 0) ||
|
|
118
|
+
styleHasChanged
|
|
119
|
+
) {
|
|
120
|
+
delete content[updateFeatureOverride];
|
|
121
|
+
const batchSize = content.featuresLength;
|
|
122
|
+
const featureOverride = {
|
|
123
|
+
hideLocal: [] as [string, HighlightableFeature][],
|
|
124
|
+
hideGlobal: [] as [string, HighlightableFeature][],
|
|
125
|
+
highlight: [] as [string, HighlightableFeature][],
|
|
126
|
+
};
|
|
127
|
+
for (let batchId = 0; batchId < batchSize; batchId++) {
|
|
128
|
+
const feature = content.getFeature(batchId);
|
|
129
|
+
if (feature) {
|
|
130
|
+
const id = String(feature.getId());
|
|
131
|
+
let shouldUpdateOriginalStyle = true;
|
|
132
|
+
if (
|
|
133
|
+
impl.featureVisibility.highlightedObjects[id] &&
|
|
134
|
+
!impl.featureVisibility.hasHighlightFeature(id, feature)
|
|
135
|
+
) {
|
|
136
|
+
impl.featureVisibility.addHighlightFeature(id, feature);
|
|
137
|
+
featureOverride.highlight.push([id, feature]);
|
|
138
|
+
shouldUpdateOriginalStyle = false;
|
|
139
|
+
} else if (
|
|
140
|
+
impl.featureVisibility.hasHighlightFeature(id, feature) &&
|
|
141
|
+
styleHasChanged &&
|
|
142
|
+
feature[originalStyle]
|
|
143
|
+
) {
|
|
144
|
+
// Feature is already highlighted and style has changed
|
|
145
|
+
// Clear the old cached style - when unhighlighted, we'll force a tileset style update
|
|
146
|
+
delete feature[originalStyle];
|
|
147
|
+
featureOverride.highlight.push([id, feature]);
|
|
148
|
+
shouldUpdateOriginalStyle = false;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (impl.featureVisibility.hiddenObjects[id]) {
|
|
152
|
+
if (!impl.featureVisibility.hasHiddenFeature(id, feature)) {
|
|
153
|
+
impl.featureVisibility.addHiddenFeature(id, feature);
|
|
154
|
+
featureOverride.hideLocal.push([id, feature]);
|
|
155
|
+
} else if (styleHasChanged && feature[originalStyle]) {
|
|
156
|
+
// Feature is already hidden and style has changed, clear original style
|
|
157
|
+
// so it will be re-cached with the new style when shown
|
|
158
|
+
delete feature[originalStyle];
|
|
159
|
+
}
|
|
160
|
+
shouldUpdateOriginalStyle = false;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (impl.globalHider?.hiddenObjects[id]) {
|
|
164
|
+
if (!impl.globalHider?.hasFeature(id, feature)) {
|
|
165
|
+
impl.globalHider?.addFeature(id, feature);
|
|
166
|
+
}
|
|
167
|
+
featureOverride.hideGlobal.push([id, feature]);
|
|
168
|
+
if (styleHasChanged && feature[originalStyle]) {
|
|
169
|
+
// Feature is globally hidden and style has changed, clear original style
|
|
170
|
+
delete feature[originalStyle];
|
|
171
|
+
}
|
|
172
|
+
shouldUpdateOriginalStyle = false;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (
|
|
176
|
+
shouldUpdateOriginalStyle &&
|
|
177
|
+
styleHasChanged &&
|
|
178
|
+
feature[originalStyle] // can only be a color for cesium, so no check for undefined required
|
|
179
|
+
) {
|
|
180
|
+
updateOriginalStyle(feature);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (
|
|
185
|
+
featureOverride.hideLocal.length > 0 ||
|
|
186
|
+
featureOverride.hideGlobal.length > 0 ||
|
|
187
|
+
featureOverride.highlight.length > 0
|
|
188
|
+
) {
|
|
189
|
+
content[updateFeatureOverride] = (): void => {
|
|
190
|
+
featureOverride.hideGlobal.forEach(([id, feature]) => {
|
|
191
|
+
if (impl.globalHider?.hasFeature(id, feature)) {
|
|
192
|
+
hideFeature(feature);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
featureOverride.hideLocal.forEach(([id, feature]) => {
|
|
197
|
+
if (impl.featureVisibility.hasHiddenFeature(id, feature)) {
|
|
198
|
+
hideFeature(feature);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
featureOverride.highlight.forEach(([id, feature]) => {
|
|
203
|
+
if (impl.featureVisibility.hasHighlightFeature(id, feature)) {
|
|
204
|
+
highlightFeature(feature);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
content[cesiumTilesetLastUpdated] = Date.now();
|
|
210
|
+
} else {
|
|
211
|
+
content[updateFeatureOverride]?.();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
function updateStyle(style: StyleItem): void {
|
|
215
|
+
impl.style = style;
|
|
216
|
+
|
|
217
|
+
function updateTilesetStyle(tileset: Cesium3DTileset): void {
|
|
218
|
+
tileset.style = impl.style.cesiumStyle;
|
|
219
|
+
if (onStyleChangeRemover) {
|
|
220
|
+
onStyleChangeRemover();
|
|
221
|
+
}
|
|
222
|
+
styleLastUpdated = Date.now();
|
|
223
|
+
if (tileset.colorBlendMode !== impl.style.colorBlendMode) {
|
|
224
|
+
// we only support replace and mix mode if the _3DTILESDIFFUSE Flag is set in the tileset
|
|
225
|
+
if (
|
|
226
|
+
impl.style.colorBlendMode !== Cesium3DTileColorBlendMode.HIGHLIGHT
|
|
227
|
+
) {
|
|
228
|
+
if (
|
|
229
|
+
tileset.extras &&
|
|
230
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,no-underscore-dangle
|
|
231
|
+
(tileset.extras._3DTILESDIFFUSE as boolean)
|
|
232
|
+
) {
|
|
233
|
+
tileset.colorBlendMode = impl.style.colorBlendMode;
|
|
234
|
+
}
|
|
235
|
+
} else {
|
|
236
|
+
tileset.colorBlendMode = impl.style.colorBlendMode;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (impl.initialized) {
|
|
241
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
242
|
+
if (impl instanceof CesiumTilesetCesiumImpl) {
|
|
243
|
+
if (impl.cesium3DTileset) {
|
|
244
|
+
updateTilesetStyle(impl.cesium3DTileset);
|
|
245
|
+
onStyleChangeRemover = impl.style.styleChanged.addEventListener(
|
|
246
|
+
() => {
|
|
247
|
+
impl.cesium3DTileset?.makeStyleDirty();
|
|
248
|
+
styleLastUpdated = Date.now();
|
|
249
|
+
},
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
} else if (impl.data) {
|
|
253
|
+
impl.data.layers.forEach(({ tileset }) => {
|
|
254
|
+
if (tileset) {
|
|
255
|
+
updateTilesetStyle(tileset);
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
onStyleChangeRemover = impl.style.styleChanged.addEventListener(() => {
|
|
259
|
+
impl.data?.layers.forEach(({ tileset }) => {
|
|
260
|
+
tileset?.makeStyleDirty();
|
|
261
|
+
});
|
|
262
|
+
styleLastUpdated = Date.now();
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
function applyStyle(tile: Cesium3DTile): void {
|
|
268
|
+
if (tile.contentReady) {
|
|
269
|
+
if (tile.content instanceof Composite3DTileContent) {
|
|
270
|
+
for (let i = 0; i < tile.content.innerContents.length; i++) {
|
|
271
|
+
styleContent(tile.content.innerContents[i] as Cesium3DTileContent);
|
|
272
|
+
}
|
|
273
|
+
} else {
|
|
274
|
+
styleContent(tile.content);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
280
|
+
if (impl instanceof CesiumTilesetCesiumImpl) {
|
|
281
|
+
onFeatureVisibilityChangeRemover =
|
|
282
|
+
impl.featureVisibility.changed.addEventListener(() => {
|
|
283
|
+
impl.cesium3DTileset?.makeStyleDirty();
|
|
284
|
+
});
|
|
285
|
+
} else {
|
|
286
|
+
onFeatureVisibilityChangeRemover =
|
|
287
|
+
impl.featureVisibility.changed.addEventListener(() => {
|
|
288
|
+
impl.data?.layers.forEach(({ tileset }) => {
|
|
289
|
+
tileset?.makeStyleDirty();
|
|
290
|
+
});
|
|
291
|
+
styleLastUpdated = Date.now();
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
return {
|
|
296
|
+
styleContent,
|
|
297
|
+
updateStyle,
|
|
298
|
+
applyStyle,
|
|
299
|
+
destroy: (): void => {
|
|
300
|
+
if (onStyleChangeRemover) {
|
|
301
|
+
onStyleChangeRemover();
|
|
302
|
+
onStyleChangeRemover = null;
|
|
303
|
+
}
|
|
304
|
+
if (onFeatureVisibilityChangeRemover) {
|
|
305
|
+
onFeatureVisibilityChangeRemover();
|
|
306
|
+
onFeatureVisibilityChangeRemover = null;
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export function createTilesetEventListeners(
|
|
313
|
+
impl: CesiumTilesetCesiumImpl | I3SCesiumImpl,
|
|
314
|
+
tileset: Cesium3DTileset,
|
|
315
|
+
): void {
|
|
316
|
+
function tileLoadedHandler(tile: Cesium3DTile): void {
|
|
317
|
+
if (impl.attributeProvider) {
|
|
318
|
+
const extent = getExtentFromBoundingVolume(
|
|
319
|
+
tile.contentBoundingVolume,
|
|
320
|
+
tile.boundingSphere,
|
|
321
|
+
);
|
|
322
|
+
const features: HighlightableFeature[] = [];
|
|
323
|
+
const batchSize = tile.content.featuresLength;
|
|
324
|
+
for (let batchId = 0; batchId < batchSize; batchId++) {
|
|
325
|
+
const feature = tile.content.getFeature(batchId);
|
|
326
|
+
if (feature) {
|
|
327
|
+
features.push(feature);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
impl.attributeProvider
|
|
332
|
+
.augmentFeatures(features, extent)
|
|
333
|
+
.then(() => {
|
|
334
|
+
impl.applyStyle(tile);
|
|
335
|
+
})
|
|
336
|
+
.catch((err: unknown) => {
|
|
337
|
+
impl
|
|
338
|
+
.getLogger()
|
|
339
|
+
.error(`Error augmenting features in ${impl.className}:`, err);
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
tileset.tileLoad.addEventListener(tileLoadedHandler);
|
|
345
|
+
tileset.tileVisible.addEventListener(impl.applyStyle);
|
|
346
|
+
tileset.tileUnload.addEventListener((tile: Cesium3DTile) => {
|
|
347
|
+
delete tile[cesiumTilesetLastUpdated];
|
|
348
|
+
delete tile.content[cesiumTilesetLastUpdated];
|
|
349
|
+
delete tile.content[updateFeatureOverride];
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
|
|
84
353
|
/**
|
|
85
354
|
* represents the cesium implementation for a {@link CesiumTilesetLayer} layer.
|
|
86
355
|
*/
|
|
87
356
|
class CesiumTilesetCesiumImpl
|
|
88
|
-
extends LayerImplementation<
|
|
357
|
+
extends LayerImplementation<BaseCesiumMap>
|
|
89
358
|
implements FeatureLayerImplementation
|
|
90
359
|
{
|
|
91
360
|
static get className(): string {
|
|
@@ -112,19 +381,23 @@ class CesiumTilesetCesiumImpl
|
|
|
112
381
|
|
|
113
382
|
allowPicking: boolean;
|
|
114
383
|
|
|
384
|
+
attributeProvider?: AttributeProvider;
|
|
385
|
+
|
|
115
386
|
private _initializedPromise: Promise<Cesium3DTileset> | null = null;
|
|
116
387
|
|
|
117
388
|
private _originalOrigin: Cartesian3 | null = null;
|
|
118
389
|
|
|
119
|
-
private
|
|
390
|
+
private _destroyStyle: (() => void) | null = null;
|
|
120
391
|
|
|
121
|
-
private
|
|
392
|
+
private _customShader: CustomShader | undefined;
|
|
122
393
|
|
|
123
|
-
|
|
394
|
+
styleContent: (content: Cesium3DTileContent) => void;
|
|
124
395
|
|
|
125
|
-
|
|
396
|
+
updateStyle: (style: StyleItem) => void;
|
|
126
397
|
|
|
127
|
-
|
|
398
|
+
applyStyle: (tile: Cesium3DTile) => void;
|
|
399
|
+
|
|
400
|
+
constructor(map: BaseCesiumMap, options: CesiumTilesetImplementationOptions) {
|
|
128
401
|
super(map, options);
|
|
129
402
|
|
|
130
403
|
this.cesium3DTileset = null;
|
|
@@ -138,18 +411,13 @@ class CesiumTilesetCesiumImpl
|
|
|
138
411
|
this.offset = options.offset;
|
|
139
412
|
this._customShader = options.customShader;
|
|
140
413
|
this.allowPicking = options.allowPicking;
|
|
414
|
+
this.attributeProvider = options.attributeProvider;
|
|
141
415
|
|
|
142
|
-
|
|
143
|
-
this.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
this.cesium3DTileset
|
|
148
|
-
) {
|
|
149
|
-
// Force tileset to re-apply style for unhighlighted features
|
|
150
|
-
this.cesium3DTileset.makeStyleDirty();
|
|
151
|
-
}
|
|
152
|
-
});
|
|
416
|
+
const stylingContext = createCesiumStylingContext(this);
|
|
417
|
+
this.styleContent = stylingContext.styleContent;
|
|
418
|
+
this.updateStyle = stylingContext.updateStyle;
|
|
419
|
+
this.applyStyle = stylingContext.applyStyle;
|
|
420
|
+
this._destroyStyle = stylingContext.destroy;
|
|
153
421
|
}
|
|
154
422
|
|
|
155
423
|
get customShader(): CustomShader | undefined {
|
|
@@ -199,14 +467,7 @@ class CesiumTilesetCesiumImpl
|
|
|
199
467
|
}
|
|
200
468
|
this.cesium3DTileset[vcsLayerName] = this.name;
|
|
201
469
|
this.cesium3DTileset[allowPicking] = this.allowPicking;
|
|
202
|
-
this.cesium3DTileset
|
|
203
|
-
this.applyStyle.bind(this),
|
|
204
|
-
);
|
|
205
|
-
this.cesium3DTileset.tileUnload.addEventListener((tile: Cesium3DTile) => {
|
|
206
|
-
delete tile[cesiumTilesetLastUpdated];
|
|
207
|
-
delete tile.content[cesiumTilesetLastUpdated];
|
|
208
|
-
delete tile.content[updateFeatureOverride];
|
|
209
|
-
});
|
|
470
|
+
createTilesetEventListeners(this, this.cesium3DTileset);
|
|
210
471
|
|
|
211
472
|
this._originalOrigin = Cartesian3.clone(
|
|
212
473
|
this.cesium3DTileset.boundingSphere.center,
|
|
@@ -290,39 +551,6 @@ class CesiumTilesetCesiumImpl
|
|
|
290
551
|
}
|
|
291
552
|
}
|
|
292
553
|
|
|
293
|
-
updateStyle(style: StyleItem): void {
|
|
294
|
-
this.style = style;
|
|
295
|
-
if (this.initialized && this.cesium3DTileset) {
|
|
296
|
-
this.cesium3DTileset.style = this.style.cesiumStyle;
|
|
297
|
-
if (this._onStyleChangeRemover) {
|
|
298
|
-
this._onStyleChangeRemover();
|
|
299
|
-
}
|
|
300
|
-
this._onStyleChangeRemover = this.style.styleChanged.addEventListener(
|
|
301
|
-
() => {
|
|
302
|
-
this.cesium3DTileset?.makeStyleDirty();
|
|
303
|
-
this._styleLastUpdated = Date.now();
|
|
304
|
-
},
|
|
305
|
-
);
|
|
306
|
-
this._styleLastUpdated = Date.now();
|
|
307
|
-
if (this.cesium3DTileset.colorBlendMode !== this.style.colorBlendMode) {
|
|
308
|
-
// we only support replace and mix mode if the _3DTILESDIFFUSE Flag is set in the tileset
|
|
309
|
-
if (
|
|
310
|
-
this.style.colorBlendMode !== Cesium3DTileColorBlendMode.HIGHLIGHT
|
|
311
|
-
) {
|
|
312
|
-
if (
|
|
313
|
-
this.cesium3DTileset.extras &&
|
|
314
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,no-underscore-dangle
|
|
315
|
-
(this.cesium3DTileset.extras._3DTILESDIFFUSE as boolean)
|
|
316
|
-
) {
|
|
317
|
-
this.cesium3DTileset.colorBlendMode = this.style.colorBlendMode;
|
|
318
|
-
}
|
|
319
|
-
} else {
|
|
320
|
-
this.cesium3DTileset.colorBlendMode = this.style.colorBlendMode;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
554
|
updateSplitDirection(splitDirection: SplitDirection): void {
|
|
327
555
|
this.splitDirection = splitDirection;
|
|
328
556
|
if (this.cesium3DTileset) {
|
|
@@ -330,130 +558,6 @@ class CesiumTilesetCesiumImpl
|
|
|
330
558
|
}
|
|
331
559
|
}
|
|
332
560
|
|
|
333
|
-
applyStyle(tile: Cesium3DTile): void {
|
|
334
|
-
if (tile.contentReady) {
|
|
335
|
-
if (tile.content instanceof Composite3DTileContent) {
|
|
336
|
-
for (let i = 0; i < tile.content.innerContents.length; i++) {
|
|
337
|
-
this.styleContent(
|
|
338
|
-
tile.content.innerContents[i] as Cesium3DTileContent,
|
|
339
|
-
);
|
|
340
|
-
}
|
|
341
|
-
} else {
|
|
342
|
-
this.styleContent(tile.content);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
styleContent(content: Cesium3DTileContent): void {
|
|
348
|
-
const styleHasChanged =
|
|
349
|
-
this._styleLastUpdated > (content[cesiumTilesetLastUpdated] ?? 0);
|
|
350
|
-
if (
|
|
351
|
-
!content[cesiumTilesetLastUpdated] ||
|
|
352
|
-
content[cesiumTilesetLastUpdated] < this.featureVisibility.lastUpdated ||
|
|
353
|
-
content[cesiumTilesetLastUpdated] <
|
|
354
|
-
(this.globalHider?.lastUpdated ?? 0) ||
|
|
355
|
-
styleHasChanged
|
|
356
|
-
) {
|
|
357
|
-
// content[updateFeatureOverride]?.reset();
|
|
358
|
-
delete content[updateFeatureOverride];
|
|
359
|
-
const batchSize = content.featuresLength;
|
|
360
|
-
const featureOverride = {
|
|
361
|
-
hideLocal: [] as [string, HighlightableFeature][],
|
|
362
|
-
hideGlobal: [] as [string, HighlightableFeature][],
|
|
363
|
-
highlight: [] as [string, HighlightableFeature][],
|
|
364
|
-
};
|
|
365
|
-
for (let batchId = 0; batchId < batchSize; batchId++) {
|
|
366
|
-
const feature = content.getFeature(batchId);
|
|
367
|
-
if (feature) {
|
|
368
|
-
let id = feature.getProperty('id') as string | undefined;
|
|
369
|
-
if (!id) {
|
|
370
|
-
id = `${content.url}${String(batchId)}`;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
let shouldUpdateOriginalStyle = true;
|
|
374
|
-
if (
|
|
375
|
-
this.featureVisibility.highlightedObjects[id] &&
|
|
376
|
-
!this.featureVisibility.hasHighlightFeature(id, feature)
|
|
377
|
-
) {
|
|
378
|
-
this.featureVisibility.addHighlightFeature(id, feature);
|
|
379
|
-
featureOverride.highlight.push([id, feature]);
|
|
380
|
-
shouldUpdateOriginalStyle = false;
|
|
381
|
-
} else if (
|
|
382
|
-
this.featureVisibility.hasHighlightFeature(id, feature) &&
|
|
383
|
-
styleHasChanged &&
|
|
384
|
-
feature[originalStyle]
|
|
385
|
-
) {
|
|
386
|
-
// Feature is already highlighted and style has changed
|
|
387
|
-
// Clear the old cached style - when unhighlighted, we'll force a tileset style update
|
|
388
|
-
delete feature[originalStyle];
|
|
389
|
-
featureOverride.highlight.push([id, feature]);
|
|
390
|
-
shouldUpdateOriginalStyle = false;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
if (this.featureVisibility.hiddenObjects[id]) {
|
|
394
|
-
if (!this.featureVisibility.hasHiddenFeature(id, feature)) {
|
|
395
|
-
this.featureVisibility.addHiddenFeature(id, feature);
|
|
396
|
-
featureOverride.hideLocal.push([id, feature]);
|
|
397
|
-
} else if (styleHasChanged && feature[originalStyle]) {
|
|
398
|
-
// Feature is already hidden and style has changed, clear original style
|
|
399
|
-
// so it will be re-cached with the new style when shown
|
|
400
|
-
delete feature[originalStyle];
|
|
401
|
-
}
|
|
402
|
-
shouldUpdateOriginalStyle = false;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
if (this.globalHider?.hiddenObjects[id]) {
|
|
406
|
-
if (!this.globalHider?.hasFeature(id, feature)) {
|
|
407
|
-
this.globalHider?.addFeature(id, feature);
|
|
408
|
-
}
|
|
409
|
-
featureOverride.hideGlobal.push([id, feature]);
|
|
410
|
-
if (styleHasChanged && feature[originalStyle]) {
|
|
411
|
-
// Feature is globally hidden and style has changed, clear original style
|
|
412
|
-
delete feature[originalStyle];
|
|
413
|
-
}
|
|
414
|
-
shouldUpdateOriginalStyle = false;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
if (
|
|
418
|
-
shouldUpdateOriginalStyle &&
|
|
419
|
-
styleHasChanged &&
|
|
420
|
-
feature[originalStyle] // can only be a color for cesium, so no check for undefined required
|
|
421
|
-
) {
|
|
422
|
-
updateOriginalStyle(feature);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
if (
|
|
427
|
-
featureOverride.hideLocal.length > 0 ||
|
|
428
|
-
featureOverride.hideGlobal.length > 0 ||
|
|
429
|
-
featureOverride.highlight.length > 0
|
|
430
|
-
) {
|
|
431
|
-
content[updateFeatureOverride] = (): void => {
|
|
432
|
-
featureOverride.hideGlobal.forEach(([id, feature]) => {
|
|
433
|
-
if (this.globalHider?.hasFeature(id, feature)) {
|
|
434
|
-
hideFeature(feature);
|
|
435
|
-
}
|
|
436
|
-
});
|
|
437
|
-
|
|
438
|
-
featureOverride.hideLocal.forEach(([id, feature]) => {
|
|
439
|
-
if (this.featureVisibility.hasHiddenFeature(id, feature)) {
|
|
440
|
-
hideFeature(feature);
|
|
441
|
-
}
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
featureOverride.highlight.forEach(([id, feature]) => {
|
|
445
|
-
if (this.featureVisibility.hasHighlightFeature(id, feature)) {
|
|
446
|
-
highlightFeature(feature);
|
|
447
|
-
}
|
|
448
|
-
});
|
|
449
|
-
};
|
|
450
|
-
}
|
|
451
|
-
content[cesiumTilesetLastUpdated] = Date.now();
|
|
452
|
-
} else {
|
|
453
|
-
content[updateFeatureOverride]?.();
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
|
|
457
561
|
destroy(): void {
|
|
458
562
|
if (this.cesium3DTileset) {
|
|
459
563
|
if (this.map.initialized) {
|
|
@@ -466,12 +570,8 @@ class CesiumTilesetCesiumImpl
|
|
|
466
570
|
this.cesium3DTileset = null;
|
|
467
571
|
}
|
|
468
572
|
|
|
469
|
-
if (this.
|
|
470
|
-
this.
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
if (this._onFeatureVisibilityChangeRemover) {
|
|
474
|
-
this._onFeatureVisibilityChangeRemover();
|
|
573
|
+
if (this._destroyStyle) {
|
|
574
|
+
this._destroyStyle();
|
|
475
575
|
}
|
|
476
576
|
|
|
477
577
|
super.destroy();
|