itowns 2.44.3-next.9 → 2.45.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 (214) hide show
  1. package/README.md +3 -129
  2. package/examples/3dtiles_loader.html +20 -6
  3. package/examples/config.json +1 -0
  4. package/examples/copc_simple_loader.html +15 -5
  5. package/examples/effects_stereo.html +2 -2
  6. package/examples/entwine_3d_loader.html +3 -1
  7. package/examples/entwine_simple_loader.html +1 -1
  8. package/examples/images/itowns_logo.svg +123 -0
  9. package/examples/js/plugins/COGParser.js +1 -1
  10. package/examples/jsm/OGC3DTilesHelper.js +6 -1
  11. package/examples/layers/JSONLayers/GeoidMNT.json +3 -1
  12. package/examples/misc_collada.html +2 -2
  13. package/examples/source_file_geojson_3d.html +0 -1
  14. package/examples/source_file_kml_raster_usgs.html +0 -1
  15. package/examples/source_stream_wfs_raster.html +0 -7
  16. package/examples/vector_tile_mapbox_raster.html +91 -0
  17. package/examples/view_3d_map_webxr.html +3 -1
  18. package/examples/view_multi_25d.html +2 -2
  19. package/package.json +21 -75
  20. package/CODING.md +0 -120
  21. package/CONTRIBUTING.md +0 -150
  22. package/CONTRIBUTORS.md +0 -55
  23. package/LICENSE.md +0 -44
  24. package/changelog.md +0 -1361
  25. package/dist/455.js +0 -2
  26. package/dist/455.js.map +0 -1
  27. package/dist/debug.js +0 -3
  28. package/dist/debug.js.LICENSE.txt +0 -13
  29. package/dist/debug.js.map +0 -1
  30. package/dist/itowns.js +0 -3
  31. package/dist/itowns.js.LICENSE.txt +0 -7
  32. package/dist/itowns.js.map +0 -1
  33. package/dist/itowns_lasparser.js +0 -2
  34. package/dist/itowns_lasparser.js.map +0 -1
  35. package/dist/itowns_lasworker.js +0 -2
  36. package/dist/itowns_lasworker.js.map +0 -1
  37. package/dist/itowns_potree2worker.js +0 -2
  38. package/dist/itowns_potree2worker.js.map +0 -1
  39. package/dist/itowns_widgets.js +0 -2
  40. package/dist/itowns_widgets.js.map +0 -1
  41. package/examples/.eslintrc.cjs +0 -35
  42. package/examples/jsm/.eslintrc.cjs +0 -38
  43. package/lib/Controls/FirstPersonControls.js +0 -308
  44. package/lib/Controls/FlyControls.js +0 -175
  45. package/lib/Controls/GlobeControls.js +0 -1162
  46. package/lib/Controls/PlanarControls.js +0 -1025
  47. package/lib/Controls/StateControl.js +0 -429
  48. package/lib/Controls/StreetControls.js +0 -392
  49. package/lib/Converter/Feature2Mesh.js +0 -615
  50. package/lib/Converter/Feature2Texture.js +0 -170
  51. package/lib/Converter/convertToTile.js +0 -75
  52. package/lib/Converter/textureConverter.js +0 -44
  53. package/lib/Core/3DTiles/C3DTBatchTable.js +0 -131
  54. package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.js +0 -96
  55. package/lib/Core/3DTiles/C3DTBoundingVolume.js +0 -157
  56. package/lib/Core/3DTiles/C3DTExtensions.js +0 -97
  57. package/lib/Core/3DTiles/C3DTFeature.js +0 -110
  58. package/lib/Core/3DTiles/C3DTilesEnums.js +0 -20
  59. package/lib/Core/3DTiles/C3DTileset.js +0 -99
  60. package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.js +0 -100
  61. package/lib/Core/AnimationPlayer.js +0 -142
  62. package/lib/Core/CopcNode.js +0 -174
  63. package/lib/Core/Deprecated/Undeprecator.js +0 -75
  64. package/lib/Core/EntwinePointTileNode.js +0 -126
  65. package/lib/Core/Feature.js +0 -490
  66. package/lib/Core/Geographic/CoordStars.js +0 -80
  67. package/lib/Core/Geographic/Coordinates.js +0 -320
  68. package/lib/Core/Geographic/Crs.js +0 -175
  69. package/lib/Core/Geographic/Extent.js +0 -534
  70. package/lib/Core/Geographic/GeoidGrid.js +0 -109
  71. package/lib/Core/Label.js +0 -222
  72. package/lib/Core/MainLoop.js +0 -211
  73. package/lib/Core/Math/Ellipsoid.js +0 -144
  74. package/lib/Core/Picking.js +0 -255
  75. package/lib/Core/PointCloudNode.js +0 -42
  76. package/lib/Core/Potree2Node.js +0 -206
  77. package/lib/Core/Potree2PointAttributes.js +0 -139
  78. package/lib/Core/PotreeNode.js +0 -101
  79. package/lib/Core/Prefab/Globe/Atmosphere.js +0 -299
  80. package/lib/Core/Prefab/Globe/BuilderEllipsoidTile.js +0 -110
  81. package/lib/Core/Prefab/Globe/GlobeLayer.js +0 -145
  82. package/lib/Core/Prefab/Globe/SkyShader.js +0 -78
  83. package/lib/Core/Prefab/GlobeView.js +0 -161
  84. package/lib/Core/Prefab/Planar/PlanarLayer.js +0 -53
  85. package/lib/Core/Prefab/Planar/PlanarTileBuilder.js +0 -72
  86. package/lib/Core/Prefab/PlanarView.js +0 -62
  87. package/lib/Core/Prefab/TileBuilder.js +0 -80
  88. package/lib/Core/Prefab/computeBufferTileGeometry.js +0 -183
  89. package/lib/Core/Scheduler/Cache.js +0 -256
  90. package/lib/Core/Scheduler/CancelledCommandException.js +0 -15
  91. package/lib/Core/Scheduler/Scheduler.js +0 -294
  92. package/lib/Core/Style.js +0 -1121
  93. package/lib/Core/System/Capabilities.js +0 -63
  94. package/lib/Core/Tile/Tile.js +0 -219
  95. package/lib/Core/Tile/TileGrid.js +0 -46
  96. package/lib/Core/TileGeometry.js +0 -40
  97. package/lib/Core/TileMesh.js +0 -109
  98. package/lib/Core/View.js +0 -1109
  99. package/lib/Layer/C3DTilesLayer.js +0 -456
  100. package/lib/Layer/ColorLayer.js +0 -128
  101. package/lib/Layer/CopcLayer.js +0 -58
  102. package/lib/Layer/ElevationLayer.js +0 -107
  103. package/lib/Layer/EntwinePointTileLayer.js +0 -64
  104. package/lib/Layer/FeatureGeometryLayer.js +0 -63
  105. package/lib/Layer/GeoidLayer.js +0 -80
  106. package/lib/Layer/GeometryLayer.js +0 -202
  107. package/lib/Layer/InfoLayer.js +0 -64
  108. package/lib/Layer/LabelLayer.js +0 -456
  109. package/lib/Layer/Layer.js +0 -304
  110. package/lib/Layer/LayerUpdateState.js +0 -89
  111. package/lib/Layer/LayerUpdateStrategy.js +0 -80
  112. package/lib/Layer/OGC3DTilesLayer.js +0 -412
  113. package/lib/Layer/OrientedImageLayer.js +0 -222
  114. package/lib/Layer/PointCloudLayer.js +0 -359
  115. package/lib/Layer/Potree2Layer.js +0 -164
  116. package/lib/Layer/PotreeLayer.js +0 -65
  117. package/lib/Layer/RasterLayer.js +0 -27
  118. package/lib/Layer/ReferencingLayerProperties.js +0 -62
  119. package/lib/Layer/TiledGeometryLayer.js +0 -403
  120. package/lib/Loader/LASLoader.js +0 -193
  121. package/lib/Loader/Potree2BrotliLoader.js +0 -261
  122. package/lib/Loader/Potree2Loader.js +0 -207
  123. package/lib/Main.js +0 -115
  124. package/lib/MainBundle.js +0 -4
  125. package/lib/Parser/B3dmParser.js +0 -174
  126. package/lib/Parser/CameraCalibrationParser.js +0 -94
  127. package/lib/Parser/GDFParser.js +0 -72
  128. package/lib/Parser/GTXParser.js +0 -75
  129. package/lib/Parser/GeoJsonParser.js +0 -212
  130. package/lib/Parser/GpxParser.js +0 -25
  131. package/lib/Parser/ISGParser.js +0 -71
  132. package/lib/Parser/KMLParser.js +0 -25
  133. package/lib/Parser/LASParser.js +0 -137
  134. package/lib/Parser/MapBoxUrlParser.js +0 -83
  135. package/lib/Parser/PntsParser.js +0 -131
  136. package/lib/Parser/Potree2BinParser.js +0 -92
  137. package/lib/Parser/PotreeBinParser.js +0 -106
  138. package/lib/Parser/PotreeCinParser.js +0 -29
  139. package/lib/Parser/ShapefileParser.js +0 -78
  140. package/lib/Parser/VectorTileParser.js +0 -202
  141. package/lib/Parser/XbilParser.js +0 -119
  142. package/lib/Parser/deprecated/LegacyGLTFLoader.js +0 -1386
  143. package/lib/Parser/iGLTFLoader.js +0 -168
  144. package/lib/Process/3dTilesProcessing.js +0 -304
  145. package/lib/Process/FeatureProcessing.js +0 -76
  146. package/lib/Process/LayeredMaterialNodeProcessing.js +0 -221
  147. package/lib/Process/ObjectRemovalHelper.js +0 -97
  148. package/lib/Process/handlerNodeError.js +0 -23
  149. package/lib/Provider/3dTilesProvider.js +0 -149
  150. package/lib/Provider/DataSourceProvider.js +0 -8
  151. package/lib/Provider/Fetcher.js +0 -229
  152. package/lib/Provider/PointCloudProvider.js +0 -45
  153. package/lib/Provider/TileProvider.js +0 -16
  154. package/lib/Provider/URLBuilder.js +0 -116
  155. package/lib/Renderer/Camera.js +0 -281
  156. package/lib/Renderer/Color.js +0 -56
  157. package/lib/Renderer/ColorLayersOrdering.js +0 -115
  158. package/lib/Renderer/CommonMaterial.js +0 -31
  159. package/lib/Renderer/Label2DRenderer.js +0 -190
  160. package/lib/Renderer/LayeredMaterial.js +0 -243
  161. package/lib/Renderer/OBB.js +0 -153
  162. package/lib/Renderer/OrientedImageCamera.js +0 -118
  163. package/lib/Renderer/OrientedImageMaterial.js +0 -167
  164. package/lib/Renderer/PointsMaterial.js +0 -485
  165. package/lib/Renderer/RasterTile.js +0 -209
  166. package/lib/Renderer/RenderMode.js +0 -31
  167. package/lib/Renderer/Shader/ShaderChunk.js +0 -160
  168. package/lib/Renderer/Shader/ShaderUtils.js +0 -47
  169. package/lib/Renderer/SphereHelper.js +0 -23
  170. package/lib/Renderer/WebXR.js +0 -51
  171. package/lib/Renderer/c3DEngine.js +0 -214
  172. package/lib/Source/C3DTilesGoogleSource.js +0 -74
  173. package/lib/Source/C3DTilesIonSource.js +0 -54
  174. package/lib/Source/C3DTilesSource.js +0 -30
  175. package/lib/Source/CopcSource.js +0 -115
  176. package/lib/Source/EntwinePointTileSource.js +0 -62
  177. package/lib/Source/FileSource.js +0 -189
  178. package/lib/Source/OGC3DTilesGoogleSource.js +0 -29
  179. package/lib/Source/OGC3DTilesIonSource.js +0 -34
  180. package/lib/Source/OGC3DTilesSource.js +0 -21
  181. package/lib/Source/OrientedImageSource.js +0 -59
  182. package/lib/Source/Potree2Source.js +0 -167
  183. package/lib/Source/PotreeSource.js +0 -82
  184. package/lib/Source/Source.js +0 -223
  185. package/lib/Source/TMSSource.js +0 -145
  186. package/lib/Source/VectorTilesSource.js +0 -178
  187. package/lib/Source/WFSSource.js +0 -168
  188. package/lib/Source/WMSSource.js +0 -133
  189. package/lib/Source/WMTSSource.js +0 -86
  190. package/lib/ThreeExtended/capabilities/WebGL.js +0 -69
  191. package/lib/ThreeExtended/libs/ktx-parse.module.js +0 -470
  192. package/lib/ThreeExtended/libs/zstddec.module.js +0 -29
  193. package/lib/ThreeExtended/loaders/DDSLoader.js +0 -200
  194. package/lib/ThreeExtended/loaders/DRACOLoader.js +0 -399
  195. package/lib/ThreeExtended/loaders/GLTFLoader.js +0 -2876
  196. package/lib/ThreeExtended/loaders/KTX2Loader.js +0 -625
  197. package/lib/ThreeExtended/utils/BufferGeometryUtils.js +0 -846
  198. package/lib/ThreeExtended/utils/WorkerPool.js +0 -70
  199. package/lib/Utils/CameraUtils.js +0 -555
  200. package/lib/Utils/DEMUtils.js +0 -350
  201. package/lib/Utils/FeaturesUtils.js +0 -156
  202. package/lib/Utils/Gradients.js +0 -16
  203. package/lib/Utils/OrientationUtils.js +0 -457
  204. package/lib/Utils/ThreeUtils.js +0 -115
  205. package/lib/Utils/gui/C3DTilesStyle.js +0 -215
  206. package/lib/Utils/gui/Main.js +0 -7
  207. package/lib/Utils/gui/Minimap.js +0 -154
  208. package/lib/Utils/gui/Navigation.js +0 -245
  209. package/lib/Utils/gui/Scale.js +0 -107
  210. package/lib/Utils/gui/Searchbar.js +0 -234
  211. package/lib/Utils/gui/Widget.js +0 -80
  212. package/lib/Utils/placeObjectOnGround.js +0 -137
  213. package/lib/Worker/LASLoaderWorker.js +0 -19
  214. package/lib/Worker/Potree2Worker.js +0 -21
package/README.md CHANGED
@@ -1,131 +1,5 @@
1
- ![iTowns](https://raw.githubusercontent.com/iTowns/itowns.github.io/master/images/itowns_logo_300x134.png)
2
- # iTowns
3
-
4
- [![Coverage Status](https://coveralls.io/repos/github/iTowns/itowns/badge.svg?branch=master)](https://coveralls.io/github/iTowns/itowns?branch=master)
5
- [![example branch parameter](https://github.com/iTowns/itowns/actions/workflows/integration.yml/badge.svg?query=branch%3Amaster)](https://github.com/iTowns/itowns/actions/workflows/integration.yml?query=branch%3Amaster)
6
- [![DeepScan grade](https://deepscan.io/api/teams/2856/projects/10991/branches/159107/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=2856&pid=10991&bid=159107)
7
-
8
1
  ## What is it?
9
2
 
10
- iTowns is a [Three.js](https://threejs.org/)-based framework written in
11
- Javascript/WebGL for visualizing 3D geospatial data.
12
-
13
- It can connect to WMS/WMTS/TMS servers including elevation data and load many
14
- different data formats (3dTiles, GeoJSON, Vector Tiles, GPX and much more). A
15
- complete list of features and supported data formats is [available on the
16
- wiki](https://github.com/iTowns/itowns/wiki/Supported-Features).
17
-
18
- It officially targets the last two major versions of both Firefox, Safari and
19
- Chromium-based browsers (Chrome, Edge, ...) at the date of each release. Older
20
- browsers supporting WebGL 2.0 may work but we do not offer support.
21
-
22
- ![iTowns screenshot](https://raw.githubusercontent.com/iTowns/itowns.github.io/master/images/itownsReleaseXS.jpg)
23
-
24
- ## Documentation and examples
25
-
26
- The official documentation is [available
27
- here](http://www.itowns-project.org/itowns/docs/). It contains tutorials to help
28
- you start using iTowns, and an API reference. You can find more informations on
29
- its contribution [here](docs/README.md).
30
-
31
- Official examples can be [viewed
32
- here](http://www.itowns-project.org/itowns/examples/). Some examples available:
33
-
34
- * [Globe with WFS data](http://www.itowns-project.org/itowns/examples/#source_stream_wfs_3d)
35
- * [Plane mode with Vector Tiles](http://www.itowns-project.org/itowns/examples/#vector_tile_raster_2d)
36
- * [3D effect using scene postprocessing](http://www.itowns-project.org/itowns/examples/#effects_stereo)
37
- * [Globe with split rendering](http://www.itowns-project.org/itowns/examples/#effects_split)
38
-
39
- [![iTowns examples](http://www.itowns-project.org/images/montage.jpg)](http://www.itowns-project.org/itowns/examples/)
40
-
41
- ## How to run it locally?
42
-
43
- Clone the repo and then run:
44
-
45
- ```
46
- npm install
47
- npm start
48
- ```
49
-
50
- Try out the examples at http://localhost:8080/examples
51
-
52
- ## How to use it in your project?
53
-
54
- You can use it through npm (the preferred way) or download a bundle from our
55
- github release page.
56
-
57
- ### With npm
58
-
59
- In your project:
60
-
61
- ```bash
62
- npm install --save itowns
63
- ```
64
-
65
- This package contains the ES5-compatible sources of iTowns, up to date with the latest release.
66
-
67
- If you're using a module bundler (like wepback), you can directly write
68
- `require('itowns')` in your code.
69
-
70
- Alternatively, we provide a bundle you can directly include in your html files
71
- that exposes `itowns` in `window`:
72
-
73
- ```html
74
- <script src="node_modules/itowns/dist/itowns.js"></script>
75
- ```
76
-
77
- **/!\ Please note that this bundle also contains the dependencies**.
78
-
79
- ### From a release bundle
80
-
81
- See our [release page](https://github.com/iTowns/itowns/releases). Note that
82
- there isn't a lot of support for older version of iTowns, we highly recommend to
83
- use the last release everytime.
84
-
85
- ### Try modifications before they are released
86
-
87
- If you want to try some features or bug fixes that are planned for the next release, we provide
88
- a @next version of itowns. You can install it as such :
89
-
90
- ```bash
91
- npm install --save itowns@next
92
- ```
93
-
94
- To switch back to the version to date with the latest release, you need to run :
95
-
96
- ```bash
97
- npm install --save itowns@latest
98
- ```
99
-
100
- ## Contributing
101
-
102
- If you are interested in contributing to iTowns, please read the [CONTRIBUTING
103
- guide](CONTRIBUTING.md) and the [CODING guide](CODING.md).
104
-
105
- iTowns has been redesigned from this [early version](https://github.com/iTowns/itowns-legacy).
106
-
107
- ## Licence
108
-
109
- iTowns is dual-licenced under Cecill-B V1.0 and MIT.
110
- Incorporated libraries are published under their original licences.
111
-
112
- See [LICENSE.md](LICENSE.md) for more information.
113
-
114
- ## Maintainers
115
-
116
- iTowns is an original work from French IGN, [MATIS research
117
- laboratory](http://recherche.ign.fr/labos/matis/). It has been funded through
118
- various research programs involving the French National Research Agency, Cap
119
- Digital, UPMC, Mines ParisTec, CNRS, LCPC and maintained by several organizations
120
- along the years (IGN, Oslandia, AtolCD, CIRIL Group). It has also received contributions from people [listed
121
- here](CONTRIBUTORS.md).
122
-
123
- iTowns is currently maintained by [IGN](http://www.ign.fr) and
124
- [CIRIL Group](https://www.cirilgroup.com/en/).
125
-
126
- Contributions in any forms and new contributors and maintainers are welcome. Get in touch with us if you are interested :)
127
-
128
- The governance of the project is open and explicited [here](https://github.com/iTowns/itowns-governance).
129
-
130
- [![IGN](./img/logo_ign.png)](https://www.ign.fr)
131
- [![CIRIL Group](./img/CIRIL_Group_logo.png)](https://www.cirilgroup.com/en/)
3
+ This itowns module acts as a central point of access, allowing users to leverage the complete range of features offered by the @itowns submodules without needing to import or manage them individually.
4
+ Refer to [README main](https://raw.githubusercontent.com/iTowns/itowns.github.io/master/README.md) for more information.
5
+ The official documentation is [available here](http://www.itowns-project.org/itowns/docs/)
@@ -50,14 +50,19 @@
50
50
  <script type="importmap">
51
51
  {
52
52
  "imports": {
53
- "three": "https://cdn.jsdelivr.net/npm/three@0.165.0/build/three.module.js",
54
- "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.165.0/examples/jsm/"
53
+ "three": "https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js",
54
+ "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"
55
55
  }
56
56
  }
57
- </script>
57
+ </script>
58
58
 
59
59
  <script type="module">
60
- import { AmbientLight } from 'three';
60
+ import {
61
+ AmbientLight,
62
+ PMREMGenerator,
63
+ } from 'three';
64
+ import { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js';
65
+ import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';
61
66
  import {
62
67
  zoomToLayer,
63
68
  fillHTMLWithPickingInfo,
@@ -95,14 +100,23 @@
95
100
 
96
101
  // Enable various compression support for 3D Tiles tileset:
97
102
  // - `KHR_draco_mesh_compression` mesh compression extension
98
- // - `KHR_texture_basisu` texture compresion extension
103
+ // - `KHR_texture_basisu` texture compression extension
104
+ // - `EXT_meshopt_compression` data compression extension
99
105
  itowns.enableDracoLoader('./libs/draco/');
100
106
  itowns.enableKtx2Loader('./lib/basis/', view.renderer);
107
+ itowns.enableMeshoptDecoder(MeshoptDecoder);
101
108
 
102
109
  // Add ambient light to globally illuminates all objects
103
- const light = new AmbientLight(0x404040, 15);
110
+ const light = new AmbientLight(0x404040, 40);
104
111
  view.scene.add(light);
105
112
 
113
+ // Set the environment map for all physical materials in the scene.
114
+ // Otherwise, mesh with only diffuse colors will appear black.
115
+ const environment = new RoomEnvironment();
116
+ const pmremGenerator = new PMREMGenerator(view.renderer);
117
+ view.scene.environment = pmremGenerator.fromScene(environment).texture;
118
+ pmremGenerator.dispose();
119
+
106
120
  // Setup loading screen
107
121
  setupLoadingScreen(viewerDiv, view);
108
122
 
@@ -31,6 +31,7 @@
31
31
  "Vector tiles": {
32
32
  "vector_tile_raster_3d": "Raster on 3D map",
33
33
  "vector_tile_raster_2d": "Raster on 2D map",
34
+ "vector_tile_mapbox_raster": "Mapbox Vector Tiles to raster",
34
35
  "vector_tile_3d_mesh": "Vector tile to 3d objects",
35
36
  "vector_tile_3d_mesh_mapbox": "Mapbox Vector tile to 3d objects",
36
37
  "vector_tile_dragndrop": "Drag and drop a style"
@@ -19,7 +19,7 @@
19
19
  </head>
20
20
  <body>
21
21
  <div id="description">Specify the URL of a COPC file to load:
22
- <input type="text" id="url" />
22
+ <input type="text" id="copc_url" />
23
23
  <button onclick="readURL()">Load</button>
24
24
  <div>
25
25
  <button onClick="loadAutzen()">Load Autzen Stadium (80mb)</button>
@@ -71,7 +71,7 @@
71
71
 
72
72
 
73
73
  function readURL() {
74
- const url = document.getElementById('url').value;
74
+ const url = document.getElementById('copc_url').value;
75
75
 
76
76
  if (url) {
77
77
  setUrl(url);
@@ -81,7 +81,7 @@
81
81
  function setUrl(url) {
82
82
  if (!url) return;
83
83
 
84
- const input_url = document.getElementById('url');
84
+ const input_url = document.getElementById('copc_url');
85
85
  if (!input_url) return;
86
86
 
87
87
  uri.searchParams.set('copc', url);
@@ -93,6 +93,13 @@
93
93
 
94
94
 
95
95
  function load(url) {
96
+ const options = {};
97
+ const urlParams = uri.searchParams
98
+ urlParams.keys().forEach(key => {
99
+ if (key !== 'copc') {
100
+ options[key] = parseInt(urlParams.get(key), 10);
101
+ }
102
+ });
96
103
  const source = new itowns.CopcSource({ url });
97
104
 
98
105
  if (layer) {
@@ -102,12 +109,15 @@
102
109
  layer.delete();
103
110
  }
104
111
 
105
- layer = new itowns.CopcLayer('COPC', {
112
+ const config = {
106
113
  source,
107
114
  crs: view.referenceCrs,
108
115
  sseThreshold: 2,
109
116
  pointBudget: 3000000,
110
- });
117
+ ...options,
118
+ };
119
+
120
+ layer = new itowns.CopcLayer('COPC', config);
111
121
  view.addLayer(layer).then(onLayerReady);
112
122
  layer.whenReady
113
123
  .then(() => debug.PointCloudDebug.initTools(view, layer, gui));
@@ -23,8 +23,8 @@
23
23
  <script type="importmap">
24
24
  {
25
25
  "imports": {
26
- "three": "https://cdn.jsdelivr.net/npm/three@0.159.0/build/three.module.js",
27
- "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.159.0/examples/jsm/"
26
+ "three": "https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js",
27
+ "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"
28
28
  }
29
29
  }
30
30
  </script>
@@ -87,8 +87,10 @@
87
87
  eptSource = new itowns.EntwinePointTileSource({ url });
88
88
 
89
89
  if (eptLayer) {
90
- view.removeLayer('ept');
90
+ debugGui.removeFolder(eptLayer.debugUI);
91
+ view.removeLayer('Entwine Point Tile');
91
92
  view.notifyChange();
93
+ eptLayer.delete();
92
94
  }
93
95
 
94
96
  eptLayer = new itowns.EntwinePointTileLayer('Entwine Point Tile', {
@@ -88,7 +88,7 @@
88
88
  eptSource = new itowns.EntwinePointTileSource({ url });
89
89
 
90
90
  if (eptLayer) {
91
- debugGUI.removeFolder(eptLayer.debugUI);
91
+ debugGui.removeFolder(eptLayer.debugUI);
92
92
  view.removeLayer('Entwine Point Tile');
93
93
  view.notifyChange();
94
94
  eptLayer.delete();
@@ -0,0 +1,123 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg
3
+ width="2123.8423"
4
+ height="504"
5
+ viewBox="0 0 2123.8423 504"
6
+ version="1.1"
7
+ id="svg91"
8
+ sodipodi:docname="logo.svg"
9
+ inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
10
+ inkscape:label="layer_i"
11
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
13
+ xmlns:xlink="http://www.w3.org/1999/xlink"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ xmlns:svg="http://www.w3.org/2000/svg">
16
+ <sodipodi:namedview
17
+ id="namedview93"
18
+ pagecolor="#ffffff"
19
+ bordercolor="#666666"
20
+ borderopacity="1.0"
21
+ inkscape:pageshadow="2"
22
+ inkscape:pageopacity="0.0"
23
+ inkscape:pagecheckerboard="0"
24
+ showgrid="false"
25
+ inkscape:zoom="0.21100549"
26
+ inkscape:cx="1390.9591"
27
+ inkscape:cy="1049.7357"
28
+ inkscape:window-width="1850"
29
+ inkscape:window-height="1016"
30
+ inkscape:window-x="70"
31
+ inkscape:window-y="1107"
32
+ inkscape:window-maximized="1"
33
+ inkscape:current-layer="svg91"
34
+ showguides="true"
35
+ inkscape:guide-bbox="true">
36
+ <sodipodi:guide
37
+ position="303,12"
38
+ orientation="0,-1"
39
+ id="guide149742" />
40
+ <sodipodi:guide
41
+ position="922.7708,353.293"
42
+ orientation="0,-1"
43
+ id="guide161704" />
44
+ <sodipodi:guide
45
+ position="1076.0872,118.0449"
46
+ orientation="0,-1"
47
+ id="guide161710" />
48
+ <sodipodi:guide
49
+ position="1172.7675,246.6387"
50
+ orientation="0,-1"
51
+ id="guide161712" />
52
+ </sodipodi:namedview>
53
+ <defs
54
+ id="defs85">
55
+ <linearGradient
56
+ inkscape:collect="always"
57
+ id="linearGradient124706">
58
+ <stop
59
+ style="stop-color:#7ea8c5;stop-opacity:1"
60
+ offset="0"
61
+ id="stop124702" />
62
+ <stop
63
+ style="stop-color:#404e73;stop-opacity:1"
64
+ offset="1"
65
+ id="stop124704" />
66
+ </linearGradient>
67
+ <style
68
+ id="style83">
69
+ .cls-1 {
70
+ opacity: 0.4;
71
+ }
72
+ </style>
73
+ <linearGradient
74
+ inkscape:collect="always"
75
+ xlink:href="#linearGradient124706"
76
+ id="linearGradient124708"
77
+ x1="1129.2401"
78
+ y1="606.47083"
79
+ x2="1401.899"
80
+ y2="774.6546"
81
+ gradientUnits="userSpaceOnUse" />
82
+ </defs>
83
+ <g
84
+ id="g149219"
85
+ inkscape:label="Globe"
86
+ transform="translate(-523,-390)">
87
+ <ellipse
88
+ style="display:inline;fill:#c8d3da;fill-opacity:1;fill-rule:evenodd"
89
+ id="path1259"
90
+ cx="1227.5"
91
+ cy="692"
92
+ rx="202.5"
93
+ ry="202"
94
+ inkscape:label="Circle" />
95
+ <g
96
+ id="g124715"
97
+ style="display:inline;stroke:#355c77;stroke-opacity:1"
98
+ inkscape:label="Arrows">
99
+ <g
100
+ id="g124711"
101
+ style="stroke:#355c77;stroke-opacity:1"
102
+ inkscape:label="g124711">
103
+ <path
104
+ style="fill:url(#linearGradient124708);fill-opacity:1;stroke:none;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
105
+ d="m 1330,681 61,-12 c 3.02,7.842 4.076,15.87 6.019,24 0.623,2.608 1.725,6.621 4.931,7.079 3.39,0.484 5.145,-4.756 6.294,-7.079 4.368,-8.837 7.681,-18.455 10.126,-28 6.613,-25.808 -5.85,-43.846 -20.997,-64 -5.472,-7.282 -12.303,-17.758 -20.354,-22.338 -4.273,-2.4306 -5.13,2.0092 -4.714,5.3388 0.586,4.6919 7.851,20.6632 3.171,23.9322 -2.895,2.022 -10.95,0.067 -14.476,0.067 -10.657,-10e-4 -21.347,-0.246 -32,0.015 -4.325,0.106 -9.726,2.094 -13.892,0.382 -5.397,-2.219 -7.556,-13.418 -9.687,-18.397 -7.301,-17.0598 -16.733,-32.6765 -25.421,-49 5.562,-1.763 24.398,-1.5626 26.824,-7.2245 2.682,-6.2591 -15.778,-11.6544 -19.824,-13.3511 -16.725,-7.013 -34.232,-12.7414 -52,-16.4213 -6.905,-1.4301 -15.602,-3.9163 -21.535,1.4267 -9.584,8.6288 -15.545,24.2163 -21.218,35.5702 -1.756,3.5154 -6.626,10.6646 -1.928,13.821 8.653,5.8139 20.931,-6.3429 29.576,-1.7786 4.537,2.3953 6.205,9.4776 7.761,13.9576 4.228,12.1783 8.181,24.53 11.46,37 1.02,3.88 4.614,11.885 2.683,15.697 -2.377,4.69 -15.124,5.832 -19.799,7.163 -16.494,4.695 -32.732,10.384 -49,15.807 -4.374,1.458 -13.407,6.621 -17.891,4.977 -7.289,-2.674 -4.547,-35.284 -17.019,-27.036 -5.418,3.583 -8.841,11.197 -12.514,16.392 -10.2548,14.501 -20.0164,29.506 -28.7149,45 -3.9849,7.098 -10.3602,15.972 -4.2083,23.815 3.6295,4.627 10.3443,6.941 15.3472,9.761 13.8979,7.833 28.591,14.399 43,21.205 4.886,2.308 14.588,9.972 19.566,4.897 7.959,-8.114 -7.807,-22.054 -1.784,-30.399 3.34,-4.629 13.088,-4.493 18.218,-5.476 17.25,-3.306 34.664,-5.608 52,-8.393 4.543,-0.729 16.572,-4.766 20.411,-1.637 3.876,3.159 4.049,14.529 4.989,19.227 3.19,15.949 5.824,31.89 8.024,48 0.723,5.296 3.474,14.919 0.548,19.775 -5.411,8.981 -25.656,0.601 -29.171,11.33 -1.841,5.617 6.874,11.422 10.109,14.895 8.451,9.072 17.016,17.641 26.09,26.09 4.394,4.091 8.431,9.791 15,9.823 7.581,0.036 13.971,-7.022 19,-11.928 12.818,-12.503 24.842,-25.974 35.996,-39.985 3.543,-4.45 12.487,-12.805 12.176,-18.891 -0.593,-11.601 -26.368,5.893 -29.399,-4.168 -2.107,-6.995 0.227,-18.497 0.227,-25.941 0,-21.005 0.853,-42.26 -3,-63"
106
+ id="path1080"
107
+ sodipodi:nodetypes="ccsscccssscscccscsccsscsccscscsscsscccscscccscccscsc"
108
+ inkscape:label="path1080" />
109
+ </g>
110
+ </g>
111
+ </g>
112
+ <path
113
+ id="path952"
114
+ style="display:inline;fill:#404e73;fill-opacity:1"
115
+ inkscape:label="T wns"
116
+ d="M 177.03906,0 176.91602,93.58398 303,94 V 492 H 409.99414 L 410.5,94.5 538.5,93.5 539.0195,0 Z M 2011.0176,134.28125 c -13.0632,0.12998 -25.5667,1.33054 -36.8633,3.63281 -29.4349,5.99891 -57.9681,21.05292 -73.8867,38.98047 -12.3465,13.90461 -21.0569,31.08151 -24.6992,48.71485 -2.306,11.16435 -2.1202,33.20565 0.3613,42.9082 3.8861,15.19442 12.6728,29.33206 26.4336,42.5332 17.1315,16.43468 37.8519,27.767 72.9277,39.88477 26.8743,9.28436 38.5632,16.26831 43.2481,25.84375 2.4031,4.91179 2.6657,6.40755 2.2519,12.78711 -0.5206,8.02613 -2.1474,11.92677 -6.998,16.77734 -7.1349,7.1349 -19.3393,10.38075 -38.793,10.31445 -24.4588,-0.0833 -56.8353,-8.26242 -81.3359,-20.54687 -4.31,-2.161 -8.34,-3.76166 -8.9551,-3.55664 -1.2952,0.43175 -19.849,73.70135 -19.0078,75.0625 0.3086,0.4992 3.8636,2.41232 7.9004,4.25195 21.9315,9.99451 50.5827,16.99204 79.4902,19.41406 12.4848,1.04603 43.0849,0.48063 54.9082,-1.01367 38.4999,-4.86586 68.3037,-18.04186 88.5781,-39.16015 14.0553,-14.64031 22.6133,-31.44619 26.0528,-51.16797 2.1158,-12.13186 1.3753,-33.68965 -1.5606,-45.46875 -5.6685,-22.74204 -19.5206,-41.66585 -41.0273,-56.04688 -15.1873,-10.15539 -26.2884,-15.30705 -58.543,-27.16992 -36.0413,-13.25557 -46.6692,-22.13625 -45.248,-37.80859 0.83,-9.1535 5.475,-15.93482 13.8339,-20.19922 17.7737,-9.06744 56.359,-5.47043 87.0977,8.11914 11.915,5.26763 13.4655,5.6248 14.1797,3.27148 2.9956,-9.87087 17.6841,-68.85641 17.4472,-70.06445 -0.4198,-2.14067 -16.4538,-8.45661 -30.8222,-12.14063 -21.8739,-5.60839 -45.1988,-8.36897 -66.9707,-8.15234 z m -328.5235,8.21094 c -20.9646,0 -40.1175,4.76669 -57.4609,14.30078 -17.3434,9.33124 -33.7343,23.93681 -49.1719,43.81641 V 150.70703 H 1473.5156 V 491.5 h 102.3457 V 323.8418 c 0,-31.03651 6.0974,-55.27731 18.2949,-72.72266 12.1976,-17.64821 28.9707,-26.47266 50.3165,-26.47266 8.767,0 16.5802,2.02888 23.4414,6.08594 6.8612,3.85422 12.2926,9.3318 16.2949,16.43164 3.0494,5.27419 5.1455,13.48958 6.289,24.64649 1.3341,11.15691 2.002,31.44178 2.002,60.85547 V 457.72461 491.5 h 102.916 V 283.98047 c 0,-46.04763 -9.6238,-81.13979 -28.873,-105.2793 -19.0587,-24.1395 -47.0751,-36.20898 -84.0489,-36.20898 z M 922.7715,150.70703 1007.1504,492 h 111.8398 L 1172.7676,257.36133 1226.8262,492 h 111.8418 l 84.3808,-341.29297 h -99.541 l -54.0605,232.81055 -53.7735,-232.81055 h -85.5273 l -54.0586,235.24805 -53.7774,-235.24805 z" />
117
+ <path
118
+ id="path41630"
119
+ style="display:inline;fill:#7ea8c5;fill-opacity:1"
120
+ d="M 56.2207,0 C 25.17087,2e-5 2e-5,25.17087 0,56.2207 c 1e-5,31.04983 25.17087,56.22069 56.2207,56.22071 31.04984,-1e-5 56.2207,-25.17087 56.22071,-56.22071 C 112.44139,25.17087 87.27053,10e-6 56.2207,0 Z M 4.20703,151.33203 C 3.98701,264.88792 3.91235,378.44395 3.82849,492 c 34.67057,0 69.34114,0 104.01172,0 -0.29968,-113.55583 -0.46282,-227.11189 -0.63318,-340.66797 -34.33333,0 -68.66667,0 -103,0 z"
121
+ inkscape:label="i"
122
+ sodipodi:nodetypes="sssssccccc" />
123
+ </svg>
@@ -235,7 +235,7 @@ const COGParser = (function _() {
235
235
  */
236
236
  parse: async function _(data, options) {
237
237
  const source = options.in;
238
- const tileExtent = options.extent.as(source.crs);
238
+ const tileExtent = options.extent.isExtent ? options.extent.as(source.crs) : options.extent.toExtent(source.crs);
239
239
 
240
240
  const level = selectLevel(source, tileExtent, source.tileWidth, source.tileHeight);
241
241
  const viewport = makeWindowFromExtent(source, tileExtent, level.resolution);
@@ -33,6 +33,11 @@ export function fillHTMLWithPickingInfo(event, pickingArg) {
33
33
  // eslint-disable-next-line
34
34
  htmlDiv.appendChild(createHTMLListFromObject(closestC3DTileFeature));
35
35
  }
36
+
37
+ layer.getMetadataFromIntersections(intersects).then((metadata) => {
38
+ // eslint-disable-next-line
39
+ metadata?.forEach(m => htmlDiv.appendChild(createHTMLListFromObject(m)));
40
+ });
36
41
  }
37
42
 
38
43
  function zoomToSphere(view, tile, sphere) {
@@ -47,7 +52,7 @@ function zoomToSphere(view, tile, sphere) {
47
52
  const distance = radius * Math.tan(fov * 2);
48
53
 
49
54
  return {
50
- coord: new Coordinates('EPSG:4978', center),
55
+ coord: new Coordinates('EPSG:4978').setFromVector3(center),
51
56
  range: distance + radius,
52
57
  };
53
58
  }
@@ -4,7 +4,9 @@
4
4
  "updateStrategy": {
5
5
  "type": 0
6
6
  },
7
- "zmin": -12000,
7
+ "clampValues": {
8
+ "min": -12000
9
+ },
8
10
  "source": {
9
11
  "url": "https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/geoid/geoid/bil/%TILEMATRIX/geoid_%COL_%ROW.bil",
10
12
  "format": "image/x-bil;bits=32",
@@ -25,8 +25,8 @@
25
25
  <script type="importmap">
26
26
  {
27
27
  "imports": {
28
- "three": "https://cdn.jsdelivr.net/npm/three@0.159.0/build/three.module.js",
29
- "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.159.0/examples/jsm/"
28
+ "three": "https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js",
29
+ "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"
30
30
  }
31
31
  }
32
32
  </script>
@@ -54,7 +54,6 @@
54
54
  crs: 'EPSG:4326',
55
55
  format: 'application/json',
56
56
  }),
57
- transparent: true,
58
57
  opacity: 0.7,
59
58
  zoom: { min: 10 },
60
59
  style: {
@@ -69,7 +69,6 @@
69
69
  }
70
70
 
71
71
  var kmlStyle = {
72
- zoom: { min: 10, max: 20 },
73
72
  text: {
74
73
  field: '{name}',
75
74
  haloColor: 'black',
@@ -53,12 +53,6 @@
53
53
  itowns.Fetcher.json('./layers/JSONLayers/IGN_MNT_HIGHRES.json').then(addElevationLayerFromConfig);
54
54
  itowns.Fetcher.json('./layers/JSONLayers/WORLD_DTM.json').then(addElevationLayerFromConfig);
55
55
 
56
- function isValidData(data) {
57
- if(data.features[0].geometries.length < 1000) {
58
- return data;
59
- }
60
- }
61
-
62
56
  var wfsBuildingSource = new itowns.WFSSource({
63
57
  url: 'https://data.geopf.fr/wfs/ows?',
64
58
  version: '2.0.0',
@@ -102,7 +96,6 @@
102
96
  width: 2.0,
103
97
  },
104
98
  },
105
- isValidData: isValidData,
106
99
  source: wfsBuildingSource,
107
100
  zoom: { max: 20, min: 13 },
108
101
  });
@@ -0,0 +1,91 @@
1
+ <html>
2
+ <head>
3
+ <title>Itowns - vector-tiles 2d </title>
4
+
5
+ <meta charset="UTF-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+
8
+ <link
9
+ rel="stylesheet"
10
+ type="text/css"
11
+ href="css/example.css"
12
+ />
13
+ <link
14
+ rel="stylesheet"
15
+ type="text/css"
16
+ href="css/LoadingScreen.css"
17
+ />
18
+
19
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.7.6/dat.gui.min.js"></script>
20
+ </head>
21
+ <body>
22
+ <div id="viewerDiv"></div>
23
+
24
+ <!-- Import iTowns source code -->
25
+ <script src="../dist/itowns.js"></script>
26
+ <script src="../dist/debug.js"></script>
27
+ <!-- Import iTowns LoadingScreen and GuiTools plugins -->
28
+ <script src="js/GUI/GuiTools.js"></script>
29
+ <script src="js/GUI/LoadingScreen.js"></script>
30
+
31
+ <script>
32
+ const typeView = 'Planar';
33
+ // const typeView = 'Globe';
34
+
35
+ // `viewerDiv` will contain iTowns' rendering area (`<canvas>`)
36
+ var viewerDiv = document.getElementById('viewerDiv');
37
+ let view;
38
+
39
+ if (typeView === 'Globe') {
40
+ const coord = new itowns.Coordinates('EPSG:4326', 2.351323, 48.856712); // Paris
41
+ // const coord = new itowns.Coordinates("EPSG:4326", 60.599525, 56.834341); // Yekaterinburg
42
+ const placement = {
43
+ coord,
44
+ range: 950000,
45
+ };
46
+ view = new itowns.GlobeView(viewerDiv, placement);
47
+ } else if (typeView === 'Planar') {
48
+ // Define geographic extent: CRS, min/max X, min/max Y
49
+ var extent = new itowns.Extent(
50
+ 'EPSG:3857',
51
+ -20037508.342789244, 20037508.342789244,
52
+ -20037508.342789255, 20037508.342789244);
53
+
54
+ // Instanciate PlanarView
55
+ view = new itowns.PlanarView(viewerDiv, extent, {
56
+ maxSubdivisionLevel: 20,
57
+ controls: {
58
+ // We do not want the user to zoom out too much
59
+ maxAltitude: 40000000,
60
+ // We want to keep the rotation disabled, to only have a view from the top
61
+ enableRotation: false,
62
+ // Don't zoom too much on smart zoom
63
+ smartTravelHeightMax: 100000,
64
+ },
65
+ });
66
+ }
67
+
68
+ const debugMenu = new GuiTools("menuDiv", view);
69
+ setupLoadingScreen(viewerDiv, view);
70
+
71
+ const source = new itowns.VectorTilesSource({
72
+ style: "mapbox://styles/mapbox/streets-v8",
73
+ accessToken:
74
+ "pk.eyJ1IjoiZnRvcm9tYW5vZmYiLCJhIjoiY2xrc2Zpa2o3MDQxNTNxcG5sczJyaTlncyJ9.5KFKdMLIiy-b_fAjSVhjCQ",
75
+ });
76
+
77
+ const layer = new itowns.ColorLayer("vector-map", {
78
+ source,
79
+ noTextureParentOutsideLimit: true,
80
+ addLabelLayer: true,
81
+ });
82
+
83
+ view.addLayer(layer).then(() => {
84
+ debugMenu.addLayerGUI.bind(debugMenu);
85
+ itowns.ColorLayersOrdering.moveLayerToIndex(view, "vector-map", 15);
86
+ });
87
+
88
+ debug.createTileDebugUI(debugMenu.gui, view);
89
+ </script>
90
+ </body>
91
+ </html>
@@ -14,7 +14,7 @@
14
14
  <script type="importmap">
15
15
  {
16
16
  "imports": {
17
- "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.159.0/examples/jsm/"
17
+ "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"
18
18
  }
19
19
  }
20
20
  </script>
@@ -43,6 +43,8 @@
43
43
  const view = new itowns.GlobeView(viewerDiv, placement, {
44
44
  webXR: { scale: 0.005 },
45
45
  });
46
+ // Temporary workaround to https://github.com/iTowns/itowns/issues/2473
47
+ view.scene.matrixWorldAutoUpdate = true;
46
48
 
47
49
  // Instantiate three's VR Button
48
50
  const vrButton = VRButton.createButton(view.renderer);
@@ -17,8 +17,8 @@
17
17
  <script type="importmap">
18
18
  {
19
19
  "imports": {
20
- "three": "https://cdn.jsdelivr.net/npm/three@0.159.0/build/three.module.js",
21
- "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.159.0/examples/jsm/"
20
+ "three": "https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js",
21
+ "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"
22
22
  }
23
23
  }
24
24
  </script>