@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,10 @@ import VectorTileLayer, {
|
|
|
9
9
|
import PanoramaDatasetPanoramaImpl from './panorama/panoramaDatasetPanoramaImpl.js';
|
|
10
10
|
import type VcsMap from '../map/vcsMap.js';
|
|
11
11
|
import PanoramaMap from '../map/panoramaMap.js';
|
|
12
|
-
import VectorProperties, {
|
|
12
|
+
import VectorProperties, {
|
|
13
|
+
PrimitiveOptionsType,
|
|
14
|
+
type VectorPropertiesOptions,
|
|
15
|
+
} from './vectorProperties.js';
|
|
13
16
|
import { maxZIndexMin50 } from '../util/layerCollection.js';
|
|
14
17
|
import { layerClassRegistry } from '../classRegistry.js';
|
|
15
18
|
import FlatGeobufTileProvider from './tileProvider/flatGeobufTileProvider.js';
|
|
@@ -30,11 +33,12 @@ export type PanoramaDatasetOptions = Omit<
|
|
|
30
33
|
url: string;
|
|
31
34
|
baseLevel?: number;
|
|
32
35
|
cameraOffset?: number;
|
|
36
|
+
panoramaVectorProperties?: VectorPropertiesOptions;
|
|
33
37
|
};
|
|
34
38
|
|
|
35
39
|
export type PanoramaDatasetFeatureProperties = {
|
|
36
40
|
name: string;
|
|
37
|
-
time:
|
|
41
|
+
time: Date;
|
|
38
42
|
dataset: PanoramaDatasetLayer;
|
|
39
43
|
};
|
|
40
44
|
|
|
@@ -48,11 +52,22 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
48
52
|
...VectorTileLayer.getDefaultOptions(),
|
|
49
53
|
url: '',
|
|
50
54
|
baseLevel: 15,
|
|
51
|
-
activeOnStartup: false,
|
|
52
55
|
cameraOffset: 0,
|
|
53
56
|
minLevel: 15,
|
|
54
57
|
maxLevel: 22,
|
|
55
58
|
zIndex: maxZIndexMin50,
|
|
59
|
+
ignoreMapLayerTypes: true,
|
|
60
|
+
panoramaVectorProperties: {
|
|
61
|
+
altitudeMode: 'absolute',
|
|
62
|
+
primitiveOptions: {
|
|
63
|
+
type: PrimitiveOptionsType.CYLINDER,
|
|
64
|
+
geometryOptions: {
|
|
65
|
+
topRadius: 1,
|
|
66
|
+
bottomRadius: 1,
|
|
67
|
+
length: 0.01,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
56
71
|
};
|
|
57
72
|
}
|
|
58
73
|
|
|
@@ -100,7 +115,7 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
100
115
|
if (name && time) {
|
|
101
116
|
feature[panoramaFeature] = {
|
|
102
117
|
name,
|
|
103
|
-
time,
|
|
118
|
+
time: new Date(time),
|
|
104
119
|
dataset: this,
|
|
105
120
|
};
|
|
106
121
|
}
|
|
@@ -115,18 +130,20 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
115
130
|
defaultOptions.cameraOffset,
|
|
116
131
|
);
|
|
117
132
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
133
|
+
defaultOptions.panoramaVectorProperties!.primitiveOptions!.offset = [
|
|
134
|
+
0,
|
|
135
|
+
0,
|
|
136
|
+
this.cameraOffset,
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
this._panoramaVectorProperties = new VectorProperties(
|
|
140
|
+
defaultOptions.panoramaVectorProperties!,
|
|
141
|
+
);
|
|
142
|
+
if (options.panoramaVectorProperties) {
|
|
143
|
+
this._panoramaVectorProperties.setValues(
|
|
144
|
+
options.panoramaVectorProperties,
|
|
145
|
+
);
|
|
146
|
+
}
|
|
130
147
|
|
|
131
148
|
this._supportedMaps.push(PanoramaMap.className);
|
|
132
149
|
}
|
|
@@ -172,10 +189,15 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
172
189
|
* Creates a panorama image with the given name, if it belongs to this dataset.
|
|
173
190
|
* Will cache the image for later use.
|
|
174
191
|
* @param name
|
|
192
|
+
* @param [time] - optional time for the image.
|
|
175
193
|
* @returns
|
|
176
194
|
*/
|
|
177
|
-
createPanoramaImage(name: string): Promise<PanoramaImage> {
|
|
178
|
-
return createPanoramaImageFromURL(
|
|
195
|
+
createPanoramaImage(name: string, time?: Date): Promise<PanoramaImage> {
|
|
196
|
+
return createPanoramaImageFromURL(
|
|
197
|
+
`${this.baseUrl}/${name}_rgb.tif`,
|
|
198
|
+
this,
|
|
199
|
+
time,
|
|
200
|
+
);
|
|
179
201
|
}
|
|
180
202
|
|
|
181
203
|
override getZoomToExtent(): Extent | null {
|
|
@@ -196,7 +218,9 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
196
218
|
async getClosestImage(
|
|
197
219
|
coordinate: Coordinate,
|
|
198
220
|
maxDistance = 200,
|
|
199
|
-
): Promise<
|
|
221
|
+
): Promise<
|
|
222
|
+
{ imageName: string; distanceSqrd: number; time?: Date } | undefined
|
|
223
|
+
> {
|
|
200
224
|
const extent = createOrUpdateFromCoordinate(coordinate);
|
|
201
225
|
buffer(extent, maxDistance, extent);
|
|
202
226
|
const features = await this.tileProvider.getFeaturesForExtent(
|
|
@@ -208,6 +232,7 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
208
232
|
);
|
|
209
233
|
let minDistanceSqrd = Infinity;
|
|
210
234
|
let closestImageName: string | undefined;
|
|
235
|
+
let closestImageTime: Date | undefined;
|
|
211
236
|
features.forEach((feature) => {
|
|
212
237
|
const imagePosition = (feature.getGeometry() as Point).getCoordinates();
|
|
213
238
|
const distanceSqrd = cartesian2DDistanceSquared(
|
|
@@ -218,12 +243,17 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
218
243
|
if (distanceSqrd < minDistanceSqrd) {
|
|
219
244
|
minDistanceSqrd = distanceSqrd;
|
|
220
245
|
closestImageName = feature.get('name') as string;
|
|
246
|
+
const dateString = feature.get('time') as string | undefined;
|
|
247
|
+
if (dateString) {
|
|
248
|
+
closestImageTime = new Date(dateString);
|
|
249
|
+
}
|
|
221
250
|
}
|
|
222
251
|
});
|
|
223
252
|
|
|
224
253
|
if (closestImageName) {
|
|
225
254
|
return {
|
|
226
255
|
imageName: closestImageName,
|
|
256
|
+
time: closestImageTime,
|
|
227
257
|
distanceSqrd: minDistanceSqrd,
|
|
228
258
|
};
|
|
229
259
|
}
|
|
@@ -231,13 +261,15 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
231
261
|
return undefined;
|
|
232
262
|
}
|
|
233
263
|
|
|
234
|
-
override toJSON(
|
|
235
|
-
|
|
236
|
-
|
|
264
|
+
override toJSON(
|
|
265
|
+
defaultOptions = PanoramaDatasetLayer.getDefaultOptions(),
|
|
266
|
+
): PanoramaDatasetOptions {
|
|
267
|
+
const config = super.toJSON(
|
|
268
|
+
defaultOptions,
|
|
269
|
+
) as Partial<PanoramaDatasetOptions> & VectorTileOptions;
|
|
237
270
|
delete config.tileProvider; // tileProvider is not serializable
|
|
238
271
|
config.url = this.url;
|
|
239
272
|
|
|
240
|
-
const defaultOptions = PanoramaDatasetLayer.getDefaultOptions();
|
|
241
273
|
if (this.cameraOffset !== defaultOptions.cameraOffset) {
|
|
242
274
|
config.cameraOffset = this.cameraOffset;
|
|
243
275
|
}
|
|
@@ -257,6 +289,20 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
257
289
|
delete config.zIndex;
|
|
258
290
|
}
|
|
259
291
|
|
|
292
|
+
defaultOptions.panoramaVectorProperties!.primitiveOptions!.offset = [
|
|
293
|
+
0,
|
|
294
|
+
0,
|
|
295
|
+
this.cameraOffset,
|
|
296
|
+
];
|
|
297
|
+
const vectorPropertiesConfig = this._panoramaVectorProperties.getVcsMeta({
|
|
298
|
+
...VectorProperties.getDefaultOptions(),
|
|
299
|
+
...defaultOptions.panoramaVectorProperties,
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
if (Object.keys(vectorPropertiesConfig).length > 0) {
|
|
303
|
+
config.panoramaVectorProperties = vectorPropertiesConfig;
|
|
304
|
+
}
|
|
305
|
+
|
|
260
306
|
const thisDefaultStyle = getStyleOrDefaultStyle(defaultOptions.style);
|
|
261
307
|
if (this.style.equals(thisDefaultStyle)) {
|
|
262
308
|
delete config.style;
|
|
@@ -8,11 +8,8 @@ import type DeclarativeStyleItem from '../style/declarativeStyleItem.js';
|
|
|
8
8
|
import { defaultDeclarativeStyle } from '../style/declarativeStyleItem.js';
|
|
9
9
|
import type { VectorStyleItemOptions } from '../style/vectorStyleItem.js';
|
|
10
10
|
import VectorStyleItem from '../style/vectorStyleItem.js';
|
|
11
|
-
import CesiumMap from '../map/cesiumMap.js';
|
|
12
|
-
import CesiumTilesetCesiumImpl from './cesium/cesiumTilesetCesiumImpl.js';
|
|
13
11
|
import { layerClassRegistry } from '../classRegistry.js';
|
|
14
12
|
import type StyleItem from '../style/styleItem.js';
|
|
15
|
-
import type VcsMap from '../map/vcsMap.js';
|
|
16
13
|
|
|
17
14
|
export type PointCloudOptions = CesiumTilesetOptions & {
|
|
18
15
|
pointSize?: number | string;
|
|
@@ -46,12 +43,9 @@ class PointCloudLayer extends CesiumTilesetLayer {
|
|
|
46
43
|
|
|
47
44
|
private _pointSize: number | string | undefined;
|
|
48
45
|
|
|
49
|
-
protected _supportedMaps = [CesiumMap.className];
|
|
50
|
-
|
|
51
46
|
constructor(options: PointCloudOptions) {
|
|
52
|
-
super(options);
|
|
53
|
-
|
|
54
47
|
const defaultOptions = PointCloudLayer.getDefaultOptions();
|
|
48
|
+
super({ ...defaultOptions, ...options });
|
|
55
49
|
|
|
56
50
|
this.defaultPointSize =
|
|
57
51
|
options.pointSize != null ? options.pointSize : defaultOptions.pointSize;
|
|
@@ -86,16 +80,6 @@ class PointCloudLayer extends CesiumTilesetLayer {
|
|
|
86
80
|
this.pointSize = this._pointSize;
|
|
87
81
|
}
|
|
88
82
|
|
|
89
|
-
createImplementationsForMap(map: VcsMap): CesiumTilesetCesiumImpl[] {
|
|
90
|
-
if (map instanceof CesiumMap) {
|
|
91
|
-
return [
|
|
92
|
-
new CesiumTilesetCesiumImpl(map, this.getImplementationOptions()),
|
|
93
|
-
];
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return [];
|
|
97
|
-
}
|
|
98
|
-
|
|
99
83
|
/**
|
|
100
84
|
* Clears the style of this layer resets the point size to the defaultPointSize
|
|
101
85
|
*/
|
|
@@ -117,9 +101,10 @@ class PointCloudLayer extends CesiumTilesetLayer {
|
|
|
117
101
|
}
|
|
118
102
|
}
|
|
119
103
|
|
|
120
|
-
toJSON(
|
|
121
|
-
|
|
122
|
-
|
|
104
|
+
toJSON(
|
|
105
|
+
defaultOptions = PointCloudLayer.getDefaultOptions(),
|
|
106
|
+
): PointCloudOptions {
|
|
107
|
+
const config: PointCloudOptions = super.toJSON(defaultOptions);
|
|
123
108
|
|
|
124
109
|
if (this.defaultPointSize !== defaultOptions.pointSize) {
|
|
125
110
|
config.pointSize = this.defaultPointSize;
|
package/src/layer/rasterLayer.ts
CHANGED
|
@@ -186,6 +186,7 @@ class RasterLayer<
|
|
|
186
186
|
static getDefaultOptions(): RasterLayerOptions {
|
|
187
187
|
return {
|
|
188
188
|
...Layer.getDefaultOptions(),
|
|
189
|
+
url: '',
|
|
189
190
|
minLevel: 0,
|
|
190
191
|
maxLevel: 18,
|
|
191
192
|
minRenderingLevel: undefined,
|
|
@@ -251,8 +252,8 @@ class RasterLayer<
|
|
|
251
252
|
* @param options
|
|
252
253
|
*/
|
|
253
254
|
constructor(options: RasterLayerOptions) {
|
|
254
|
-
super({ url: '', ...options });
|
|
255
255
|
const defaultOptions = RasterLayer.getDefaultOptions();
|
|
256
|
+
super({ ...defaultOptions, ...options });
|
|
256
257
|
this.extent = options.extent ? new Extent(options.extent) : new Extent();
|
|
257
258
|
this.tilingSchema = parseEnumValue(
|
|
258
259
|
options.tilingSchema,
|
|
@@ -349,9 +350,8 @@ class RasterLayer<
|
|
|
349
350
|
return options;
|
|
350
351
|
}
|
|
351
352
|
|
|
352
|
-
toJSON(): RasterLayerOptions {
|
|
353
|
-
const config: RasterLayerOptions = super.toJSON();
|
|
354
|
-
const defaultOptions = RasterLayer.getDefaultOptions();
|
|
353
|
+
toJSON(defaultOptions = RasterLayer.getDefaultOptions()): RasterLayerOptions {
|
|
354
|
+
const config: RasterLayerOptions = super.toJSON(defaultOptions);
|
|
355
355
|
|
|
356
356
|
if (this.extent?.equals(new Extent())) {
|
|
357
357
|
delete config.extent;
|
|
@@ -43,8 +43,8 @@ class SingleImageLayer extends RasterLayer<
|
|
|
43
43
|
credit: string | undefined;
|
|
44
44
|
|
|
45
45
|
constructor(options: SingleImageOptions) {
|
|
46
|
-
super(options);
|
|
47
46
|
const defaultOptions = SingleImageLayer.getDefaultOptions();
|
|
47
|
+
super({ ...defaultOptions, ...options });
|
|
48
48
|
this.credit = options.credit || defaultOptions.credit;
|
|
49
49
|
|
|
50
50
|
if (!this.extent.isValid()) {
|
|
@@ -95,8 +95,10 @@ class SingleImageLayer extends RasterLayer<
|
|
|
95
95
|
void this.forceRedraw();
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
toJSON(
|
|
99
|
-
|
|
98
|
+
toJSON(
|
|
99
|
+
defaultOptions = SingleImageLayer.getDefaultOptions(),
|
|
100
|
+
): SingleImageOptions {
|
|
101
|
+
const config: SingleImageOptions = super.toJSON(defaultOptions);
|
|
100
102
|
delete config.tilingSchema;
|
|
101
103
|
|
|
102
104
|
if (this.credit) {
|
|
@@ -10,6 +10,8 @@ import CesiumMap from '../map/cesiumMap.js';
|
|
|
10
10
|
import TerrainCesiumImpl from './cesium/terrainCesiumImpl.js';
|
|
11
11
|
import { layerClassRegistry } from '../classRegistry.js';
|
|
12
12
|
import type VcsMap from '../map/vcsMap.js';
|
|
13
|
+
import PanoramaMap from '../map/panoramaMap.js';
|
|
14
|
+
import BaseCesiumMap from '../map/baseCesiumMap.js';
|
|
13
15
|
|
|
14
16
|
export type TerrainOptions = LayerOptions & {
|
|
15
17
|
requestVertexNormals?: boolean;
|
|
@@ -32,20 +34,21 @@ class TerrainLayer extends Layer<TerrainCesiumImpl> {
|
|
|
32
34
|
static getDefaultOptions(): TerrainOptions {
|
|
33
35
|
return {
|
|
34
36
|
...Layer.getDefaultOptions(),
|
|
37
|
+
ignoreMapLayerTypes: true,
|
|
35
38
|
requestVertexNormals: true,
|
|
36
39
|
requestWaterMask: false,
|
|
37
40
|
};
|
|
38
41
|
}
|
|
39
42
|
|
|
40
|
-
protected _supportedMaps = [CesiumMap.className];
|
|
43
|
+
protected _supportedMaps = [CesiumMap.className, PanoramaMap.className];
|
|
41
44
|
|
|
42
45
|
requestVertexNormals: boolean;
|
|
43
46
|
|
|
44
47
|
requestWaterMask: boolean;
|
|
45
48
|
|
|
46
49
|
constructor(options: TerrainOptions) {
|
|
47
|
-
super(options);
|
|
48
50
|
const defaultOptions = TerrainLayer.getDefaultOptions();
|
|
51
|
+
super({ ...defaultOptions, ...options });
|
|
49
52
|
|
|
50
53
|
this.requestVertexNormals = parseBoolean(
|
|
51
54
|
options.requestVertexNormals,
|
|
@@ -66,7 +69,7 @@ class TerrainLayer extends Layer<TerrainCesiumImpl> {
|
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
createImplementationsForMap(map: VcsMap): TerrainCesiumImpl[] {
|
|
69
|
-
if (map instanceof
|
|
72
|
+
if (map instanceof BaseCesiumMap) {
|
|
70
73
|
return [new TerrainCesiumImpl(map, this.getImplementationOptions())];
|
|
71
74
|
}
|
|
72
75
|
return [];
|
|
@@ -95,13 +98,13 @@ class TerrainLayer extends Layer<TerrainCesiumImpl> {
|
|
|
95
98
|
);
|
|
96
99
|
}
|
|
97
100
|
|
|
98
|
-
toJSON(): TerrainOptions {
|
|
99
|
-
const config: TerrainOptions = super.toJSON();
|
|
100
|
-
const defaultOptions = TerrainLayer.getDefaultOptions();
|
|
101
|
+
toJSON(defaultOptions = TerrainLayer.getDefaultOptions()): TerrainOptions {
|
|
102
|
+
const config: TerrainOptions = super.toJSON(defaultOptions);
|
|
101
103
|
|
|
102
104
|
if (this.requestVertexNormals !== defaultOptions.requestVertexNormals) {
|
|
103
105
|
config.requestVertexNormals = this.requestVertexNormals;
|
|
104
106
|
}
|
|
107
|
+
|
|
105
108
|
if (this.requestWaterMask !== defaultOptions.requestWaterMask) {
|
|
106
109
|
config.requestWaterMask = this.requestWaterMask;
|
|
107
110
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type Feature from 'ol/Feature.js';
|
|
2
2
|
import type { HttpReader } from 'flatgeobuf/lib/mjs/http-reader.js';
|
|
3
3
|
import type { TileProviderOptions } from './tileProvider.js';
|
|
4
|
-
import TileProvider
|
|
4
|
+
import TileProvider from './tileProvider.js';
|
|
5
5
|
import type { ProjectionOptions } from '../../util/projection.js';
|
|
6
6
|
import Projection, {
|
|
7
7
|
getDefaultProjection,
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
getRootNode,
|
|
15
15
|
getValidReader,
|
|
16
16
|
} from '../flatGeobufHelpers.js';
|
|
17
|
+
import { rectangleToMercatorExtent } from '../../util/math.js';
|
|
17
18
|
|
|
18
19
|
export type FlatGeobufTileProviderOptions = Omit<
|
|
19
20
|
TileProviderOptions,
|
|
@@ -41,8 +42,9 @@ export default class FlatGeobufTileProvider extends TileProvider {
|
|
|
41
42
|
private _projection: Projection;
|
|
42
43
|
|
|
43
44
|
constructor(options: FlatGeobufTileProviderOptions) {
|
|
45
|
+
const defaultOptions = FlatGeobufTileProvider.getDefaultOptions();
|
|
44
46
|
const baseLevels = options.levels.map((level) => level.level);
|
|
45
|
-
super({ ...options, baseLevels });
|
|
47
|
+
super({ ...defaultOptions, ...options, baseLevels });
|
|
46
48
|
|
|
47
49
|
this._levels = new Map(
|
|
48
50
|
options.levels.map((level) => [level.level, { url: level.url }]),
|
|
@@ -80,7 +82,7 @@ export default class FlatGeobufTileProvider extends TileProvider {
|
|
|
80
82
|
|
|
81
83
|
async loader(x: number, y: number, z: number): Promise<Feature[]> {
|
|
82
84
|
const rectangle = this.tilingScheme.tileXYToRectangle(x, y, z);
|
|
83
|
-
const extent =
|
|
85
|
+
const extent = rectangleToMercatorExtent(rectangle);
|
|
84
86
|
const mercatorExtent = new Extent({
|
|
85
87
|
coordinates: extent,
|
|
86
88
|
projection: mercatorProjection,
|
|
@@ -90,13 +92,15 @@ export default class FlatGeobufTileProvider extends TileProvider {
|
|
|
90
92
|
return getOlFeatures(reader, this._projection, mercatorExtent);
|
|
91
93
|
}
|
|
92
94
|
|
|
93
|
-
toJSON(
|
|
95
|
+
toJSON(
|
|
96
|
+
defaultOptions = FlatGeobufTileProvider.getDefaultOptions(),
|
|
97
|
+
): FlatGeobufTileProviderOptions {
|
|
94
98
|
const config: FlatGeobufTileProviderOptions & { baseLevels?: number[] } = {
|
|
95
99
|
levels: Array.from(this._levels.entries()).map(([level, { url }]) => ({
|
|
96
100
|
level,
|
|
97
101
|
url,
|
|
98
102
|
})),
|
|
99
|
-
...super.toJSON(),
|
|
103
|
+
...super.toJSON(defaultOptions),
|
|
100
104
|
};
|
|
101
105
|
delete config.baseLevels;
|
|
102
106
|
if (this._projection.epsg !== getDefaultProjection().epsg) {
|
|
@@ -3,10 +3,11 @@ import Feature from 'ol/Feature.js';
|
|
|
3
3
|
import { getCenter } from 'ol/extent.js';
|
|
4
4
|
import type { Geometry } from 'ol/geom.js';
|
|
5
5
|
import type { TileProviderOptions } from './tileProvider.js';
|
|
6
|
-
import TileProvider
|
|
6
|
+
import TileProvider from './tileProvider.js';
|
|
7
7
|
import { getURL } from './urlTemplateTileProvider.js';
|
|
8
8
|
import { getInitForUrl, requestArrayBuffer } from '../../util/fetch.js';
|
|
9
9
|
import { tileProviderClassRegistry } from '../../classRegistry.js';
|
|
10
|
+
import { rectangleToMercatorExtent } from '../../util/math.js';
|
|
10
11
|
|
|
11
12
|
export type MVTTileProviderOptions = TileProviderOptions & {
|
|
12
13
|
/**
|
|
@@ -36,7 +37,7 @@ class MVTTileProvider extends TileProvider {
|
|
|
36
37
|
|
|
37
38
|
constructor(options: MVTTileProviderOptions) {
|
|
38
39
|
const defaultOptions = MVTTileProvider.getDefaultOptions();
|
|
39
|
-
super(options);
|
|
40
|
+
super({ ...defaultOptions, ...options });
|
|
40
41
|
|
|
41
42
|
this.url = options.url || defaultOptions.url;
|
|
42
43
|
}
|
|
@@ -66,7 +67,7 @@ class MVTTileProvider extends TileProvider {
|
|
|
66
67
|
): Promise<Feature[]> {
|
|
67
68
|
const rectangle = this.tilingScheme.tileXYToRectangle(x, y, z);
|
|
68
69
|
const url = getURL(this.url, x, y, z, rectangle, this.locale);
|
|
69
|
-
const extent =
|
|
70
|
+
const extent = rectangleToMercatorExtent(rectangle);
|
|
70
71
|
const center = getCenter(extent);
|
|
71
72
|
const init = getInitForUrl(this.url, headers);
|
|
72
73
|
const data = await requestArrayBuffer(url, init);
|
|
@@ -90,8 +91,12 @@ class MVTTileProvider extends TileProvider {
|
|
|
90
91
|
return features;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
toJSON(
|
|
94
|
-
|
|
94
|
+
toJSON(
|
|
95
|
+
defaultOptions = MVTTileProvider.getDefaultOptions(),
|
|
96
|
+
): MVTTileProviderOptions {
|
|
97
|
+
const config: Partial<MVTTileProviderOptions> = super.toJSON(
|
|
98
|
+
defaultOptions,
|
|
99
|
+
);
|
|
95
100
|
|
|
96
101
|
if (this.url) {
|
|
97
102
|
config.url = this.url;
|
|
@@ -25,7 +25,7 @@ export default class StaticFeatureTileProvider extends TileProvider {
|
|
|
25
25
|
|
|
26
26
|
constructor(options: StaticFeatureTileProviderOptions) {
|
|
27
27
|
const defaultOptions = StaticFeatureTileProvider.getDefaultOptions();
|
|
28
|
-
super({ ...options, baseLevels: [0] });
|
|
28
|
+
super({ ...defaultOptions, ...options, baseLevels: [0] });
|
|
29
29
|
this._features = options.features || defaultOptions.features;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -42,8 +42,10 @@ export default class StaticFeatureTileProvider extends TileProvider {
|
|
|
42
42
|
return Promise.resolve(this._features);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
toJSON(
|
|
46
|
-
|
|
45
|
+
toJSON(
|
|
46
|
+
defaultOptions = StaticFeatureTileProvider.getDefaultOptions(),
|
|
47
|
+
): StaticFeatureTileProviderOptions {
|
|
48
|
+
const config: TileProviderOptions = super.toJSON(defaultOptions);
|
|
47
49
|
|
|
48
50
|
delete config.baseLevels;
|
|
49
51
|
const staticFeatureConfig: StaticFeatureTileProviderOptions = {
|
|
@@ -30,7 +30,11 @@ class StaticGeoJSONTileProvider extends TileProvider {
|
|
|
30
30
|
|
|
31
31
|
constructor(options: StaticGeoJSONTileProviderOptions) {
|
|
32
32
|
const defaultOptions = StaticGeoJSONTileProvider.getDefaultOptions();
|
|
33
|
-
super({
|
|
33
|
+
super({
|
|
34
|
+
...defaultOptions,
|
|
35
|
+
...options,
|
|
36
|
+
baseLevels: defaultOptions.baseLevels,
|
|
37
|
+
});
|
|
34
38
|
|
|
35
39
|
this.url = options.url || defaultOptions.url;
|
|
36
40
|
}
|
|
@@ -47,9 +51,12 @@ class StaticGeoJSONTileProvider extends TileProvider {
|
|
|
47
51
|
return features;
|
|
48
52
|
}
|
|
49
53
|
|
|
50
|
-
toJSON(
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
toJSON(
|
|
55
|
+
defaultOptions = StaticGeoJSONTileProvider.getDefaultOptions(),
|
|
56
|
+
): StaticGeoJSONTileProviderOptions {
|
|
57
|
+
const config: Partial<StaticGeoJSONTileProviderOptions> = super.toJSON(
|
|
58
|
+
defaultOptions,
|
|
59
|
+
);
|
|
53
60
|
|
|
54
61
|
if (this.url) {
|
|
55
62
|
config.url = this.url;
|
|
@@ -27,6 +27,7 @@ import VcsObject from '../../vcsObject.js';
|
|
|
27
27
|
import VcsEvent from '../../vcsEvent.js';
|
|
28
28
|
import { tileProviderClassRegistry } from '../../classRegistry.js';
|
|
29
29
|
import type Extent from '../../util/extent.js';
|
|
30
|
+
import { rectangleToMercatorExtent } from '../../util/math.js';
|
|
30
31
|
|
|
31
32
|
export type TileProviderRTreeEntry = {
|
|
32
33
|
minX: number;
|
|
@@ -56,6 +57,7 @@ for (let i = 0; i < mercatorResolutionsToLevel.length; i++) {
|
|
|
56
57
|
* transforms cesium geographic rectangle to mercator extent
|
|
57
58
|
* @param rectangle in wgs84 radians
|
|
58
59
|
* @returns extent in mercator
|
|
60
|
+
* @deprecated use rectangleToMercatorExtent
|
|
59
61
|
*/
|
|
60
62
|
export function rectangleToExtent(rectangle: Rectangle): OLExtent {
|
|
61
63
|
const baseSouthWestLevel = Rectangle.southwest(rectangle);
|
|
@@ -163,8 +165,8 @@ class TileProvider extends VcsObject {
|
|
|
163
165
|
private _idProperty: string | undefined;
|
|
164
166
|
|
|
165
167
|
constructor(options: TileProviderOptions) {
|
|
166
|
-
super(options);
|
|
167
168
|
const defaultOptions = TileProvider.getDefaultOptions();
|
|
169
|
+
super({ ...defaultOptions, ...options });
|
|
168
170
|
|
|
169
171
|
this._tileCacheSize = parseInteger(
|
|
170
172
|
options.tileCacheSize,
|
|
@@ -387,6 +389,16 @@ class TileProvider extends VcsObject {
|
|
|
387
389
|
return `${level}/${x}/${y}`;
|
|
388
390
|
}
|
|
389
391
|
|
|
392
|
+
// eslint-disable-next-line class-methods-use-this
|
|
393
|
+
parseCacheKey(key: string): { x: number; y: number; level: number } {
|
|
394
|
+
const parts = key.split('/');
|
|
395
|
+
return {
|
|
396
|
+
level: parseInt(parts[0], 10),
|
|
397
|
+
x: parseInt(parts[1], 10),
|
|
398
|
+
y: parseInt(parts[2], 10),
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
|
|
390
402
|
private async _getRtreeForBaseTile(
|
|
391
403
|
baseLevel: number,
|
|
392
404
|
tileCenter: Cartographic,
|
|
@@ -506,7 +518,7 @@ class TileProvider extends VcsObject {
|
|
|
506
518
|
if (level === baseLevel) {
|
|
507
519
|
return rtree.all().map((item) => item.value);
|
|
508
520
|
} else {
|
|
509
|
-
const extent =
|
|
521
|
+
const extent = rectangleToMercatorExtent(rectangle);
|
|
510
522
|
const features = rtree
|
|
511
523
|
.search({
|
|
512
524
|
minX: extent[0],
|
|
@@ -649,9 +661,10 @@ class TileProvider extends VcsObject {
|
|
|
649
661
|
return Promise.resolve([]);
|
|
650
662
|
}
|
|
651
663
|
|
|
652
|
-
toJSON(
|
|
653
|
-
|
|
654
|
-
|
|
664
|
+
toJSON(
|
|
665
|
+
defaultOptions = TileProvider.getDefaultOptions(),
|
|
666
|
+
): TileProviderOptions {
|
|
667
|
+
const config: TileProviderOptions = super.toJSON(defaultOptions);
|
|
655
668
|
|
|
656
669
|
if (defaultOptions.tileCacheSize !== this.tileCacheSize) {
|
|
657
670
|
config.tileCacheSize = this.tileCacheSize;
|
|
@@ -74,7 +74,7 @@ class URLTemplateTileProvider extends TileProvider {
|
|
|
74
74
|
|
|
75
75
|
constructor(options: URLTemplateTileProviderOptions) {
|
|
76
76
|
const defaultOptions = URLTemplateTileProvider.getDefaultOptions();
|
|
77
|
-
super(options);
|
|
77
|
+
super({ ...defaultOptions, ...options });
|
|
78
78
|
this.url = options.url || defaultOptions.url;
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -110,8 +110,12 @@ class URLTemplateTileProvider extends TileProvider {
|
|
|
110
110
|
return features;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
toJSON(
|
|
114
|
-
|
|
113
|
+
toJSON(
|
|
114
|
+
defaultOptions = URLTemplateTileProvider.getDefaultOptions(),
|
|
115
|
+
): URLTemplateTileProviderOptions {
|
|
116
|
+
const config: Partial<URLTemplateTileProviderOptions> = super.toJSON(
|
|
117
|
+
defaultOptions,
|
|
118
|
+
);
|
|
115
119
|
|
|
116
120
|
if (this.url) {
|
|
117
121
|
config.url = this.url;
|
package/src/layer/tmsLayer.ts
CHANGED
|
@@ -44,7 +44,7 @@ class TMSLayer extends RasterLayer<TmsCesiumImpl | TmsOpenlayersImpl> {
|
|
|
44
44
|
|
|
45
45
|
constructor(options: TMSOptions) {
|
|
46
46
|
const defaultOptions = TMSLayer.getDefaultOptions();
|
|
47
|
-
super({
|
|
47
|
+
super({ ...defaultOptions, ...options });
|
|
48
48
|
|
|
49
49
|
this._supportedMaps = [OpenlayersMap.className, CesiumMap.className];
|
|
50
50
|
|
|
@@ -75,15 +75,8 @@ class TMSLayer extends RasterLayer<TmsCesiumImpl | TmsOpenlayersImpl> {
|
|
|
75
75
|
return [];
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
toJSON(): TMSOptions {
|
|
79
|
-
const config: TMSOptions = super.toJSON();
|
|
80
|
-
const defaultOptions = TMSLayer.getDefaultOptions();
|
|
81
|
-
|
|
82
|
-
if (this.tilingSchema !== defaultOptions.tilingSchema) {
|
|
83
|
-
config.tilingSchema = this.tilingSchema;
|
|
84
|
-
} else {
|
|
85
|
-
delete config.tilingSchema;
|
|
86
|
-
}
|
|
78
|
+
toJSON(defaultOptions = TMSLayer.getDefaultOptions()): TMSOptions {
|
|
79
|
+
const config: TMSOptions = super.toJSON(defaultOptions);
|
|
87
80
|
|
|
88
81
|
if (this.format !== defaultOptions.format) {
|
|
89
82
|
config.format = this.format;
|