@vcmap/core 5.0.2 → 5.1.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/cesium.d.ts +257 -0
- package/dist/geojson.d.ts +27 -0
- package/dist/index.d.ts +15 -2
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/ol.d.ts +138 -0
- package/dist/src/classRegistry.js +2 -2
- package/dist/src/classRegistry.js.map +1 -1
- package/dist/src/featureProvider/abstractFeatureProvider.d.ts +2 -1
- package/dist/src/featureProvider/abstractFeatureProvider.js +2 -1
- package/dist/src/featureProvider/abstractFeatureProvider.js.map +1 -1
- package/dist/src/featureProvider/tileProviderFeatureProvider.d.ts +1 -1
- package/dist/src/featureProvider/tileProviderFeatureProvider.js +2 -2
- package/dist/src/featureProvider/tileProviderFeatureProvider.js.map +1 -1
- package/dist/src/featureProvider/wmsFeatureProvider.d.ts +1 -1
- package/dist/src/featureProvider/wmsFeatureProvider.js +4 -3
- package/dist/src/featureProvider/wmsFeatureProvider.js.map +1 -1
- package/dist/src/interaction/eventHandler.js +3 -3
- package/dist/src/interaction/eventHandler.js.map +1 -1
- package/dist/src/interaction/featureProviderInteraction.js +1 -1
- package/dist/src/interaction/featureProviderInteraction.js.map +1 -1
- package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.d.ts +4 -1
- package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js +31 -2
- package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/resourceHelper.d.ts +2 -0
- package/dist/src/layer/cesium/resourceHelper.js +12 -0
- package/dist/src/layer/cesium/resourceHelper.js.map +1 -0
- package/dist/src/layer/cesium/singleImageCesiumImpl.js +2 -1
- package/dist/src/layer/cesium/singleImageCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/terrainCesiumImpl.js +1 -1
- package/dist/src/layer/cesium/terrainCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/tmsCesiumImpl.js +2 -1
- package/dist/src/layer/cesium/tmsCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js +1 -0
- package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vectorTileImageryProvider.d.ts +2 -0
- package/dist/src/layer/cesium/vectorTileImageryProvider.js +3 -1
- package/dist/src/layer/cesium/vectorTileImageryProvider.js.map +1 -1
- package/dist/src/layer/cesium/wmsCesiumImpl.js +2 -1
- package/dist/src/layer/cesium/wmsCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/wmtsCesiumImpl.js +2 -1
- package/dist/src/layer/cesium/wmtsCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesiumTilesetLayer.d.ts +5 -1
- package/dist/src/layer/cesiumTilesetLayer.js +17 -7
- package/dist/src/layer/cesiumTilesetLayer.js.map +1 -1
- package/dist/src/layer/czmlLayer.js +2 -1
- package/dist/src/layer/czmlLayer.js.map +1 -1
- package/dist/src/layer/featureLayer.js +2 -2
- package/dist/src/layer/featureLayer.js.map +1 -1
- package/dist/src/layer/featureStoreLayer.js +8 -5
- package/dist/src/layer/featureStoreLayer.js.map +1 -1
- package/dist/src/layer/featureStoreLayerChanges.d.ts +20 -8
- package/dist/src/layer/featureStoreLayerChanges.js +26 -26
- package/dist/src/layer/featureStoreLayerChanges.js.map +1 -1
- package/dist/src/layer/featureStoreLayerState.d.ts +1 -5
- package/dist/src/layer/featureStoreLayerState.js +0 -9
- package/dist/src/layer/featureStoreLayerState.js.map +1 -1
- package/dist/src/layer/geojsonLayer.js +3 -2
- package/dist/src/layer/geojsonLayer.js.map +1 -1
- package/dist/src/layer/layer.d.ts +15 -0
- package/dist/src/layer/layer.js +30 -4
- package/dist/src/layer/layer.js.map +1 -1
- package/dist/src/layer/layerImplementation.d.ts +1 -0
- package/dist/src/layer/layerImplementation.js +2 -0
- package/dist/src/layer/layerImplementation.js.map +1 -1
- package/dist/src/layer/oblique/vectorObliqueImpl.js +9 -6
- package/dist/src/layer/oblique/vectorObliqueImpl.js.map +1 -1
- package/dist/src/layer/openlayers/loadFunctionHelpers.d.ts +2 -0
- package/dist/src/layer/openlayers/loadFunctionHelpers.js +20 -0
- package/dist/src/layer/openlayers/loadFunctionHelpers.js.map +1 -0
- package/dist/src/layer/openlayers/singleImageOpenlayersImpl.js +25 -1
- package/dist/src/layer/openlayers/singleImageOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/tmsOpenlayersImpl.js +9 -1
- package/dist/src/layer/openlayers/tmsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.js +1 -1
- package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/wmsOpenlayersImpl.d.ts +4 -1
- package/dist/src/layer/openlayers/wmsOpenlayersImpl.js +20 -1
- package/dist/src/layer/openlayers/wmsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/wmtsOpenlayersImpl.js +9 -1
- package/dist/src/layer/openlayers/wmtsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/pointCloudLayer.js +2 -2
- package/dist/src/layer/pointCloudLayer.js.map +1 -1
- package/dist/src/layer/terrainHelpers.d.ts +3 -3
- package/dist/src/layer/terrainHelpers.js +12 -7
- package/dist/src/layer/terrainHelpers.js.map +1 -1
- package/dist/src/layer/terrainLayer.js +1 -1
- package/dist/src/layer/terrainLayer.js.map +1 -1
- package/dist/src/layer/tileProvider/mvtTileProvider.d.ts +1 -1
- package/dist/src/layer/tileProvider/mvtTileProvider.js +4 -3
- package/dist/src/layer/tileProvider/mvtTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/staticGeojsonTileProvider.d.ts +1 -1
- package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js +4 -3
- package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/tileProvider.d.ts +14 -11
- package/dist/src/layer/tileProvider/tileProvider.js +23 -20
- 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 +4 -3
- package/dist/src/layer/tileProvider/urlTemplateTileProvider.js.map +1 -1
- package/dist/src/layer/vectorLayer.d.ts +1 -2
- package/dist/src/layer/vectorLayer.js +3 -3
- package/dist/src/layer/vectorLayer.js.map +1 -1
- package/dist/src/layer/vectorProperties.d.ts +11 -16
- package/dist/src/layer/vectorProperties.js +16 -13
- package/dist/src/layer/vectorProperties.js.map +1 -1
- package/dist/src/layer/wfsLayer.js +9 -6
- package/dist/src/layer/wfsLayer.js.map +1 -1
- package/dist/src/layer/wmsHelpers.d.ts +10 -0
- package/dist/src/layer/wmsHelpers.js +53 -12
- package/dist/src/layer/wmsHelpers.js.map +1 -1
- package/dist/src/layer/wmsLayer.d.ts +6 -0
- package/dist/src/layer/wmsLayer.js +5 -2
- package/dist/src/layer/wmsLayer.js.map +1 -1
- package/dist/src/map/cameraLimiter.d.ts +5 -0
- package/dist/src/map/cameraLimiter.js +11 -4
- package/dist/src/map/cameraLimiter.js.map +1 -1
- package/dist/src/map/cesiumMap.d.ts +20 -1
- package/dist/src/map/cesiumMap.js +51 -2
- package/dist/src/map/cesiumMap.js.map +1 -1
- package/dist/src/map/vcsMap.js +2 -2
- package/dist/src/map/vcsMap.js.map +1 -1
- package/dist/src/oblique/helpers.d.ts +1 -1
- package/dist/src/oblique/helpers.js +5 -9
- package/dist/src/oblique/helpers.js.map +1 -1
- package/dist/src/oblique/obliqueCollection.d.ts +1 -0
- package/dist/src/oblique/obliqueCollection.js +1 -1
- package/dist/src/oblique/obliqueCollection.js.map +1 -1
- package/dist/src/oblique/obliqueDataSet.d.ts +3 -1
- package/dist/src/oblique/obliqueDataSet.js +13 -6
- package/dist/src/oblique/obliqueDataSet.js.map +1 -1
- package/dist/src/oblique/obliqueImageMeta.d.ts +2 -0
- package/dist/src/oblique/obliqueImageMeta.js +2 -0
- package/dist/src/oblique/obliqueImageMeta.js.map +1 -1
- package/dist/src/oblique/obliqueView.d.ts +1 -0
- package/dist/src/oblique/obliqueView.js +12 -2
- package/dist/src/oblique/obliqueView.js.map +1 -1
- package/dist/src/oblique/parseImageJson.d.ts +6 -5
- package/dist/src/oblique/parseImageJson.js +7 -5
- package/dist/src/oblique/parseImageJson.js.map +1 -1
- package/dist/src/ol/geom/circle.js.map +1 -1
- package/dist/src/style/declarativeStyleItem.js +10 -2
- package/dist/src/style/declarativeStyleItem.js.map +1 -1
- package/dist/src/style/styleFactory.js +2 -2
- package/dist/src/style/styleFactory.js.map +1 -1
- package/dist/src/style/styleHelpers.js +13 -3
- package/dist/src/style/styleHelpers.js.map +1 -1
- package/dist/src/style/vectorStyleItem.js +29 -16
- package/dist/src/style/vectorStyleItem.js.map +1 -1
- package/dist/src/util/clipping/clippingPlaneHelper.js +3 -3
- package/dist/src/util/clipping/clippingPlaneHelper.js.map +1 -1
- package/dist/src/util/editor/createFeatureSession.d.ts +2 -2
- package/dist/src/util/editor/createFeatureSession.js +2 -2
- package/dist/src/util/editor/createFeatureSession.js.map +1 -1
- package/dist/src/util/editor/editFeaturesSession.d.ts +2 -2
- package/dist/src/util/editor/editGeometrySession.d.ts +2 -2
- package/dist/src/util/editor/editorSessionHelpers.d.ts +2 -2
- package/dist/src/util/editor/selectFeaturesSession.d.ts +2 -2
- package/dist/src/util/editor/selectFeaturesSession.js +2 -2
- package/dist/src/util/editor/selectFeaturesSession.js.map +1 -1
- package/dist/src/util/featureconverter/arcToCesium.d.ts +1 -1
- package/dist/src/util/featureconverter/arcToCesium.js +5 -2
- package/dist/src/util/featureconverter/arcToCesium.js.map +1 -1
- package/dist/src/util/featureconverter/circleToCesium.d.ts +4 -2
- package/dist/src/util/featureconverter/circleToCesium.js +8 -3
- package/dist/src/util/featureconverter/circleToCesium.js.map +1 -1
- package/dist/src/util/featureconverter/extent3D.js.map +1 -1
- package/dist/src/util/featureconverter/featureconverterHelper.js +2 -2
- package/dist/src/util/featureconverter/featureconverterHelper.js.map +1 -1
- package/dist/src/util/featureconverter/lineStringToCesium.d.ts +3 -1
- package/dist/src/util/featureconverter/lineStringToCesium.js +7 -2
- package/dist/src/util/featureconverter/lineStringToCesium.js.map +1 -1
- package/dist/src/util/featureconverter/pointToCesium.js +1 -1
- package/dist/src/util/featureconverter/pointToCesium.js.map +1 -1
- package/dist/src/util/featureconverter/polygonToCesium.d.ts +3 -3
- package/dist/src/util/featureconverter/polygonToCesium.js +9 -15
- package/dist/src/util/featureconverter/polygonToCesium.js.map +1 -1
- package/dist/src/util/fetch.d.ts +2 -0
- package/dist/src/util/fetch.js +16 -0
- package/dist/src/util/fetch.js.map +1 -1
- package/dist/src/util/flight/flightAnchor.d.ts +23 -0
- package/dist/src/util/flight/flightAnchor.js +152 -0
- package/dist/src/util/flight/flightAnchor.js.map +1 -0
- package/dist/src/util/flight/flightCollection.d.ts +25 -0
- package/dist/src/util/flight/flightCollection.js +63 -0
- package/dist/src/util/flight/flightCollection.js.map +1 -0
- package/dist/src/util/flight/flightHelpers.d.ts +29 -0
- package/dist/src/util/flight/flightHelpers.js +134 -0
- package/dist/src/util/flight/flightHelpers.js.map +1 -0
- package/dist/src/util/flight/flightInstance.d.ts +57 -0
- package/dist/src/util/flight/flightInstance.js +166 -0
- package/dist/src/util/flight/flightInstance.js.map +1 -0
- package/dist/src/util/flight/flightPlayer.d.ts +30 -0
- package/dist/src/util/flight/flightPlayer.js +247 -0
- package/dist/src/util/flight/flightPlayer.js.map +1 -0
- package/dist/src/util/flight/flightVisualizer.d.ts +18 -0
- package/dist/src/util/flight/flightVisualizer.js +151 -0
- package/dist/src/util/flight/flightVisualizer.js.map +1 -0
- package/dist/src/util/hiddenObjects.d.ts +8 -0
- package/dist/src/util/hiddenObjects.js +17 -0
- package/dist/src/util/hiddenObjects.js.map +1 -0
- package/dist/src/util/mapCollection.js +2 -2
- package/dist/src/util/mapCollection.js.map +1 -1
- package/dist/src/util/overrideCollection.d.ts +8 -3
- package/dist/src/util/overrideCollection.js +17 -0
- package/dist/src/util/overrideCollection.js.map +1 -1
- package/dist/src/util/projection.js +5 -2
- package/dist/src/util/projection.js.map +1 -1
- package/dist/src/util/viewpoint.d.ts +1 -0
- package/dist/src/util/viewpoint.js +24 -7
- package/dist/src/util/viewpoint.js.map +1 -1
- package/dist/src/vcsApp.d.ts +10 -3
- package/dist/src/vcsApp.js +34 -15
- package/dist/src/vcsApp.js.map +1 -1
- package/dist/src/vcsModule.d.ts +4 -0
- package/dist/src/vcsModule.js.map +1 -1
- package/dist/tests/unit/helpers/cesiumHelpers.d.ts +2 -2
- package/dist/tests/unit/helpers/cesiumHelpers.js +2 -1
- package/dist/tests/unit/helpers/cesiumHelpers.js.map +1 -1
- package/dist/tests/unit/helpers/terrain/terrainData.d.ts +7 -0
- package/dist/tests/unit/helpers/terrain/terrainData.js +2 -2
- package/dist/tests/unit/helpers/terrain/terrainData.js.map +1 -1
- package/index.ts +39 -1
- package/package.json +4 -2
- package/src/classRegistry.ts +2 -2
- package/src/featureProvider/abstractFeatureProvider.ts +2 -0
- package/src/featureProvider/tileProviderFeatureProvider.ts +2 -0
- package/src/featureProvider/wmsFeatureProvider.ts +4 -2
- package/src/interaction/eventHandler.ts +3 -3
- package/src/interaction/featureProviderInteraction.ts +1 -0
- package/src/layer/cesium/cesiumTilesetCesiumImpl.ts +44 -5
- package/src/layer/cesium/resourceHelper.ts +15 -0
- package/src/layer/cesium/singleImageCesiumImpl.ts +2 -1
- package/src/layer/cesium/terrainCesiumImpl.ts +2 -1
- package/src/layer/cesium/tmsCesiumImpl.ts +2 -1
- package/src/layer/cesium/vectorRasterTileCesiumImpl.ts +1 -0
- package/src/layer/cesium/vectorTileImageryProvider.ts +10 -1
- package/src/layer/cesium/wmsCesiumImpl.ts +2 -1
- package/src/layer/cesium/wmtsCesiumImpl.ts +4 -2
- package/src/layer/cesiumTilesetLayer.ts +25 -7
- package/src/layer/czmlLayer.ts +2 -1
- package/src/layer/featureLayer.ts +2 -2
- package/src/layer/featureStoreLayer.ts +8 -8
- package/src/layer/featureStoreLayerChanges.ts +63 -45
- package/src/layer/featureStoreLayerState.ts +6 -5
- package/src/layer/geojsonLayer.ts +3 -3
- package/src/layer/layer.ts +41 -4
- package/src/layer/layerImplementation.ts +3 -0
- package/src/layer/oblique/vectorObliqueImpl.ts +9 -8
- package/src/layer/openlayers/loadFunctionHelpers.ts +24 -0
- package/src/layer/openlayers/singleImageOpenlayersImpl.ts +25 -1
- package/src/layer/openlayers/tmsOpenlayersImpl.ts +8 -1
- package/src/layer/openlayers/vectorTileOpenlayersImpl.ts +1 -0
- package/src/layer/openlayers/wmsOpenlayersImpl.ts +23 -2
- package/src/layer/openlayers/wmtsOpenlayersImpl.ts +8 -1
- package/src/layer/pointCloudLayer.ts +2 -2
- package/src/layer/terrainHelpers.ts +19 -6
- package/src/layer/terrainLayer.ts +8 -4
- package/src/layer/tileProvider/mvtTileProvider.ts +9 -3
- package/src/layer/tileProvider/staticGeojsonTileProvider.ts +9 -3
- package/src/layer/tileProvider/tileProvider.ts +49 -13
- package/src/layer/tileProvider/urlTemplateTileProvider.ts +10 -3
- package/src/layer/vectorLayer.ts +9 -9
- package/src/layer/vectorProperties.ts +46 -22
- package/src/layer/wfsLayer.ts +9 -6
- package/src/layer/wmsHelpers.ts +78 -10
- package/src/layer/wmsLayer.ts +11 -2
- package/src/map/cameraLimiter.ts +21 -2
- package/src/map/cesiumMap.ts +67 -2
- package/src/map/vcsMap.ts +2 -2
- package/src/oblique/helpers.ts +5 -13
- package/src/oblique/obliqueCollection.ts +2 -0
- package/src/oblique/obliqueDataSet.ts +16 -2
- package/src/oblique/obliqueImageMeta.ts +4 -0
- package/src/oblique/obliqueView.ts +12 -2
- package/src/oblique/parseImageJson.ts +7 -4
- package/src/ol/geojson.d.ts +1 -2
- package/src/ol/geom/circle.ts +1 -1
- package/src/style/declarativeStyleItem.ts +10 -2
- package/src/style/styleFactory.ts +2 -2
- package/src/style/styleHelpers.ts +13 -4
- package/src/style/vectorStyleItem.ts +32 -20
- package/src/util/clipping/clippingPlaneHelper.ts +3 -3
- package/src/util/editor/createFeatureSession.ts +9 -8
- package/src/util/editor/editFeaturesSession.ts +1 -1
- package/src/util/editor/editGeometrySession.ts +1 -1
- package/src/util/editor/editorSessionHelpers.ts +2 -2
- package/src/util/editor/selectFeaturesSession.ts +3 -3
- package/src/util/featureconverter/arcToCesium.ts +5 -1
- package/src/util/featureconverter/circleToCesium.ts +8 -2
- package/src/util/featureconverter/extent3D.ts +1 -1
- package/src/util/featureconverter/featureconverterHelper.ts +3 -5
- package/src/util/featureconverter/lineStringToCesium.ts +8 -1
- package/src/util/featureconverter/pointToCesium.ts +1 -1
- package/src/util/featureconverter/polygonToCesium.ts +6 -15
- package/src/util/fetch.ts +25 -0
- package/src/util/flight/flightAnchor.ts +195 -0
- package/src/util/flight/flightCollection.ts +78 -0
- package/src/util/flight/flightHelpers.ts +208 -0
- package/src/util/flight/flightInstance.ts +240 -0
- package/src/util/flight/flightPlayer.ts +326 -0
- package/src/util/flight/flightVisualizer.ts +202 -0
- package/src/util/hiddenObjects.ts +35 -0
- package/src/util/mapCollection.ts +2 -2
- package/src/util/overrideCollection.ts +26 -3
- package/src/util/projection.ts +5 -2
- package/src/util/viewpoint.ts +27 -7
- package/src/vcsApp.ts +56 -15
- package/src/vcsModule.ts +4 -0
package/src/util/viewpoint.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Coordinate } from 'ol/coordinate.js';
|
|
2
|
+
import { containsCoordinate } from 'ol/extent.js';
|
|
2
3
|
import { EasingFunction } from '@vcmap-cesium/engine';
|
|
3
4
|
import { parseBoolean, parseNumber } from '@vcsuite/parsers';
|
|
4
5
|
import Projection, { wgs84Projection } from './projection.js';
|
|
@@ -159,12 +160,27 @@ class Viewpoint extends VcsObject {
|
|
|
159
160
|
*/
|
|
160
161
|
easingFunctionName: string | undefined;
|
|
161
162
|
|
|
163
|
+
static getDefaultOptions(): ViewpointOptions {
|
|
164
|
+
return {
|
|
165
|
+
cameraPosition: undefined,
|
|
166
|
+
groundPosition: undefined,
|
|
167
|
+
distance: 1000,
|
|
168
|
+
heading: 0,
|
|
169
|
+
pitch: -90,
|
|
170
|
+
roll: 0,
|
|
171
|
+
animate: false,
|
|
172
|
+
duration: undefined,
|
|
173
|
+
easingFunctionName: undefined,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
162
177
|
/**
|
|
163
178
|
* @param options
|
|
164
179
|
*/
|
|
165
180
|
constructor(options: ViewpointOptions) {
|
|
166
181
|
super(options);
|
|
167
182
|
|
|
183
|
+
const defaultOptions = Viewpoint.getDefaultOptions();
|
|
168
184
|
this.cameraPosition = null;
|
|
169
185
|
if (
|
|
170
186
|
Array.isArray(options.cameraPosition) &&
|
|
@@ -179,12 +195,12 @@ class Viewpoint extends VcsObject {
|
|
|
179
195
|
}
|
|
180
196
|
this.distance = parseNumber(
|
|
181
197
|
options.distance,
|
|
182
|
-
this.cameraPosition ? this.cameraPosition[2] :
|
|
198
|
+
this.cameraPosition ? this.cameraPosition[2] : defaultOptions.distance,
|
|
183
199
|
);
|
|
184
|
-
this.heading = parseNumber(options.heading,
|
|
185
|
-
this.pitch = parseNumber(options.pitch,
|
|
186
|
-
this.roll = parseNumber(options.roll,
|
|
187
|
-
this.animate = parseBoolean(options.animate,
|
|
200
|
+
this.heading = parseNumber(options.heading, defaultOptions.heading);
|
|
201
|
+
this.pitch = parseNumber(options.pitch, defaultOptions.pitch);
|
|
202
|
+
this.roll = parseNumber(options.roll, defaultOptions.roll);
|
|
203
|
+
this.animate = parseBoolean(options.animate, defaultOptions.animate);
|
|
188
204
|
this.duration = parseNumber(options.duration);
|
|
189
205
|
this.easingFunctionName = options.easingFunctionName;
|
|
190
206
|
}
|
|
@@ -341,13 +357,17 @@ class Viewpoint extends VcsObject {
|
|
|
341
357
|
this.cameraPosition &&
|
|
342
358
|
Array.isArray(this.cameraPosition) &&
|
|
343
359
|
this.cameraPosition.length === 3 &&
|
|
344
|
-
this.cameraPosition.every((position) => Number.isFinite(position))
|
|
360
|
+
this.cameraPosition.every((position) => Number.isFinite(position)) &&
|
|
361
|
+
containsCoordinate(Extent.WGS_84_EXTENT, this.cameraPosition);
|
|
362
|
+
|
|
345
363
|
const hasGround =
|
|
346
364
|
this.groundPosition &&
|
|
347
365
|
Array.isArray(this.groundPosition) &&
|
|
348
366
|
this.groundPosition.length > 1 &&
|
|
349
367
|
this.groundPosition.length < 4 &&
|
|
350
|
-
this.groundPosition.every((position) => Number.isFinite(position))
|
|
368
|
+
this.groundPosition.every((position) => Number.isFinite(position)) &&
|
|
369
|
+
containsCoordinate(Extent.WGS_84_EXTENT, this.groundPosition);
|
|
370
|
+
|
|
351
371
|
if (!hasGround && !hasCamera) {
|
|
352
372
|
return false;
|
|
353
373
|
}
|
package/src/vcsApp.ts
CHANGED
|
@@ -42,6 +42,14 @@ import type LayerCollection from './util/layerCollection.js';
|
|
|
42
42
|
import type Category from './category/category.js';
|
|
43
43
|
import type TileProvider from './layer/tileProvider/tileProvider.js';
|
|
44
44
|
import type AbstractFeatureProvider from './featureProvider/abstractFeatureProvider.js';
|
|
45
|
+
import {
|
|
46
|
+
createHiddenObjectsCollection,
|
|
47
|
+
HiddenObject,
|
|
48
|
+
} from './util/hiddenObjects.js';
|
|
49
|
+
import FlightInstance, {
|
|
50
|
+
FlightInstanceOptions,
|
|
51
|
+
} from './util/flight/flightInstance.js';
|
|
52
|
+
import FlightCollection from './util/flight/flightCollection.js';
|
|
45
53
|
|
|
46
54
|
function getLogger(): Logger {
|
|
47
55
|
return getLoggerByName('init');
|
|
@@ -104,7 +112,11 @@ class VcsApp {
|
|
|
104
112
|
|
|
105
113
|
private _modules: IndexedCollection<VcsModule>;
|
|
106
114
|
|
|
107
|
-
private
|
|
115
|
+
private _hiddenObjects: OverrideCollection<HiddenObject>;
|
|
116
|
+
|
|
117
|
+
private _flights: OverrideCollection<FlightInstance, FlightCollection>;
|
|
118
|
+
|
|
119
|
+
private _categoryClassRegistry: OverrideClassRegistry<typeof Category>;
|
|
108
120
|
|
|
109
121
|
private _categories: CategoryCollection;
|
|
110
122
|
|
|
@@ -114,11 +126,11 @@ class VcsApp {
|
|
|
114
126
|
|
|
115
127
|
private _categoryItemClassRegistry: OverrideClassRegistry<Ctor<any>>;
|
|
116
128
|
|
|
117
|
-
private
|
|
129
|
+
private _tileProviderClassRegistry: OverrideClassRegistry<
|
|
118
130
|
typeof TileProvider
|
|
119
131
|
>;
|
|
120
132
|
|
|
121
|
-
private
|
|
133
|
+
private _featureProviderClassRegistry: OverrideClassRegistry<
|
|
122
134
|
typeof AbstractFeatureProvider
|
|
123
135
|
>;
|
|
124
136
|
|
|
@@ -186,7 +198,20 @@ class VcsApp {
|
|
|
186
198
|
this._modules = new IndexedCollection('_id');
|
|
187
199
|
this._modules.add(this._dynamicModule);
|
|
188
200
|
|
|
189
|
-
this.
|
|
201
|
+
this._hiddenObjects = createHiddenObjectsCollection(
|
|
202
|
+
getDynamicModuleId,
|
|
203
|
+
this._layers.globalHider,
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
this._flights = makeOverrideCollection(
|
|
207
|
+
new FlightCollection(this),
|
|
208
|
+
getDynamicModuleId,
|
|
209
|
+
undefined,
|
|
210
|
+
(flightOptions: FlightInstanceOptions) =>
|
|
211
|
+
new FlightInstance(flightOptions),
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
this._categoryClassRegistry = new OverrideClassRegistry(
|
|
190
215
|
categoryClassRegistry,
|
|
191
216
|
);
|
|
192
217
|
this._categories = new CategoryCollection(this);
|
|
@@ -195,10 +220,10 @@ class VcsApp {
|
|
|
195
220
|
this._categoryItemClassRegistry = new OverrideClassRegistry(
|
|
196
221
|
new ClassRegistry(),
|
|
197
222
|
);
|
|
198
|
-
this.
|
|
223
|
+
this._tileProviderClassRegistry = new OverrideClassRegistry(
|
|
199
224
|
tileProviderClassRegistry,
|
|
200
225
|
);
|
|
201
|
-
this.
|
|
226
|
+
this._featureProviderClassRegistry = new OverrideClassRegistry(
|
|
202
227
|
featureProviderClassRegistry,
|
|
203
228
|
);
|
|
204
229
|
|
|
@@ -262,6 +287,14 @@ class VcsApp {
|
|
|
262
287
|
return this._categories;
|
|
263
288
|
}
|
|
264
289
|
|
|
290
|
+
get hiddenObject(): OverrideCollection<HiddenObject> {
|
|
291
|
+
return this._hiddenObjects;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
get flights(): OverrideCollection<FlightInstance, FlightCollection> {
|
|
295
|
+
return this._flights;
|
|
296
|
+
}
|
|
297
|
+
|
|
265
298
|
get destroyed(): VcsEvent<void> {
|
|
266
299
|
return this._destroyed;
|
|
267
300
|
}
|
|
@@ -299,7 +332,7 @@ class VcsApp {
|
|
|
299
332
|
}
|
|
300
333
|
|
|
301
334
|
get categoryClassRegistry(): OverrideClassRegistry<typeof Category> {
|
|
302
|
-
return this.
|
|
335
|
+
return this._categoryClassRegistry;
|
|
303
336
|
}
|
|
304
337
|
|
|
305
338
|
get categoryItemClassRegistry(): OverrideClassRegistry<Ctor<any>> {
|
|
@@ -307,13 +340,13 @@ class VcsApp {
|
|
|
307
340
|
}
|
|
308
341
|
|
|
309
342
|
get tileProviderClassRegistry(): OverrideClassRegistry<typeof TileProvider> {
|
|
310
|
-
return this.
|
|
343
|
+
return this._tileProviderClassRegistry;
|
|
311
344
|
}
|
|
312
345
|
|
|
313
346
|
get featureProviderClassRegistry(): OverrideClassRegistry<
|
|
314
347
|
typeof AbstractFeatureProvider
|
|
315
348
|
> {
|
|
316
|
-
return this.
|
|
349
|
+
return this._featureProviderClassRegistry;
|
|
317
350
|
}
|
|
318
351
|
|
|
319
352
|
getModuleById(id: string): VcsModule | undefined {
|
|
@@ -329,7 +362,7 @@ class VcsApp {
|
|
|
329
362
|
|
|
330
363
|
await this._styles.parseItems(config.styles, module._id);
|
|
331
364
|
await this._layers.parseItems(config.layers, module._id);
|
|
332
|
-
// TODO add
|
|
365
|
+
// TODO add ade here
|
|
333
366
|
|
|
334
367
|
await this._obliqueCollections.parseItems(
|
|
335
368
|
config.obliqueCollections,
|
|
@@ -337,6 +370,8 @@ class VcsApp {
|
|
|
337
370
|
);
|
|
338
371
|
await this._viewpoints.parseItems(config.viewpoints, module._id);
|
|
339
372
|
await this._maps.parseItems(config.maps, module._id);
|
|
373
|
+
await this._hiddenObjects.parseItems(config.hiddenObjects, module._id);
|
|
374
|
+
await this._flights.parseItems(config.flights, module._id);
|
|
340
375
|
|
|
341
376
|
if (Array.isArray(config.categories)) {
|
|
342
377
|
await Promise.all(
|
|
@@ -358,8 +393,6 @@ class VcsApp {
|
|
|
358
393
|
`Failed to activate active on startup layer ${l.name}`,
|
|
359
394
|
);
|
|
360
395
|
getLogger().error(String(err));
|
|
361
|
-
this._layers.remove(l);
|
|
362
|
-
l.destroy();
|
|
363
396
|
});
|
|
364
397
|
}
|
|
365
398
|
});
|
|
@@ -424,6 +457,10 @@ class VcsApp {
|
|
|
424
457
|
this._obliqueCollections.serializeModule(moduleId);
|
|
425
458
|
config.viewpoints = this._viewpoints.serializeModule(moduleId);
|
|
426
459
|
config.styles = this._styles.serializeModule(moduleId);
|
|
460
|
+
config.hiddenObjects = this._hiddenObjects.serializeModule(
|
|
461
|
+
moduleId,
|
|
462
|
+
) as HiddenObject[];
|
|
463
|
+
config.flights = this._flights.serializeModule(moduleId);
|
|
427
464
|
config.categories = [...this._categories]
|
|
428
465
|
.map((c) => c.serializeModule(moduleId))
|
|
429
466
|
.filter((c) => !!c) as { name: string; items: object[] }[];
|
|
@@ -461,6 +498,8 @@ class VcsApp {
|
|
|
461
498
|
this._viewpoints.removeModule(moduleId),
|
|
462
499
|
this._styles.removeModule(moduleId),
|
|
463
500
|
this._obliqueCollections.removeModule(moduleId),
|
|
501
|
+
this._hiddenObjects.removeModule(moduleId),
|
|
502
|
+
this._flights.removeModule(moduleId),
|
|
464
503
|
]);
|
|
465
504
|
}
|
|
466
505
|
|
|
@@ -494,13 +533,15 @@ class VcsApp {
|
|
|
494
533
|
destroyCollection(this._viewpoints);
|
|
495
534
|
destroyCollection(this._styles);
|
|
496
535
|
destroyCollection(this._categories);
|
|
536
|
+
this._modules.destroy();
|
|
537
|
+
this._hiddenObjects.destroy();
|
|
497
538
|
this._mapClassRegistry.destroy();
|
|
498
539
|
this._layerClassRegistry.destroy();
|
|
499
540
|
this._styleClassRegistry.destroy();
|
|
500
|
-
this.
|
|
541
|
+
this._categoryClassRegistry.destroy();
|
|
501
542
|
this._categoryItemClassRegistry.destroy();
|
|
502
|
-
this.
|
|
503
|
-
this.
|
|
543
|
+
this._tileProviderClassRegistry.destroy();
|
|
544
|
+
this._featureProviderClassRegistry.destroy();
|
|
504
545
|
this.destroyed.raiseEvent();
|
|
505
546
|
this.destroyed.destroy();
|
|
506
547
|
this.localeChanged.destroy();
|
package/src/vcsModule.ts
CHANGED
|
@@ -7,6 +7,8 @@ import type { ViewpointOptions } from './util/viewpoint.js';
|
|
|
7
7
|
import type { ObliqueCollectionOptions } from './oblique/obliqueCollection.js';
|
|
8
8
|
import type VcsApp from './vcsApp.js';
|
|
9
9
|
import { moduleIdSymbol } from './moduleIdSymbol.js';
|
|
10
|
+
import { HiddenObject } from './util/hiddenObjects.js';
|
|
11
|
+
import { FlightInstanceOptions } from './util/flight/flightInstance.js';
|
|
10
12
|
|
|
11
13
|
export type VcsModuleConfig = {
|
|
12
14
|
_id?: string | undefined;
|
|
@@ -23,6 +25,8 @@ export type VcsModuleConfig = {
|
|
|
23
25
|
projection?: ProjectionOptions;
|
|
24
26
|
obliqueCollections?: ObliqueCollectionOptions[];
|
|
25
27
|
categories?: { name: string; items: object[] }[];
|
|
28
|
+
hiddenObjects?: HiddenObject[];
|
|
29
|
+
flights?: FlightInstanceOptions[];
|
|
26
30
|
};
|
|
27
31
|
|
|
28
32
|
/**
|