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,28 +1,17 @@
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
- exports.getLookAtFromMath = getLookAtFromMath;
9
- exports.getRig = getRig;
10
- var THREE = _interopRequireWildcard(require("three"));
11
- var _tween = _interopRequireDefault(require("@tweenjs/tween.js"));
12
- var _DEMUtils = _interopRequireDefault(require("./DEMUtils"));
13
- var _MainLoop = require("../Core/MainLoop");
14
- var _Coordinates = _interopRequireDefault(require("../Core/Geographic/Coordinates"));
15
- var _Ellipsoid = _interopRequireDefault(require("../Core/Math/Ellipsoid"));
16
- var _OBB = _interopRequireDefault(require("../Renderer/OBB"));
17
- var _View = require("../Core/View");
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; }
1
+ import * as THREE from 'three';
2
+ import TWEEN from '@tweenjs/tween.js';
3
+ import DEMUtils from "./DEMUtils.js";
4
+ import { MAIN_LOOP_EVENTS } from "../Core/MainLoop.js";
5
+ import Coordinates from "../Core/Geographic/Coordinates.js";
6
+ import Ellipsoid from "../Core/Math/Ellipsoid.js";
7
+ import OBB from "../Renderer/OBB.js";
8
+ import { VIEW_EVENTS } from "../Core/View.js";
20
9
  THREE.Object3D.DEFAULT_UP.set(0, 0, 1);
21
10
  const targetPosition = new THREE.Vector3();
22
- const targetCoord = new _Coordinates.default('EPSG:4326', 0, 0, 0);
23
- const ellipsoid = new _Ellipsoid.default();
11
+ const targetCoord = new Coordinates('EPSG:4326', 0, 0, 0);
12
+ const ellipsoid = new Ellipsoid();
24
13
  const rigs = [];
25
- const obb = new _OBB.default();
14
+ const obb = new OBB();
26
15
  const size = new THREE.Vector3();
27
16
  const deferred = () => {
28
17
  let resolve;
@@ -44,7 +33,7 @@ function wrapTo180(angle) {
44
33
  function tileLayer(view) {
45
34
  return view.getLayers(l => l.isTiledGeometryLayer)[0];
46
35
  }
47
- function getLookAtFromMath(view, camera) {
36
+ export function getLookAtFromMath(view, camera) {
48
37
  const direction = new THREE.Vector3(0, 0, 0.5);
49
38
  direction.unproject(camera);
50
39
  direction.sub(camera.position).normalize();
@@ -100,7 +89,7 @@ class CameraRig extends THREE.Object3D {
100
89
  this.seaLevel.add(this.target);
101
90
  this.target.add(this.camera);
102
91
  // target's geographic coordinate
103
- this.coord = new _Coordinates.default('EPSG:4978', 0, 0);
92
+ this.coord = new Coordinates('EPSG:4978', 0, 0);
104
93
  // sea level's worldPoistion
105
94
  this.targetWorldPosition = new THREE.Vector3();
106
95
  this.removeAll = () => {};
@@ -117,7 +106,7 @@ class CameraRig extends THREE.Object3D {
117
106
  this.camera.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);
118
107
  }
119
108
  view.dispatchEvent({
120
- type: _View.VIEW_EVENTS.CAMERA_MOVED,
109
+ type: VIEW_EVENTS.CAMERA_MOVED,
121
110
  coord: this.coord,
122
111
  range: this.range,
123
112
  heading: this.heading,
@@ -148,7 +137,7 @@ class CameraRig extends THREE.Object3D {
148
137
  setTargetFromCoordinate(view, coord) {
149
138
  // compute precise coordinate (coord) altitude and clamp it above seaLevel
150
139
  coord.as(tileLayer(view).extent.crs, this.coord);
151
- const altitude = Math.max(0, _DEMUtils.default.getElevationValueAt(tileLayer(view), this.coord, _DEMUtils.default.PRECISE_READ_Z) || this.coord.z);
140
+ const altitude = Math.max(0, DEMUtils.getElevationValueAt(tileLayer(view), this.coord, DEMUtils.PRECISE_READ_Z) || this.coord.z);
152
141
  this.coord.z = altitude;
153
142
  // adjust target's position with clamped altitude
154
143
  this.coord.as(view.referenceCrs).toVector3(targetPosition);
@@ -167,7 +156,7 @@ class CameraRig extends THREE.Object3D {
167
156
 
168
157
  // set rig's objects transformation from camera's position and target's position
169
158
  setFromPositions(view, cameraPosition) {
170
- this.setTargetFromCoordinate(view, new _Coordinates.default(view.referenceCrs, targetPosition));
159
+ this.setTargetFromCoordinate(view, new Coordinates(view.referenceCrs, targetPosition));
171
160
  this.target.rotation.set(0, 0, 0);
172
161
  this.updateMatrixWorld(true);
173
162
  this.camera.position.copy(cameraPosition);
@@ -223,9 +212,9 @@ class CameraRig extends THREE.Object3D {
223
212
  return this;
224
213
  }
225
214
  animateCameraToLookAtTarget(view, camera, params) {
226
- params.easing = params.easing || _tween.default.Easing.Quartic.InOut;
215
+ params.easing = params.easing || TWEEN.Easing.Quartic.InOut;
227
216
  this.setfromCamera(view, camera);
228
- const tweenGroup = new _tween.default.Group();
217
+ const tweenGroup = new TWEEN.Group();
229
218
  this.start = (this.start || new CameraRig()).copyObject3D(this);
230
219
  this.end = (this.end || new CameraRig()).copyObject3D(this);
231
220
  const time = params.time || 2500;
@@ -242,7 +231,7 @@ class CameraRig extends THREE.Object3D {
242
231
  if (Math.abs(difference) > Math.PI) {
243
232
  this.end.target.rotation.z = this.start.target.rotation.z + difference - Math.sign(difference) * 2 * Math.PI;
244
233
  }
245
- animations.push(new _tween.default.Tween(factor, tweenGroup).to({
234
+ animations.push(new TWEEN.Tween(factor, tweenGroup).to({
246
235
  t: 1
247
236
  }, time).easing(params.easing).onUpdate(d => {
248
237
  // rotate to coord destination in geocentric projection
@@ -259,14 +248,14 @@ class CameraRig extends THREE.Object3D {
259
248
 
260
249
  // translate to coordinate destination in planar projection
261
250
  if (view.referenceCrs != 'EPSG:4978') {
262
- animations.push(new _tween.default.Tween(this.position, tweenGroup).to(this.end.position, time).easing(params.easing));
251
+ animations.push(new TWEEN.Tween(this.position, tweenGroup).to(this.end.position, time).easing(params.easing));
263
252
  }
264
253
 
265
254
  // translate to altitude zero
266
- animations.push(new _tween.default.Tween(this.seaLevel.position, tweenGroup).to(this.end.seaLevel.position, time).easing(params.easing));
255
+ animations.push(new TWEEN.Tween(this.seaLevel.position, tweenGroup).to(this.end.seaLevel.position, time).easing(params.easing));
267
256
 
268
257
  // translate camera position
269
- animations.push(new _tween.default.Tween(this.camera.position, tweenGroup).to(this.end.camera.position, time).easing(params.easing));
258
+ animations.push(new TWEEN.Tween(this.camera.position, tweenGroup).to(this.end.camera.position, time).easing(params.easing));
270
259
 
271
260
  // update animations, transformation and view
272
261
  this.animationFrameRequester = () => {
@@ -285,7 +274,7 @@ class CameraRig extends THREE.Object3D {
285
274
  this.removeAll = () => {};
286
275
  tweenGroup.removeAll();
287
276
  if (this.animationFrameRequester) {
288
- view.removeFrameRequester(_MainLoop.MAIN_LOOP_EVENTS.BEFORE_RENDER, this.animationFrameRequester);
277
+ view.removeFrameRequester(MAIN_LOOP_EVENTS.BEFORE_RENDER, this.animationFrameRequester);
289
278
  }
290
279
  def.resolve(o !== undefined);
291
280
  this.animationFrameRequester = null;
@@ -295,7 +284,7 @@ class CameraRig extends THREE.Object3D {
295
284
  // we assume that the animation that completes last is the one that was started last
296
285
  animations[animations.length - 1].onComplete(this.removeAll);
297
286
  animations.forEach(anim => anim.start());
298
- view.addFrameRequester(_MainLoop.MAIN_LOOP_EVENTS.BEFORE_RENDER, this.animationFrameRequester);
287
+ view.addFrameRequester(MAIN_LOOP_EVENTS.BEFORE_RENDER, this.animationFrameRequester);
299
288
  view.notifyChange(camera);
300
289
  return def;
301
290
  }
@@ -313,18 +302,18 @@ class CameraRig extends THREE.Object3D {
313
302
  if (view && camera) {
314
303
  const startAltitude = this.target.position.z;
315
304
  this.placeTargetOnGround = () => {
316
- const altitude = Math.max(0, _DEMUtils.default.getElevationValueAt(tileLayer(view), coord || this.coord, _DEMUtils.default.PRECISE_READ_Z) || 0);
305
+ const altitude = Math.max(0, DEMUtils.getElevationValueAt(tileLayer(view), coord || this.coord, DEMUtils.PRECISE_READ_Z) || 0);
317
306
  this.target.position.z = startAltitude * (1.0 - options.t) + altitude * options.t;
318
307
  this.target.updateMatrixWorld(true);
319
308
  this.applyTransformToCamera(view, camera);
320
309
  };
321
310
  this.placeTargetOnGround();
322
- view.addFrameRequester(_MainLoop.MAIN_LOOP_EVENTS.BEFORE_RENDER, this.placeTargetOnGround);
311
+ view.addFrameRequester(MAIN_LOOP_EVENTS.BEFORE_RENDER, this.placeTargetOnGround);
323
312
  }
324
313
  }
325
314
  removePlaceTargetOnGround(view) {
326
315
  if (view && this.placeTargetOnGround) {
327
- view.removeFrameRequester(_MainLoop.MAIN_LOOP_EVENTS.BEFORE_RENDER, this.placeTargetOnGround);
316
+ view.removeFrameRequester(MAIN_LOOP_EVENTS.BEFORE_RENDER, this.placeTargetOnGround);
328
317
  this.placeTargetOnGround = null;
329
318
  }
330
319
  }
@@ -338,7 +327,7 @@ class CameraRig extends THREE.Object3D {
338
327
  return this.camera.position.y;
339
328
  }
340
329
  }
341
- function getRig(camera) {
330
+ export function getRig(camera) {
342
331
  rigs[camera.uuid] = rigs[camera.uuid] || new CameraRig();
343
332
  return rigs[camera.uuid];
344
333
  }
@@ -346,7 +335,7 @@ function getRig(camera) {
346
335
  /**
347
336
  * @module CameraUtils
348
337
  */
349
- var _default = {
338
+ export default {
350
339
  /**
351
340
  * @typedef {Object} CameraTransformOptions
352
341
  * @property {Coordinate} [coord=currentCoordinate] Camera look at geographic coordinate
@@ -365,7 +354,7 @@ var _default = {
365
354
  * Default value is false.
366
355
  */
367
356
  defaultStopPlaceOnGroundAtEnd: false,
368
- Easing: _tween.default.Easing,
357
+ Easing: TWEEN.Easing,
369
358
  /**
370
359
  * Stop camera's animation
371
360
  *
@@ -425,7 +414,7 @@ var _default = {
425
414
  */
426
415
  getCameraTransformOptionsFromExtent(view, camera, extent) {
427
416
  const cameraTransformOptions = {
428
- coord: new _Coordinates.default(extent.crs, 0, 0, 0),
417
+ coord: new Coordinates(extent.crs, 0, 0, 0),
429
418
  heading: 0,
430
419
  tilt: view.isPlanarView ? 90 : 89.9
431
420
  };
@@ -562,5 +551,4 @@ var _default = {
562
551
  }
563
552
  return diff;
564
553
  }
565
- };
566
- exports.default = _default;
554
+ };
@@ -1,16 +1,6 @@
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
- exports.readTextureValueWithBilinearFiltering = readTextureValueWithBilinearFiltering;
9
- var THREE = _interopRequireWildcard(require("three"));
10
- var _Coordinates = _interopRequireDefault(require("../Core/Geographic/Coordinates"));
11
- var _placeObjectOnGround = _interopRequireDefault(require("./placeObjectOnGround"));
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 * as THREE from 'three';
2
+ import Coordinates from "../Core/Geographic/Coordinates.js";
3
+ import placeObjectOnGround from "./placeObjectOnGround.js";
14
4
  const FAST_READ_Z = 0;
15
5
  const PRECISE_READ_Z = 1;
16
6
 
@@ -22,7 +12,7 @@ const PRECISE_READ_Z = 1;
22
12
  *
23
13
  * @module DEMUtils
24
14
  */
25
- var _default = {
15
+ export default {
26
16
  /**
27
17
  * Gives the elevation value of a {@link TiledGeometryLayer}, at a specific
28
18
  * {@link Coordinates}.
@@ -95,9 +85,8 @@ var _default = {
95
85
  },
96
86
  FAST_READ_Z,
97
87
  PRECISE_READ_Z,
98
- placeObjectOnGround: _placeObjectOnGround.default
88
+ placeObjectOnGround
99
89
  };
100
- exports.default = _default;
101
90
  function tileAt(pt, tile) {
102
91
  if (tile.extent) {
103
92
  if (!tile.extent.isPointInside(pt)) {
@@ -212,7 +201,7 @@ function _lerpWithUndefinedCheck(x, y, t) {
212
201
  return THREE.MathUtils.lerp(x, y, t);
213
202
  }
214
203
  }
215
- function readTextureValueWithBilinearFiltering(metadata, texture, vertexU, vertexV) {
204
+ export function readTextureValueWithBilinearFiltering(metadata, texture, vertexU, vertexV) {
216
205
  const coords = _convertUVtoTextureCoords(texture, vertexU, vertexV);
217
206
  const [z11, z21, z12, z22] = _readTextureValueAt(metadata, texture, coords.u1, coords.v1, coords.u2, coords.v1, coords.u1, coords.v2, coords.u2, coords.v2);
218
207
 
@@ -282,8 +271,8 @@ function _readZCorrect(layer, texture, uv, tileDimensions, tileOwnerDimensions)
282
271
  }
283
272
  const temp = {
284
273
  v: new THREE.Vector3(),
285
- coord1: new _Coordinates.default('EPSG:4978'),
286
- coord2: new _Coordinates.default('EPSG:4978'),
274
+ coord1: new Coordinates('EPSG:4978'),
275
+ coord2: new Coordinates('EPSG:4978'),
287
276
  offset: new THREE.Vector2()
288
277
  };
289
278
  const dimension = new THREE.Vector2();
@@ -1,12 +1,5 @@
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 _Feature = require("../Core/Feature");
9
- var _Coordinates = _interopRequireDefault(require("../Core/Geographic/Coordinates"));
1
+ import { FEATURE_TYPES } from "../Core/Feature.js";
2
+ import Coordinates from "../Core/Geographic/Coordinates.js";
10
3
  function pointIsOverLine(point, linePoints, epsilon, offset, count, size) {
11
4
  const x0 = point.x;
12
5
  const y0 = point.y;
@@ -91,11 +84,11 @@ function pointIsInsidePolygon(point, polygonPoints, epsilon, offset, count, size
91
84
  return inside;
92
85
  }
93
86
  function isFeatureSingleGeometryUnderCoordinate(coordinate, type, coordinates, epsilon, offset, count, size) {
94
- if (type == _Feature.FEATURE_TYPES.LINE && pointIsOverLine(coordinate, coordinates, epsilon, offset, count, size)) {
87
+ if (type == FEATURE_TYPES.LINE && pointIsOverLine(coordinate, coordinates, epsilon, offset, count, size)) {
95
88
  return true;
96
- } else if (type == _Feature.FEATURE_TYPES.POLYGON && pointIsInsidePolygon(coordinate, coordinates, epsilon, offset, count, size)) {
89
+ } else if (type == FEATURE_TYPES.POLYGON && pointIsInsidePolygon(coordinate, coordinates, epsilon, offset, count, size)) {
97
90
  return true;
98
- } else if (type == _Feature.FEATURE_TYPES.POINT) {
91
+ } else if (type == FEATURE_TYPES.POINT) {
99
92
  const closestPoint = getClosestPoint(coordinate, coordinates, epsilon, offset, count, size);
100
93
  if (closestPoint) {
101
94
  return {
@@ -122,8 +115,8 @@ function isFeatureUnderCoordinate(coordinate, feature, epsilon, result) {
122
115
  }
123
116
  }
124
117
  }
125
- const coord = new _Coordinates.default('EPSG:4326', 0, 0, 0);
126
- var _default = {
118
+ const coord = new Coordinates('EPSG:4326', 0, 0, 0);
119
+ export default {
127
120
  /**
128
121
  * Filter from a list of features, features that are under a coordinate.
129
122
  *
@@ -160,5 +153,4 @@ var _default = {
160
153
  }
161
154
  return result;
162
155
  }
163
- };
164
- exports.default = _default;
156
+ };
@@ -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
- 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; }
10
- var _default = {
1
+ import * as THREE from 'three';
2
+ export default {
11
3
  // From chroma spectral http://gka.github.io/chroma.js/
12
4
  SPECTRAL: [[0, new THREE.Color(0.3686, 0.3098, 0.6353)], [0.1, new THREE.Color(0.1961, 0.5333, 0.7412)], [0.2, new THREE.Color(0.4000, 0.7608, 0.6471)], [0.3, new THREE.Color(0.6706, 0.8667, 0.6431)], [0.4, new THREE.Color(0.9020, 0.9608, 0.5961)], [0.5, new THREE.Color(1.0000, 1.0000, 0.7490)], [0.6, new THREE.Color(0.9961, 0.8784, 0.5451)], [0.7, new THREE.Color(0.9922, 0.6824, 0.3804)], [0.8, new THREE.Color(0.9569, 0.4275, 0.2627)], [0.9, new THREE.Color(0.8353, 0.2431, 0.3098)], [1, new THREE.Color(0.6196, 0.0039, 0.2588)]],
13
5
  PLASMA: [[0.0, new THREE.Color(0.241, 0.015, 0.610)], [0.1, new THREE.Color(0.387, 0.001, 0.654)], [0.2, new THREE.Color(0.524, 0.025, 0.653)], [0.3, new THREE.Color(0.651, 0.125, 0.596)], [0.4, new THREE.Color(0.752, 0.227, 0.513)], [0.5, new THREE.Color(0.837, 0.329, 0.431)], [0.6, new THREE.Color(0.907, 0.435, 0.353)], [0.7, new THREE.Color(0.963, 0.554, 0.272)], [0.8, new THREE.Color(0.992, 0.681, 0.195)], [0.9, new THREE.Color(0.987, 0.822, 0.144)], [1.0, new THREE.Color(0.940, 0.975, 0.131)]],
@@ -21,5 +13,4 @@ var _default = {
21
13
  TURBO: [[0.00, new THREE.Color(0.18995, 0.07176, 0.23217)], [0.07, new THREE.Color(0.25107, 0.25237, 0.63374)], [0.13, new THREE.Color(0.27628, 0.42118, 0.89123)], [0.20, new THREE.Color(0.25862, 0.57958, 0.99876)], [0.27, new THREE.Color(0.15844, 0.73551, 0.92305)], [0.33, new THREE.Color(0.09267, 0.86554, 0.7623)], [0.40, new THREE.Color(0.19659, 0.94901, 0.59466)], [0.47, new THREE.Color(0.42778, 0.99419, 0.38575)], [0.53, new THREE.Color(0.64362, 0.98999, 0.23356)], [0.60, new THREE.Color(0.80473, 0.92452, 0.20459)], [0.67, new THREE.Color(0.93301, 0.81236, 0.22667)], [0.73, new THREE.Color(0.99314, 0.67408, 0.20348)], [0.80, new THREE.Color(0.9836, 0.49291, 0.12849)], [0.87, new THREE.Color(0.92105, 0.31489, 0.05475)], [0.93, new THREE.Color(0.81608, 0.18462, 0.01809)], [1.00, new THREE.Color(0.66449, 0.08436, 0.00424)]],
22
14
  RAINBOW: [[0, new THREE.Color(0.278, 0, 0.714)], [1 / 6, new THREE.Color(0, 0, 1)], [2 / 6, new THREE.Color(0, 1, 1)], [3 / 6, new THREE.Color(0, 1, 0)], [4 / 6, new THREE.Color(1, 1, 0)], [5 / 6, new THREE.Color(1, 0.64, 0)], [1, new THREE.Color(1, 0, 0)]],
23
15
  CONTOUR: [[0.00, new THREE.Color(0, 0, 0)], [0.03, new THREE.Color(0, 0, 0)], [0.04, new THREE.Color(1, 1, 1)], [1.00, new THREE.Color(1, 1, 1)]]
24
- };
25
- exports.default = _default;
16
+ };
@@ -1,21 +1,12 @@
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 _proj = _interopRequireDefault(require("proj4"));
10
- var _Coordinates = _interopRequireDefault(require("../Core/Geographic/Coordinates"));
11
- 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); }
12
- 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 proj4 from 'proj4';
3
+ import Coordinates from "../Core/Geographic/Coordinates.js";
13
4
  const DEG2RAD = THREE.MathUtils.DEG2RAD;
14
5
  const matrix = new THREE.Matrix4();
15
6
  const north = new THREE.Vector3();
16
7
  const east = new THREE.Vector3();
17
8
  const axis = new THREE.Vector3().set(0, 0, 1);
18
- const coord = new _Coordinates.default('EPSG:4326', 0, 0, 0);
9
+ const coord = new Coordinates('EPSG:4326', 0, 0, 0);
19
10
  const euler = new THREE.Euler();
20
11
  const quat = new THREE.Quaternion();
21
12
  function quaternionIdentity(coordinates) {
@@ -44,7 +35,7 @@ function quaternionIdentity(coordinates) {
44
35
  *
45
36
  * @module OrientationUtils
46
37
  */
47
- var _default = {
38
+ export default {
48
39
  /**
49
40
  * @typedef {Object} Attitude
50
41
  * Properties are either defined as (omega, phi, kappa) or as (roll, pitch,
@@ -389,7 +380,7 @@ var _default = {
389
380
  if (coordinates) {
390
381
  return this.quaternionFromEnuToCRS(crsOrProj)(coordinates, target);
391
382
  }
392
- const proj = crsOrProj.projName ? crsOrProj : _proj.default.defs(crsOrProj);
383
+ const proj = crsOrProj.projName ? crsOrProj : proj4.defs(crsOrProj);
393
384
  switch (proj.projName) {
394
385
  case 'geocent':
395
386
  return this.quaternionFromEnuToGeocent();
@@ -420,7 +411,7 @@ var _default = {
420
411
  if (coordinates) {
421
412
  return this.quaternionFromCRSToEnu(crsOrProj)(coordinates, target);
422
413
  }
423
- const proj = crsOrProj.projName ? crsOrProj : _proj.default.defs(crsOrProj);
414
+ const proj = crsOrProj.projName ? crsOrProj : proj4.defs(crsOrProj);
424
415
  switch (proj.projName) {
425
416
  case 'geocent':
426
417
  return this.quaternionFromGeocentToEnu();
@@ -465,5 +456,4 @@ var _default = {
465
456
  return toCrs(origin, target).multiply(fromCrs(origin, quat));
466
457
  };
467
458
  }
468
- };
469
- exports.default = _default;
459
+ };
@@ -1,10 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = disposeThreeMaterial;
7
- exports.optimizeGeometryGroups = optimizeGeometryGroups;
8
1
  /**
9
2
  * Find threejs textures from a material
10
3
  * @param {Material} material the threejs material holding textures
@@ -57,7 +50,7 @@ function findTextures(material) {
57
50
  * won't be freed.
58
51
  * @param {Material} material the material to remove
59
52
  */
60
- function disposeThreeMaterial(material) {
53
+ export default function disposeThreeMaterial(material) {
61
54
  const textures = findTextures(material);
62
55
  // Remove material
63
56
  if (Array.isArray(material)) {
@@ -79,7 +72,7 @@ function disposeThreeMaterial(material) {
79
72
  *
80
73
  * @param {THREE.Object3D} object3D - object to get optimize
81
74
  */
82
- function optimizeGeometryGroups(object3D) {
75
+ export function optimizeGeometryGroups(object3D) {
83
76
  if (!object3D.geometry) {
84
77
  return;
85
78
  }
@@ -1,13 +1,6 @@
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 _Style = _interopRequireDefault(require("../../Core/Style"));
9
- var _C3DTilesLayer = require("../../Layer/C3DTilesLayer");
10
- var _Widget = _interopRequireDefault(require("./Widget"));
1
+ import Style from "../../Core/Style.js";
2
+ import { C3DTILES_LAYER_EVENTS } from "../../Layer/C3DTilesLayer.js";
3
+ import Widget from "./Widget.js";
11
4
  const DEFAULT_OPTIONS = {
12
5
  width: 200,
13
6
  position: 'top-right'
@@ -27,7 +20,7 @@ const DEFAULT_OPTIONS = {
27
20
  * @property {HTMLElement} domElement An html div containing the minimap.
28
21
  * @property {HTMLElement} parentElement The parent HTML container of `this.domElement`.
29
22
  */
30
- class C3DTilesStyle extends _Widget.default {
23
+ class C3DTilesStyle extends Widget {
31
24
  /**
32
25
  *
33
26
  * @param {View} view view
@@ -60,7 +53,7 @@ class C3DTilesStyle extends _Widget.default {
60
53
  selectOptionLayerContent.set(selectC3DTilesLayerOption, layerContent);
61
54
 
62
55
  // wait for C3DTileFeatures to load
63
- c3DTilesLayer.addEventListener(_C3DTilesLayer.C3DTILES_LAYER_EVENTS.ON_TILE_CONTENT_LOADED, () => {
56
+ c3DTilesLayer.addEventListener(C3DTILES_LAYER_EVENTS.ON_TILE_CONTENT_LOADED, () => {
64
57
  // reset
65
58
  while (layerContent.firstChild) {
66
59
  layerContent.firstChild.remove();
@@ -194,7 +187,7 @@ class C3DTilesStyle extends _Widget.default {
194
187
  }
195
188
 
196
189
  // set style
197
- c3DTilesLayer.style = new _Style.default({
190
+ c3DTilesLayer.style = new Style({
198
191
  fill: {
199
192
  color: c3DTileFeature => {
200
193
  let result = null;
@@ -220,5 +213,4 @@ class C3DTilesStyle extends _Widget.default {
220
213
  return 10;
221
214
  }
222
215
  }
223
- var _default = C3DTilesStyle;
224
- exports.default = _default;
216
+ export default C3DTilesStyle;
@@ -1,48 +1,7 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- Object.defineProperty(exports, "C3DTilesStyle", {
8
- enumerable: true,
9
- get: function () {
10
- return _C3DTilesStyle.default;
11
- }
12
- });
13
- Object.defineProperty(exports, "Minimap", {
14
- enumerable: true,
15
- get: function () {
16
- return _Minimap.default;
17
- }
18
- });
19
- Object.defineProperty(exports, "Navigation", {
20
- enumerable: true,
21
- get: function () {
22
- return _Navigation.default;
23
- }
24
- });
25
- Object.defineProperty(exports, "Scale", {
26
- enumerable: true,
27
- get: function () {
28
- return _Scale.default;
29
- }
30
- });
31
- Object.defineProperty(exports, "Searchbar", {
32
- enumerable: true,
33
- get: function () {
34
- return _Searchbar.default;
35
- }
36
- });
37
- Object.defineProperty(exports, "Widget", {
38
- enumerable: true,
39
- get: function () {
40
- return _Widget.default;
41
- }
42
- });
43
- var _Navigation = _interopRequireDefault(require("./Navigation"));
44
- var _Minimap = _interopRequireDefault(require("./Minimap"));
45
- var _Scale = _interopRequireDefault(require("./Scale"));
46
- var _Searchbar = _interopRequireDefault(require("./Searchbar"));
47
- var _Widget = _interopRequireDefault(require("./Widget"));
48
- var _C3DTilesStyle = _interopRequireDefault(require("./C3DTilesStyle"));
1
+ // eslint-disable-next-line import/prefer-default-export
2
+ export { default as Navigation } from "./Navigation.js";
3
+ export { default as Minimap } from "./Minimap.js";
4
+ export { default as Scale } from "./Scale.js";
5
+ export { default as Searchbar } from "./Searchbar.js";
6
+ export { default as Widget } from "./Widget.js";
7
+ export { default as C3DTilesStyle } from "./C3DTilesStyle.js";
@@ -1,15 +1,8 @@
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 _Coordinates = _interopRequireDefault(require("../../Core/Geographic/Coordinates"));
9
- var _MainLoop = require("../../Core/MainLoop");
10
- var _PlanarView = _interopRequireDefault(require("../../Core/Prefab/PlanarView"));
11
- var _Camera = require("../../Renderer/Camera");
12
- var _Widget = _interopRequireDefault(require("./Widget"));
1
+ import Coordinates from "../../Core/Geographic/Coordinates.js";
2
+ import { MAIN_LOOP_EVENTS } from "../../Core/MainLoop.js";
3
+ import PlanarView from "../../Core/Prefab/PlanarView.js";
4
+ import { CAMERA_TYPE } from "../../Renderer/Camera.js";
5
+ import Widget from "./Widget.js";
13
6
  const DEFAULT_OPTIONS = {
14
7
  minScale: 1 / 500000,
15
8
  maxScale: 1 / 5E8,
@@ -33,7 +26,7 @@ const DEFAULT_OPTIONS = {
33
26
  * @property {HTMLElement} domElement An html div containing the minimap.
34
27
  * @property {HTMLElement} parentElement The parent HTML container of `this.domElement`.
35
28
  */
36
- class Minimap extends _Widget.default {
29
+ class Minimap extends Widget {
37
30
  /**
38
31
  * @param {GlobeView} view The iTowns view the minimap should be
39
32
  * linked to. Only {@link GlobeView} is
@@ -111,9 +104,9 @@ class Minimap extends _Widget.default {
111
104
 
112
105
  // ---------- CREATE A MINIMAP View AND DISPLAY DATA PASSED IN Layer PARAMETER : ----------
113
106
 
114
- this.view = new _PlanarView.default(this.domElement, layer.source.extent, {
107
+ this.view = new PlanarView(this.domElement, layer.source.extent, {
115
108
  camera: {
116
- type: _Camera.CAMERA_TYPE.ORTHOGRAPHIC
109
+ type: CAMERA_TYPE.ORTHOGRAPHIC
117
110
  },
118
111
  placement: layer.source.extent,
119
112
  // TODO : the default placement should be the view extent for ortho camera
@@ -137,10 +130,10 @@ class Minimap extends _Widget.default {
137
130
  const maxZoom = this.view.camera3D.zoom * this.minScale / initialScale;
138
131
 
139
132
  // Coordinates used to transform position vectors from the main view CRS to the minimap view CRS.
140
- const mainViewCoordinates = new _Coordinates.default(view.referenceCrs);
141
- const viewCoordinates = new _Coordinates.default(this.view.referenceCrs);
133
+ const mainViewCoordinates = new Coordinates(view.referenceCrs);
134
+ const viewCoordinates = new Coordinates(this.view.referenceCrs);
142
135
  const targetPosition = view.controls.getCameraTargetPosition();
143
- view.addFrameRequester(_MainLoop.MAIN_LOOP_EVENTS.AFTER_RENDER, () => {
136
+ view.addFrameRequester(MAIN_LOOP_EVENTS.AFTER_RENDER, () => {
144
137
  // Update minimap camera zoom
145
138
  const distance = view.camera3D.position.distanceTo(targetPosition);
146
139
  const scale = view.getScaleFromDistance(options.pitch, distance);
@@ -158,5 +151,4 @@ class Minimap extends _Widget.default {
158
151
  });
159
152
  }
160
153
  }
161
- var _default = Minimap;
162
- exports.default = _default;
154
+ export default Minimap;
@@ -1,12 +1,5 @@
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 _View = require("../../Core/View");
9
- var _Widget = _interopRequireDefault(require("./Widget"));
1
+ import { VIEW_EVENTS } from "../../Core/View.js";
2
+ import Widget from "./Widget.js";
10
3
  const DEFAULT_OPTIONS = {
11
4
  displayCompass: true,
12
5
  display3DToggle: true,
@@ -73,7 +66,7 @@ const DEFAULT_BUTTONS = {
73
66
  * }
74
67
  * navigation.zoomIn.onclick = newMethod;
75
68
  */
76
- class Navigation extends _Widget.default {
69
+ class Navigation extends Widget {
77
70
  #_view;
78
71
  #_action(params) {
79
72
  params.time = this.animationDuration;
@@ -157,7 +150,7 @@ class Navigation extends _Widget.default {
157
150
  });
158
151
 
159
152
  // Manage compass rotation when the view's camera is moved.
160
- view.addEventListener(_View.VIEW_EVENTS.CAMERA_MOVED, event => {
153
+ view.addEventListener(VIEW_EVENTS.CAMERA_MOVED, event => {
161
154
  this.compass.style.transform = `rotate(${-event.heading}deg)`;
162
155
  });
163
156
  }
@@ -171,7 +164,7 @@ class Navigation extends _Widget.default {
171
164
  });
172
165
 
173
166
  // Manage button content toggle when the view's camera is moved.
174
- view.addEventListener(_View.VIEW_EVENTS.CAMERA_MOVED, event => {
167
+ view.addEventListener(VIEW_EVENTS.CAMERA_MOVED, event => {
175
168
  this.toggle3D.innerHTML = event.tilt < 89 ? '2D' : '3D';
176
169
  });
177
170
  }
@@ -249,5 +242,4 @@ class Navigation extends _Widget.default {
249
242
  return buttonBar;
250
243
  }
251
244
  }
252
- var _default = Navigation;
253
- exports.default = _default;
245
+ export default Navigation;