@vcmap/core 6.2.2 → 6.3.0-rc.1
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/index.d.ts +3 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- 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/featureProvider/abstractFeatureProvider.d.ts +1 -1
- package/dist/src/featureProvider/abstractFeatureProvider.js +3 -4
- package/dist/src/featureProvider/abstractFeatureProvider.js.map +1 -1
- package/dist/src/featureProvider/wmsFeatureProvider.d.ts +3 -1
- package/dist/src/featureProvider/wmsFeatureProvider.js +37 -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.js +29 -17
- package/dist/src/interaction/featureAtPixelInteraction.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 +3 -3
- package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/cogImageryProvider.d.ts +2 -2
- package/dist/src/layer/cesium/cogImageryProvider.js +6 -26
- package/dist/src/layer/cesium/cogImageryProvider.js.map +1 -1
- 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/vectorContext.js +1 -1
- package/dist/src/layer/cesium/vectorContext.js.map +1 -1
- package/dist/src/layer/cesiumTilesetLayer.d.ts +1 -1
- package/dist/src/layer/cesiumTilesetLayer.js +7 -7
- package/dist/src/layer/cesiumTilesetLayer.js.map +1 -1
- package/dist/src/layer/cogLayer.d.ts +7 -2
- package/dist/src/layer/cogLayer.js +10 -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/layer.d.ts +21 -7
- package/dist/src/layer/layer.js +107 -33
- package/dist/src/layer/layer.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 +5 -3
- package/dist/src/layer/panoramaDatasetLayer.js +13 -7
- 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 +4 -3
- 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 +3 -3
- 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 +1 -1
- package/dist/src/layer/tileProvider/tileProvider.js +3 -4
- 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 +19 -8
- package/dist/src/layer/vectorLayer.js.map +1 -1
- package/dist/src/layer/vectorTileLayer.d.ts +1 -1
- package/dist/src/layer/vectorTileLayer.js +4 -5
- 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 +1 -1
- package/dist/src/layer/wmsLayer.js +3 -4
- 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 +381 -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 +32 -258
- package/dist/src/map/cesiumMap.js.map +1 -1
- package/dist/src/map/obliqueMap.d.ts +1 -1
- package/dist/src/map/obliqueMap.js +3 -4
- 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 +9 -4
- 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/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/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/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 +19 -2
- 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 +3 -5
- package/package.json +2 -2
- package/src/category/category.ts +3 -4
- package/src/featureProvider/abstractFeatureProvider.ts +5 -4
- package/src/featureProvider/wmsFeatureProvider.ts +52 -14
- package/src/global.d.ts +0 -1
- 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 +39 -29
- package/src/interaction/panoramaImageSelection.ts +4 -2
- package/src/layer/cesium/cesiumTilesetCesiumImpl.ts +3 -3
- package/src/layer/cesium/cogImageryProvider.ts +9 -26
- package/src/layer/cesium/rasterLayerCesiumImpl.ts +3 -3
- package/src/layer/cesium/terrainCesiumImpl.ts +3 -3
- package/src/layer/cesium/vectorContext.ts +1 -1
- package/src/layer/cesiumTilesetLayer.ts +9 -7
- package/src/layer/cogLayer.ts +22 -6
- 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/layer.ts +148 -36
- package/src/layer/openStreetMapLayer.ts +13 -6
- package/src/layer/panorama/vectorPanoramaImpl.ts +238 -0
- package/src/layer/panoramaDatasetLayer.ts +25 -10
- 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 +6 -3
- package/src/layer/tileProvider/mvtTileProvider.ts +7 -3
- package/src/layer/tileProvider/staticFeatureTileProvider.ts +5 -3
- package/src/layer/tileProvider/staticGeojsonTileProvider.ts +11 -4
- package/src/layer/tileProvider/tileProvider.ts +5 -4
- package/src/layer/tileProvider/urlTemplateTileProvider.ts +7 -3
- package/src/layer/tmsLayer.ts +3 -10
- package/src/layer/vectorLayer.ts +25 -9
- package/src/layer/vectorTileLayer.ts +6 -6
- package/src/layer/wfsLayer.ts +7 -4
- package/src/layer/wmsLayer.ts +3 -4
- package/src/layer/wmtsLayer.ts +3 -10
- package/src/map/baseCesiumMap.ts +576 -0
- package/src/map/cesiumMap.ts +103 -446
- package/src/map/obliqueMap.ts +3 -4
- 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/panorama/panoramaCameraController.ts +13 -1
- package/src/panorama/panoramaImage.ts +17 -3
- 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/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/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/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
|
@@ -26,10 +26,10 @@ import { allowPicking, vcsLayerName } from '../layer/layerSymbols.js';
|
|
|
26
26
|
import { originalFeatureSymbol, primitives } from '../layer/vectorSymbols.js';
|
|
27
27
|
import type OpenlayersMap from '../map/openlayersMap.js';
|
|
28
28
|
import type ObliqueMap from '../map/obliqueMap.js';
|
|
29
|
-
import type CesiumMap from '../map/cesiumMap.js';
|
|
30
29
|
import { vectorClusterGroupName } from '../vectorCluster/vectorClusterSymbols.js';
|
|
31
|
-
import { cartesianToMercator } from '../util/math.js';
|
|
30
|
+
import { cartesian3DDistance, cartesianToMercator } from '../util/math.js';
|
|
32
31
|
import type { PrimitiveType } from '../util/featureconverter/convert.js';
|
|
32
|
+
import type BaseCesiumMap from '../map/baseCesiumMap.js';
|
|
33
33
|
import type PanoramaMap from '../map/panoramaMap.js';
|
|
34
34
|
|
|
35
35
|
/**
|
|
@@ -283,7 +283,7 @@ class FeatureAtPixelInteraction extends AbstractInteraction {
|
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
private _cesiumHandler(event: InteractionEvent): Promise<InteractionEvent> {
|
|
286
|
-
const cesiumMap = event.map as
|
|
286
|
+
const cesiumMap = event.map as BaseCesiumMap;
|
|
287
287
|
const { scene } = cesiumMap.getCesiumWidget()!;
|
|
288
288
|
|
|
289
289
|
if (!scene) {
|
|
@@ -301,14 +301,10 @@ class FeatureAtPixelInteraction extends AbstractInteraction {
|
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
const { pickTranslucentDepth } = scene;
|
|
304
|
-
if (!(event.type & this.pickPosition)) {
|
|
305
|
-
return Promise.resolve(event);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
304
|
if (
|
|
305
|
+
!!(event.type & this.pickPosition) &&
|
|
309
306
|
pickObject &&
|
|
310
|
-
scene.pickPositionSupported
|
|
311
|
-
event.map.className === 'CesiumMap'
|
|
307
|
+
scene.pickPositionSupported
|
|
312
308
|
) {
|
|
313
309
|
if (this.pickTranslucent) {
|
|
314
310
|
scene.pickTranslucentDepth = true;
|
|
@@ -334,30 +330,44 @@ class FeatureAtPixelInteraction extends AbstractInteraction {
|
|
|
334
330
|
);
|
|
335
331
|
|
|
336
332
|
if (
|
|
337
|
-
|
|
338
|
-
Cartesian3.equals(cartesianPosition, Cartesian3.ZERO)
|
|
333
|
+
cartesianPosition &&
|
|
334
|
+
!Cartesian3.equals(cartesianPosition, Cartesian3.ZERO)
|
|
339
335
|
) {
|
|
340
|
-
|
|
341
|
-
|
|
336
|
+
if (this.pullPickedPosition && event.ray) {
|
|
337
|
+
const pulledCartesian = Cartesian3.multiplyByScalar(
|
|
338
|
+
event.ray.direction,
|
|
339
|
+
this.pullPickedPosition,
|
|
340
|
+
new Cartesian3(),
|
|
341
|
+
);
|
|
342
|
+
|
|
343
|
+
Cartesian3.subtract(
|
|
344
|
+
cartesianPosition,
|
|
345
|
+
pulledCartesian,
|
|
346
|
+
cartesianPosition,
|
|
347
|
+
);
|
|
348
|
+
}
|
|
342
349
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
event.
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
350
|
+
if (event.map.className === 'CesiumMap') {
|
|
351
|
+
event.position = cartesianToMercator(cartesianPosition);
|
|
352
|
+
event.positionOrPixel = event.position.slice();
|
|
353
|
+
} else {
|
|
354
|
+
const currentImage = (event.map as PanoramaMap).currentPanoramaImage;
|
|
355
|
+
if (currentImage) {
|
|
356
|
+
const imageCenter = cartesianToMercator(currentImage.position);
|
|
357
|
+
const newPosition = cartesianToMercator(cartesianPosition);
|
|
358
|
+
const newDistance = cartesian3DDistance(imageCenter, newPosition);
|
|
359
|
+
const currentDistance = event.position
|
|
360
|
+
? cartesian3DDistance(imageCenter, event.position)
|
|
361
|
+
: undefined;
|
|
362
|
+
|
|
363
|
+
if (currentDistance == null || newDistance < currentDistance) {
|
|
364
|
+
event.position = newPosition;
|
|
365
|
+
event.positionOrPixel = event.position.slice();
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
355
369
|
}
|
|
356
|
-
|
|
357
|
-
event.position = cartesianToMercator(cartesianPosition);
|
|
358
|
-
event.positionOrPixel = event.position.slice();
|
|
359
370
|
scene.pickTranslucentDepth = pickTranslucentDepth;
|
|
360
|
-
return Promise.resolve(event);
|
|
361
371
|
}
|
|
362
372
|
|
|
363
373
|
return Promise.resolve(event);
|
|
@@ -13,8 +13,10 @@ export default class PanoramaImageSelection extends AbstractInteraction {
|
|
|
13
13
|
|
|
14
14
|
override async pipe(event: InteractionEvent): Promise<InteractionEvent> {
|
|
15
15
|
if (event.feature && (event.feature as Feature)[panoramaFeature]) {
|
|
16
|
-
const { dataset, name } = (event.feature as Feature)[
|
|
17
|
-
|
|
16
|
+
const { dataset, name, time } = (event.feature as Feature)[
|
|
17
|
+
panoramaFeature
|
|
18
|
+
]!;
|
|
19
|
+
const panoramaImage = await dataset.createPanoramaImage(name, time);
|
|
18
20
|
event.stopPropagation = true;
|
|
19
21
|
|
|
20
22
|
if (event.map instanceof PanoramaMap) {
|
|
@@ -33,11 +33,11 @@ import type {
|
|
|
33
33
|
CesiumTilesetImplementationOptions,
|
|
34
34
|
CesiumTilesetTilesetProperties,
|
|
35
35
|
} from '../cesiumTilesetLayer.js';
|
|
36
|
-
import type CesiumMap from '../../map/cesiumMap.js';
|
|
37
36
|
import type { FeatureLayerImplementation } from '../featureLayer.js';
|
|
38
37
|
import type StyleItem from '../../style/styleItem.js';
|
|
39
38
|
import type GlobalHider from '../globalHider.js';
|
|
40
39
|
import { getResourceOrUrl } from './resourceHelper.js';
|
|
40
|
+
import type BaseCesiumMap from '../../map/baseCesiumMap.js';
|
|
41
41
|
|
|
42
42
|
export const cesiumTilesetLastUpdated: unique symbol = Symbol(
|
|
43
43
|
'cesiumTilesetLastUpdated',
|
|
@@ -84,7 +84,7 @@ export function getExtentFromTileset(
|
|
|
84
84
|
* represents the cesium implementation for a {@link CesiumTilesetLayer} layer.
|
|
85
85
|
*/
|
|
86
86
|
class CesiumTilesetCesiumImpl
|
|
87
|
-
extends LayerImplementation<
|
|
87
|
+
extends LayerImplementation<BaseCesiumMap>
|
|
88
88
|
implements FeatureLayerImplementation
|
|
89
89
|
{
|
|
90
90
|
static get className(): string {
|
|
@@ -121,7 +121,7 @@ class CesiumTilesetCesiumImpl
|
|
|
121
121
|
|
|
122
122
|
private _customShader: CustomShader | undefined;
|
|
123
123
|
|
|
124
|
-
constructor(map:
|
|
124
|
+
constructor(map: BaseCesiumMap, options: CesiumTilesetImplementationOptions) {
|
|
125
125
|
super(map, options);
|
|
126
126
|
|
|
127
127
|
this.cesium3DTileset = null;
|
|
@@ -98,6 +98,10 @@ export default class COGImageryProvider {
|
|
|
98
98
|
level: number,
|
|
99
99
|
) => Promise<ImageryTypes>;
|
|
100
100
|
|
|
101
|
+
readonly tileWidth: number = 256;
|
|
102
|
+
|
|
103
|
+
readonly tileHeight: number = 256;
|
|
104
|
+
|
|
101
105
|
constructor(private _source: GeoTIFFSource) {
|
|
102
106
|
this._emptyCanvas = createEmptyCanvas(this.tileWidth, this.tileHeight);
|
|
103
107
|
this._projection = this._source.getProjection()!;
|
|
@@ -108,6 +112,11 @@ export default class COGImageryProvider {
|
|
|
108
112
|
} else {
|
|
109
113
|
this._boundTileLoader = this._loadUnalignedTile.bind(this);
|
|
110
114
|
}
|
|
115
|
+
|
|
116
|
+
// @ts-expect-error protected
|
|
117
|
+
const [width, height] = this._source.getTileSize(0);
|
|
118
|
+
this.tileWidth = Math.round(width);
|
|
119
|
+
this.tileHeight = Math.round(height);
|
|
111
120
|
}
|
|
112
121
|
|
|
113
122
|
// eslint-disable-next-line class-methods-use-this,@typescript-eslint/naming-convention
|
|
@@ -140,32 +149,6 @@ export default class COGImageryProvider {
|
|
|
140
149
|
return undefined;
|
|
141
150
|
}
|
|
142
151
|
|
|
143
|
-
get tileWidth(): number {
|
|
144
|
-
const tileGrid = this._source.getTileGrid();
|
|
145
|
-
if (tileGrid) {
|
|
146
|
-
const tileSizeAtZoom0 = tileGrid.getTileSize(0);
|
|
147
|
-
if (Array.isArray(tileSizeAtZoom0)) {
|
|
148
|
-
return Math.round(tileSizeAtZoom0[0]);
|
|
149
|
-
} else {
|
|
150
|
-
return Math.round(tileSizeAtZoom0); // same width and height
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
return 256;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
get tileHeight(): number {
|
|
157
|
-
const tileGrid = this._source.getTileGrid();
|
|
158
|
-
if (tileGrid) {
|
|
159
|
-
const tileSizeAtZoom0 = tileGrid.getTileSize(0);
|
|
160
|
-
if (Array.isArray(tileSizeAtZoom0)) {
|
|
161
|
-
return Math.round(tileSizeAtZoom0[1]);
|
|
162
|
-
} else {
|
|
163
|
-
return Math.round(tileSizeAtZoom0); // same width and height
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
return 256;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
152
|
get maximumLevel(): number {
|
|
170
153
|
const tileGrid = this._source.getTileGrid();
|
|
171
154
|
if (tileGrid) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { ImageryLayer, SplitDirection } from '@vcmap-cesium/engine';
|
|
2
2
|
import { vcsLayerName } from '../layerSymbols.js';
|
|
3
3
|
import LayerImplementation from '../layerImplementation.js';
|
|
4
|
-
import type CesiumMap from '../../map/cesiumMap.js';
|
|
5
4
|
import type {
|
|
6
5
|
RasterLayerImplementation,
|
|
7
6
|
RasterLayerImplementationOptions,
|
|
8
7
|
TilingScheme,
|
|
9
8
|
} from '../rasterLayer.js';
|
|
10
9
|
import type Extent from '../../util/extent.js';
|
|
10
|
+
import type BaseCesiumMap from '../../map/baseCesiumMap.js';
|
|
11
11
|
|
|
12
12
|
class RasterLayerCesiumImpl
|
|
13
|
-
extends LayerImplementation<
|
|
13
|
+
extends LayerImplementation<BaseCesiumMap>
|
|
14
14
|
implements RasterLayerImplementation
|
|
15
15
|
{
|
|
16
16
|
static get className(): string {
|
|
@@ -37,7 +37,7 @@ class RasterLayerCesiumImpl
|
|
|
37
37
|
|
|
38
38
|
imageryLayerOptions: ImageryLayer.ConstructorOptions | undefined;
|
|
39
39
|
|
|
40
|
-
constructor(map:
|
|
40
|
+
constructor(map: BaseCesiumMap, options: RasterLayerImplementationOptions) {
|
|
41
41
|
super(map, options);
|
|
42
42
|
this.splitDirection = options.splitDirection;
|
|
43
43
|
this.minLevel = options.minLevel;
|
|
@@ -2,13 +2,13 @@ import type { CesiumTerrainProvider } from '@vcmap-cesium/engine';
|
|
|
2
2
|
import LayerImplementation from '../layerImplementation.js';
|
|
3
3
|
import { vcsLayerName } from '../layerSymbols.js';
|
|
4
4
|
import { getTerrainProviderForUrl } from '../terrainHelpers.js';
|
|
5
|
-
import type CesiumMap from '../../map/cesiumMap.js';
|
|
6
5
|
import type { TerrainImplementationOptions } from '../terrainLayer.js';
|
|
6
|
+
import type BaseCesiumMap from '../../map/baseCesiumMap.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* TerrainLayer implementation for {@link CesiumMap}
|
|
10
10
|
*/
|
|
11
|
-
class TerrainCesiumImpl extends LayerImplementation<
|
|
11
|
+
class TerrainCesiumImpl extends LayerImplementation<BaseCesiumMap> {
|
|
12
12
|
static get className(): string {
|
|
13
13
|
return 'TerrainCesiumImpl';
|
|
14
14
|
}
|
|
@@ -19,7 +19,7 @@ class TerrainCesiumImpl extends LayerImplementation<CesiumMap> {
|
|
|
19
19
|
|
|
20
20
|
terrainProvider: CesiumTerrainProvider | undefined = undefined;
|
|
21
21
|
|
|
22
|
-
constructor(map:
|
|
22
|
+
constructor(map: BaseCesiumMap, options: TerrainImplementationOptions) {
|
|
23
23
|
super(map, options);
|
|
24
24
|
|
|
25
25
|
this.requestVertexNormals = options.requestVertexNormals;
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
scaleSymbol,
|
|
32
32
|
} from '../vectorSymbols.js';
|
|
33
33
|
import type PanoramaMap from '../../map/panoramaMap.js';
|
|
34
|
-
import { getResolution } from '../../map/
|
|
34
|
+
import { getResolution } from '../../map/baseCesiumMap.js';
|
|
35
35
|
|
|
36
36
|
export function setReferenceForPicking(
|
|
37
37
|
feature: Feature,
|
|
@@ -23,6 +23,8 @@ import type { LayerOptions } from './layer.js';
|
|
|
23
23
|
import type FeatureVisibility from './featureVisibility.js';
|
|
24
24
|
import type VcsMap from '../map/vcsMap.js';
|
|
25
25
|
import { cesiumColorToColor, getStringColor } from '../style/styleHelpers.js';
|
|
26
|
+
import PanoramaMap from '../map/panoramaMap.js';
|
|
27
|
+
import BaseCesiumMap from '../map/baseCesiumMap.js';
|
|
26
28
|
|
|
27
29
|
export type CesiumTilesetOptions = LayerOptions & {
|
|
28
30
|
/**
|
|
@@ -94,14 +96,13 @@ class CesiumTilesetLayer extends FeatureLayer<CesiumTilesetCesiumImpl> {
|
|
|
94
96
|
|
|
95
97
|
private _offset: Coordinate | undefined;
|
|
96
98
|
|
|
97
|
-
protected _supportedMaps = [CesiumMap.className];
|
|
99
|
+
protected _supportedMaps = [CesiumMap.className, PanoramaMap.className];
|
|
98
100
|
|
|
99
101
|
private _customShader: CustomShader | undefined = undefined;
|
|
100
102
|
|
|
101
103
|
constructor(options: CesiumTilesetOptions) {
|
|
102
|
-
super(options);
|
|
103
|
-
this._supportedMaps = [CesiumMap.className];
|
|
104
104
|
const defaultOptions = CesiumTilesetLayer.getDefaultOptions();
|
|
105
|
+
super({ ...defaultOptions, ...options });
|
|
105
106
|
|
|
106
107
|
this.highlightStyle = null;
|
|
107
108
|
if (options.highlightStyle) {
|
|
@@ -199,7 +200,7 @@ class CesiumTilesetLayer extends FeatureLayer<CesiumTilesetCesiumImpl> {
|
|
|
199
200
|
}
|
|
200
201
|
|
|
201
202
|
createImplementationsForMap(map: VcsMap): CesiumTilesetCesiumImpl[] {
|
|
202
|
-
if (map instanceof
|
|
203
|
+
if (map instanceof BaseCesiumMap) {
|
|
203
204
|
return [
|
|
204
205
|
new CesiumTilesetCesiumImpl(map, this.getImplementationOptions()),
|
|
205
206
|
];
|
|
@@ -244,9 +245,10 @@ class CesiumTilesetLayer extends FeatureLayer<CesiumTilesetCesiumImpl> {
|
|
|
244
245
|
});
|
|
245
246
|
}
|
|
246
247
|
|
|
247
|
-
toJSON(
|
|
248
|
-
|
|
249
|
-
|
|
248
|
+
toJSON(
|
|
249
|
+
defaultOptions = CesiumTilesetLayer.getDefaultOptions(),
|
|
250
|
+
): CesiumTilesetOptions {
|
|
251
|
+
const config: CesiumTilesetOptions = super.toJSON(defaultOptions);
|
|
250
252
|
if (this.highlightStyle) {
|
|
251
253
|
config.highlightStyle = this.highlightStyle.toJSON();
|
|
252
254
|
}
|
package/src/layer/cogLayer.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import GeoTIFF, {
|
|
1
|
+
import GeoTIFF, {
|
|
2
|
+
type GeoTIFFSourceOptions,
|
|
3
|
+
type Options as GeoTIFFOptions,
|
|
4
|
+
} from 'ol/source/GeoTIFF.js';
|
|
2
5
|
import type { EventsKey } from 'ol/events.js';
|
|
3
6
|
import { unByKey } from 'ol/Observable.js';
|
|
4
7
|
import RasterLayer, {
|
|
@@ -28,6 +31,11 @@ export type COGLayerOptions = Omit<RasterLayerOptions, 'tilingSchema'> & {
|
|
|
28
31
|
* Passed directly to the GeoTIFF source.
|
|
29
32
|
*/
|
|
30
33
|
interpolate?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Passed directly to the GeoTIFF.js source options see
|
|
36
|
+
* https://openlayers.org/en/latest/apidoc/module-ol_source_GeoTIFF.html#~GeoTIFFSourceOptions
|
|
37
|
+
*/
|
|
38
|
+
sourceOptions?: GeoTIFFSourceOptions;
|
|
31
39
|
};
|
|
32
40
|
|
|
33
41
|
export type COGLayerImplementationOptions = RasterLayerImplementationOptions & {
|
|
@@ -72,6 +80,7 @@ class COGLayer extends RasterLayer<COGOpenlayersImpl | COGCesiumImpl> {
|
|
|
72
80
|
convertToRGB: 'auto',
|
|
73
81
|
normalize: undefined,
|
|
74
82
|
interpolate: undefined,
|
|
83
|
+
sourceOptions: undefined,
|
|
75
84
|
};
|
|
76
85
|
}
|
|
77
86
|
|
|
@@ -79,12 +88,15 @@ class COGLayer extends RasterLayer<COGOpenlayersImpl | COGCesiumImpl> {
|
|
|
79
88
|
private _source: GeoTIFF | undefined;
|
|
80
89
|
|
|
81
90
|
constructor(options: COGLayerOptions) {
|
|
82
|
-
super(options);
|
|
83
91
|
const defaultOptions = COGLayer.getDefaultOptions();
|
|
92
|
+
super({ ...defaultOptions, ...options });
|
|
84
93
|
this._sourceOptions = {
|
|
85
94
|
convertToRGB: options.convertToRGB ?? defaultOptions.convertToRGB,
|
|
86
95
|
normalize: options.normalize,
|
|
87
96
|
interpolate: options.interpolate,
|
|
97
|
+
sourceOptions: options.sourceOptions
|
|
98
|
+
? structuredClone(options.sourceOptions)
|
|
99
|
+
: defaultOptions.sourceOptions,
|
|
88
100
|
};
|
|
89
101
|
|
|
90
102
|
this._supportedMaps = [OpenlayersMap.className, CesiumMap.className];
|
|
@@ -120,10 +132,10 @@ class COGLayer extends RasterLayer<COGOpenlayersImpl | COGCesiumImpl> {
|
|
|
120
132
|
return [];
|
|
121
133
|
}
|
|
122
134
|
|
|
123
|
-
toJSON(): COGLayerOptions {
|
|
124
|
-
const config: Partial<COGLayerOptions> & RasterLayerOptions =
|
|
125
|
-
|
|
126
|
-
|
|
135
|
+
toJSON(defaultOptions = COGLayer.getDefaultOptions()): COGLayerOptions {
|
|
136
|
+
const config: Partial<COGLayerOptions> & RasterLayerOptions = super.toJSON(
|
|
137
|
+
defaultOptions,
|
|
138
|
+
);
|
|
127
139
|
|
|
128
140
|
delete config.tilingSchema;
|
|
129
141
|
if (this._sourceOptions.convertToRGB !== defaultOptions.convertToRGB) {
|
|
@@ -138,6 +150,10 @@ class COGLayer extends RasterLayer<COGOpenlayersImpl | COGCesiumImpl> {
|
|
|
138
150
|
config.interpolate = this._sourceOptions.interpolate;
|
|
139
151
|
}
|
|
140
152
|
|
|
153
|
+
if (this._sourceOptions.sourceOptions != null) {
|
|
154
|
+
config.sourceOptions = structuredClone(this._sourceOptions.sourceOptions);
|
|
155
|
+
}
|
|
156
|
+
|
|
141
157
|
return config;
|
|
142
158
|
}
|
|
143
159
|
|
package/src/layer/czmlLayer.ts
CHANGED
|
@@ -49,10 +49,10 @@ class CzmlLayer extends DataSourceLayer {
|
|
|
49
49
|
* @param options
|
|
50
50
|
*/
|
|
51
51
|
constructor(options: CzmlOptions) {
|
|
52
|
-
|
|
52
|
+
const defaultOptions = CzmlLayer.getDefaultOptions();
|
|
53
|
+
super({ ...defaultOptions, ...options });
|
|
53
54
|
this.entities = this.dataSource.entities;
|
|
54
55
|
|
|
55
|
-
const defaultOptions = CzmlLayer.getDefaultOptions();
|
|
56
56
|
this.sourceUri = options.sourceUri || defaultOptions.sourceUri;
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -99,8 +99,8 @@ class CzmlLayer extends DataSourceLayer {
|
|
|
99
99
|
await this.forceRedraw();
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
toJSON(): CzmlOptions {
|
|
103
|
-
const config: CzmlOptions = super.toJSON();
|
|
102
|
+
toJSON(defaultOptions = CzmlLayer.getDefaultOptions()): CzmlOptions {
|
|
103
|
+
const config: CzmlOptions = super.toJSON(defaultOptions);
|
|
104
104
|
if (this.sourceUri) {
|
|
105
105
|
config.sourceUri = this.sourceUri;
|
|
106
106
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import Style, { type StyleFunction } from 'ol/style/Style.js';
|
|
2
2
|
|
|
3
3
|
import { check, oneOf } from '@vcsuite/check';
|
|
4
|
-
import { parseInteger } from '@vcsuite/parsers';
|
|
5
4
|
import { SplitDirection } from '@vcmap-cesium/engine';
|
|
6
5
|
import type {
|
|
7
6
|
LayerImplementationOptions,
|
|
@@ -25,7 +24,6 @@ import type { DeclarativeStyleItemOptions } from '../style/declarativeStyleItem.
|
|
|
25
24
|
|
|
26
25
|
export type FeatureLayerOptions = LayerOptions & {
|
|
27
26
|
style?: VectorStyleItemOptions | DeclarativeStyleItemOptions | StyleItem;
|
|
28
|
-
balloonHeightOffset?: number;
|
|
29
27
|
splitDirection?: string;
|
|
30
28
|
featureVisibility?: FeatureVisibility;
|
|
31
29
|
};
|
|
@@ -60,7 +58,6 @@ class FeatureLayer<
|
|
|
60
58
|
return {
|
|
61
59
|
...Layer.getDefaultOptions(),
|
|
62
60
|
style: undefined,
|
|
63
|
-
balloonHeightOffset: 10,
|
|
64
61
|
splitDirection: undefined,
|
|
65
62
|
};
|
|
66
63
|
}
|
|
@@ -74,11 +71,6 @@ class FeatureLayer<
|
|
|
74
71
|
*/
|
|
75
72
|
readonly styleChanged = new VcsEvent<StyleItem>();
|
|
76
73
|
|
|
77
|
-
/**
|
|
78
|
-
* a height offset for rendering of a balloon for a feature of this layer.
|
|
79
|
-
*/
|
|
80
|
-
balloonHeightOffset: number;
|
|
81
|
-
|
|
82
74
|
private _splitDirection: SplitDirection = SplitDirection.NONE;
|
|
83
75
|
|
|
84
76
|
/**
|
|
@@ -95,17 +87,12 @@ class FeatureLayer<
|
|
|
95
87
|
* @param options
|
|
96
88
|
*/
|
|
97
89
|
constructor(options: FeatureLayerOptions) {
|
|
98
|
-
super(options);
|
|
99
90
|
const defaultOptions = FeatureLayer.getDefaultOptions();
|
|
91
|
+
super({ ...defaultOptions, ...options });
|
|
100
92
|
|
|
101
93
|
this._style = this.getStyleOrDefaultStyle(options.style);
|
|
102
94
|
this._defaultStyle = this._style;
|
|
103
95
|
|
|
104
|
-
this.balloonHeightOffset = parseInteger(
|
|
105
|
-
options.balloonHeightOffset,
|
|
106
|
-
defaultOptions.balloonHeightOffset,
|
|
107
|
-
);
|
|
108
|
-
|
|
109
96
|
if (options.splitDirection) {
|
|
110
97
|
this._splitDirection =
|
|
111
98
|
options.splitDirection === 'left'
|
|
@@ -201,8 +188,10 @@ class FeatureLayer<
|
|
|
201
188
|
this.setStyle(this.defaultStyle);
|
|
202
189
|
}
|
|
203
190
|
|
|
204
|
-
toJSON(
|
|
205
|
-
|
|
191
|
+
toJSON(
|
|
192
|
+
defaultOptions = FeatureLayer.getDefaultOptions(),
|
|
193
|
+
): FeatureLayerOptions {
|
|
194
|
+
const config: FeatureLayerOptions = super.toJSON(defaultOptions);
|
|
206
195
|
if (!this.getStyleOrDefaultStyle().equals(this._style)) {
|
|
207
196
|
config.style = this.style.toJSON();
|
|
208
197
|
}
|
|
@@ -46,6 +46,8 @@ import type StyleItem from '../style/styleItem.js';
|
|
|
46
46
|
import type VcsMap from '../map/vcsMap.js';
|
|
47
47
|
import type VectorCesiumImpl from './cesium/vectorCesiumImpl.js';
|
|
48
48
|
import FeatureStoreFeatureVisibility from './featureStoreFeatureVisibility.js';
|
|
49
|
+
import BaseCesiumMap from '../map/baseCesiumMap.js';
|
|
50
|
+
import type VectorPanoramaImpl from './panorama/vectorPanoramaImpl.js';
|
|
49
51
|
|
|
50
52
|
export type FeatureStoreStaticRepresentation = {
|
|
51
53
|
/**
|
|
@@ -179,9 +181,10 @@ class FeatureStoreLayer extends VectorLayer {
|
|
|
179
181
|
constructor(options: FeatureStoreOptions) {
|
|
180
182
|
const defaultOptions = FeatureStoreLayer.getDefaultOptions();
|
|
181
183
|
super({
|
|
182
|
-
|
|
184
|
+
...defaultOptions,
|
|
183
185
|
...options,
|
|
184
186
|
});
|
|
187
|
+
|
|
185
188
|
this._supportedMaps = [
|
|
186
189
|
CesiumMap.className,
|
|
187
190
|
OpenlayersMap.className,
|
|
@@ -315,10 +318,11 @@ class FeatureStoreLayer extends VectorLayer {
|
|
|
315
318
|
| VectorOpenlayersImpl
|
|
316
319
|
| VectorCesiumImpl
|
|
317
320
|
| CesiumTilesetCesiumImpl
|
|
321
|
+
| VectorPanoramaImpl
|
|
318
322
|
)[] {
|
|
319
323
|
const impls = super.createImplementationsForMap(map);
|
|
320
324
|
if (
|
|
321
|
-
map instanceof
|
|
325
|
+
map instanceof BaseCesiumMap &&
|
|
322
326
|
this.staticRepresentation &&
|
|
323
327
|
this.staticRepresentation.threeDim
|
|
324
328
|
) {
|
|
@@ -588,9 +592,10 @@ class FeatureStoreLayer extends VectorLayer {
|
|
|
588
592
|
}
|
|
589
593
|
}
|
|
590
594
|
|
|
591
|
-
toJSON(
|
|
592
|
-
|
|
593
|
-
|
|
595
|
+
toJSON(
|
|
596
|
+
defaultOptions = FeatureStoreLayer.getDefaultOptions(),
|
|
597
|
+
): FeatureStoreOptions {
|
|
598
|
+
const config = super.toJSON(defaultOptions) as Partial<FeatureStoreOptions>;
|
|
594
599
|
|
|
595
600
|
delete config.projection;
|
|
596
601
|
const vcsMeta = this.vectorProperties.getVcsMeta({
|
|
@@ -616,6 +621,7 @@ class FeatureStoreLayer extends VectorLayer {
|
|
|
616
621
|
if (this.hiddenStaticFeatureIds.size > 0) {
|
|
617
622
|
config.hiddenStaticFeatureIds = [...this.hiddenStaticFeatureIds];
|
|
618
623
|
}
|
|
624
|
+
|
|
619
625
|
return config as FeatureStoreOptions;
|
|
620
626
|
}
|
|
621
627
|
|
|
@@ -18,11 +18,17 @@ export default class FlatGeobufLayer extends VectorLayer {
|
|
|
18
18
|
return {
|
|
19
19
|
...super.getDefaultOptions(),
|
|
20
20
|
url: '',
|
|
21
|
+
ignoreMapLayerTypes: false,
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
private _dataFetchedPromise: Promise<void> | undefined;
|
|
25
26
|
|
|
27
|
+
constructor(options: FlatGeobufLayerOptions) {
|
|
28
|
+
const defaultOptions = FlatGeobufLayer.getDefaultOptions();
|
|
29
|
+
super({ ...defaultOptions, ...options });
|
|
30
|
+
}
|
|
31
|
+
|
|
26
32
|
async initialize(): Promise<void> {
|
|
27
33
|
if (!this.initialized) {
|
|
28
34
|
await super.initialize();
|
|
@@ -63,5 +69,11 @@ export default class FlatGeobufLayer extends VectorLayer {
|
|
|
63
69
|
}
|
|
64
70
|
return this.forceRedraw();
|
|
65
71
|
}
|
|
72
|
+
|
|
73
|
+
override toJSON(
|
|
74
|
+
defaultOptions = FlatGeobufLayer.getDefaultOptions(),
|
|
75
|
+
): VectorOptions {
|
|
76
|
+
return super.toJSON(defaultOptions);
|
|
77
|
+
}
|
|
66
78
|
}
|
|
67
79
|
layerClassRegistry.registerClass(FlatGeobufLayer.className, FlatGeobufLayer);
|
|
@@ -3,7 +3,7 @@ import type { FeatureCollection } from 'geojson';
|
|
|
3
3
|
import type { VectorOptions } from './vectorLayer.js';
|
|
4
4
|
import VectorLayer from './vectorLayer.js';
|
|
5
5
|
import { parseGeoJSON, writeGeoJSONFeature } from './geojsonHelpers.js';
|
|
6
|
-
import
|
|
6
|
+
import { wgs84Projection } from '../util/projection.js';
|
|
7
7
|
import { layerClassRegistry } from '../classRegistry.js';
|
|
8
8
|
import { getInitForUrl, requestJson } from '../util/fetch.js';
|
|
9
9
|
|
|
@@ -29,6 +29,7 @@ class GeoJSONLayer extends VectorLayer {
|
|
|
29
29
|
...VectorLayer.getDefaultOptions(),
|
|
30
30
|
projection: wgs84Projection.toJSON(),
|
|
31
31
|
features: undefined,
|
|
32
|
+
ignoreMapLayerTypes: false,
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
|
|
@@ -39,7 +40,7 @@ class GeoJSONLayer extends VectorLayer {
|
|
|
39
40
|
constructor(options: GeoJSONOptions) {
|
|
40
41
|
const defaultOptions = GeoJSONLayer.getDefaultOptions();
|
|
41
42
|
super({
|
|
42
|
-
|
|
43
|
+
...defaultOptions,
|
|
43
44
|
...options,
|
|
44
45
|
});
|
|
45
46
|
this._featuresToLoad = options.features || defaultOptions.features;
|
|
@@ -120,16 +121,8 @@ class GeoJSONLayer extends VectorLayer {
|
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
|
|
123
|
-
toJSON(): GeoJSONOptions {
|
|
124
|
-
const config: GeoJSONOptions = super.toJSON();
|
|
125
|
-
const defaultOptions = GeoJSONLayer.getDefaultOptions();
|
|
126
|
-
|
|
127
|
-
const defaultProjection = new Projection(defaultOptions.projection);
|
|
128
|
-
if (!this.projection.equals(defaultProjection)) {
|
|
129
|
-
config.projection = this.projection.toJSON();
|
|
130
|
-
} else {
|
|
131
|
-
delete config.projection;
|
|
132
|
-
}
|
|
124
|
+
toJSON(defaultOptions = GeoJSONLayer.getDefaultOptions()): GeoJSONOptions {
|
|
125
|
+
const config: GeoJSONOptions = super.toJSON(defaultOptions);
|
|
133
126
|
|
|
134
127
|
if (Array.isArray(this._featuresToLoad)) {
|
|
135
128
|
config.features = this._featuresToLoad.slice();
|