itowns 2.42.1-next.8 → 2.43.0

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.
Files changed (174) hide show
  1. package/changelog.md +90 -0
  2. package/dist/debug.js +1 -1
  3. package/dist/debug.js.map +1 -1
  4. package/dist/itowns.js +1 -1
  5. package/dist/itowns.js.map +1 -1
  6. package/dist/itowns_widgets.js +1 -1
  7. package/dist/itowns_widgets.js.map +1 -1
  8. package/examples/{.eslintrc.js → .eslintrc.cjs} +1 -1
  9. package/examples/effects_stereo.html +2 -2
  10. package/examples/misc_collada.html +2 -2
  11. package/examples/source_stream_wfs_25d.html +11 -11
  12. package/examples/source_stream_wfs_3d.html +1 -1
  13. package/examples/view_25d_map.html +2 -2
  14. package/examples/view_3d_map.html +2 -2
  15. package/examples/view_3d_map_webxr.html +1 -1
  16. package/examples/view_3d_mns_map.html +2 -2
  17. package/examples/view_immersive.html +1 -1
  18. package/examples/view_multi_25d.html +2 -2
  19. package/examples/widgets_searchbar.html +2 -2
  20. package/lib/Controls/FirstPersonControls.js +5 -12
  21. package/lib/Controls/FlyControls.js +4 -13
  22. package/lib/Controls/GlobeControls.js +33 -43
  23. package/lib/Controls/PlanarControls.js +9 -20
  24. package/lib/Controls/StateControl.js +2 -11
  25. package/lib/Controls/StreetControls.js +14 -24
  26. package/lib/Converter/Feature2Mesh.js +28 -38
  27. package/lib/Converter/Feature2Texture.js +15 -25
  28. package/lib/Converter/convertToTile.js +16 -26
  29. package/lib/Converter/textureConverter.js +9 -19
  30. package/lib/Core/3DTiles/C3DTBatchTable.js +5 -13
  31. package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.js +1 -8
  32. package/lib/Core/3DTiles/C3DTBoundingVolume.js +17 -27
  33. package/lib/Core/3DTiles/C3DTExtensions.js +1 -8
  34. package/lib/Core/3DTiles/C3DTFeature.js +3 -10
  35. package/lib/Core/3DTiles/C3DTilesEnums.js +3 -11
  36. package/lib/Core/3DTiles/C3DTileset.js +7 -16
  37. package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.js +5 -11
  38. package/lib/Core/AnimationPlayer.js +2 -11
  39. package/lib/Core/Deprecated/Undeprecator.js +9 -20
  40. package/lib/Core/EntwinePointTileNode.js +6 -16
  41. package/lib/Core/Feature.js +16 -30
  42. package/lib/Core/Geographic/CoordStars.js +3 -12
  43. package/lib/Core/Geographic/Coordinates.js +12 -22
  44. package/lib/Core/Geographic/Crs.js +7 -15
  45. package/lib/Core/Geographic/Extent.js +36 -47
  46. package/lib/Core/Geographic/GeoidGrid.js +6 -16
  47. package/lib/Core/Label.js +7 -17
  48. package/lib/Core/MainLoop.js +7 -16
  49. package/lib/Core/Math/Ellipsoid.js +6 -17
  50. package/lib/Core/Picking.js +10 -20
  51. package/lib/Core/PointCloudNode.js +2 -11
  52. package/lib/Core/PotreeNode.js +4 -13
  53. package/lib/Core/Prefab/Globe/Atmosphere.js +17 -26
  54. package/lib/Core/Prefab/Globe/BuilderEllipsoidTile.js +6 -16
  55. package/lib/Core/Prefab/Globe/GlobeLayer.js +19 -28
  56. package/lib/Core/Prefab/Globe/SkyShader.js +2 -11
  57. package/lib/Core/Prefab/GlobeView.js +27 -45
  58. package/lib/Core/Prefab/Planar/PlanarLayer.js +11 -20
  59. package/lib/Core/Prefab/Planar/PlanarTileBuilder.js +6 -16
  60. package/lib/Core/Prefab/PlanarView.js +10 -25
  61. package/lib/Core/Prefab/TileBuilder.js +13 -22
  62. package/lib/Core/Prefab/computeBufferTileGeometry.js +12 -16
  63. package/lib/Core/Scheduler/Cache.js +2 -10
  64. package/lib/Core/Scheduler/CancelledCommandException.js +1 -8
  65. package/lib/Core/Scheduler/Scheduler.js +15 -23
  66. package/lib/Core/Style.js +24 -38
  67. package/lib/Core/System/Capabilities.js +2 -13
  68. package/lib/Core/TileGeometry.js +13 -15
  69. package/lib/Core/TileMesh.js +6 -15
  70. package/lib/Core/View.js +43 -58
  71. package/lib/Layer/C3DTilesLayer.js +29 -41
  72. package/lib/Layer/ColorLayer.js +10 -16
  73. package/lib/Layer/ElevationLayer.js +7 -14
  74. package/lib/Layer/EntwinePointTileLayer.js +9 -18
  75. package/lib/Layer/FeatureGeometryLayer.js +9 -16
  76. package/lib/Layer/GeoidLayer.js +6 -15
  77. package/lib/Layer/GeometryLayer.js +11 -17
  78. package/lib/Layer/InfoLayer.js +5 -14
  79. package/lib/Layer/LabelLayer.js +22 -32
  80. package/lib/Layer/Layer.js +16 -26
  81. package/lib/Layer/LayerUpdateState.js +1 -8
  82. package/lib/Layer/LayerUpdateStrategy.js +7 -18
  83. package/lib/Layer/OrientedImageLayer.js +15 -25
  84. package/lib/Layer/PointCloudLayer.js +9 -19
  85. package/lib/Layer/PotreeLayer.js +8 -18
  86. package/lib/Layer/RasterLayer.js +9 -17
  87. package/lib/Layer/ReferencingLayerProperties.js +1 -8
  88. package/lib/Layer/TiledGeometryLayer.js +37 -33
  89. package/lib/Main.js +87 -708
  90. package/lib/MainBundle.js +4 -34
  91. package/lib/Parser/B3dmParser.js +80 -131
  92. package/lib/Parser/CameraCalibrationParser.js +5 -14
  93. package/lib/Parser/GDFParser.js +11 -22
  94. package/lib/Parser/GLTFParser.js +88 -0
  95. package/lib/Parser/GTXParser.js +9 -21
  96. package/lib/Parser/GeoJsonParser.js +14 -22
  97. package/lib/Parser/GpxParser.js +7 -14
  98. package/lib/Parser/ISGParser.js +19 -28
  99. package/lib/Parser/KMLParser.js +7 -14
  100. package/lib/Parser/LASLoader.js +20 -21
  101. package/lib/Parser/LASParser.js +6 -15
  102. package/lib/Parser/MapBoxUrlParser.js +2 -9
  103. package/lib/Parser/PntsParser.js +4 -14
  104. package/lib/Parser/PotreeBinParser.js +8 -16
  105. package/lib/Parser/PotreeCinParser.js +3 -12
  106. package/lib/Parser/ShapefileParser.js +11 -18
  107. package/lib/Parser/VectorTileParser.js +23 -31
  108. package/lib/Parser/XbilParser.js +5 -13
  109. package/lib/Parser/deprecated/LegacyGLTFLoader.js +2 -12
  110. package/lib/Process/3dTilesProcessing.js +14 -27
  111. package/lib/Process/FeatureProcessing.js +14 -22
  112. package/lib/Process/LayeredMaterialNodeProcessing.js +14 -26
  113. package/lib/Process/ObjectRemovalHelper.js +2 -9
  114. package/lib/Process/handlerNodeError.js +1 -7
  115. package/lib/Provider/3dTilesProvider.js +32 -29
  116. package/lib/Provider/DataSourceProvider.js +2 -9
  117. package/lib/Provider/Fetcher.js +40 -22
  118. package/lib/Provider/PointCloudProvider.js +7 -19
  119. package/lib/Provider/TileProvider.js +4 -12
  120. package/lib/Provider/URLBuilder.js +4 -12
  121. package/lib/Renderer/Camera.js +7 -17
  122. package/lib/Renderer/Color.js +3 -11
  123. package/lib/Renderer/ColorLayersOrdering.js +14 -22
  124. package/lib/Renderer/CommonMaterial.js +3 -12
  125. package/lib/Renderer/Label2DRenderer.js +5 -16
  126. package/lib/Renderer/LayeredMaterial.js +33 -53
  127. package/lib/Renderer/OBB.js +12 -21
  128. package/lib/Renderer/OrientedImageCamera.js +2 -11
  129. package/lib/Renderer/OrientedImageMaterial.js +17 -35
  130. package/lib/Renderer/PointsMaterial.js +37 -60
  131. package/lib/Renderer/RasterTile.js +16 -29
  132. package/lib/Renderer/RenderMode.js +2 -9
  133. package/lib/Renderer/Shader/ShaderChunk.js +5 -23
  134. package/lib/Renderer/Shader/ShaderUtils.js +2 -9
  135. package/lib/Renderer/SphereHelper.js +2 -11
  136. package/lib/Renderer/WebXR.js +2 -11
  137. package/lib/Renderer/c3DEngine.js +20 -53
  138. package/lib/Source/C3DTilesGoogleSource.js +76 -0
  139. package/lib/Source/C3DTilesIonSource.js +6 -13
  140. package/lib/Source/C3DTilesSource.js +5 -12
  141. package/lib/Source/EntwinePointTileSource.js +12 -19
  142. package/lib/Source/FileSource.js +7 -14
  143. package/lib/Source/OrientedImageSource.js +6 -14
  144. package/lib/Source/PotreeSource.js +9 -16
  145. package/lib/Source/Source.js +26 -39
  146. package/lib/Source/TMSSource.js +11 -22
  147. package/lib/Source/VectorTilesSource.js +75 -34
  148. package/lib/Source/WFSSource.js +7 -14
  149. package/lib/Source/WMSSource.js +5 -12
  150. package/lib/Source/WMTSSource.js +3 -10
  151. package/lib/ThreeExtended/capabilities/WebGL.js +1 -8
  152. package/lib/ThreeExtended/libs/ktx-parse.module.js +2 -256
  153. package/lib/ThreeExtended/libs/zstddec.module.js +2 -8
  154. package/lib/ThreeExtended/loaders/DDSLoader.js +10 -16
  155. package/lib/ThreeExtended/loaders/DRACOLoader.js +14 -19
  156. package/lib/ThreeExtended/loaders/GLTFLoader.js +124 -129
  157. package/lib/ThreeExtended/loaders/KTX2Loader.js +73 -78
  158. package/lib/ThreeExtended/utils/BufferGeometryUtils.js +40 -59
  159. package/lib/ThreeExtended/utils/WorkerPool.js +2 -9
  160. package/lib/Utils/CameraUtils.js +32 -44
  161. package/lib/Utils/DEMUtils.js +8 -19
  162. package/lib/Utils/FeaturesUtils.js +8 -16
  163. package/lib/Utils/Gradients.js +3 -12
  164. package/lib/Utils/OrientationUtils.js +8 -18
  165. package/lib/Utils/ThreeUtils.js +2 -9
  166. package/lib/Utils/gui/C3DTilesStyle.js +7 -15
  167. package/lib/Utils/gui/Main.js +7 -48
  168. package/lib/Utils/gui/Minimap.js +12 -20
  169. package/lib/Utils/gui/Navigation.js +6 -14
  170. package/lib/Utils/gui/Scale.js +11 -19
  171. package/lib/Utils/gui/Searchbar.js +5 -13
  172. package/lib/Utils/gui/Widget.js +1 -8
  173. package/lib/Utils/placeObjectOnGround.js +13 -23
  174. package/package.json +13 -8
@@ -1,16 +1,10 @@
1
- "use strict";
1
+ import * as THREE from 'three';
2
+ import { MAIN_LOOP_EVENTS } from "../Core/MainLoop.js";
2
3
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var THREE = _interopRequireWildcard(require("three"));
8
- var _MainLoop = require("../Core/MainLoop");
9
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
4
  // Note: we could use existing three.js controls (like https://github.com/mrdoob/three.js/blob/dev/examples/js/controls/FirstPersonControls.js)
12
5
  // but including these controls in itowns allows use to integrate them tightly with itowns.
13
6
  // Especially the existing controls are expecting a continuous update loop while we have a pausable one (so our controls use .notifyChange when needed)
7
+
14
8
  function limitRotation(camera3D, rot, verticalFOV) {
15
9
  // Limit vertical rotation (look up/down) to make sure the user cannot see
16
10
  // outside of the cone defined by verticalFOV
@@ -134,7 +128,7 @@ class FirstPersonControls extends THREE.EventDispatcher {
134
128
  document.addEventListener('keydown', this._onKeyDown, false);
135
129
  document.addEventListener('keyup', this._onKeyUp, false);
136
130
  }
137
- this.view.addFrameRequester(_MainLoop.MAIN_LOOP_EVENTS.AFTER_CAMERA_UPDATE, this.update.bind(this));
131
+ this.view.addFrameRequester(MAIN_LOOP_EVENTS.AFTER_CAMERA_UPDATE, this.update.bind(this));
138
132
 
139
133
  // focus policy
140
134
  this._onFocus = () => view.domElement.focus();
@@ -313,5 +307,4 @@ class FirstPersonControls extends THREE.EventDispatcher {
313
307
  });
314
308
  }
315
309
  }
316
- var _default = FirstPersonControls;
317
- exports.default = _default;
310
+ export default FirstPersonControls;
@@ -1,13 +1,5 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var THREE = _interopRequireWildcard(require("three"));
8
- var _MainLoop = require("../Core/MainLoop");
9
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1
+ import * as THREE from 'three';
2
+ import { MAIN_LOOP_EVENTS } from "../Core/MainLoop.js";
11
3
  const MOVEMENTS = {
12
4
  38: {
13
5
  method: 'translateZ',
@@ -149,7 +141,7 @@ class FlyControls extends THREE.EventDispatcher {
149
141
  view.domElement.addEventListener('wheel', onDocumentMouseWheel.bind(this), false);
150
142
  view.domElement.addEventListener('keyup', onKeyUp.bind(this), true);
151
143
  view.domElement.addEventListener('keydown', onKeyDown.bind(this), true);
152
- this.view.addFrameRequester(_MainLoop.MAIN_LOOP_EVENTS.AFTER_CAMERA_UPDATE, this.update.bind(this));
144
+ this.view.addFrameRequester(MAIN_LOOP_EVENTS.AFTER_CAMERA_UPDATE, this.update.bind(this));
153
145
 
154
146
  // focus policy
155
147
  if (options.focusOnMouseOver) {
@@ -182,5 +174,4 @@ class FlyControls extends THREE.EventDispatcher {
182
174
  }
183
175
  }
184
176
  }
185
- var _default = FlyControls;
186
- exports.default = _default;
177
+ export default FlyControls;
@@ -1,19 +1,11 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.CONTROL_EVENTS = void 0;
8
- var THREE = _interopRequireWildcard(require("three"));
9
- var _AnimationPlayer = _interopRequireDefault(require("../Core/AnimationPlayer"));
10
- var _Coordinates = _interopRequireDefault(require("../Core/Geographic/Coordinates"));
11
- var _Ellipsoid = require("../Core/Math/Ellipsoid");
12
- var _CameraUtils = _interopRequireDefault(require("../Utils/CameraUtils"));
13
- var _StateControl = _interopRequireDefault(require("./StateControl"));
14
- var _View = require("../Core/View");
15
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1
+ import * as THREE from 'three';
2
+ import AnimationPlayer from "../Core/AnimationPlayer.js";
3
+ import Coordinates from "../Core/Geographic/Coordinates.js";
4
+ import { ellipsoidSizes } from "../Core/Math/Ellipsoid.js";
5
+ import CameraUtils from "../Utils/CameraUtils.js";
6
+ import StateControl from "./StateControl.js";
7
+ import { VIEW_EVENTS } from "../Core/View.js";
8
+
17
9
  // private members
18
10
  const EPS = 0.000001;
19
11
  const direction = {
@@ -46,10 +38,10 @@ let dollyScale;
46
38
  // Globe move
47
39
  const moveAroundGlobe = new THREE.Quaternion();
48
40
  const cameraTarget = new THREE.Object3D();
49
- const coordCameraTarget = new _Coordinates.default('EPSG:4978');
41
+ const coordCameraTarget = new Coordinates('EPSG:4978');
50
42
  cameraTarget.matrixWorldInverse = new THREE.Matrix4();
51
- const xyz = new _Coordinates.default('EPSG:4978', 0, 0, 0);
52
- const c = new _Coordinates.default('EPSG:4326', 0, 0, 0);
43
+ const xyz = new Coordinates('EPSG:4978', 0, 0, 0);
44
+ const c = new Coordinates('EPSG:4326', 0, 0, 0);
53
45
  // Position object on globe
54
46
  function positionObject(newPosition, object) {
55
47
  xyz.setFromVector3(newPosition).as('EPSG:4326', c);
@@ -130,13 +122,12 @@ const helpers = {};
130
122
  * @property CAMERA_TARGET_CHANGED {string} Fires when camera's target change
131
123
  */
132
124
 
133
- const CONTROL_EVENTS = {
125
+ export const CONTROL_EVENTS = {
134
126
  PAN_CHANGED: 'pan-changed',
135
127
  ORIENTATION_CHANGED: 'orientation-changed',
136
128
  RANGE_CHANGED: 'range-changed',
137
129
  CAMERA_TARGET_CHANGED: 'camera-target-changed'
138
130
  };
139
- exports.CONTROL_EVENTS = CONTROL_EVENTS;
140
131
  const quaterPano = new THREE.Quaternion();
141
132
  const quaterAxis = new THREE.Quaternion();
142
133
  const axisX = new THREE.Vector3(1, 0, 0);
@@ -184,12 +175,12 @@ class GlobeControls extends THREE.EventDispatcher {
184
175
  constructor(view, placement) {
185
176
  let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
186
177
  super();
187
- this.player = new _AnimationPlayer.default();
178
+ this.player = new AnimationPlayer();
188
179
  this.view = view;
189
180
  this.camera = view.camera3D;
190
181
 
191
182
  // State control
192
- this.states = new _StateControl.default(this.view);
183
+ this.states = new StateControl(this.view);
193
184
 
194
185
  // this.enabled property has moved to StateControl
195
186
  Object.defineProperty(this, 'enabled', {
@@ -210,7 +201,7 @@ class GlobeControls extends THREE.EventDispatcher {
210
201
 
211
202
  // Limits to how far you can dolly in and out ( PerspectiveCamera only )
212
203
  this.minDistance = options.minDistance || 250;
213
- this.maxDistance = options.maxDistance || _Ellipsoid.ellipsoidSizes.x * 8.0;
204
+ this.maxDistance = options.maxDistance || ellipsoidSizes.x * 8.0;
214
205
 
215
206
  // Limits to how far you can zoom in and out ( OrthographicCamera only )
216
207
  this.minZoom = options.minZoom || 0;
@@ -523,7 +514,7 @@ class GlobeControls extends THREE.EventDispatcher {
523
514
  this.player.playLater(durationDampingOrbital, 2);
524
515
  }
525
516
  this.view.dispatchEvent({
526
- type: _View.VIEW_EVENTS.CAMERA_MOVED,
517
+ type: VIEW_EVENTS.CAMERA_MOVED,
527
518
  coord: coordCameraTarget.setFromVector3(cameraTarget.position),
528
519
  range: spherical.radius,
529
520
  heading: -THREE.MathUtils.radToDeg(spherical.theta),
@@ -539,7 +530,7 @@ class GlobeControls extends THREE.EventDispatcher {
539
530
 
540
531
  // Stop CameraUtils ongoing animations, which can for instance be triggered with `this.travel` or
541
532
  // `this.lookAtCoordinate` methods.
542
- _CameraUtils.default.stop(this.view, this.camera);
533
+ CameraUtils.stop(this.view, this.camera);
543
534
 
544
535
  // Dispatch events which specify if changes occurred in camera transform options.
545
536
  this.onEndingMove();
@@ -549,7 +540,7 @@ class GlobeControls extends THREE.EventDispatcher {
549
540
 
550
541
  // Update camera transform options.
551
542
  this.updateTarget();
552
- previous = _CameraUtils.default.getTransformCameraLookingAtTarget(this.view, this.camera, pickedPosition);
543
+ previous = CameraUtils.getTransformCameraLookingAtTarget(this.view, this.camera, pickedPosition);
553
544
 
554
545
  // Initialize rotation and panoramic movements.
555
546
  rotateStart.copy(event.viewCoords);
@@ -667,8 +658,8 @@ class GlobeControls extends THREE.EventDispatcher {
667
658
  }
668
659
  }
669
660
  handlingEvent(current) {
670
- current = current || _CameraUtils.default.getTransformCameraLookingAtTarget(this.view, this.camera);
671
- const diff = _CameraUtils.default.getDiffParams(previous, current);
661
+ current = current || CameraUtils.getTransformCameraLookingAtTarget(this.view, this.camera);
662
+ const diff = CameraUtils.getDiffParams(previous, current);
672
663
  if (diff) {
673
664
  if (diff.range) {
674
665
  this.dispatchEvent({
@@ -712,7 +703,7 @@ class GlobeControls extends THREE.EventDispatcher {
712
703
  const range = this.getRange(point);
713
704
  if (point && range > this.minDistance) {
714
705
  return this.lookAtCoordinate({
715
- coord: new _Coordinates.default('EPSG:4978', point),
706
+ coord: new Coordinates('EPSG:4978', point),
716
707
  range: range * (event.direction === 'out' ? 1 / 0.6 : 0.6),
717
708
  time: 1500
718
709
  });
@@ -720,7 +711,7 @@ class GlobeControls extends THREE.EventDispatcher {
720
711
  }
721
712
  handleZoom(event) {
722
713
  this.player.stop();
723
- _CameraUtils.default.stop(this.view, this.camera);
714
+ CameraUtils.stop(this.view, this.camera);
724
715
  this.updateTarget();
725
716
  const delta = -event.delta;
726
717
  this.dolly(delta);
@@ -918,7 +909,7 @@ class GlobeControls extends THREE.EventDispatcher {
918
909
  * @return {number} number
919
910
  */
920
911
  getRange(position) {
921
- return _CameraUtils.default.getTransformCameraLookingAtTarget(this.view, this.camera, position).range;
912
+ return CameraUtils.getTransformCameraLookingAtTarget(this.view, this.camera, position).range;
922
913
  }
923
914
 
924
915
  /**
@@ -928,7 +919,7 @@ class GlobeControls extends THREE.EventDispatcher {
928
919
  * @return {number} The angle of the rotation in degrees.
929
920
  */
930
921
  getTilt(position) {
931
- return _CameraUtils.default.getTransformCameraLookingAtTarget(this.view, this.camera, position).tilt;
922
+ return CameraUtils.getTransformCameraLookingAtTarget(this.view, this.camera, position).tilt;
932
923
  }
933
924
 
934
925
  /**
@@ -938,7 +929,7 @@ class GlobeControls extends THREE.EventDispatcher {
938
929
  * @return {number} The angle of the rotation in degrees.
939
930
  */
940
931
  getHeading(position) {
941
- return _CameraUtils.default.getTransformCameraLookingAtTarget(this.view, this.camera, position).heading;
932
+ return CameraUtils.getTransformCameraLookingAtTarget(this.view, this.camera, position).heading;
942
933
  }
943
934
 
944
935
  /**
@@ -968,7 +959,7 @@ class GlobeControls extends THREE.EventDispatcher {
968
959
  */
969
960
 
970
961
  getCameraCoordinate() {
971
- return new _Coordinates.default('EPSG:4978', this.camera.position).as('EPSG:4326');
962
+ return new Coordinates('EPSG:4978', this.camera.position).as('EPSG:4326');
972
963
  }
973
964
 
974
965
  /**
@@ -976,7 +967,7 @@ class GlobeControls extends THREE.EventDispatcher {
976
967
  * @return {Coordinates} coordinate
977
968
  */
978
969
  getLookAtCoordinate() {
979
- return _CameraUtils.default.getTransformCameraLookingAtTarget(this.view, this.camera).coord;
970
+ return CameraUtils.getTransformCameraLookingAtTarget(this.view, this.camera).coord;
980
971
  }
981
972
 
982
973
  /**
@@ -1058,7 +1049,7 @@ class GlobeControls extends THREE.EventDispatcher {
1058
1049
  let pixelPitch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.28;
1059
1050
  console.warn('Deprecated, use View#getPixelsToMeters and GlobeControls#getMetersToDegrees instead.');
1060
1051
  const chord = this.pixelsToMeters(pixels, pixelPitch);
1061
- return THREE.MathUtils.radToDeg(2 * Math.asin(chord / (2 * _Ellipsoid.ellipsoidSizes.x)));
1052
+ return THREE.MathUtils.radToDeg(2 * Math.asin(chord / (2 * ellipsoidSizes.x)));
1062
1053
  }
1063
1054
 
1064
1055
  /**
@@ -1130,13 +1121,13 @@ class GlobeControls extends THREE.EventDispatcher {
1130
1121
  }
1131
1122
  }
1132
1123
  }
1133
- previous = _CameraUtils.default.getTransformCameraLookingAtTarget(this.view, this.camera);
1124
+ previous = CameraUtils.getTransformCameraLookingAtTarget(this.view, this.camera);
1134
1125
  if (isAnimated) {
1135
1126
  params.callback = r => cameraTarget.position.copy(r.targetWorldPosition);
1136
1127
  this.dispatchEvent({
1137
1128
  type: 'animation-started'
1138
1129
  });
1139
- return _CameraUtils.default.animateCameraToLookAtTarget(this.view, this.camera, params).then(result => {
1130
+ return CameraUtils.animateCameraToLookAtTarget(this.view, this.camera, params).then(result => {
1140
1131
  this.dispatchEvent({
1141
1132
  type: 'animation-ended'
1142
1133
  });
@@ -1144,7 +1135,7 @@ class GlobeControls extends THREE.EventDispatcher {
1144
1135
  return result;
1145
1136
  });
1146
1137
  } else {
1147
- return _CameraUtils.default.transformCameraToLookAtTarget(this.view, this.camera, params).then(result => {
1138
+ return CameraUtils.transformCameraToLookAtTarget(this.view, this.camera, params).then(result => {
1148
1139
  cameraTarget.position.copy(result.targetWorldPosition);
1149
1140
  this.handlingEvent(result);
1150
1141
  return result;
@@ -1163,8 +1154,7 @@ class GlobeControls extends THREE.EventDispatcher {
1163
1154
  if (!pickedPosition) {
1164
1155
  return;
1165
1156
  }
1166
- return new _Coordinates.default('EPSG:4978', pickedPosition).as('EPSG:4326');
1157
+ return new Coordinates('EPSG:4978', pickedPosition).as('EPSG:4326');
1167
1158
  }
1168
1159
  }
1169
- var _default = GlobeControls;
1170
- exports.default = _default;
1160
+ export default GlobeControls;
@@ -1,21 +1,13 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.keys = exports.default = exports.STATE = exports.PLANAR_CONTROL_EVENT = void 0;
7
- var THREE = _interopRequireWildcard(require("three"));
8
- var _MainLoop = require("../Core/MainLoop");
9
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1
+ import * as THREE from 'three';
2
+ import { MAIN_LOOP_EVENTS } from "../Core/MainLoop.js";
3
+
11
4
  // event keycode
12
- const keys = {
5
+ export const keys = {
13
6
  CTRL: 17,
14
7
  SPACE: 32,
15
8
  T: 84,
16
9
  Y: 89
17
10
  };
18
- exports.keys = keys;
19
11
  const mouseButtons = {
20
12
  LEFTCLICK: THREE.MOUSE.LEFT,
21
13
  MIDDLECLICK: THREE.MOUSE.MIDDLE,
@@ -33,7 +25,7 @@ let cameraInitialZoom = 0;
33
25
  const pointUnderCursor = new THREE.Vector3();
34
26
 
35
27
  // control state
36
- const STATE = {
28
+ export const STATE = {
37
29
  NONE: -1,
38
30
  DRAG: 0,
39
31
  PAN: 1,
@@ -43,7 +35,6 @@ const STATE = {
43
35
  };
44
36
 
45
37
  // cursor shape linked to control state
46
- exports.STATE = STATE;
47
38
  const cursor = {
48
39
  default: 'auto',
49
40
  drag: 'move',
@@ -120,7 +111,7 @@ const defaultOptions = {
120
111
  enableSmartTravel: true,
121
112
  enablePan: true
122
113
  };
123
- const PLANAR_CONTROL_EVENT = {
114
+ export const PLANAR_CONTROL_EVENT = {
124
115
  MOVED: 'moved'
125
116
  };
126
117
 
@@ -174,7 +165,6 @@ const PLANAR_CONTROL_EVENT = {
174
165
  * rotation, in degrees.
175
166
  * @param {boolean} [options.handleCollision=true]
176
167
  */
177
- exports.PLANAR_CONTROL_EVENT = PLANAR_CONTROL_EVENT;
178
168
  class PlanarControls extends THREE.EventDispatcher {
179
169
  constructor(view) {
180
170
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -308,14 +298,14 @@ class PlanarControls extends THREE.EventDispatcher {
308
298
 
309
299
  // add this PlanarControl instance to the view's frameRequesters
310
300
  // with this, PlanarControl.update() will be called each frame
311
- this.view.addFrameRequester(_MainLoop.MAIN_LOOP_EVENTS.AFTER_CAMERA_UPDATE, this._handlerUpdate);
301
+ this.view.addFrameRequester(MAIN_LOOP_EVENTS.AFTER_CAMERA_UPDATE, this._handlerUpdate);
312
302
 
313
303
  // event listeners for user input (to activate the controls)
314
304
  this.addInputListeners();
315
305
  }
316
306
  dispose() {
317
307
  this.removeInputListeners();
318
- this.view.removeFrameRequester(_MainLoop.MAIN_LOOP_EVENTS.AFTER_CAMERA_UPDATE, this._handlerUpdate);
308
+ this.view.removeFrameRequester(MAIN_LOOP_EVENTS.AFTER_CAMERA_UPDATE, this._handlerUpdate);
319
309
  }
320
310
 
321
311
  /**
@@ -1032,5 +1022,4 @@ class PlanarControls extends THREE.EventDispatcher {
1032
1022
  return (value ** 2 * (3 - 2 * value)) ** 1.20;
1033
1023
  }
1034
1024
  }
1035
- var _default = PlanarControls;
1036
- exports.default = _default;
1025
+ export default PlanarControls;
@@ -1,12 +1,4 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var THREE = _interopRequireWildcard(require("three"));
8
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
9
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1
+ import * as THREE from 'three';
10
2
  const CONTROL_KEYS = {
11
3
  LEFT: 37,
12
4
  UP: 38,
@@ -434,5 +426,4 @@ class StateControl extends THREE.EventDispatcher {
434
426
  this._domElement.removeEventListener('contextmenu', this._onContextMenu, false);
435
427
  }
436
428
  }
437
- var _default = StateControl;
438
- exports.default = _default;
429
+ export default StateControl;
@@ -1,16 +1,7 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _tween = _interopRequireDefault(require("@tweenjs/tween.js"));
9
- var THREE = _interopRequireWildcard(require("three"));
10
- var _MainLoop = require("../Core/MainLoop");
11
- var _FirstPersonControls = _interopRequireDefault(require("./FirstPersonControls"));
12
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1
+ import TWEEN from '@tweenjs/tween.js';
2
+ import * as THREE from 'three';
3
+ import { MAIN_LOOP_EVENTS } from "../Core/MainLoop.js";
4
+ import FirstPersonControls from "./FirstPersonControls.js";
14
5
  const material = new THREE.MeshBasicMaterial({
15
6
  color: 0xffffff,
16
7
  depthTest: false,
@@ -119,7 +110,7 @@ function computeTime(distance) {
119
110
  * @property {number} keySetCameraToCurrentPositionAndLookAtPrevious key code set camera to current position, default to 81 for key Q
120
111
  * @extends FirstPersonControls
121
112
  */
122
- class StreetControls extends _FirstPersonControls.default {
113
+ class StreetControls extends FirstPersonControls {
123
114
  /**
124
115
  * @constructor
125
116
  * @param { View } view - View where this control will be used
@@ -149,7 +140,7 @@ class StreetControls extends _FirstPersonControls.default {
149
140
  this.keySetCameraToCurrentPositionAndLookAtPrevious = 81;
150
141
 
151
142
  // Tween is used to make smooth animations
152
- this.tweenGroup = new _tween.default.Group();
143
+ this.tweenGroup = new TWEEN.Group();
153
144
 
154
145
  // init surfaces used as helper for end user
155
146
  this.surfaceGround = options.surfaceGround || createCircle();
@@ -298,11 +289,11 @@ class StreetControls extends _FirstPersonControls.default {
298
289
  startQuaternion.copy(this.camera.quaternion);
299
290
  this.end.copy(this.camera);
300
291
  this.end.lookAt(position);
301
- this.tween = new _tween.default.Tween({
292
+ this.tween = new TWEEN.Tween({
302
293
  t: 0
303
294
  }, this.tweenGroup).to({
304
295
  t: 1
305
- }, time).easing(_tween.default.Easing.Quadratic.Out).onComplete(() => {
296
+ }, time).easing(TWEEN.Easing.Quadratic.Out).onComplete(() => {
306
297
  this.stopAnimations();
307
298
  }).onUpdate(d => {
308
299
  // 'manually' slerp the Quaternion to avoid rotation issues
@@ -314,7 +305,7 @@ class StreetControls extends _FirstPersonControls.default {
314
305
  this.reset();
315
306
  this.view.notifyChange(this.camera);
316
307
  };
317
- this.view.addFrameRequester(_MainLoop.MAIN_LOOP_EVENTS.BEFORE_RENDER, this.animationFrameRequester);
308
+ this.view.addFrameRequester(MAIN_LOOP_EVENTS.BEFORE_RENDER, this.animationFrameRequester);
318
309
  this.view.notifyChange(this.camera);
319
310
  }
320
311
 
@@ -335,8 +326,8 @@ class StreetControls extends _FirstPersonControls.default {
335
326
  resolve = r;
336
327
  });
337
328
  this.stopAnimations();
338
- this.tween = new _tween.default.Tween(this.camera.position, this.tweenGroup) // Create a new tween that modifies camera position
339
- .to(position.clone(), time).easing(_tween.default.Easing.Quadratic.Out) // Use an easing function to make the animation smooth.
329
+ this.tween = new TWEEN.Tween(this.camera.position, this.tweenGroup) // Create a new tween that modifies camera position
330
+ .to(position.clone(), time).easing(TWEEN.Easing.Quadratic.Out) // Use an easing function to make the animation smooth.
340
331
  .onComplete(() => {
341
332
  this.stopAnimations();
342
333
  resolve();
@@ -345,7 +336,7 @@ class StreetControls extends _FirstPersonControls.default {
345
336
  this.tweenGroup.update();
346
337
  this.view.notifyChange(this.camera);
347
338
  };
348
- this.view.addFrameRequester(_MainLoop.MAIN_LOOP_EVENTS.BEFORE_RENDER, this.animationFrameRequester);
339
+ this.view.addFrameRequester(MAIN_LOOP_EVENTS.BEFORE_RENDER, this.animationFrameRequester);
349
340
  this.view.notifyChange(this.camera);
350
341
  return promise;
351
342
  }
@@ -355,7 +346,7 @@ class StreetControls extends _FirstPersonControls.default {
355
346
  this.tween = undefined;
356
347
  }
357
348
  if (this.animationFrameRequester) {
358
- this.view.removeFrameRequester(_MainLoop.MAIN_LOOP_EVENTS.BEFORE_RENDER, this.animationFrameRequester);
349
+ this.view.removeFrameRequester(MAIN_LOOP_EVENTS.BEFORE_RENDER, this.animationFrameRequester);
359
350
  this.animationFrameRequester = null;
360
351
  }
361
352
  }
@@ -396,5 +387,4 @@ class StreetControls extends _FirstPersonControls.default {
396
387
  super.dispose();
397
388
  }
398
389
  }
399
- var _default = StreetControls;
400
- exports.default = _default;
390
+ export default StreetControls;
@@ -1,25 +1,16 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var THREE = _interopRequireWildcard(require("three"));
9
- var _earcut = _interopRequireDefault(require("earcut"));
10
- var _Feature = require("../Core/Feature");
11
- var _ReferencingLayerProperties = _interopRequireDefault(require("../Layer/ReferencingLayerProperties"));
12
- var _Undeprecator = require("../Core/Deprecated/Undeprecator");
13
- var _Extent = _interopRequireDefault(require("../Core/Geographic/Extent"));
14
- var _Crs = _interopRequireDefault(require("../Core/Geographic/Crs"));
15
- var _OrientationUtils = _interopRequireDefault(require("../Utils/OrientationUtils"));
16
- var _Coordinates = _interopRequireDefault(require("../Core/Geographic/Coordinates"));
17
- var _Style = _interopRequireWildcard(require("../Core/Style"));
18
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
20
- const coord = new _Coordinates.default('EPSG:4326', 0, 0, 0);
21
- const context = new _Style.StyleContext();
22
- const defaultStyle = new _Style.default();
1
+ import * as THREE from 'three';
2
+ import Earcut from 'earcut';
3
+ import { FEATURE_TYPES } from "../Core/Feature.js";
4
+ import ReferLayerProperties from "../Layer/ReferencingLayerProperties.js";
5
+ import { deprecatedFeature2MeshOptions } from "../Core/Deprecated/Undeprecator.js";
6
+ import Extent from "../Core/Geographic/Extent.js";
7
+ import Crs from "../Core/Geographic/Crs.js";
8
+ import OrientationUtils from "../Utils/OrientationUtils.js";
9
+ import Coordinates from "../Core/Geographic/Coordinates.js";
10
+ import Style, { StyleContext } from "../Core/Style.js";
11
+ const coord = new Coordinates('EPSG:4326', 0, 0, 0);
12
+ const context = new StyleContext();
13
+ const defaultStyle = new Style();
23
14
  let style;
24
15
  const dim_ref = new THREE.Vector2();
25
16
  const dim = new THREE.Vector2();
@@ -27,7 +18,7 @@ const normal = new THREE.Vector3();
27
18
  const baseCoord = new THREE.Vector3();
28
19
  const topCoord = new THREE.Vector3();
29
20
  const inverseScale = new THREE.Vector3();
30
- const extent = new _Extent.default('EPSG:4326', 0, 0, 0, 0);
21
+ const extent = new Extent('EPSG:4326', 0, 0, 0, 0);
31
22
  const _color = new THREE.Color();
32
23
  const maxValueUint8 = 2 ** 8 - 1;
33
24
  const maxValueUint16 = 2 ** 16 - 1;
@@ -63,7 +54,7 @@ class FeatureMesh extends THREE.Group {
63
54
  } else {
64
55
  // calculate the scale transformation to transform the feature.extent
65
56
  // to feature.extent.as(crs)
66
- coord.crs = _Crs.default.formatToEPSG(this.#originalCrs);
57
+ coord.crs = Crs.formatToEPSG(this.#originalCrs);
67
58
  extent.copy(this.extent).applyMatrix4(this.#collection.matrix);
68
59
  extent.as(coord.crs, extent);
69
60
  extent.spatialEuclideanDimensions(dim_ref);
@@ -81,7 +72,7 @@ class FeatureMesh extends THREE.Group {
81
72
 
82
73
  // get method to calculate orientation
83
74
  const crsInput = this.#originalCrs == 'EPSG:3857' ? crsWGS84 : this.#originalCrs;
84
- const crs2crs = _OrientationUtils.default.quaternionFromCRSToCRS(crsInput, crs);
75
+ const crs2crs = OrientationUtils.quaternionFromCRSToCRS(crsInput, crs);
85
76
  // calculate orientation to crs
86
77
  crs2crs(coord.as(crsWGS84), this.quaternion);
87
78
 
@@ -347,7 +338,7 @@ function featureToPolygon(feature, options) {
347
338
  featureId++;
348
339
  const geomVertices = vertices.slice(start * 3, end * 3);
349
340
  const holesOffsets = geometry.indices.map(i => i.offset - start).slice(1);
350
- const triangles = (0, _earcut.default)(geomVertices, holesOffsets, 3);
341
+ const triangles = Earcut(geomVertices, holesOffsets, 3);
351
342
  const startIndice = indices.length;
352
343
  indices.length += triangles.length;
353
344
  for (let i = 0; i < triangles.length; i++) {
@@ -429,7 +420,7 @@ function featureToExtrudedPolygon(feature, options) {
429
420
  featureId++;
430
421
  const geomVertices = vertices.slice(startTop * 3, (end + totalVertices) * 3);
431
422
  const holesOffsets = geometry.indices.map(i => i.offset - start).slice(1);
432
- const triangles = (0, _earcut.default)(geomVertices, holesOffsets, 3);
423
+ const triangles = Earcut(geomVertices, holesOffsets, 3);
433
424
  const startIndice = indices.length;
434
425
  indices.length += triangles.length;
435
426
  for (let i = 0; i < triangles.length; i++) {
@@ -511,7 +502,7 @@ function featureToMesh(feature, options) {
511
502
  }
512
503
  let mesh;
513
504
  switch (feature.type) {
514
- case _Feature.FEATURE_TYPES.POINT:
505
+ case FEATURE_TYPES.POINT:
515
506
  if ((_style$point = style.point) !== null && _style$point !== void 0 && (_style$point$model = _style$point.model) !== null && _style$point$model !== void 0 && _style$point$model.object) {
516
507
  try {
517
508
  mesh = pointsToInstancedMeshes(feature);
@@ -523,10 +514,10 @@ function featureToMesh(feature, options) {
523
514
  mesh = featureToPoint(feature, options);
524
515
  }
525
516
  break;
526
- case _Feature.FEATURE_TYPES.LINE:
517
+ case FEATURE_TYPES.LINE:
527
518
  mesh = featureToLine(feature, options);
528
519
  break;
529
- case _Feature.FEATURE_TYPES.POLYGON:
520
+ case FEATURE_TYPES.POLYGON:
530
521
  if (style.fill && Object.keys(style.fill).includes('extrusion_height')) {
531
522
  mesh = featureToExtrudedPolygon(feature, options);
532
523
  } else {
@@ -546,7 +537,7 @@ function featureToMesh(feature, options) {
546
537
  /**
547
538
  * @module Feature2Mesh
548
539
  */
549
- var _default = {
540
+ export default {
550
541
  /**
551
542
  * Return a function that converts [Features]{@link module:GeoJsonParser} to Meshes. Feature collection will be converted to a
552
543
  * a THREE.Group.
@@ -584,7 +575,7 @@ var _default = {
584
575
  */
585
576
  convert() {
586
577
  let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
587
- (0, _Undeprecator.deprecatedFeature2MeshOptions)(options);
578
+ deprecatedFeature2MeshOptions(options);
588
579
  return function (collection) {
589
580
  if (!collection) {
590
581
  return;
@@ -592,16 +583,16 @@ var _default = {
592
583
  if (!options.pointMaterial) {
593
584
  // Opacity and wireframe refered with layer properties
594
585
  // TODO: next step is move these properties to Style
595
- options.pointMaterial = (0, _ReferencingLayerProperties.default)(new THREE.PointsMaterial(), this);
596
- options.lineMaterial = (0, _ReferencingLayerProperties.default)(new THREE.LineBasicMaterial(), this);
597
- options.polygonMaterial = (0, _ReferencingLayerProperties.default)(new THREE.MeshBasicMaterial(), this);
586
+ options.pointMaterial = ReferLayerProperties(new THREE.PointsMaterial(), this);
587
+ options.lineMaterial = ReferLayerProperties(new THREE.LineBasicMaterial(), this);
588
+ options.polygonMaterial = ReferLayerProperties(new THREE.MeshBasicMaterial(), this);
598
589
  }
599
590
 
600
591
  // In the case we didn't instanciate the layer (this) before the convert, we can pass
601
592
  // style properties (@link StyleOptions) using options.style.
602
593
  // This is usually done in some tests and if you want to use Feature2Mesh.convert()
603
594
  // as in examples/source_file_gpx_3d.html.
604
- style = (this === null || this === void 0 ? void 0 : this.style) || (options.style ? new _Style.default(options.style) : defaultStyle);
595
+ style = (this === null || this === void 0 ? void 0 : this.style) || (options.style ? new Style(options.style) : defaultStyle);
605
596
  context.setCollection(collection);
606
597
  const features = collection.features;
607
598
  if (!features || features.length == 0) {
@@ -616,5 +607,4 @@ var _default = {
616
607
  return featureNode;
617
608
  };
618
609
  }
619
- };
620
- exports.default = _default;
610
+ };