@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
|
@@ -34,7 +34,7 @@ export type PanoramaDatasetOptions = Omit<
|
|
|
34
34
|
|
|
35
35
|
export type PanoramaDatasetFeatureProperties = {
|
|
36
36
|
name: string;
|
|
37
|
-
time:
|
|
37
|
+
time: Date;
|
|
38
38
|
dataset: PanoramaDatasetLayer;
|
|
39
39
|
};
|
|
40
40
|
|
|
@@ -48,11 +48,11 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
48
48
|
...VectorTileLayer.getDefaultOptions(),
|
|
49
49
|
url: '',
|
|
50
50
|
baseLevel: 15,
|
|
51
|
-
activeOnStartup: false,
|
|
52
51
|
cameraOffset: 0,
|
|
53
52
|
minLevel: 15,
|
|
54
53
|
maxLevel: 22,
|
|
55
54
|
zIndex: maxZIndexMin50,
|
|
55
|
+
ignoreMapLayerTypes: true,
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -100,7 +100,7 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
100
100
|
if (name && time) {
|
|
101
101
|
feature[panoramaFeature] = {
|
|
102
102
|
name,
|
|
103
|
-
time,
|
|
103
|
+
time: new Date(time),
|
|
104
104
|
dataset: this,
|
|
105
105
|
};
|
|
106
106
|
}
|
|
@@ -172,10 +172,15 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
172
172
|
* Creates a panorama image with the given name, if it belongs to this dataset.
|
|
173
173
|
* Will cache the image for later use.
|
|
174
174
|
* @param name
|
|
175
|
+
* @param [time] - optional time for the image.
|
|
175
176
|
* @returns
|
|
176
177
|
*/
|
|
177
|
-
createPanoramaImage(name: string): Promise<PanoramaImage> {
|
|
178
|
-
return createPanoramaImageFromURL(
|
|
178
|
+
createPanoramaImage(name: string, time?: Date): Promise<PanoramaImage> {
|
|
179
|
+
return createPanoramaImageFromURL(
|
|
180
|
+
`${this.baseUrl}/${name}_rgb.tif`,
|
|
181
|
+
this,
|
|
182
|
+
time,
|
|
183
|
+
);
|
|
179
184
|
}
|
|
180
185
|
|
|
181
186
|
override getZoomToExtent(): Extent | null {
|
|
@@ -196,7 +201,9 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
196
201
|
async getClosestImage(
|
|
197
202
|
coordinate: Coordinate,
|
|
198
203
|
maxDistance = 200,
|
|
199
|
-
): Promise<
|
|
204
|
+
): Promise<
|
|
205
|
+
{ imageName: string; distanceSqrd: number; time?: Date } | undefined
|
|
206
|
+
> {
|
|
200
207
|
const extent = createOrUpdateFromCoordinate(coordinate);
|
|
201
208
|
buffer(extent, maxDistance, extent);
|
|
202
209
|
const features = await this.tileProvider.getFeaturesForExtent(
|
|
@@ -208,6 +215,7 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
208
215
|
);
|
|
209
216
|
let minDistanceSqrd = Infinity;
|
|
210
217
|
let closestImageName: string | undefined;
|
|
218
|
+
let closestImageTime: Date | undefined;
|
|
211
219
|
features.forEach((feature) => {
|
|
212
220
|
const imagePosition = (feature.getGeometry() as Point).getCoordinates();
|
|
213
221
|
const distanceSqrd = cartesian2DDistanceSquared(
|
|
@@ -218,12 +226,17 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
218
226
|
if (distanceSqrd < minDistanceSqrd) {
|
|
219
227
|
minDistanceSqrd = distanceSqrd;
|
|
220
228
|
closestImageName = feature.get('name') as string;
|
|
229
|
+
const dateString = feature.get('time') as string | undefined;
|
|
230
|
+
if (dateString) {
|
|
231
|
+
closestImageTime = new Date(dateString);
|
|
232
|
+
}
|
|
221
233
|
}
|
|
222
234
|
});
|
|
223
235
|
|
|
224
236
|
if (closestImageName) {
|
|
225
237
|
return {
|
|
226
238
|
imageName: closestImageName,
|
|
239
|
+
time: closestImageTime,
|
|
227
240
|
distanceSqrd: minDistanceSqrd,
|
|
228
241
|
};
|
|
229
242
|
}
|
|
@@ -231,13 +244,15 @@ export default class PanoramaDatasetLayer extends VectorTileLayer<PanoramaDatase
|
|
|
231
244
|
return undefined;
|
|
232
245
|
}
|
|
233
246
|
|
|
234
|
-
override toJSON(
|
|
235
|
-
|
|
236
|
-
|
|
247
|
+
override toJSON(
|
|
248
|
+
defaultOptions = PanoramaDatasetLayer.getDefaultOptions(),
|
|
249
|
+
): PanoramaDatasetOptions {
|
|
250
|
+
const config = super.toJSON(
|
|
251
|
+
defaultOptions,
|
|
252
|
+
) as Partial<PanoramaDatasetOptions> & VectorTileOptions;
|
|
237
253
|
delete config.tileProvider; // tileProvider is not serializable
|
|
238
254
|
config.url = this.url;
|
|
239
255
|
|
|
240
|
-
const defaultOptions = PanoramaDatasetLayer.getDefaultOptions();
|
|
241
256
|
if (this.cameraOffset !== defaultOptions.cameraOffset) {
|
|
242
257
|
config.cameraOffset = this.cameraOffset;
|
|
243
258
|
}
|
|
@@ -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
|
}
|
|
@@ -41,8 +41,9 @@ export default class FlatGeobufTileProvider extends TileProvider {
|
|
|
41
41
|
private _projection: Projection;
|
|
42
42
|
|
|
43
43
|
constructor(options: FlatGeobufTileProviderOptions) {
|
|
44
|
+
const defaultOptions = FlatGeobufTileProvider.getDefaultOptions();
|
|
44
45
|
const baseLevels = options.levels.map((level) => level.level);
|
|
45
|
-
super({ ...options, baseLevels });
|
|
46
|
+
super({ ...defaultOptions, ...options, baseLevels });
|
|
46
47
|
|
|
47
48
|
this._levels = new Map(
|
|
48
49
|
options.levels.map((level) => [level.level, { url: level.url }]),
|
|
@@ -90,13 +91,15 @@ export default class FlatGeobufTileProvider extends TileProvider {
|
|
|
90
91
|
return getOlFeatures(reader, this._projection, mercatorExtent);
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
toJSON(
|
|
94
|
+
toJSON(
|
|
95
|
+
defaultOptions = FlatGeobufTileProvider.getDefaultOptions(),
|
|
96
|
+
): FlatGeobufTileProviderOptions {
|
|
94
97
|
const config: FlatGeobufTileProviderOptions & { baseLevels?: number[] } = {
|
|
95
98
|
levels: Array.from(this._levels.entries()).map(([level, { url }]) => ({
|
|
96
99
|
level,
|
|
97
100
|
url,
|
|
98
101
|
})),
|
|
99
|
-
...super.toJSON(),
|
|
102
|
+
...super.toJSON(defaultOptions),
|
|
100
103
|
};
|
|
101
104
|
delete config.baseLevels;
|
|
102
105
|
if (this._projection.epsg !== getDefaultProjection().epsg) {
|
|
@@ -36,7 +36,7 @@ class MVTTileProvider extends TileProvider {
|
|
|
36
36
|
|
|
37
37
|
constructor(options: MVTTileProviderOptions) {
|
|
38
38
|
const defaultOptions = MVTTileProvider.getDefaultOptions();
|
|
39
|
-
super(options);
|
|
39
|
+
super({ ...defaultOptions, ...options });
|
|
40
40
|
|
|
41
41
|
this.url = options.url || defaultOptions.url;
|
|
42
42
|
}
|
|
@@ -90,8 +90,12 @@ class MVTTileProvider extends TileProvider {
|
|
|
90
90
|
return features;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
toJSON(
|
|
94
|
-
|
|
93
|
+
toJSON(
|
|
94
|
+
defaultOptions = MVTTileProvider.getDefaultOptions(),
|
|
95
|
+
): MVTTileProviderOptions {
|
|
96
|
+
const config: Partial<MVTTileProviderOptions> = super.toJSON(
|
|
97
|
+
defaultOptions,
|
|
98
|
+
);
|
|
95
99
|
|
|
96
100
|
if (this.url) {
|
|
97
101
|
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;
|
|
@@ -163,8 +163,8 @@ class TileProvider extends VcsObject {
|
|
|
163
163
|
private _idProperty: string | undefined;
|
|
164
164
|
|
|
165
165
|
constructor(options: TileProviderOptions) {
|
|
166
|
-
super(options);
|
|
167
166
|
const defaultOptions = TileProvider.getDefaultOptions();
|
|
167
|
+
super({ ...defaultOptions, ...options });
|
|
168
168
|
|
|
169
169
|
this._tileCacheSize = parseInteger(
|
|
170
170
|
options.tileCacheSize,
|
|
@@ -649,9 +649,10 @@ class TileProvider extends VcsObject {
|
|
|
649
649
|
return Promise.resolve([]);
|
|
650
650
|
}
|
|
651
651
|
|
|
652
|
-
toJSON(
|
|
653
|
-
|
|
654
|
-
|
|
652
|
+
toJSON(
|
|
653
|
+
defaultOptions = TileProvider.getDefaultOptions(),
|
|
654
|
+
): TileProviderOptions {
|
|
655
|
+
const config: TileProviderOptions = super.toJSON(defaultOptions);
|
|
655
656
|
|
|
656
657
|
if (defaultOptions.tileCacheSize !== this.tileCacheSize) {
|
|
657
658
|
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;
|
package/src/layer/vectorLayer.ts
CHANGED
|
@@ -45,6 +45,8 @@ import type { GeoJSONwriteOptions } from './geojsonHelpers.js';
|
|
|
45
45
|
import { vcsLayerName } from './layerSymbols.js';
|
|
46
46
|
import type CesiumTilesetCesiumImpl from './cesium/cesiumTilesetCesiumImpl.js';
|
|
47
47
|
import VcsEvent from '../vcsEvent.js';
|
|
48
|
+
import PanoramaMap from '../map/panoramaMap.js';
|
|
49
|
+
import VectorPanoramaImpl from './panorama/vectorPanoramaImpl.js';
|
|
48
50
|
|
|
49
51
|
export type VectorOptions = FeatureLayerOptions & {
|
|
50
52
|
/**
|
|
@@ -72,8 +74,13 @@ export type VectorImplementationOptions = FeatureLayerImplementationOptions & {
|
|
|
72
74
|
};
|
|
73
75
|
|
|
74
76
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
+
* the vector layer is the standard layer to display vector features on the map. mostly, a specialization
|
|
78
|
+
* is used to load data from a certain source, e.g. GeoJSONLayer, FlatGeobufLayer, etc. But it can also
|
|
79
|
+
* be used as a generic layer to add features to, mostly at runtime.
|
|
80
|
+
*
|
|
81
|
+
* This layer ignores the mapLayerTypes configuration by default, as it is mostly used to display user data.
|
|
82
|
+
* Be sure to configure this otherwise if needed and reset the default when extending this class to implement
|
|
83
|
+
* a layer for a specific data source.
|
|
77
84
|
*/
|
|
78
85
|
class VectorLayer
|
|
79
86
|
extends FeatureLayer<
|
|
@@ -81,6 +88,7 @@ class VectorLayer
|
|
|
81
88
|
| VectorOpenlayersImpl
|
|
82
89
|
| VectorCesiumImpl
|
|
83
90
|
| CesiumTilesetCesiumImpl
|
|
91
|
+
| VectorPanoramaImpl
|
|
84
92
|
>
|
|
85
93
|
implements SplitLayer
|
|
86
94
|
{
|
|
@@ -95,11 +103,11 @@ class VectorLayer
|
|
|
95
103
|
maxResolution: undefined,
|
|
96
104
|
minResolution: undefined,
|
|
97
105
|
dontUseTerrainForOblique: false,
|
|
98
|
-
zIndex: 50,
|
|
99
106
|
highlightStyle: undefined,
|
|
100
107
|
isDynamic: false,
|
|
101
108
|
vectorProperties: {}, // XXX or should we return VectorProperties default options?
|
|
102
109
|
vectorClusterGroup: undefined,
|
|
110
|
+
ignoreMapLayerTypes: true,
|
|
103
111
|
};
|
|
104
112
|
}
|
|
105
113
|
|
|
@@ -107,6 +115,7 @@ class VectorLayer
|
|
|
107
115
|
CesiumMap.className,
|
|
108
116
|
ObliqueMap.className,
|
|
109
117
|
OpenlayersMap.className,
|
|
118
|
+
PanoramaMap.className,
|
|
110
119
|
];
|
|
111
120
|
|
|
112
121
|
source: VectorSource = new VectorSource({});
|
|
@@ -148,9 +157,9 @@ class VectorLayer
|
|
|
148
157
|
}>();
|
|
149
158
|
|
|
150
159
|
constructor(options: VectorOptions) {
|
|
151
|
-
super(options);
|
|
152
|
-
|
|
153
160
|
const defaultOptions = VectorLayer.getDefaultOptions();
|
|
161
|
+
super({ ...defaultOptions, ...options });
|
|
162
|
+
|
|
154
163
|
this.projection = new Projection(options.projection);
|
|
155
164
|
this.maxResolution =
|
|
156
165
|
options.maxResolution != null
|
|
@@ -291,6 +300,7 @@ class VectorLayer
|
|
|
291
300
|
| VectorOpenlayersImpl
|
|
292
301
|
| VectorCesiumImpl
|
|
293
302
|
| CesiumTilesetCesiumImpl
|
|
303
|
+
| VectorPanoramaImpl
|
|
294
304
|
)[] {
|
|
295
305
|
if (!this.visibility || !!this.vectorClusterGroup) {
|
|
296
306
|
return [];
|
|
@@ -308,6 +318,10 @@ class VectorLayer
|
|
|
308
318
|
return [new VectorObliqueImpl(map, this.getImplementationOptions())];
|
|
309
319
|
}
|
|
310
320
|
|
|
321
|
+
if (map instanceof PanoramaMap) {
|
|
322
|
+
return [new VectorPanoramaImpl(map, this.getImplementationOptions())];
|
|
323
|
+
}
|
|
324
|
+
|
|
311
325
|
return [];
|
|
312
326
|
}
|
|
313
327
|
|
|
@@ -499,11 +513,13 @@ class VectorLayer
|
|
|
499
513
|
return null;
|
|
500
514
|
}
|
|
501
515
|
|
|
502
|
-
toJSON(): VectorOptions {
|
|
503
|
-
const config: VectorOptions = super.toJSON();
|
|
504
|
-
|
|
516
|
+
toJSON(defaultOptions = VectorLayer.getDefaultOptions()): VectorOptions {
|
|
517
|
+
const config: VectorOptions = super.toJSON(defaultOptions);
|
|
518
|
+
|
|
519
|
+
const defaultProjection =
|
|
520
|
+
defaultOptions.projection ?? getDefaultProjection();
|
|
505
521
|
|
|
506
|
-
if (this.projection.epsg !==
|
|
522
|
+
if (this.projection.epsg !== defaultProjection.epsg) {
|
|
507
523
|
config.projection = this.projection.toJSON();
|
|
508
524
|
}
|
|
509
525
|
|
|
@@ -204,12 +204,11 @@ class VectorTileLayer<
|
|
|
204
204
|
* @param options
|
|
205
205
|
*/
|
|
206
206
|
constructor(options: VectorTileOptions) {
|
|
207
|
-
|
|
207
|
+
const defaultOptions = VectorTileLayer.getDefaultOptions();
|
|
208
|
+
super({ ...defaultOptions, ...options });
|
|
208
209
|
|
|
209
210
|
this._supportedMaps = [CesiumMap.className, OpenlayersMap.className];
|
|
210
211
|
|
|
211
|
-
const defaultOptions = VectorTileLayer.getDefaultOptions();
|
|
212
|
-
|
|
213
212
|
this.highlightStyle = undefined;
|
|
214
213
|
if (options.highlightStyle) {
|
|
215
214
|
this.highlightStyle =
|
|
@@ -535,9 +534,10 @@ class VectorTileLayer<
|
|
|
535
534
|
}
|
|
536
535
|
}
|
|
537
536
|
|
|
538
|
-
toJSON(
|
|
539
|
-
|
|
540
|
-
|
|
537
|
+
toJSON(
|
|
538
|
+
defaultOptions = VectorTileLayer.getDefaultOptions(),
|
|
539
|
+
): VectorTileOptions {
|
|
540
|
+
const config: VectorTileOptions = super.toJSON(defaultOptions);
|
|
541
541
|
|
|
542
542
|
if (this._maxLevel !== defaultOptions.maxLevel) {
|
|
543
543
|
config.maxLevel = this._maxLevel;
|
package/src/layer/wfsLayer.ts
CHANGED
|
@@ -56,6 +56,7 @@ class WFSLayer extends VectorLayer {
|
|
|
56
56
|
featurePrefix: '',
|
|
57
57
|
getFeatureOptions: {},
|
|
58
58
|
version: undefined,
|
|
59
|
+
ignoreMapLayerTypes: false,
|
|
59
60
|
};
|
|
60
61
|
}
|
|
61
62
|
|
|
@@ -66,7 +67,8 @@ class WFSLayer extends VectorLayer {
|
|
|
66
67
|
(proj.epsg as string).match(/\d+/)?.[0] as string
|
|
67
68
|
}`,
|
|
68
69
|
];
|
|
69
|
-
|
|
70
|
+
const defaultOptions = WFSLayer.getDefaultOptions();
|
|
71
|
+
super({ ...defaultOptions, ...options, projection: proj });
|
|
70
72
|
|
|
71
73
|
this.featureType = Array.isArray(options.featureType)
|
|
72
74
|
? options.featureType
|
|
@@ -157,15 +159,16 @@ class WFSLayer extends VectorLayer {
|
|
|
157
159
|
this.addFeatures(features);
|
|
158
160
|
}
|
|
159
161
|
|
|
160
|
-
toJSON(): WFSOptions {
|
|
161
|
-
const config: Partial<WFSOptions> = super.toJSON();
|
|
162
|
-
const defaultOptions = WFSLayer.getDefaultOptions();
|
|
162
|
+
toJSON(defaultOptions = WFSLayer.getDefaultOptions()): WFSOptions {
|
|
163
|
+
const config: Partial<WFSOptions> = super.toJSON(defaultOptions);
|
|
163
164
|
config.featureType = this.featureType.slice();
|
|
164
165
|
config.featureNS = this.featureNS;
|
|
165
166
|
config.featurePrefix = this.featurePrefix;
|
|
167
|
+
|
|
166
168
|
if (Object.keys(this.getFeaturesOptions).length > 0) {
|
|
167
169
|
config.getFeatureOptions = this.getFeaturesOptions;
|
|
168
170
|
}
|
|
171
|
+
|
|
169
172
|
if (this.version !== defaultOptions.version) {
|
|
170
173
|
config.version = this.version;
|
|
171
174
|
}
|
package/src/layer/wmsLayer.ts
CHANGED
|
@@ -96,8 +96,8 @@ class WMSLayer extends RasterLayer<WmsCesiumImpl | WmsOpenlayersImpl> {
|
|
|
96
96
|
* @param options
|
|
97
97
|
*/
|
|
98
98
|
constructor(options: WMSOptions) {
|
|
99
|
-
super(options);
|
|
100
99
|
const defaultOptions = WMSLayer.getDefaultOptions();
|
|
100
|
+
super({ ...defaultOptions, ...options });
|
|
101
101
|
|
|
102
102
|
this.version = options.version || (defaultOptions.version as string);
|
|
103
103
|
|
|
@@ -217,9 +217,8 @@ class WMSLayer extends RasterLayer<WmsCesiumImpl | WmsOpenlayersImpl> {
|
|
|
217
217
|
return this.parameters.LAYERS ? this.parameters.LAYERS.split(',') : [];
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
toJSON(): WMSOptions {
|
|
221
|
-
const config: WMSOptions = super.toJSON();
|
|
222
|
-
const defaultOptions = WMSLayer.getDefaultOptions();
|
|
220
|
+
toJSON(defaultOptions = WMSLayer.getDefaultOptions()): WMSOptions {
|
|
221
|
+
const config: WMSOptions = super.toJSON(defaultOptions);
|
|
223
222
|
|
|
224
223
|
if (this.parameters.LAYERS) {
|
|
225
224
|
config.layers = this.parameters.LAYERS;
|
package/src/layer/wmtsLayer.ts
CHANGED
|
@@ -106,7 +106,7 @@ class WMTSLayer extends RasterLayer<WmtsCesiumImpl | WmtsOpenlayersImpl> {
|
|
|
106
106
|
|
|
107
107
|
constructor(options: WMTSOptions) {
|
|
108
108
|
const defaultOptions = WMTSLayer.getDefaultOptions();
|
|
109
|
-
super({
|
|
109
|
+
super({ ...defaultOptions, ...options });
|
|
110
110
|
|
|
111
111
|
this._supportedMaps = [OpenlayersMap.className, CesiumMap.className];
|
|
112
112
|
|
|
@@ -174,15 +174,8 @@ class WMTSLayer extends RasterLayer<WmtsCesiumImpl | WmtsOpenlayersImpl> {
|
|
|
174
174
|
return [];
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
toJSON(): WMTSOptions {
|
|
178
|
-
const config: Partial<WMTSOptions> = super.toJSON();
|
|
179
|
-
const defaultOptions = WMTSLayer.getDefaultOptions();
|
|
180
|
-
|
|
181
|
-
if (this.tilingSchema !== defaultOptions.tilingSchema) {
|
|
182
|
-
config.tilingSchema = this.tilingSchema;
|
|
183
|
-
} else {
|
|
184
|
-
delete config.tilingSchema;
|
|
185
|
-
}
|
|
177
|
+
toJSON(defaultOptions = WMTSLayer.getDefaultOptions()): WMTSOptions {
|
|
178
|
+
const config: Partial<WMTSOptions> = super.toJSON(defaultOptions);
|
|
186
179
|
|
|
187
180
|
if (
|
|
188
181
|
this.numberOfLevelZeroTilesX !== defaultOptions.numberOfLevelZeroTilesX
|