itowns 2.34.0 → 2.36.2

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 (68) hide show
  1. package/CONTRIBUTORS.md +1 -0
  2. package/changelog.md +150 -0
  3. package/dist/debug.js +2 -16
  4. package/dist/debug.js.LICENSE.txt +6 -0
  5. package/dist/debug.js.map +1 -1
  6. package/dist/itowns.js +2 -19
  7. package/dist/itowns.js.LICENSE.txt +28 -0
  8. package/dist/itowns.js.map +1 -1
  9. package/examples/3dtiles_basic.html +2 -2
  10. package/examples/config.json +2 -1
  11. package/examples/js/plugins/CSVnVRTParser.js +0 -1
  12. package/examples/layers/JSONLayers/Administrative.json +1 -1
  13. package/examples/layers/JSONLayers/Cada.json +1 -1
  14. package/examples/layers/JSONLayers/EtatMajor.json +1 -1
  15. package/examples/layers/JSONLayers/IGN_MNT.json +1 -1
  16. package/examples/layers/JSONLayers/IGN_MNT_HIGHRES.json +1 -1
  17. package/examples/layers/JSONLayers/Ortho.json +1 -1
  18. package/examples/layers/JSONLayers/WORLD_DTM.json +1 -1
  19. package/examples/misc_camera_traveling.html +148 -0
  20. package/examples/misc_custom_label.html +0 -2
  21. package/examples/plugins_vrt.html +0 -1
  22. package/examples/source_file_geojson_raster.html +0 -3
  23. package/examples/source_file_shapefile.html +0 -1
  24. package/examples/source_stream_wfs_25d.html +8 -16
  25. package/examples/vector_tile_raster_2d.html +2 -2
  26. package/examples/vector_tile_raster_3d.html +2 -2
  27. package/examples/view_25d_map.html +28 -0
  28. package/examples/view_multi_25d.html +1 -1
  29. package/lib/Controls/FirstPersonControls.js +12 -14
  30. package/lib/Controls/FlyControls.js +2 -10
  31. package/lib/Controls/GlobeControls.js +231 -303
  32. package/lib/Controls/PlanarControls.js +5 -16
  33. package/lib/Controls/StateControl.js +362 -96
  34. package/lib/Converter/Feature2Mesh.js +20 -5
  35. package/lib/Converter/Feature2Texture.js +2 -2
  36. package/lib/Converter/convertToTile.js +1 -1
  37. package/lib/Core/AnimationPlayer.js +15 -0
  38. package/lib/Core/Feature.js +39 -38
  39. package/lib/Core/Geographic/Coordinates.js +56 -0
  40. package/lib/Core/Geographic/Crs.js +15 -0
  41. package/lib/Core/Geographic/Extent.js +99 -11
  42. package/lib/Core/Label.js +1 -1
  43. package/lib/Core/Math/Ellipsoid.js +26 -8
  44. package/lib/Core/Prefab/Globe/BuilderEllipsoidTile.js +1 -1
  45. package/lib/Core/Prefab/PlanarView.js +1 -1
  46. package/lib/Core/Style.js +1 -0
  47. package/lib/Core/TileMesh.js +3 -2
  48. package/lib/Core/View.js +3 -3
  49. package/lib/Layer/ElevationLayer.js +9 -16
  50. package/lib/Layer/LabelLayer.js +7 -1
  51. package/lib/Main.js +1 -1
  52. package/lib/Parser/ShapefileParser.js +1 -2
  53. package/lib/Parser/VectorTileParser.js +1 -1
  54. package/lib/Process/3dTilesProcessing.js +8 -8
  55. package/lib/Process/FeatureProcessing.js +1 -2
  56. package/lib/Process/ObjectRemovalHelper.js +5 -2
  57. package/lib/Renderer/Label2DRenderer.js +15 -11
  58. package/lib/Renderer/LayeredMaterial.js +2 -1
  59. package/lib/Renderer/OBB.js +2 -2
  60. package/lib/Renderer/RasterTile.js +22 -4
  61. package/lib/Renderer/Shader/ShaderChunk.js +3 -3
  62. package/lib/Renderer/c3DEngine.js +14 -2
  63. package/lib/Source/FileSource.js +2 -7
  64. package/lib/Source/VectorTilesSource.js +19 -0
  65. package/lib/ThreeExtended/loaders/GLTFLoader.js +320 -76
  66. package/lib/Utils/CameraUtils.js +8 -8
  67. package/lib/Utils/DEMUtils.js +2 -2
  68. package/package.json +29 -29
@@ -143,7 +143,7 @@ var CameraRig = /*#__PURE__*/function (_THREE$Object3D) {
143
143
 
144
144
  _this.seaLevel.add(_this.target);
145
145
 
146
- _this.target.add(_this.camera); // sea level's geograohic coordinate
146
+ _this.target.add(_this.camera); // target's geographic coordinate
147
147
 
148
148
 
149
149
  _this.coord = new _Coordinates["default"]('EPSG:4978', 0, 0); // sea level's worldPoistion
@@ -216,9 +216,9 @@ var CameraRig = /*#__PURE__*/function (_THREE$Object3D) {
216
216
  }, {
217
217
  key: "setTargetFromCoordinate",
218
218
  value: function setTargetFromCoordinate(view, coord) {
219
- // clamp altitude to seaLevel
219
+ // compute precise coordinate (coord) altitude and clamp it above seaLevel
220
220
  coord.as(tileLayer(view).extent.crs, this.coord);
221
- var altitude = Math.max(0, this.coord.z);
221
+ var altitude = Math.max(0, _DEMUtils["default"].getElevationValueAt(tileLayer(view), this.coord, _DEMUtils["default"].PRECISE_READ_Z) || this.coord.z);
222
222
  this.coord.z = altitude; // adjust target's position with clamped altitude
223
223
 
224
224
  this.coord.as(view.referenceCrs).toVector3(targetPosition);
@@ -482,7 +482,7 @@ var _default = {
482
482
  * @property {boolean} [proxy=true] use proxy to handling camera's transformation. if proxy == true, other camera's transformation stops rig's transformation
483
483
  * @property {Number} [easing=TWEEN.Easing.Quartic.InOut] in and out easing animation
484
484
  * @property {function} [callback] callback call each animation's frame (params are current cameraTransform and worldTargetPosition)
485
- * @property {boolean} [stopPlaceOnGroundAtEnd=defaultStopPlaceOnGroundAtEnd] stop place target on the ground at animation ending
485
+ * @property {boolean} [stopPlaceOnGroundAtEnd=false] stop place target on the ground at animation ending
486
486
  */
487
487
 
488
488
  /**
@@ -577,7 +577,7 @@ var _default = {
577
577
  };
578
578
  } else {
579
579
  extent = extent.as(view.referenceCrs);
580
- dimensions = extent.dimensions();
580
+ dimensions = extent.planarDimensions();
581
581
  }
582
582
 
583
583
  extent.center(cameraTransformOptions.coord);
@@ -630,15 +630,15 @@ var _default = {
630
630
  }
631
631
 
632
632
  return rig.animateCameraToLookAtTarget(view, camera, params).promise.then(function (finished) {
633
- var params = rig.getParams();
634
633
  var stopPlaceOnGround = params.stopPlaceOnGroundAtEnd === undefined ? _this7.defaultStopPlaceOnGroundAtEnd : params.stopPlaceOnGroundAtEnd;
634
+ var newTransformation = rig.getParams();
635
635
 
636
636
  if (stopPlaceOnGround) {
637
637
  rig.stop(view);
638
638
  }
639
639
 
640
- params.finished = finished;
641
- return params;
640
+ newTransformation.finished = finished;
641
+ return newTransformation;
642
642
  });
643
643
  },
644
644
 
@@ -345,7 +345,7 @@ function offsetInExtent(point, extent) {
345
345
  throw new Error("Unsupported mix: ".concat(point.crs, " and ").concat(extent.crs));
346
346
  }
347
347
 
348
- extent.dimensions(dimension);
348
+ extent.planarDimensions(dimension);
349
349
  var originX = (point.x - extent.west) / dimension.x;
350
350
  var originY = (extent.north - point.y) / dimension.y;
351
351
  return target.set(originX, originY);
@@ -402,7 +402,7 @@ function _readZ(layer, method, coord, nodes, cache) {
402
402
  // - the correct one: emulate the vertex shader code
403
403
 
404
404
  if (method == PRECISE_READ_Z) {
405
- pt.z = _readZCorrect(layer, src, temp.offset, tile.extent.dimensions(), tileWithValidElevationTexture.extent.dimensions());
405
+ pt.z = _readZCorrect(layer, src, temp.offset, tile.extent.planarDimensions(), tileWithValidElevationTexture.extent.planarDimensions());
406
406
  } else {
407
407
  pt.z = _readZFast(layer, src, temp.offset);
408
408
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itowns",
3
- "version": "2.34.0",
3
+ "version": "2.36.2",
4
4
  "description": "A JS/WebGL framework for 3D geospatial data visualization",
5
5
  "main": "lib/Main.js",
6
6
  "scripts": {
@@ -15,8 +15,8 @@
15
15
  "base-test-unit": "cross-env BABEL_DISABLE_CACHE=1 mocha --require @babel/register --file test/unit/bootstrap.js",
16
16
  "build": "cross-env NODE_ENV=production webpack",
17
17
  "transpile": "cross-env BABEL_DISABLE_CACHE=1 babel src --out-dir lib",
18
- "start": "cross-env NODE_ENV=development webpack-dev-server -d --inline --hot",
19
- "debug": "npm start -- --env.noInline=true",
18
+ "start": "cross-env NODE_ENV=development webpack serve",
19
+ "debug": "cross-env noInline=true npm start",
20
20
  "prepublishOnly": "npm run build && npm run transpile",
21
21
  "prepare": "cross-env NO_UPDATE_NOTIFIER=true node ./config/prepare.js && node ./config/replace.config.js",
22
22
  "watch": "cross-env BABEL_DISABLE_CACHE=1 babel --watch src --out-dir lib",
@@ -47,63 +47,63 @@
47
47
  },
48
48
  "homepage": "https://itowns.github.io/",
49
49
  "dependencies": {
50
- "@loaders.gl/las": "^2.3.13",
51
- "@mapbox/mapbox-gl-style-spec": "^13.20.0",
50
+ "@loaders.gl/las": "^3.0.12",
51
+ "@mapbox/mapbox-gl-style-spec": "^13.22.0",
52
52
  "@mapbox/vector-tile": "^1.3.1",
53
- "@tmcw/togeojson": "^4.4.1",
53
+ "@tmcw/togeojson": "^4.5.0",
54
54
  "@tweenjs/tween.js": "^18.6.4",
55
- "earcut": "^2.2.2",
55
+ "earcut": "^2.2.3",
56
56
  "js-priority-queue": "^0.1.5",
57
57
  "pbf": "^3.2.1",
58
- "regenerator-runtime": "^0.13.7",
59
- "shpjs": "^3.6.3",
58
+ "regenerator-runtime": "^0.13.9",
59
+ "shpjs": "^4.0.2",
60
60
  "text-encoding-utf-8": "^1.0.2"
61
61
  },
62
62
  "peerDependencies": {
63
- "proj4": "^2.7.2",
64
- "three": "0.129.0"
63
+ "proj4": "^2.7.5",
64
+ "three": "0.133.1"
65
65
  },
66
66
  "devDependencies": {
67
- "@babel/cli": "^7.14.3",
68
- "@babel/plugin-transform-runtime": "^7.14.3",
69
- "@babel/preset-env": "^7.14.2",
70
- "@babel/register": "^7.13.16",
67
+ "@babel/cli": "^7.15.7",
68
+ "@babel/plugin-transform-runtime": "^7.15.8",
69
+ "@babel/preset-env": "^7.15.8",
70
+ "@babel/register": "^7.15.3",
71
71
  "babel-inline-import-loader": "^1.0.1",
72
72
  "babel-loader": "^8.2.2",
73
73
  "babel-plugin-inline-import": "^3.0.0",
74
74
  "babel-plugin-minify-dead-code-elimination": "^0.5.1",
75
75
  "babel-plugin-minify-replace": "^0.5.0",
76
76
  "babel-plugin-module-resolver": "^4.1.0",
77
- "chalk": "^4.1.1",
78
- "chart.js": "^3.3.0",
77
+ "chalk": "^4.1.2",
78
+ "chart.js": "^3.5.1",
79
79
  "compare-func": "^2.0.0",
80
80
  "conventional-changelog-cli": "^2.1.1",
81
81
  "copyfiles": "^2.4.1",
82
- "core-js": "^3.13.0",
82
+ "core-js": "^3.18.3",
83
83
  "cross-env": "^7.0.3",
84
- "eslint": "^7.27.0",
84
+ "eslint": "^7.32.0",
85
85
  "eslint-config-airbnb-base": "^14.2.1",
86
86
  "eslint-import-resolver-webpack": "^0.13.1",
87
87
  "eslint-loader": "^4.0.2",
88
- "eslint-plugin-import": "^2.23.3",
88
+ "eslint-plugin-import": "^2.25.2",
89
89
  "github-url-from-git": "^1.5.0",
90
90
  "grunt": "^1.4.1",
91
91
  "grunt-bump": "^0.8.0",
92
92
  "https-proxy-agent": "^5.0.0",
93
93
  "jsdoc": "^3.6.7",
94
- "marked": "^2.0.6",
95
- "mocha": "^8.4.0",
96
- "node-fetch": "^2.6.1",
94
+ "marked": "^3.0.7",
95
+ "mocha": "^9.1.2",
96
+ "node-fetch": "^2.6.2",
97
97
  "nyc": "^15.1.0",
98
- "proj4": "^2.7.2",
99
- "puppeteer": "^9.1.1",
98
+ "proj4": "^2.7.5",
99
+ "puppeteer": "^10.4.0",
100
100
  "q": "^1.5.1",
101
101
  "replace-in-file": "^6.2.0",
102
- "three": "0.129.0",
102
+ "three": "0.133.1",
103
103
  "url-polyfill": "^1.1.12",
104
- "webpack": "^4.46.0",
105
- "webpack-cli": "^3.3.12",
106
- "webpack-dev-server": "^3.11.2",
104
+ "webpack": "^5.58.1",
105
+ "webpack-cli": "^4.9.0",
106
+ "webpack-dev-server": "^4.3.1",
107
107
  "whatwg-fetch": "^3.6.2"
108
108
  }
109
109
  }