@vcmap/core 5.0.0-rc.15 → 5.0.0-rc.16

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/index.d.ts CHANGED
@@ -413,7 +413,7 @@ export interface InteractionEvent extends MapEvent {
413
413
  /**
414
414
  * a potential feature at said location
415
415
  */
416
- feature?: undefined | import("ol").Feature<import("ol/geom/Geometry").default> | import("@vcmap/cesium").Cesium3DTileFeature | import("@vcmap/cesium").Cesium3DTilePointFeature;
416
+ feature?: undefined | import("ol").Feature<import("ol/geom/Geometry").default> | import("@vcmap/cesium").Cesium3DTileFeature | import("@vcmap/cesium").Cesium3DTilePointFeature | import("@vcmap/cesium").Entity;
417
417
  /**
418
418
  * if set to true, the event chain is interrupted
419
419
  */
package/index.js CHANGED
@@ -5,6 +5,7 @@ import './src/cesium/wallpaperMaterial.js';
5
5
  import './src/cesium/cesium3DTilePointFeature.js';
6
6
  import './src/cesium/cesium3DTileFeature.js';
7
7
  import './src/cesium/cesiumVcsCameraPrimitive.js';
8
+ import './src/cesium/entity.js';
8
9
 
9
10
  export { default as AppBackedCategory } from './src/category/appBackedCategory.js';
10
11
  export { default as Category } from './src/category/category.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcmap/core",
3
- "version": "5.0.0-rc.15",
3
+ "version": "5.0.0-rc.16",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -0,0 +1,27 @@
1
+ // @ts-nocheck
2
+ import { Entity } from '@vcmap/cesium';
3
+
4
+ /**
5
+ * @returns {string|number}
6
+ */
7
+ Entity.prototype.getId = function getId() {
8
+ return this.id;
9
+ };
10
+
11
+ /**
12
+ * To be used for cesium 3D style functions
13
+ * @param {string} property
14
+ * @returns {*}
15
+ */
16
+ Entity.prototype.getProperty = function getProperty(property) {
17
+ return this[property];
18
+ };
19
+
20
+ /**
21
+ * To be used for cesium 3D style functions
22
+ * @param {string} property
23
+ * @returns {*}
24
+ */
25
+ Entity.prototype.getPropertyInherited = function getPropertyInherited(property) {
26
+ return this.getProperty(property);
27
+ };
@@ -42,6 +42,7 @@ const geojsonFormats = [
42
42
  'application/geojson',
43
43
  'application/json',
44
44
  'application/vnd.geo+json',
45
+ 'application/geo+json',
45
46
  ];
46
47
 
47
48
  /**
@@ -11,7 +11,7 @@ import { EventType, ModificationKeyType, PointerKeyType } from './interactionTyp
11
11
  /**
12
12
  * @typedef {MapEvent} InteractionEvent
13
13
  * @property {EventType} type
14
- * @property {undefined|import("ol").Feature<import("ol/geom/Geometry").default>|import("@vcmap/cesium").Cesium3DTileFeature|import("@vcmap/cesium").Cesium3DTilePointFeature} feature - a potential feature at said location
14
+ * @property {undefined|import("ol").Feature<import("ol/geom/Geometry").default>|import("@vcmap/cesium").Cesium3DTileFeature|import("@vcmap/cesium").Cesium3DTilePointFeature|import("@vcmap/cesium").Entity} feature - a potential feature at said location
15
15
  * @property {boolean|undefined} stopPropagation - if set to true, the event chain is interrupted
16
16
  * @property {undefined|ObliqueParameters} obliqueParameters - additional parameters from oblique if obliquemode is active
17
17
  * @property {import("@vcmap/cesium").Ray|undefined} ray - potential ray
@@ -1,4 +1,11 @@
1
- import { Cartographic, Cartesian3, Math as CesiumMath, Cesium3DTileFeature, Cesium3DTilePointFeature } from '@vcmap/cesium';
1
+ import {
2
+ Cartographic,
3
+ Cartesian3,
4
+ Math as CesiumMath,
5
+ Cesium3DTileFeature,
6
+ Cesium3DTilePointFeature,
7
+ Entity,
8
+ } from '@vcmap/cesium';
2
9
 
3
10
  import AbstractInteraction from './abstractInteraction.js';
4
11
  import Projection from '../util/projection.js';
@@ -241,11 +248,8 @@ class FeatureAtPixelInteraction extends AbstractInteraction {
241
248
  }
242
249
  } else if (object.id && object.id.olFeature) { // cluster size === 1
243
250
  event.feature = object.id.olFeature;
244
- } else if (object.id && object.id[vcsLayerName]) { // entity
245
- event.feature = object;
246
- event.feature[vcsLayerName] = object.id[vcsLayerName];
247
- } else {
248
- event.feature = object;
251
+ } else if (object.id && object.id[vcsLayerName] && object.id instanceof Entity) { // entity
252
+ event.feature = object.id;
249
253
  }
250
254
 
251
255
  if (!(event.type & this.pickPosition)) {