@vcmap/core 5.0.0-rc.25 → 5.0.0-rc.26
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/build/postinstall.js +2 -2
- package/index.d.ts +240 -245
- package/package.json +2 -2
- package/src/cesium/cesium3DTileFeature.js +1 -1
- package/src/cesium/cesium3DTilePointFeature.js +1 -1
- package/src/cesium/cesiumVcsCameraPrimitive.js +3 -3
- package/src/cesium/entity.js +1 -1
- package/src/cesium/wallpaperMaterial.js +1 -1
- package/src/interaction/abstractInteraction.js +2 -2
- package/src/interaction/coordinateAtPixel.js +3 -3
- package/src/interaction/eventHandler.js +3 -3
- package/src/interaction/featureAtPixelInteraction.js +1 -1
- package/src/layer/cesium/cesiumTilesetCesiumImpl.js +12 -12
- package/src/layer/cesium/clusterContext.js +7 -7
- package/src/layer/cesium/dataSourceCesiumImpl.js +6 -6
- package/src/layer/cesium/openStreetMapCesiumImpl.js +2 -2
- package/src/layer/cesium/rasterLayerCesiumImpl.js +4 -4
- package/src/layer/cesium/singleImageCesiumImpl.js +2 -2
- package/src/layer/cesium/tmsCesiumImpl.js +2 -2
- package/src/layer/cesium/vectorCesiumImpl.js +6 -6
- package/src/layer/cesium/vectorContext.js +33 -33
- package/src/layer/cesium/vectorRasterTileCesiumImpl.js +2 -2
- package/src/layer/cesium/vectorTileImageryProvider.js +7 -7
- package/src/layer/cesium/wmsCesiumImpl.js +1 -1
- package/src/layer/cesium/wmtsCesiumImpl.js +2 -2
- package/src/layer/cesium/x3dmHelper.js +1 -1
- package/src/layer/cesiumTilesetLayer.js +6 -6
- package/src/layer/czmlLayer.js +2 -2
- package/src/layer/dataSourceLayer.js +7 -7
- package/src/layer/featureLayer.js +8 -8
- package/src/layer/featureStoreLayer.js +3 -3
- package/src/layer/featureVisibility.js +18 -18
- package/src/layer/globalHider.js +3 -3
- package/src/layer/layer.js +3 -3
- package/src/layer/oblique/obliqueHelpers.js +1 -1
- package/src/layer/oblique/vectorObliqueImpl.js +1 -1
- package/src/layer/openStreetMapLayer.js +5 -5
- package/src/layer/openlayers/layerOpenlayersImpl.js +4 -4
- package/src/layer/rasterLayer.js +9 -9
- package/src/layer/terrainHelpers.js +6 -6
- package/src/layer/tileLoadedHelper.js +1 -1
- package/src/layer/tileProvider/tileProvider.js +4 -4
- package/src/layer/tileProvider/urlTemplateTileProvider.js +2 -2
- package/src/layer/vectorLayer.js +6 -6
- package/src/layer/vectorProperties.js +33 -33
- package/src/map/baseOLMap.js +1 -1
- package/src/map/cameraLimiter.js +9 -9
- package/src/map/cesiumMap.js +51 -137
- package/src/map/openlayersMap.js +1 -1
- package/src/map/vcsMap.js +6 -6
- package/src/oblique/helpers.js +3 -3
- package/src/oblique/obliqueDataSet.js +2 -2
- package/src/oblique/obliqueImage.js +8 -8
- package/src/oblique/obliqueImageMeta.js +2 -2
- package/src/oblique/parseImageJson.js +2 -2
- package/src/style/arcStyle.js +1 -1
- package/src/style/arrowStyle.js +1 -1
- package/src/style/declarativeStyleItem.js +13 -9
- package/src/style/styleHelpers.js +4 -4
- package/src/style/styleItem.js +5 -5
- package/src/style/vectorStyleItem.js +4 -4
- package/src/util/clipping/clippingObject.js +8 -8
- package/src/util/clipping/clippingObjectManager.js +1 -1
- package/src/util/clipping/clippingPlaneHelper.js +28 -28
- package/src/util/editor/editorHelpers.js +9 -9
- package/src/util/editor/interactions/editFeaturesMouseOverInteraction.js +2 -2
- package/src/util/editor/interactions/editGeometryMouseOverInteraction.js +2 -2
- package/src/util/editor/interactions/selectMultiFeatureInteraction.js +2 -2
- package/src/util/editor/interactions/selectSingleFeatureInteraction.js +2 -2
- package/src/util/editor/transformation/create2DHandlers.js +1 -1
- package/src/util/editor/transformation/create3DHandlers.js +21 -21
- package/src/util/editor/transformation/extrudeInteraction.js +1 -1
- package/src/util/editor/transformation/rotateInteraction.js +8 -8
- package/src/util/editor/transformation/scaleInteraction.js +6 -6
- package/src/util/editor/transformation/transformationHandler.js +1 -1
- package/src/util/editor/transformation/transformationTypes.js +2 -2
- package/src/util/editor/transformation/translateInteraction.js +6 -6
- package/src/util/featureconverter/arcToCesium.js +3 -3
- package/src/util/featureconverter/circleToCesium.js +8 -8
- package/src/util/featureconverter/convert.js +2 -2
- package/src/util/featureconverter/featureconverterHelper.js +18 -18
- package/src/util/featureconverter/lineStringToCesium.js +8 -8
- package/src/util/featureconverter/pointHelpers.js +20 -20
- package/src/util/featureconverter/pointToCesium.js +7 -7
- package/src/util/featureconverter/polygonToCesium.js +5 -5
- package/src/util/mapCollection.js +1 -1
- package/src/util/math.js +5 -5
- package/src/util/viewpoint.js +2 -2
- package/tests/unit/helpers/cesiumHelpers.js +1 -1
- package/tests/unit/helpers/helpers.js +1 -1
- package/tests/unit/helpers/terrain/terrainData.js +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Matrix3, Cartesian3, Matrix4 } from '@vcmap/
|
|
1
|
+
import { Matrix3, Cartesian3, Matrix4 } from '@vcmap-cesium/engine';
|
|
2
2
|
import ObliqueImage from './obliqueImage.js';
|
|
3
3
|
import { obliqueViewDirectionNames } from './obliqueViewDirection.js';
|
|
4
4
|
import ImageMeta from './obliqueImageMeta.js';
|
|
@@ -41,7 +41,7 @@ export function getVersionFromImageJson(json) {
|
|
|
41
41
|
* @param {ObliqueImageJson} json
|
|
42
42
|
* @param {string} url
|
|
43
43
|
* @param {import("@vcmap/core").Projection=} projection
|
|
44
|
-
* @param {import("@vcmap/
|
|
44
|
+
* @param {import("@vcmap-cesium/engine").CesiumTerrainProvider=} terrainProvider
|
|
45
45
|
* @returns {Array<import("@vcmap/core").ObliqueImageMeta>}
|
|
46
46
|
*/
|
|
47
47
|
export function parseImageMeta(json, url, projection, terrainProvider) {
|
package/src/style/arcStyle.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseInteger, parseNumber } from '@vcsuite/parsers';
|
|
2
2
|
import { check } from '@vcsuite/check';
|
|
3
|
-
import { Cartesian2, Cartesian3, CatmullRomSpline, Matrix3 } from '@vcmap/
|
|
3
|
+
import { Cartesian2, Cartesian3, CatmullRomSpline, Matrix3 } from '@vcmap-cesium/engine';
|
|
4
4
|
import { LineString } from 'ol/geom.js';
|
|
5
5
|
import { unByKey } from 'ol/Observable.js';
|
|
6
6
|
import { v4 as uuidv4 } from 'uuid';
|
package/src/style/arrowStyle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color, ConditionsExpression, Expression, Cesium3DTileStyle } from '@vcmap/
|
|
1
|
+
import { Color, ConditionsExpression, Expression, Cesium3DTileStyle } from '@vcmap-cesium/engine';
|
|
2
2
|
import { is } from '@vcsuite/check';
|
|
3
3
|
|
|
4
4
|
import Style from 'ol/style/Style.js';
|
|
@@ -65,7 +65,7 @@ import { styleClassRegistry } from '../classRegistry.js';
|
|
|
65
65
|
* @api
|
|
66
66
|
*/
|
|
67
67
|
|
|
68
|
-
/** @type {import("@vcmap/
|
|
68
|
+
/** @type {import("@vcmap-cesium/engine").Color} */
|
|
69
69
|
const scratchColor = new Color();
|
|
70
70
|
|
|
71
71
|
const defaultText = new OLText({
|
|
@@ -76,7 +76,7 @@ const defaultText = new OLText({
|
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
|
-
* @param {import("@vcmap/
|
|
79
|
+
* @param {import("@vcmap-cesium/engine").Cesium3DTileStyle} style
|
|
80
80
|
* @param {string} key
|
|
81
81
|
* @param {DeclarativeStyleOptions} options
|
|
82
82
|
*/
|
|
@@ -109,7 +109,7 @@ class DeclarativeStyleItem extends StyleItem {
|
|
|
109
109
|
const declarativeStyle = options.declarativeStyle || {};
|
|
110
110
|
declarativeStyle.show = declarativeStyle.show != null ? declarativeStyle.show : true;
|
|
111
111
|
|
|
112
|
-
/** @type {import("@vcmap/
|
|
112
|
+
/** @type {import("@vcmap-cesium/engine").Cesium3DTileStyle} */
|
|
113
113
|
this.cesiumStyle = new Cesium3DTileStyle(declarativeStyle);
|
|
114
114
|
|
|
115
115
|
this._style = this._styleFunction.bind(this);
|
|
@@ -234,7 +234,9 @@ class DeclarativeStyleItem extends StyleItem {
|
|
|
234
234
|
this.cesiumStyle.color.evaluate(feature, scratchColor) :
|
|
235
235
|
Color.WHITE;
|
|
236
236
|
if (color) {
|
|
237
|
-
style.setFill(new Fill({
|
|
237
|
+
style.setFill(new Fill({
|
|
238
|
+
color: cesiumColorToColor(/** @type {import("@vcmap-cesium/engine").Color} */ (color)),
|
|
239
|
+
}));
|
|
238
240
|
}
|
|
239
241
|
|
|
240
242
|
this._evaluateStroke(feature, style);
|
|
@@ -256,14 +258,16 @@ class DeclarativeStyleItem extends StyleItem {
|
|
|
256
258
|
Color.WHITE;
|
|
257
259
|
if (color) {
|
|
258
260
|
if (isExtruded) {
|
|
259
|
-
style.setFill(new Fill({
|
|
261
|
+
style.setFill(new Fill({
|
|
262
|
+
color: cesiumColorToColor(/** @type {import("@vcmap-cesium/engine").Color} */(color)),
|
|
263
|
+
}));
|
|
260
264
|
} else {
|
|
261
265
|
const strokeWidth = this.cesiumStyle.strokeWidth ?
|
|
262
266
|
this.cesiumStyle.strokeWidth.evaluate(feature) :
|
|
263
267
|
1;
|
|
264
268
|
style.setStroke(new Stroke({
|
|
265
269
|
width: Number.isFinite(strokeWidth) ? strokeWidth : 1,
|
|
266
|
-
color: cesiumColorToColor(/** @type {import("@vcmap/
|
|
270
|
+
color: cesiumColorToColor(/** @type {import("@vcmap-cesium/engine").Color} */ (color)),
|
|
267
271
|
}));
|
|
268
272
|
}
|
|
269
273
|
}
|
|
@@ -312,7 +316,7 @@ class DeclarativeStyleItem extends StyleItem {
|
|
|
312
316
|
this.cesiumStyle.labelOutlineWidth.evaluate(feature) :
|
|
313
317
|
1;
|
|
314
318
|
textStyle.setStroke(new Stroke({
|
|
315
|
-
color: cesiumColorToColor(/** @type {import("@vcmap/
|
|
319
|
+
color: cesiumColorToColor(/** @type {import("@vcmap-cesium/engine").Color} */ (outlineColor)),
|
|
316
320
|
width: outlineWidth,
|
|
317
321
|
}));
|
|
318
322
|
}
|
|
@@ -357,7 +361,7 @@ class DeclarativeStyleItem extends StyleItem {
|
|
|
357
361
|
if (!this._circleCache.has(circleCacheKey)) {
|
|
358
362
|
const circleOptions = {
|
|
359
363
|
radius,
|
|
360
|
-
fill: new Fill({ color: cesiumColorToColor(/** @type {import("@vcmap/
|
|
364
|
+
fill: new Fill({ color: cesiumColorToColor(/** @type {import("@vcmap-cesium/engine").Color} */ (color)) }),
|
|
361
365
|
};
|
|
362
366
|
if (width) {
|
|
363
367
|
circleOptions.stroke = new Stroke({
|
|
@@ -3,7 +3,7 @@ import Fill from 'ol/style/Fill.js';
|
|
|
3
3
|
import Stroke from 'ol/style/Stroke.js';
|
|
4
4
|
import OLText from 'ol/style/Text.js';
|
|
5
5
|
import Style from 'ol/style/Style.js';
|
|
6
|
-
import { Color } from '@vcmap/
|
|
6
|
+
import { Color } from '@vcmap-cesium/engine';
|
|
7
7
|
|
|
8
8
|
import { getLogger as getLoggerByName } from '@vcsuite/logger';
|
|
9
9
|
|
|
@@ -65,7 +65,7 @@ export function hexToOlColor(h, opacity) {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
* @param {import("@vcmap/
|
|
68
|
+
* @param {import("@vcmap-cesium/engine").Color} cesiumColor
|
|
69
69
|
* @returns {import("ol/color").Color}
|
|
70
70
|
*/
|
|
71
71
|
export function cesiumColorToColor(cesiumColor) {
|
|
@@ -77,7 +77,7 @@ export function cesiumColorToColor(cesiumColor) {
|
|
|
77
77
|
/**
|
|
78
78
|
* converts an openlayers color to a cesium Color
|
|
79
79
|
* @param {import("ol/color").Color} olColor
|
|
80
|
-
* @returns {import("@vcmap/
|
|
80
|
+
* @returns {import("@vcmap-cesium/engine").Color}
|
|
81
81
|
* @api
|
|
82
82
|
*/
|
|
83
83
|
export function olColorToCesiumColor(olColor) {
|
|
@@ -130,7 +130,7 @@ export function parseColor(color, defaultColor) {
|
|
|
130
130
|
*
|
|
131
131
|
* @param {import("ol/color").Color|import("ol/colorlike").ColorLike} color
|
|
132
132
|
* @param {import("ol/color").Color} defaultColor
|
|
133
|
-
* @returns {import("@vcmap/
|
|
133
|
+
* @returns {import("@vcmap-cesium/engine").Color}
|
|
134
134
|
*/
|
|
135
135
|
export function getCesiumColor(color, defaultColor) {
|
|
136
136
|
const olColor = parseColor(color, defaultColor);
|
package/src/style/styleItem.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Cesium3DTileStyle, Cesium3DTileColorBlendMode } from '@vcmap/
|
|
1
|
+
import { Cesium3DTileStyle, Cesium3DTileColorBlendMode } from '@vcmap-cesium/engine';
|
|
2
2
|
import deepEqual from 'fast-deep-equal';
|
|
3
3
|
|
|
4
4
|
import { parseEnumValue } from '@vcsuite/parsers';
|
|
@@ -8,7 +8,7 @@ import { styleClassRegistry } from '../classRegistry.js';
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @typedef {VcsObjectOptions} StyleItemOptions
|
|
11
|
-
* @property {number} [colorBlendMode=import("@vcmap/
|
|
11
|
+
* @property {number} [colorBlendMode=import("@vcmap-cesium/engine").Cesium3DTileColorBlendMode.HIGHLIGHT] - colorBlendMode for 3D Tiledataset @see https://cesiumjs.org/import("@vcmap-cesium/engine").Build/Documentation/Cesium3DTileColorBlendMode.html
|
|
12
12
|
* @api
|
|
13
13
|
*/
|
|
14
14
|
|
|
@@ -39,7 +39,7 @@ class StyleItem extends VcsObject {
|
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* The 3D representation of this style
|
|
42
|
-
* @type {import("@vcmap/
|
|
42
|
+
* @type {import("@vcmap-cesium/engine").Cesium3DTileStyle}
|
|
43
43
|
* @api
|
|
44
44
|
*/
|
|
45
45
|
this.cesiumStyle = new Cesium3DTileStyle({ show: true });
|
|
@@ -51,8 +51,8 @@ class StyleItem extends VcsObject {
|
|
|
51
51
|
*/
|
|
52
52
|
this.styleChanged = new VcsEvent();
|
|
53
53
|
|
|
54
|
-
/** @type {import("@vcmap/
|
|
55
|
-
this.colorBlendMode = /** @type {import("@vcmap/
|
|
54
|
+
/** @type {import("@vcmap-cesium/engine").Cesium3DTileColorBlendMode} */
|
|
55
|
+
this.colorBlendMode = /** @type {import("@vcmap-cesium/engine").Cesium3DTileColorBlendMode} */(parseEnumValue(
|
|
56
56
|
options.colorBlendMode, Cesium3DTileColorBlendMode, Cesium3DTileColorBlendMode.HIGHLIGHT,
|
|
57
57
|
));
|
|
58
58
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-template-curly-in-string */
|
|
2
2
|
import Stroke from 'ol/style/Stroke.js';
|
|
3
|
-
import { Color, VerticalOrigin } from '@vcmap/
|
|
3
|
+
import { Color, VerticalOrigin } from '@vcmap-cesium/engine';
|
|
4
4
|
import Icon from 'ol/style/Icon.js';
|
|
5
5
|
import Style from 'ol/style/Style.js';
|
|
6
6
|
import OLText from 'ol/style/Text.js';
|
|
@@ -179,7 +179,7 @@ class VectorStyleItem extends StyleItem {
|
|
|
179
179
|
this.label = this._label;
|
|
180
180
|
|
|
181
181
|
/**
|
|
182
|
-
* @type {import("@vcmap/
|
|
182
|
+
* @type {import("@vcmap-cesium/engine").Color}
|
|
183
183
|
* @private
|
|
184
184
|
*/
|
|
185
185
|
this._cesiumColor = new Color();
|
|
@@ -301,7 +301,7 @@ class VectorStyleItem extends StyleItem {
|
|
|
301
301
|
/**
|
|
302
302
|
* the current fill color as a cesium color
|
|
303
303
|
* @readonly
|
|
304
|
-
* @type {import("@vcmap/
|
|
304
|
+
* @type {import("@vcmap-cesium/engine").Color}
|
|
305
305
|
* @api
|
|
306
306
|
*/
|
|
307
307
|
get cesiumFillColor() {
|
|
@@ -898,7 +898,7 @@ export const defaultVectorStyle = new VectorStyleItem(getDefaultVectorStyleItemO
|
|
|
898
898
|
styleClassRegistry.registerClass(VectorStyleItem.className, VectorStyleItem);
|
|
899
899
|
|
|
900
900
|
/**
|
|
901
|
-
* @param {import("@vcmap/
|
|
901
|
+
* @param {import("@vcmap-cesium/engine").Color} cesiumColor
|
|
902
902
|
* @returns {VectorStyleItem}
|
|
903
903
|
*/
|
|
904
904
|
export function fromCesiumColor(cesiumColor) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
import { Cesium3DTileset } from '@vcmap/
|
|
2
|
+
import { Cesium3DTileset } from '@vcmap-cesium/engine';
|
|
3
3
|
|
|
4
4
|
import { check } from '@vcsuite/check';
|
|
5
5
|
import { parseBoolean } from '@vcsuite/parsers';
|
|
@@ -25,7 +25,7 @@ import LayerCollection from '../layerCollection.js';
|
|
|
25
25
|
* @typedef {Object} ClippingObjectOptions
|
|
26
26
|
* @property {Array<string>|undefined} layerNames
|
|
27
27
|
* @property {Array<ClippingObjectEntityOption>|undefined} entities
|
|
28
|
-
* @property {import("@vcmap/
|
|
28
|
+
* @property {import("@vcmap-cesium/engine").ClippingPlaneCollection|undefined} clippingPlaneCollection
|
|
29
29
|
* @property {boolean} [terrain=false]
|
|
30
30
|
* @property {boolean} [local=false] - if not local, coordinates are expected in ECEF
|
|
31
31
|
* @api
|
|
@@ -78,12 +78,12 @@ class ClippingObject {
|
|
|
78
78
|
/**
|
|
79
79
|
* Key is a semantic identifier, eg. layerName or layerName-entitiyId, depending on the target. Targets
|
|
80
80
|
* represent Cesium Object which support the clippingPlanes API
|
|
81
|
-
* @type {Map<(string|symbol), import("@vcmap/
|
|
81
|
+
* @type {Map<(string|symbol), import("@vcmap-cesium/engine").Entity|import("@vcmap-cesium/engine").Cesium3DTileset|import("@vcmap-cesium/engine").Globe>}
|
|
82
82
|
*/
|
|
83
83
|
this.targets = new Map();
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* @type {import("@vcmap/
|
|
86
|
+
* @type {import("@vcmap-cesium/engine").ClippingPlaneCollection|null}
|
|
87
87
|
* @private
|
|
88
88
|
*/
|
|
89
89
|
this._clippingPlaneCollection = options.clippingPlaneCollection || null;
|
|
@@ -124,12 +124,12 @@ class ClippingObject {
|
|
|
124
124
|
/**
|
|
125
125
|
* The current Cesium.ClippingPlaneCollection. To update the collection, set this property to the new definition.
|
|
126
126
|
* @api
|
|
127
|
-
* @type {import("@vcmap/
|
|
127
|
+
* @type {import("@vcmap-cesium/engine").ClippingPlaneCollection|null}
|
|
128
128
|
*/
|
|
129
129
|
get clippingPlaneCollection() { return this._clippingPlaneCollection; }
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
|
-
* @param {import("@vcmap/
|
|
132
|
+
* @param {import("@vcmap-cesium/engine").ClippingPlaneCollection} clippingPlaneCollection
|
|
133
133
|
*/
|
|
134
134
|
set clippingPlaneCollection(clippingPlaneCollection) {
|
|
135
135
|
this._clippingPlaneCollection = clippingPlaneCollection;
|
|
@@ -206,7 +206,7 @@ class ClippingObject {
|
|
|
206
206
|
[];
|
|
207
207
|
|
|
208
208
|
if (tilesets.length > 0) {
|
|
209
|
-
tilesets.forEach(/** @param {import("@vcmap/
|
|
209
|
+
tilesets.forEach(/** @param {import("@vcmap-cesium/engine").Cesium3DTileset} tileset */ (tileset) => {
|
|
210
210
|
tileset.readyPromise.then((cesium3DTileset) => {
|
|
211
211
|
if (this.layerNames.includes(layer.name) && layer.active) {
|
|
212
212
|
this.targets.set(layer.name, cesium3DTileset);
|
|
@@ -242,7 +242,7 @@ class ClippingObject {
|
|
|
242
242
|
.forEach((eo) => {
|
|
243
243
|
const key = `${eo.layerName}-${eo.entityId}`;
|
|
244
244
|
if (layer.active) {
|
|
245
|
-
const entity = /** @type {import("@vcmap/
|
|
245
|
+
const entity = /** @type {import("@vcmap-cesium/engine").CustomDataSource} */ (dataSource)
|
|
246
246
|
.entities.getById(eo.entityId);
|
|
247
247
|
if (entity) {
|
|
248
248
|
this.targets.set(key, entity);
|
|
@@ -31,7 +31,7 @@ class ClippingObjectManager {
|
|
|
31
31
|
*/
|
|
32
32
|
this._exclusiveClippingObjects = null;
|
|
33
33
|
/**
|
|
34
|
-
* @type {Map<(import("@vcmap/
|
|
34
|
+
* @type {Map<(import("@vcmap-cesium/engine").Globe|import("@vcmap-cesium/engine").Entity|import("@vcmap-cesium/engine").Cesium3DTileset), ClippingObject>}
|
|
35
35
|
* @private
|
|
36
36
|
*/
|
|
37
37
|
this._targetsMap = new Map();
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
JulianDate,
|
|
11
11
|
Cesium3DTileset,
|
|
12
12
|
Globe,
|
|
13
|
-
} from '@vcmap/
|
|
13
|
+
} from '@vcmap-cesium/engine';
|
|
14
14
|
import Feature from 'ol/Feature.js';
|
|
15
15
|
import LineString from 'ol/geom/LineString.js';
|
|
16
16
|
import { offset } from 'ol/sphere.js';
|
|
@@ -33,9 +33,9 @@ import { enforceEndingVertex, enforceRightHand, getFlatCoordinatesFromGeometry }
|
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Creates a Plane on p1 with the normal in the direction of P2
|
|
36
|
-
* @param {import("@vcmap/
|
|
37
|
-
* @param {import("@vcmap/
|
|
38
|
-
* @returns {import("@vcmap/
|
|
36
|
+
* @param {import("@vcmap-cesium/engine").Cartesian3} p1
|
|
37
|
+
* @param {import("@vcmap-cesium/engine").Cartesian3} p2
|
|
38
|
+
* @returns {import("@vcmap-cesium/engine").ClippingPlane}
|
|
39
39
|
*/
|
|
40
40
|
function createPlane(p1, p2) {
|
|
41
41
|
const planeNormal = Cartesian3.subtract(p1, p2, new Cartesian3());
|
|
@@ -46,7 +46,7 @@ function createPlane(p1, p2) {
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* @param {Array<import("ol/coordinate").Coordinate>} coords
|
|
49
|
-
* @returns {Array<import("@vcmap/
|
|
49
|
+
* @returns {Array<import("@vcmap-cesium/engine").ClippingPlane>} clippingPlanes
|
|
50
50
|
*/
|
|
51
51
|
function createVerticalPlanes(coords) {
|
|
52
52
|
const clippingPlanes = [];
|
|
@@ -69,7 +69,7 @@ function createVerticalPlanes(coords) {
|
|
|
69
69
|
* @param {import("ol").Feature<import("ol/geom/Geometry").default>} feature
|
|
70
70
|
* @param {Array<import("ol/coordinate").Coordinate>} coords
|
|
71
71
|
* @param {CreationOptions=} options
|
|
72
|
-
* @returns {Array<import("@vcmap/
|
|
72
|
+
* @returns {Array<import("@vcmap-cesium/engine").ClippingPlane>} clippingPlanes
|
|
73
73
|
*/
|
|
74
74
|
function createHorizontalPlanes(feature, coords, options) {
|
|
75
75
|
const clippingPlanes = [];
|
|
@@ -105,7 +105,7 @@ function createHorizontalPlanes(feature, coords, options) {
|
|
|
105
105
|
* creates a plane for each point in the opposite direction of the other point.
|
|
106
106
|
* only works for two coordinates
|
|
107
107
|
* @param {Array<import("ol/coordinate").Coordinate>} coords
|
|
108
|
-
* @returns {Array<import("@vcmap/
|
|
108
|
+
* @returns {Array<import("@vcmap-cesium/engine").ClippingPlane>} clippingPlanes
|
|
109
109
|
*/
|
|
110
110
|
function createEndingPlanes(coords) {
|
|
111
111
|
const clippingPlanes = [];
|
|
@@ -134,8 +134,8 @@ function createEndingPlanes(coords) {
|
|
|
134
134
|
* create a Cesium ClippingPlaneCollection based on a given feature having a multi-curve, polygon, or extruded solid geometry
|
|
135
135
|
* @param {import("ol").Feature<import("ol/geom/Geometry").default>} feature - base for calculating the clipping planes.
|
|
136
136
|
* @param {CreationOptions=} options
|
|
137
|
-
* @param {import("@vcmap/
|
|
138
|
-
* @returns {import("@vcmap/
|
|
137
|
+
* @param {import("@vcmap-cesium/engine").Matrix4=} transformMatrix - 4x4 matrix specifying the transform of clipping planes from Earth's fixed frame to another one
|
|
138
|
+
* @returns {import("@vcmap-cesium/engine").ClippingPlaneCollection|null}
|
|
139
139
|
* @api stable
|
|
140
140
|
*/
|
|
141
141
|
export function createClippingPlaneCollection(feature, options = {}, transformMatrix) {
|
|
@@ -172,7 +172,7 @@ export function createClippingPlaneCollection(feature, options = {}, transformMa
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
if (transformMatrix) {
|
|
175
|
-
clippingPlanes.forEach((/** @type {import("@vcmap/
|
|
175
|
+
clippingPlanes.forEach((/** @type {import("@vcmap-cesium/engine").ClippingPlane} */ plane) => {
|
|
176
176
|
const result = Plane.transform(plane, transformMatrix);
|
|
177
177
|
plane.normal = result.normal;
|
|
178
178
|
plane.distance = result.distance;
|
|
@@ -180,7 +180,7 @@ export function createClippingPlaneCollection(feature, options = {}, transformMa
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
if (options.reverse) {
|
|
183
|
-
clippingPlanes.forEach((/** @type {import("@vcmap/
|
|
183
|
+
clippingPlanes.forEach((/** @type {import("@vcmap-cesium/engine").ClippingPlane} */ plane) => {
|
|
184
184
|
Cartesian3.negate(plane.normal, plane.normal);
|
|
185
185
|
plane.distance *= -1;
|
|
186
186
|
});
|
|
@@ -194,11 +194,11 @@ export function createClippingPlaneCollection(feature, options = {}, transformMa
|
|
|
194
194
|
|
|
195
195
|
/**
|
|
196
196
|
* copies the clippingplanes and the properties from source to result
|
|
197
|
-
* @param {import("@vcmap/
|
|
198
|
-
* @param {import("@vcmap/
|
|
199
|
-
* @param {import("@vcmap/
|
|
200
|
-
* @param {import("@vcmap/
|
|
201
|
-
* @returns {import("@vcmap/
|
|
197
|
+
* @param {import("@vcmap-cesium/engine").ClippingPlaneCollection} source
|
|
198
|
+
* @param {import("@vcmap-cesium/engine").ClippingPlaneCollection} result
|
|
199
|
+
* @param {import("@vcmap-cesium/engine").Matrix4=} transformMatrix - 4x4 matrix specifying the transform of clipping planes from Earth's fixed frame to another one
|
|
200
|
+
* @param {import("@vcmap-cesium/engine").Cartesian3=} originPoint - the origin point of the transformation target, so the plane distance can be set correctly
|
|
201
|
+
* @returns {import("@vcmap-cesium/engine").ClippingPlaneCollection}
|
|
202
202
|
* @api stable
|
|
203
203
|
*/
|
|
204
204
|
export function copyClippingPlanesToCollection(source, result, transformMatrix, originPoint) {
|
|
@@ -227,14 +227,14 @@ export function copyClippingPlanesToCollection(source, result, transformMatrix,
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
/**
|
|
230
|
-
* @param {import("@vcmap/
|
|
230
|
+
* @param {import("@vcmap-cesium/engine").Globe|import("@vcmap-cesium/engine").Cesium3DTileset|import("@vcmap-cesium/engine").Entity} target
|
|
231
231
|
*/
|
|
232
232
|
export function clearClippingPlanes(target) {
|
|
233
233
|
if (target instanceof Entity) {
|
|
234
234
|
if (target.model) {
|
|
235
235
|
if (target.model.clippingPlanes) {
|
|
236
236
|
const entityClippingPlanes =
|
|
237
|
-
(/** @type {import("@vcmap/
|
|
237
|
+
(/** @type {import("@vcmap-cesium/engine").ConstantProperty} */ (target.model.clippingPlanes)).getValue();
|
|
238
238
|
entityClippingPlanes.removeAll();
|
|
239
239
|
} else {
|
|
240
240
|
target.model.clippingPlanes = new ConstantProperty(new ClippingPlaneCollection());
|
|
@@ -248,8 +248,8 @@ export function clearClippingPlanes(target) {
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
/**
|
|
251
|
-
* @param {import("@vcmap/
|
|
252
|
-
* @param {import("@vcmap/
|
|
251
|
+
* @param {import("@vcmap-cesium/engine").Cesium3DTileset} cesium3DTileset
|
|
252
|
+
* @param {import("@vcmap-cesium/engine").ClippingPlaneCollection} clippingPlaneCollection
|
|
253
253
|
* @param {boolean=} local
|
|
254
254
|
*/
|
|
255
255
|
function setTilesetClippingPlane(cesium3DTileset, clippingPlaneCollection, local) {
|
|
@@ -285,8 +285,8 @@ function setTilesetClippingPlane(cesium3DTileset, clippingPlaneCollection, local
|
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
/**
|
|
288
|
-
* @param {import("@vcmap/
|
|
289
|
-
* @param {import("@vcmap/
|
|
288
|
+
* @param {import("@vcmap-cesium/engine").Globe} globe
|
|
289
|
+
* @param {import("@vcmap-cesium/engine").ClippingPlaneCollection} clippingPlaneCollection
|
|
290
290
|
*/
|
|
291
291
|
function setGlobeClippingPlanes(globe, clippingPlaneCollection) {
|
|
292
292
|
clearClippingPlanes(globe);
|
|
@@ -295,15 +295,15 @@ function setGlobeClippingPlanes(globe, clippingPlaneCollection) {
|
|
|
295
295
|
|
|
296
296
|
/**
|
|
297
297
|
* apply a clippingPlaneCollection to an entity
|
|
298
|
-
* @param {import("@vcmap/
|
|
299
|
-
* @param {import("@vcmap/
|
|
298
|
+
* @param {import("@vcmap-cesium/engine").Entity} entity
|
|
299
|
+
* @param {import("@vcmap-cesium/engine").ClippingPlaneCollection} clippingPlaneCollection
|
|
300
300
|
* @param {boolean=} local
|
|
301
301
|
*/
|
|
302
302
|
function setEntityClippingPlanes(entity, clippingPlaneCollection, local) {
|
|
303
303
|
if (entity.model) {
|
|
304
304
|
clearClippingPlanes(entity);
|
|
305
305
|
const entityClippingPlanes =
|
|
306
|
-
(/** @type {import("@vcmap/
|
|
306
|
+
(/** @type {import("@vcmap-cesium/engine").ConstantProperty} */ (entity.model.clippingPlanes)).getValue();
|
|
307
307
|
copyClippingPlanesToCollection(clippingPlaneCollection, entityClippingPlanes);
|
|
308
308
|
if (!local) {
|
|
309
309
|
const localToFixedFrame = entity.computeModelMatrix(JulianDate.now());
|
|
@@ -320,8 +320,8 @@ function setEntityClippingPlanes(entity, clippingPlaneCollection, local) {
|
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
/**
|
|
323
|
-
* @param {import("@vcmap/
|
|
324
|
-
* @param {import("@vcmap/
|
|
323
|
+
* @param {import("@vcmap-cesium/engine").Globe|import("@vcmap-cesium/engine").Cesium3DTileset|import("@vcmap-cesium/engine").Entity} target
|
|
324
|
+
* @param {import("@vcmap-cesium/engine").ClippingPlaneCollection} clippingPlaneCollection
|
|
325
325
|
* @param {boolean=} local
|
|
326
326
|
*/
|
|
327
327
|
export function setClippingPlanes(target, clippingPlaneCollection, local) {
|
|
@@ -337,7 +337,7 @@ export function setClippingPlanes(target, clippingPlaneCollection, local) {
|
|
|
337
337
|
/**
|
|
338
338
|
* Creates a new feature at the given coordinate, which can be set on a {@link ClippingObjectEditor}.
|
|
339
339
|
* @param {import("ol/coordinate").Coordinate} coordinate - in WGS84
|
|
340
|
-
* @param {import("@vcmap/
|
|
340
|
+
* @param {import("@vcmap-cesium/engine").Camera} camera
|
|
341
341
|
* @param {boolean} [vertical=false]
|
|
342
342
|
* @param {number} [offsetDistance=25] - the offset from the coordinate to use for the size of the geometry
|
|
343
343
|
* @returns {import("ol").Feature<import("ol/geom/Geometry").default>} - the features geometry is in web mercator
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
Math as CesiumMath,
|
|
7
7
|
Plane,
|
|
8
8
|
Ray, IntersectionTests, Cartographic, HeightReference,
|
|
9
|
-
} from '@vcmap/
|
|
9
|
+
} from '@vcmap-cesium/engine';
|
|
10
10
|
|
|
11
11
|
import { mercatorToCartesian } from '../math.js';
|
|
12
12
|
import { getFlatCoordinatesFromGeometry } from '../geometryHelpers.js';
|
|
@@ -109,8 +109,8 @@ export function pointOnLine2D(start, end, point, epsilon) {
|
|
|
109
109
|
|
|
110
110
|
/**
|
|
111
111
|
* @param {import("ol/coordinate").Coordinate} originCoordinates
|
|
112
|
-
* @param {import("@vcmap/
|
|
113
|
-
* @returns {!import("@vcmap/
|
|
112
|
+
* @param {import("@vcmap-cesium/engine").Scene} scene
|
|
113
|
+
* @returns {!import("@vcmap-cesium/engine").Plane}
|
|
114
114
|
*/
|
|
115
115
|
export function createCameraVerticalPlane(originCoordinates, scene) {
|
|
116
116
|
scratchCartesian31 = mercatorToCartesian(originCoordinates, scratchCartesian31);
|
|
@@ -123,8 +123,8 @@ export function createCameraVerticalPlane(originCoordinates, scene) {
|
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* @param {import("ol/coordinate").Coordinate} originCoordinates
|
|
126
|
-
* @param {import("@vcmap/
|
|
127
|
-
* @returns {!import("@vcmap/
|
|
126
|
+
* @param {import("@vcmap-cesium/engine").Scene} scene
|
|
127
|
+
* @returns {!import("@vcmap-cesium/engine").Plane}
|
|
128
128
|
*/
|
|
129
129
|
export function createHorizontalPlane(originCoordinates, scene) {
|
|
130
130
|
scratchCartesian31 = mercatorToCartesian(originCoordinates, scratchCartesian31);
|
|
@@ -134,10 +134,10 @@ export function createHorizontalPlane(originCoordinates, scene) {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
|
-
* @param {import("@vcmap/
|
|
138
|
-
* @param {import("@vcmap/
|
|
139
|
-
* @param {import("@vcmap/
|
|
140
|
-
* @returns {import("@vcmap/
|
|
137
|
+
* @param {import("@vcmap-cesium/engine").Plane} plane
|
|
138
|
+
* @param {import("@vcmap-cesium/engine").Camera} camera
|
|
139
|
+
* @param {import("@vcmap-cesium/engine").Cartesian2} windowPosition
|
|
140
|
+
* @returns {import("@vcmap-cesium/engine").Cartographic}
|
|
141
141
|
*/
|
|
142
142
|
export function getCartographicFromPlane(plane, camera, windowPosition) {
|
|
143
143
|
const ray = camera.getPickRay(windowPosition, new Ray());
|
|
@@ -17,7 +17,7 @@ class EditFeaturesMouseOverInteraction extends AbstractInteraction {
|
|
|
17
17
|
constructor(layerName, selectMultiFeatureInteraction) {
|
|
18
18
|
super(EventType.MOVE, ModificationKeyType.ALL);
|
|
19
19
|
/**
|
|
20
|
-
* @type {import("ol").Feature|import("@vcmap/
|
|
20
|
+
* @type {import("ol").Feature|import("@vcmap-cesium/engine").Cesium3DTileFeature|import("@vcmap-cesium/engine").Cesium3DTilePointFeature|null}
|
|
21
21
|
* @private
|
|
22
22
|
*/
|
|
23
23
|
this._lastFeature = null;
|
|
@@ -49,7 +49,7 @@ class EditFeaturesMouseOverInteraction extends AbstractInteraction {
|
|
|
49
49
|
event.feature &&
|
|
50
50
|
(event.feature[vcsLayerName] === this.layerName || event.feature[handlerSymbol])
|
|
51
51
|
) {
|
|
52
|
-
this._lastFeature = /** @type {import("ol").Feature|import("@vcmap/
|
|
52
|
+
this._lastFeature = /** @type {import("ol").Feature|import("@vcmap-cesium/engine").Cesium3DTileFeature|import("@vcmap-cesium/engine").Cesium3DTilePointFeature} */
|
|
53
53
|
(event.feature);
|
|
54
54
|
} else {
|
|
55
55
|
this._lastFeature = null;
|
|
@@ -34,7 +34,7 @@ class EditGeometryMouseOverInteraction extends AbstractInteraction {
|
|
|
34
34
|
constructor(layerName) {
|
|
35
35
|
super(EventType.MOVE, ModificationKeyType.ALL);
|
|
36
36
|
/**
|
|
37
|
-
* @type {import("ol").Feature|import("@vcmap/
|
|
37
|
+
* @type {import("ol").Feature|import("@vcmap-cesium/engine").Cesium3DTileFeature|import("@vcmap-cesium/engine").Cesium3DTilePointFeature|null}
|
|
38
38
|
* @private
|
|
39
39
|
*/
|
|
40
40
|
this._lastFeature = null;
|
|
@@ -64,7 +64,7 @@ class EditGeometryMouseOverInteraction extends AbstractInteraction {
|
|
|
64
64
|
event.feature[vertexSymbol]
|
|
65
65
|
)
|
|
66
66
|
) {
|
|
67
|
-
this._lastFeature = /** @type {import("ol").Feature|import("@vcmap/
|
|
67
|
+
this._lastFeature = /** @type {import("ol").Feature|import("@vcmap-cesium/engine").Cesium3DTileFeature|import("@vcmap-cesium/engine").Cesium3DTilePointFeature} */
|
|
68
68
|
(event.feature);
|
|
69
69
|
} else {
|
|
70
70
|
this._lastFeature = null;
|
|
@@ -83,7 +83,7 @@ class SelectMultiFeatureInteraction extends AbstractInteraction {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* @param {Array<import("ol").Feature|import("@vcmap/
|
|
86
|
+
* @param {Array<import("ol").Feature|import("@vcmap-cesium/engine").Cesium3DTileFeature|import("@vcmap-cesium/engine").Cesium3DTilePointFeature|import("@vcmap-cesium/engine").Entity>} features
|
|
87
87
|
* @returns {Promise<void>}
|
|
88
88
|
*/
|
|
89
89
|
async setSelectionSet(features) {
|
|
@@ -103,7 +103,7 @@ class SelectMultiFeatureInteraction extends AbstractInteraction {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
|
-
* @param {import("ol").Feature|import("@vcmap/
|
|
106
|
+
* @param {import("ol").Feature|import("@vcmap-cesium/engine").Cesium3DTileFeature|import("@vcmap-cesium/engine").Cesium3DTilePointFeature|import("@vcmap-cesium/engine").Entity} feature
|
|
107
107
|
* @returns {Promise<void>}
|
|
108
108
|
* @private
|
|
109
109
|
*/
|
|
@@ -54,7 +54,7 @@ class SelectSingleFeatureInteraction extends AbstractInteraction {
|
|
|
54
54
|
if (!(this._selectedFeature && event.feature.getId() === this._selectedFeature.getId())) {
|
|
55
55
|
event.stopPropagation = true;
|
|
56
56
|
await this.selectFeature(
|
|
57
|
-
/** @type {import("ol").Feature|import("@vcmap/
|
|
57
|
+
/** @type {import("ol").Feature|import("@vcmap-cesium/engine").Cesium3DTileFeature|import("@vcmap-cesium/engine").Cesium3DTilePointFeature} */
|
|
58
58
|
(event.feature),
|
|
59
59
|
);
|
|
60
60
|
}
|
|
@@ -67,7 +67,7 @@ class SelectSingleFeatureInteraction extends AbstractInteraction {
|
|
|
67
67
|
/**
|
|
68
68
|
* Selects the given feature. if passed in a tiled feature store feature, it will be converted. Do not pass in uneditable features (feature which do not
|
|
69
69
|
* belong to the layer for which this interaction was created)
|
|
70
|
-
* @param {import("ol").Feature|import("@vcmap/
|
|
70
|
+
* @param {import("ol").Feature|import("@vcmap-cesium/engine").Cesium3DTileFeature|import("@vcmap-cesium/engine").Cesium3DTilePointFeature} feature
|
|
71
71
|
* @returns {Promise<void>}
|
|
72
72
|
*/
|
|
73
73
|
async selectFeature(feature) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Feature } from 'ol';
|
|
2
2
|
import { Circle, LineString, Point, Polygon } from 'ol/geom.js';
|
|
3
3
|
import { Fill, Icon, Stroke, Style } from 'ol/style.js';
|
|
4
|
-
import { Color } from '@vcmap/
|
|
4
|
+
import { Color } from '@vcmap-cesium/engine';
|
|
5
5
|
import { unByKey } from 'ol/Observable.js';
|
|
6
6
|
import { handlerSymbol } from '../editorSymbols.js';
|
|
7
7
|
import { AXIS_AND_PLANES, greyedOutColor, is1DAxis, is2DAxis, TransformationMode } from './transformationTypes.js';
|