@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
|
@@ -9,7 +9,8 @@ import { handlerSymbol, vertexSymbol } from '../editorSymbols.js';
|
|
|
9
9
|
import type { EventAfterEventHandler } from '../../../interaction/abstractInteraction.js';
|
|
10
10
|
import AbstractInteraction from '../../../interaction/abstractInteraction.js';
|
|
11
11
|
import type BaseOLMap from '../../../map/baseOLMap.js';
|
|
12
|
-
import
|
|
12
|
+
import CesiumMap from '../../../map/cesiumMap.js';
|
|
13
|
+
import PanoramaMap from '../../../map/panoramaMap.js';
|
|
13
14
|
|
|
14
15
|
function suspendOpenlayerMap(map: BaseOLMap): () => void {
|
|
15
16
|
const dragPan = map
|
|
@@ -26,6 +27,13 @@ function suspendOpenlayerMap(map: BaseOLMap): () => void {
|
|
|
26
27
|
return () => {};
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
function suspendPanoramaMap(map: PanoramaMap): () => void {
|
|
31
|
+
map.panoramaCameraController.enabled = false;
|
|
32
|
+
return () => {
|
|
33
|
+
map.panoramaCameraController.enabled = true;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
29
37
|
type CachedScreenSpaceCameraControllerKeys =
|
|
30
38
|
| 'lookEventTypes'
|
|
31
39
|
| 'tiltEventTypes'
|
|
@@ -99,8 +107,10 @@ class MapInteractionController extends AbstractInteraction {
|
|
|
99
107
|
((event.feature as Feature)[vertexSymbol] ||
|
|
100
108
|
(event.feature as Feature)[handlerSymbol])
|
|
101
109
|
) {
|
|
102
|
-
if (event.map.className ===
|
|
110
|
+
if (event.map.className === CesiumMap.className) {
|
|
103
111
|
this._clear = suspendCesiumMap(event.map as CesiumMap);
|
|
112
|
+
} else if (event.map.className === PanoramaMap.className) {
|
|
113
|
+
this._clear = suspendPanoramaMap(event.map as PanoramaMap);
|
|
104
114
|
} else {
|
|
105
115
|
this._clear = suspendOpenlayerMap(event.map as BaseOLMap);
|
|
106
116
|
}
|
|
@@ -19,6 +19,7 @@ import { vertexIndexSymbol } from '../editorSymbols.js';
|
|
|
19
19
|
import { isVertex } from '../editorHelpers.js';
|
|
20
20
|
import type { SnappingInteractionEvent } from '../editorSessionHelpers.js';
|
|
21
21
|
import { alreadySnapped } from '../editorSessionHelpers.js';
|
|
22
|
+
import PanoramaMap from '../../../map/panoramaMap.js';
|
|
22
23
|
|
|
23
24
|
function getBearings(coordinates: Coordinate[], isPolygon: boolean): number[] {
|
|
24
25
|
const length = isPolygon ? coordinates.length : coordinates.length - 1;
|
|
@@ -141,13 +142,14 @@ export default class TranslationSnapping extends AbstractInteraction {
|
|
|
141
142
|
return Promise.resolve(event);
|
|
142
143
|
}
|
|
143
144
|
|
|
145
|
+
const ctrlKey = event.key === ModificationKeyType.CTRL;
|
|
146
|
+
const useSnapping =
|
|
147
|
+
event.map.className === PanoramaMap.className ? ctrlKey : !ctrlKey;
|
|
148
|
+
|
|
144
149
|
if (event.type === EventType.DRAGEND && this._lastCoordinate) {
|
|
145
150
|
event.positionOrPixel = this._lastCoordinate;
|
|
146
151
|
this._lastCoordinate = undefined;
|
|
147
|
-
} else if (
|
|
148
|
-
event.key !== ModificationKeyType.CTRL &&
|
|
149
|
-
isVertex(event.feature)
|
|
150
|
-
) {
|
|
152
|
+
} else if (useSnapping && isVertex(event.feature)) {
|
|
151
153
|
const index = event.feature[vertexIndexSymbol];
|
|
152
154
|
if (event.type === EventType.DRAGSTART) {
|
|
153
155
|
this._setCoordinates(index);
|
|
@@ -160,7 +160,7 @@ function startSelectFeaturesSession(
|
|
|
160
160
|
interactionChain,
|
|
161
161
|
removed: interactionRemoved,
|
|
162
162
|
destroy: destroyInteractionChain,
|
|
163
|
-
} = setupInteractionChain(app.maps
|
|
163
|
+
} = setupInteractionChain(app.maps, interactionId);
|
|
164
164
|
|
|
165
165
|
const highlightManager = createHighlightManager(layer, highlightStyle);
|
|
166
166
|
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
} from './transformationTypes.js';
|
|
36
36
|
import Projection from '../../projection.js';
|
|
37
37
|
import { mercatorToCartesian } from '../../math.js';
|
|
38
|
-
import type
|
|
38
|
+
import type BaseCesiumMap from '../../../map/baseCesiumMap.js';
|
|
39
39
|
|
|
40
40
|
function setFeatureOnPrimitive(primitive: Primitive): void {
|
|
41
41
|
if (primitive[handlerSymbol]) {
|
|
@@ -545,7 +545,7 @@ function createShowShadowPrimitive(
|
|
|
545
545
|
* @param mode
|
|
546
546
|
*/
|
|
547
547
|
export default function create3DHandlers(
|
|
548
|
-
map:
|
|
548
|
+
map: BaseCesiumMap,
|
|
549
549
|
mode: TransformationMode,
|
|
550
550
|
): Handlers {
|
|
551
551
|
const primitiveCollection = new PrimitiveCollection();
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
} from 'ol/extent.js';
|
|
9
9
|
import { HeightReference } from '@vcmap-cesium/engine';
|
|
10
10
|
import Extent3D from '../../featureconverter/extent3D.js';
|
|
11
|
-
import CesiumMap from '../../../map/cesiumMap.js';
|
|
12
11
|
import BaseOLMap from '../../../map/baseOLMap.js';
|
|
13
12
|
import create3DHandlers from './create3DHandlers.js';
|
|
14
13
|
import create2DHandlers from './create2DHandlers.js';
|
|
@@ -28,6 +27,7 @@ import {
|
|
|
28
27
|
} from '../../featureconverter/vectorHeightInfo.js';
|
|
29
28
|
import { mercatorToCartographic } from '../../math.js';
|
|
30
29
|
import { is2DLayout } from '../../geometryHelpers.js';
|
|
30
|
+
import BaseCesiumMap from '../../../map/baseCesiumMap.js';
|
|
31
31
|
|
|
32
32
|
type FeatureCenterInfo = {
|
|
33
33
|
center: Coordinate;
|
|
@@ -126,7 +126,7 @@ export default function createTransformationHandler(
|
|
|
126
126
|
let handlerFeatures: Handlers;
|
|
127
127
|
let center: Coordinate = [0, 0, 0];
|
|
128
128
|
let getCenterFromFeatures: (features: Feature[]) => FeatureCenterInfo;
|
|
129
|
-
let cesiumMap:
|
|
129
|
+
let cesiumMap: BaseCesiumMap | null = null;
|
|
130
130
|
|
|
131
131
|
const setFeatures = (features: Feature[]): void => {
|
|
132
132
|
const show = features.length > 0;
|
|
@@ -168,13 +168,15 @@ export default function createTransformationHandler(
|
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
|
|
171
|
-
if (map instanceof
|
|
171
|
+
if (map instanceof BaseCesiumMap) {
|
|
172
172
|
handlerFeatures = create3DHandlers(map, mode);
|
|
173
173
|
getCenterFromFeatures = getCenterFromFeatures3D.bind(null, layer, mode);
|
|
174
174
|
cesiumMap = map;
|
|
175
175
|
} else if (map instanceof BaseOLMap) {
|
|
176
176
|
handlerFeatures = create2DHandlers(map, scratchLayer, mode);
|
|
177
177
|
getCenterFromFeatures = getCenterFromFeatures2D;
|
|
178
|
+
} else {
|
|
179
|
+
throw new Error('unsupported map type for transformation handler');
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
return {
|
|
@@ -17,7 +17,7 @@ import Projection, { mercatorProjection } from '../../projection.js';
|
|
|
17
17
|
import { cartographicToWgs84, mercatorToCartesian } from '../../math.js';
|
|
18
18
|
import type { TransformationHandler } from './transformationTypes.js';
|
|
19
19
|
import { AxisAndPlanes, is1DAxis, is2DAxis } from './transformationTypes.js';
|
|
20
|
-
import
|
|
20
|
+
import BaseCesiumMap from '../../../map/baseCesiumMap.js';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Of type [dx, dy, dz];
|
|
@@ -66,7 +66,7 @@ class TranslateInteraction extends AbstractInteraction {
|
|
|
66
66
|
const axis = (event.feature as Feature)[handlerSymbol] as AxisAndPlanes;
|
|
67
67
|
if (axis !== AxisAndPlanes.NONE) {
|
|
68
68
|
this._transformationHandler!.showAxis = axis;
|
|
69
|
-
if (event.map instanceof
|
|
69
|
+
if (event.map instanceof BaseCesiumMap) {
|
|
70
70
|
if (is1DAxis(axis)) {
|
|
71
71
|
this._getTranslateEvent = this._dragAlongAxis3D(axis, event);
|
|
72
72
|
} else if (is2DAxis(axis)) {
|
|
@@ -86,7 +86,7 @@ class TranslateInteraction extends AbstractInteraction {
|
|
|
86
86
|
axis: AxisAndPlanes,
|
|
87
87
|
event: EventAfterEventHandler,
|
|
88
88
|
): GetTranslateEvent {
|
|
89
|
-
const scene = (event.map as
|
|
89
|
+
const scene = (event.map as BaseCesiumMap).getScene() as Scene;
|
|
90
90
|
if (axis !== AxisAndPlanes.Z) {
|
|
91
91
|
const center = mercatorToCartesian(this._transformationHandler!.center);
|
|
92
92
|
let plane = Plane.clone(Plane.ORIGIN_XY_PLANE);
|
|
@@ -147,7 +147,7 @@ class TranslateInteraction extends AbstractInteraction {
|
|
|
147
147
|
axis: AxisAndPlanes,
|
|
148
148
|
event: EventAfterEventHandler,
|
|
149
149
|
): GetTranslateEvent {
|
|
150
|
-
const scene = (event.map as
|
|
150
|
+
const scene = (event.map as BaseCesiumMap).getScene() as Scene;
|
|
151
151
|
const center = mercatorToCartesian(this._transformationHandler!.center);
|
|
152
152
|
let plane: Plane;
|
|
153
153
|
if (axis === AxisAndPlanes.YZ) {
|
package/src/util/fetch.ts
CHANGED
|
@@ -38,6 +38,13 @@ export async function requestObjectUrl(
|
|
|
38
38
|
return URL.createObjectURL(blob);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Get a RequestInit object for the given url, adding optional headers. If the url is in the
|
|
43
|
+
* TrustedServers {@see https://cesium.com/learn/cesiumjs/ref-doc/TrustedServers.html?classFilter=Trusted}
|
|
44
|
+
* credentials will be included in the request.
|
|
45
|
+
* @param url
|
|
46
|
+
* @param headers
|
|
47
|
+
*/
|
|
41
48
|
export function getInitForUrl(
|
|
42
49
|
url: string,
|
|
43
50
|
headers?: Record<string, string>,
|
|
@@ -69,9 +69,9 @@ class FlightInstance extends VcsObject {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
constructor(options: FlightInstanceOptions) {
|
|
72
|
-
super(options);
|
|
73
|
-
|
|
74
72
|
const defaultOptions = FlightInstance.getDefaultOptions();
|
|
73
|
+
super({ ...defaultOptions, ...options });
|
|
74
|
+
|
|
75
75
|
const anchorsArray = (options.anchors ?? defaultOptions.anchors!)
|
|
76
76
|
.map(anchorFromGeojsonFeature)
|
|
77
77
|
.filter((a): a is FlightAnchor => !!a);
|
|
@@ -205,15 +205,16 @@ class FlightInstance extends VcsObject {
|
|
|
205
205
|
* returns an options object for this flight. if this flight was configured via an URL, only the url will be configured.
|
|
206
206
|
* @returns
|
|
207
207
|
*/
|
|
208
|
-
toJSON(
|
|
209
|
-
|
|
208
|
+
toJSON(
|
|
209
|
+
defaultOptions = FlightInstance.getDefaultOptions(),
|
|
210
|
+
): FlightInstanceOptions {
|
|
211
|
+
const config = super.toJSON(defaultOptions) as FlightInstanceOptions;
|
|
210
212
|
|
|
211
213
|
if (this._url) {
|
|
212
214
|
config.url = this._url;
|
|
213
215
|
return config;
|
|
214
216
|
}
|
|
215
217
|
|
|
216
|
-
const defaultOptions = FlightInstance.getDefaultOptions();
|
|
217
218
|
if (this._multiplier !== defaultOptions.multiplier) {
|
|
218
219
|
config.multiplier = this._multiplier;
|
|
219
220
|
}
|
|
@@ -22,6 +22,7 @@ import PanoramaImageSelection from '../interaction/panoramaImageSelection.js';
|
|
|
22
22
|
import type { PanoramaImage } from '../panorama/panoramaImage.js';
|
|
23
23
|
import type PanoramaMap from '../map/panoramaMap.js';
|
|
24
24
|
import PanoramaFeatureHighlight from '../interaction/panoramaFeatureHighlight.js';
|
|
25
|
+
import { EventType } from '../interaction/interactionType.js';
|
|
25
26
|
|
|
26
27
|
export type MapCollectionInitializationError = {
|
|
27
28
|
error: Error;
|
|
@@ -258,6 +259,23 @@ class MapCollection extends Collection<VcsMap> {
|
|
|
258
259
|
return this._exclusiveMapControls?.id;
|
|
259
260
|
}
|
|
260
261
|
|
|
262
|
+
/**
|
|
263
|
+
* Indicates whether panorama image selection is paused.
|
|
264
|
+
*/
|
|
265
|
+
get pausePanoramaImageSelection(): boolean {
|
|
266
|
+
return (
|
|
267
|
+
this._panoramaImageSelection.active === EventType.NONE &&
|
|
268
|
+
this._panoramaTileHighlight.active === EventType.NONE
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
set pausePanoramaImageSelection(paused: boolean) {
|
|
273
|
+
check(paused, Boolean);
|
|
274
|
+
const active = paused ? false : undefined;
|
|
275
|
+
this._panoramaImageSelection.setActive(active);
|
|
276
|
+
this._panoramaTileHighlight.setActive(active);
|
|
277
|
+
}
|
|
278
|
+
|
|
261
279
|
/**
|
|
262
280
|
* Adds a map to the collection. This will set the collections target
|
|
263
281
|
* and the collections on the map.
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import type { Size } from 'ol/size.js';
|
|
2
2
|
import { getLogger } from '@vcsuite/logger';
|
|
3
|
-
import CesiumMap from '../map/cesiumMap.js';
|
|
4
3
|
import OpenlayersMap from '../map/openlayersMap.js';
|
|
5
4
|
import ObliqueMap from '../map/obliqueMap.js';
|
|
6
|
-
import PanoramaMap from '../map/panoramaMap.js';
|
|
7
5
|
import type VcsApp from '../vcsApp.js';
|
|
6
|
+
import BaseCesiumMap from '../map/baseCesiumMap.js';
|
|
8
7
|
/**
|
|
9
8
|
* Prepares the cesium map for the screenshot
|
|
10
9
|
* @param map - The cesium map
|
|
11
10
|
* @param scale - The factor to scale the map according to the required resolution
|
|
12
11
|
* @returns The function to reset the applied scale.
|
|
13
12
|
*/
|
|
14
|
-
function prepareCesiumMap(
|
|
15
|
-
map: CesiumMap | PanoramaMap,
|
|
16
|
-
scale: number,
|
|
17
|
-
): () => void {
|
|
13
|
+
function prepareCesiumMap(map: BaseCesiumMap, scale: number): () => void {
|
|
18
14
|
const viewer = map.getCesiumWidget()!;
|
|
19
15
|
const { resolutionScale } = viewer;
|
|
20
16
|
viewer.resolutionScale = scale;
|
|
@@ -64,7 +60,7 @@ function prepareOlMap(
|
|
|
64
60
|
* @returns A promise that resolves to the canvas element.
|
|
65
61
|
*/
|
|
66
62
|
async function getImageFromCesium(
|
|
67
|
-
map:
|
|
63
|
+
map: BaseCesiumMap,
|
|
68
64
|
): Promise<HTMLCanvasElement> {
|
|
69
65
|
const { scene } = map.getCesiumWidget()!;
|
|
70
66
|
|
|
@@ -167,7 +163,7 @@ export default async function renderScreenshot(
|
|
|
167
163
|
let resetMap: () => void;
|
|
168
164
|
const map = app.maps.activeMap;
|
|
169
165
|
|
|
170
|
-
if (map instanceof
|
|
166
|
+
if (map instanceof BaseCesiumMap) {
|
|
171
167
|
const { canvas } = map.getCesiumWidget()!.scene;
|
|
172
168
|
const canvasWidth = canvas.width;
|
|
173
169
|
const canvasHeight = canvas.height;
|
package/src/util/viewpoint.ts
CHANGED
|
@@ -182,9 +182,9 @@ class Viewpoint extends VcsObject {
|
|
|
182
182
|
* @param options
|
|
183
183
|
*/
|
|
184
184
|
constructor(options: ViewpointOptions) {
|
|
185
|
-
super(options);
|
|
186
|
-
|
|
187
185
|
const defaultOptions = Viewpoint.getDefaultOptions();
|
|
186
|
+
super({ ...defaultOptions, ...options });
|
|
187
|
+
|
|
188
188
|
this.cameraPosition = null;
|
|
189
189
|
if (
|
|
190
190
|
Array.isArray(options.cameraPosition) &&
|
package/src/vcsApp.ts
CHANGED
|
@@ -29,7 +29,11 @@ import VcsEvent from './vcsEvent.js';
|
|
|
29
29
|
import { setDefaultProjectionOptions } from './util/projection.js';
|
|
30
30
|
import ObliqueMap from './map/obliqueMap.js';
|
|
31
31
|
import OverrideClassRegistry from './overrideClassRegistry.js';
|
|
32
|
-
import type {
|
|
32
|
+
import type {
|
|
33
|
+
AbstractCtor,
|
|
34
|
+
CtorType,
|
|
35
|
+
FeatureProviderClass,
|
|
36
|
+
} from './classRegistry.js';
|
|
33
37
|
import ClassRegistry, {
|
|
34
38
|
categoryClassRegistry,
|
|
35
39
|
featureProviderClassRegistry,
|
|
@@ -44,7 +48,6 @@ import { moduleIdSymbol } from './moduleIdSymbol.js';
|
|
|
44
48
|
import type LayerCollection from './util/layerCollection.js';
|
|
45
49
|
import type Category from './category/category.js';
|
|
46
50
|
import type TileProvider from './layer/tileProvider/tileProvider.js';
|
|
47
|
-
import type AbstractFeatureProvider from './featureProvider/abstractFeatureProvider.js';
|
|
48
51
|
import type { HiddenObject } from './util/hiddenObjects.js';
|
|
49
52
|
import { createHiddenObjectsCollection } from './util/hiddenObjects.js';
|
|
50
53
|
import type { FlightInstanceOptions } from './util/flight/flightInstance.js';
|
|
@@ -155,9 +158,7 @@ class VcsApp {
|
|
|
155
158
|
typeof TileProvider
|
|
156
159
|
>;
|
|
157
160
|
|
|
158
|
-
private _featureProviderClassRegistry: OverrideClassRegistry<
|
|
159
|
-
typeof AbstractFeatureProvider
|
|
160
|
-
>;
|
|
161
|
+
private _featureProviderClassRegistry: OverrideClassRegistry<FeatureProviderClass>;
|
|
161
162
|
|
|
162
163
|
/**
|
|
163
164
|
* @param options
|
|
@@ -402,9 +403,7 @@ class VcsApp {
|
|
|
402
403
|
return this._tileProviderClassRegistry;
|
|
403
404
|
}
|
|
404
405
|
|
|
405
|
-
get featureProviderClassRegistry(): OverrideClassRegistry<
|
|
406
|
-
typeof AbstractFeatureProvider
|
|
407
|
-
> {
|
|
406
|
+
get featureProviderClassRegistry(): OverrideClassRegistry<FeatureProviderClass> {
|
|
408
407
|
return this._featureProviderClassRegistry;
|
|
409
408
|
}
|
|
410
409
|
|
package/src/vcsModuleHelpers.ts
CHANGED
|
@@ -11,8 +11,19 @@ import type {
|
|
|
11
11
|
StyleItemOptions,
|
|
12
12
|
} from './style/styleItem.js';
|
|
13
13
|
import type { TileProviderOptions } from './layer/tileProvider/tileProvider.js';
|
|
14
|
-
import type {
|
|
14
|
+
import type {
|
|
15
|
+
// eslint-disable-next-line import/no-named-default
|
|
16
|
+
default as AbstractFeatureProvider,
|
|
17
|
+
AbstractFeatureProviderOptions,
|
|
18
|
+
} from './featureProvider/abstractFeatureProvider.js';
|
|
15
19
|
import type VcsApp from './vcsApp.js';
|
|
20
|
+
import type { CompositeFeatureProviderOptions } from './featureProvider/compositeFeatureProvider.js';
|
|
21
|
+
import CompositeFeatureProvider from './featureProvider/compositeFeatureProvider.js';
|
|
22
|
+
import type {
|
|
23
|
+
// eslint-disable-next-line import/no-named-default
|
|
24
|
+
default as AbstractAttributeProvider,
|
|
25
|
+
AbstractAttributeProviderOptions,
|
|
26
|
+
} from './featureProvider/abstractAttributeProvider.js';
|
|
16
27
|
|
|
17
28
|
function getLogger(): Logger {
|
|
18
29
|
return getLoggerByName('init');
|
|
@@ -22,7 +33,7 @@ export type ModuleLayerOptions = LayerOptions & {
|
|
|
22
33
|
style?: string | StyleItemOptions;
|
|
23
34
|
highlightStyle?: string | StyleItemOptions;
|
|
24
35
|
tileProvider?: TileProviderOptions;
|
|
25
|
-
|
|
36
|
+
attributeProvider?: AbstractAttributeProviderOptions;
|
|
26
37
|
};
|
|
27
38
|
|
|
28
39
|
export function deserializeMap(
|
|
@@ -48,6 +59,44 @@ export function deserializeViewpoint(
|
|
|
48
59
|
return null;
|
|
49
60
|
}
|
|
50
61
|
|
|
62
|
+
export function deserializeFeatureProvider(
|
|
63
|
+
vcsApp: VcsApp,
|
|
64
|
+
options:
|
|
65
|
+
| AbstractFeatureProviderOptions
|
|
66
|
+
| CompositeFeatureProviderOptions
|
|
67
|
+
| AbstractAttributeProviderOptions,
|
|
68
|
+
): AbstractAttributeProvider | AbstractFeatureProvider | null {
|
|
69
|
+
if (options.type === CompositeFeatureProvider.className) {
|
|
70
|
+
const {
|
|
71
|
+
featureProviders: featureProviderOptions,
|
|
72
|
+
attributeProviders: attributeProviderOptions,
|
|
73
|
+
} = options as CompositeFeatureProviderOptions;
|
|
74
|
+
|
|
75
|
+
const featureProviders = featureProviderOptions
|
|
76
|
+
.map((fpConfig) => deserializeFeatureProvider(vcsApp, fpConfig))
|
|
77
|
+
.filter((fp): fp is AbstractFeatureProvider => !!fp);
|
|
78
|
+
|
|
79
|
+
const attributeProviders = attributeProviderOptions
|
|
80
|
+
.map((apConfig) => deserializeFeatureProvider(vcsApp, apConfig))
|
|
81
|
+
.filter((ap): ap is AbstractAttributeProvider => !!ap);
|
|
82
|
+
|
|
83
|
+
return new CompositeFeatureProvider({
|
|
84
|
+
...options,
|
|
85
|
+
featureProviders,
|
|
86
|
+
attributeProviders,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (options.type) {
|
|
91
|
+
return getObjectFromClassRegistry(
|
|
92
|
+
vcsApp.featureProviderClassRegistry,
|
|
93
|
+
options,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
|
|
51
100
|
export function deserializeLayer(
|
|
52
101
|
vcsApp: VcsApp,
|
|
53
102
|
layerConfig: ModuleLayerOptions,
|
|
@@ -83,10 +132,18 @@ export function deserializeLayer(
|
|
|
83
132
|
);
|
|
84
133
|
}
|
|
85
134
|
|
|
135
|
+
let attributeProvider;
|
|
136
|
+
if (layerConfig.attributeProvider) {
|
|
137
|
+
attributeProvider = deserializeFeatureProvider(
|
|
138
|
+
vcsApp,
|
|
139
|
+
layerConfig.attributeProvider,
|
|
140
|
+
) as AbstractAttributeProvider | null;
|
|
141
|
+
}
|
|
142
|
+
|
|
86
143
|
let featureProvider;
|
|
87
144
|
if (layerConfig.featureProvider) {
|
|
88
|
-
featureProvider =
|
|
89
|
-
vcsApp
|
|
145
|
+
featureProvider = deserializeFeatureProvider(
|
|
146
|
+
vcsApp,
|
|
90
147
|
layerConfig.featureProvider,
|
|
91
148
|
);
|
|
92
149
|
}
|
|
@@ -97,6 +154,7 @@ export function deserializeLayer(
|
|
|
97
154
|
highlightStyle,
|
|
98
155
|
tileProvider,
|
|
99
156
|
featureProvider,
|
|
157
|
+
attributeProvider,
|
|
100
158
|
});
|
|
101
159
|
}
|
|
102
160
|
|
package/src/vcsObject.ts
CHANGED
|
@@ -25,6 +25,14 @@ class VcsObject {
|
|
|
25
25
|
return 'VcsObject';
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
static getDefaultOptions(): VcsObjectOptions {
|
|
29
|
+
return {
|
|
30
|
+
type: undefined,
|
|
31
|
+
name: undefined,
|
|
32
|
+
properties: {},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
28
36
|
/**
|
|
29
37
|
* unique Name
|
|
30
38
|
*/
|
|
@@ -50,7 +58,8 @@ class VcsObject {
|
|
|
50
58
|
return getLogger(this.className);
|
|
51
59
|
}
|
|
52
60
|
|
|
53
|
-
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
62
|
+
toJSON(_defaultOptions?: VcsObjectOptions): VcsObjectOptions {
|
|
54
63
|
const config: VcsObjectOptions = {
|
|
55
64
|
type: this.className,
|
|
56
65
|
name: this.name,
|
|
@@ -135,8 +135,8 @@ export default class VectorClusterGroup extends VcsObject {
|
|
|
135
135
|
clusterDistance: number;
|
|
136
136
|
|
|
137
137
|
constructor(options: VectorClusterGroupOptions) {
|
|
138
|
-
super(options);
|
|
139
138
|
const defaultOptions = VectorClusterGroup.getDefaultOptions();
|
|
139
|
+
super({ ...defaultOptions, ...options });
|
|
140
140
|
|
|
141
141
|
this._style = getStyleOrDefaultStyle(
|
|
142
142
|
options.style,
|
|
@@ -445,9 +445,12 @@ export default class VectorClusterGroup extends VcsObject {
|
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
|
|
448
|
-
toJSON(
|
|
449
|
-
|
|
450
|
-
|
|
448
|
+
toJSON(
|
|
449
|
+
defaultOptions = VectorClusterGroup.getDefaultOptions(),
|
|
450
|
+
): VectorClusterGroupOptions {
|
|
451
|
+
const config: Partial<VectorClusterGroupOptions> = super.toJSON(
|
|
452
|
+
defaultOptions,
|
|
453
|
+
);
|
|
451
454
|
|
|
452
455
|
if (!this.style.equals(new VectorClusterStyleItem({}))) {
|
|
453
456
|
config.style = this.style.toJSON();
|
|
@@ -99,8 +99,8 @@ export default class VectorClusterStyleItem extends VcsObject {
|
|
|
99
99
|
styleChanged = new VcsEvent<void>();
|
|
100
100
|
|
|
101
101
|
constructor(options: VectorClusterStyleItemOptions) {
|
|
102
|
-
super(options);
|
|
103
102
|
const defaultOptions = VectorClusterStyleItem.getDefaultOptions();
|
|
103
|
+
super({ ...defaultOptions, ...options });
|
|
104
104
|
|
|
105
105
|
const configTemplate = Array.isArray(options.template)
|
|
106
106
|
? options.template.join('')
|
|
@@ -336,9 +336,13 @@ export default class VectorClusterStyleItem extends VcsObject {
|
|
|
336
336
|
this._styleCache.clear();
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
toJSON(
|
|
340
|
-
|
|
341
|
-
|
|
339
|
+
toJSON(
|
|
340
|
+
defaultOptions = VectorClusterStyleItem.getDefaultOptions(),
|
|
341
|
+
): VectorClusterStyleItemOptions {
|
|
342
|
+
const config: Partial<VectorClusterStyleItemOptions> = super.toJSON(
|
|
343
|
+
defaultOptions,
|
|
344
|
+
);
|
|
345
|
+
|
|
342
346
|
if (this.template !== defaultOptions.template) {
|
|
343
347
|
config.template = this.template;
|
|
344
348
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Camera, Scene, ScreenSpaceEventHandler } from '@vcmap-cesium/engine';
|
|
2
|
-
import { Cartesian3 } from '@vcmap-cesium/engine';
|
|
3
|
-
import Viewpoint from '../util/viewpoint.js';
|
|
4
|
-
import type VcsMap from './vcsMap.js';
|
|
5
|
-
export declare function setupCesiumInteractions(map: VcsMap, scene: Scene, screenSpaceEventHandler: ScreenSpaceEventHandler): () => void;
|
|
6
|
-
export declare function getViewpointFromScene(scene: Scene): Viewpoint;
|
|
7
|
-
export declare function getResolution(cartesian: Cartesian3, camera: Camera, mapElement: HTMLElement, latitude?: number): number;
|