itowns 2.45.1 → 2.45.2-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/455.js +1 -1
- package/dist/455.js.map +1 -1
- package/dist/debug.js +1 -1
- package/dist/debug.js.LICENSE.txt +8 -2
- package/dist/debug.js.map +1 -1
- package/dist/itowns.js +1 -1
- package/dist/itowns.js.LICENSE.txt +1 -1
- package/dist/itowns.js.map +1 -1
- package/dist/itowns_lasparser.js +1 -1
- package/dist/itowns_lasparser.js.map +1 -1
- package/dist/itowns_lasworker.js +1 -1
- package/dist/itowns_lasworker.js.map +1 -1
- package/dist/itowns_potree2worker.js +1 -1
- package/dist/itowns_potree2worker.js.map +1 -1
- package/dist/itowns_widgets.js +1 -1
- package/dist/itowns_widgets.js.map +1 -1
- package/examples/copc_simple_loader.html +3 -3
- package/examples/entwine_3d_loader.html +2 -2
- package/examples/entwine_simple_loader.html +10 -6
- package/examples/potree2_25d_map.html +2 -2
- package/examples/potree_25d_map.html +2 -2
- package/examples/potree_3d_map.html +2 -2
- package/examples/view_3d_map_webxr.html +2 -5
- package/lib/Controls/FirstPersonControls.d.ts +90 -0
- package/lib/Controls/FlyControls.d.ts +36 -0
- package/lib/Controls/GlobeControls.d.ts +274 -0
- package/lib/Controls/PlanarControls.d.ts +339 -0
- package/lib/Controls/StateControl.d.ts +140 -0
- package/lib/Controls/StreetControls.d.ts +134 -0
- package/lib/Controls/VRControls.d.ts +56 -0
- package/lib/Controls/VRControls.js +409 -0
- package/lib/Converter/Feature2Mesh.d.ts +42 -0
- package/lib/Converter/Feature2Texture.d.ts +5 -0
- package/lib/Converter/convertToTile.d.ts +5 -0
- package/lib/Converter/convertToTile.js +2 -2
- package/lib/Converter/textureConverter.d.ts +4 -0
- package/lib/Core/3DTiles/C3DTBatchTable.d.ts +49 -0
- package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.d.ts +37 -0
- package/lib/Core/3DTiles/C3DTBoundingVolume.d.ts +39 -0
- package/lib/Core/3DTiles/C3DTExtensions.d.ts +75 -0
- package/lib/Core/3DTiles/C3DTFeature.d.ts +47 -0
- package/lib/Core/3DTiles/C3DTilesEnums.d.ts +14 -0
- package/lib/Core/3DTiles/C3DTileset.d.ts +46 -0
- package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.d.ts +14 -0
- package/lib/Core/AnimationPlayer.d.ts +53 -0
- package/lib/Core/CopcNode.d.ts +68 -0
- package/lib/Core/CopcNode.js +57 -74
- package/lib/Core/Deprecated/Undeprecator.d.ts +6 -0
- package/lib/Core/EntwinePointTileNode.d.ts +59 -0
- package/lib/Core/EntwinePointTileNode.js +16 -41
- package/lib/Core/Feature.d.ts +323 -0
- package/lib/Core/Geographic/GeoidGrid.d.ts +86 -0
- package/lib/Core/Label.d.ts +86 -0
- package/lib/Core/MainLoop.d.ts +23 -0
- package/lib/Core/Picking.d.ts +6 -0
- package/lib/Core/Picking.js +4 -0
- package/lib/Core/PointCloudNode.d.ts +16 -0
- package/lib/Core/PointCloudNode.js +34 -4
- package/lib/Core/Potree2Node.d.ts +11 -0
- package/lib/Core/Potree2Node.js +5 -60
- package/lib/Core/Potree2PointAttributes.d.ts +97 -0
- package/lib/Core/PotreeNode.d.ts +14 -0
- package/lib/Core/PotreeNode.js +28 -18
- package/lib/Core/Prefab/Globe/Atmosphere.d.ts +66 -0
- package/lib/Core/Prefab/Globe/Atmosphere.js +10 -5
- package/lib/Core/Prefab/Globe/GlobeLayer.d.ts +48 -0
- package/lib/Core/Prefab/Globe/GlobeTileBuilder.d.ts +38 -0
- package/lib/Core/Prefab/Globe/SkyShader.d.ts +5 -0
- package/lib/Core/Prefab/Globe/SkyShader.js +3 -3
- package/lib/Core/Prefab/GlobeView.d.ts +65 -0
- package/lib/Core/Prefab/GlobeView.js +9 -0
- package/lib/Core/Prefab/Planar/PlanarLayer.d.ts +38 -0
- package/lib/Core/Prefab/Planar/PlanarTileBuilder.d.ts +32 -0
- package/lib/Core/Prefab/PlanarView.d.ts +33 -0
- package/lib/Core/Prefab/TileBuilder.d.ts +63 -0
- package/lib/Core/Prefab/computeBufferTileGeometry.d.ts +17 -0
- package/lib/Core/Scheduler/Cache.d.ts +25 -0
- package/lib/Core/Scheduler/CancelledCommandException.d.ts +12 -0
- package/lib/Core/Scheduler/Scheduler.d.ts +106 -0
- package/lib/Core/Style.d.ts +248 -0
- package/lib/Core/StyleOptions.d.ts +455 -0
- package/lib/Core/System/Capabilities.d.ts +9 -0
- package/lib/Core/Tile/Tile.d.ts +70 -0
- package/lib/Core/Tile/TileGrid.d.ts +12 -0
- package/lib/Core/TileGeometry.d.ts +46 -0
- package/lib/Core/TileMesh.d.ts +50 -0
- package/lib/Core/TileMesh.js +2 -4
- package/lib/Core/View.d.ts +403 -0
- package/lib/Core/View.js +1 -7
- package/lib/Layer/C3DTilesLayer.d.ts +140 -0
- package/lib/Layer/ColorLayer.d.ts +128 -0
- package/lib/Layer/ColorLayer.js +4 -4
- package/lib/Layer/CopcLayer.d.ts +42 -0
- package/lib/Layer/CopcLayer.js +3 -6
- package/lib/Layer/ElevationLayer.d.ts +96 -0
- package/lib/Layer/ElevationLayer.js +3 -3
- package/lib/Layer/EntwinePointTileLayer.d.ts +56 -0
- package/lib/Layer/EntwinePointTileLayer.js +4 -3
- package/lib/Layer/FeatureGeometryLayer.d.ts +62 -0
- package/lib/Layer/GeoidLayer.d.ts +41 -0
- package/lib/Layer/GeometryLayer.d.ts +120 -0
- package/lib/Layer/InfoLayer.d.ts +24 -0
- package/lib/Layer/InfoLayer.js +1 -1
- package/lib/Layer/LabelLayer.d.ts +93 -0
- package/lib/Layer/LabelLayer.js +2 -2
- package/lib/Layer/Layer.d.ts +185 -0
- package/lib/Layer/LayerUpdateState.d.ts +24 -0
- package/lib/Layer/LayerUpdateStrategy.d.ts +11 -0
- package/lib/Layer/LayerUpdateStrategy.js +2 -7
- package/lib/Layer/OGC3DTilesLayer.d.ts +277 -0
- package/lib/Layer/OGC3DTilesLayer.js +21 -0
- package/lib/Layer/OrientedImageLayer.d.ts +53 -0
- package/lib/Layer/PointCloudLayer.d.ts +103 -0
- package/lib/Layer/PointCloudLayer.js +8 -11
- package/lib/Layer/Potree2Layer.d.ts +56 -0
- package/lib/Layer/Potree2Layer.js +0 -2
- package/lib/Layer/PotreeLayer.d.ts +55 -0
- package/lib/Layer/RasterLayer.d.ts +8 -0
- package/lib/Layer/RasterLayer.js +2 -2
- package/lib/Layer/ReferencingLayerProperties.d.ts +2 -0
- package/lib/Layer/ReferencingLayerProperties.js +0 -12
- package/lib/Layer/TiledGeometryLayer.d.ts +192 -0
- package/lib/Layer/TiledGeometryLayer.js +4 -3
- package/lib/Main.d.ts +89 -0
- package/lib/Main.js +3 -1
- package/lib/Parser/B3dmParser.d.ts +26 -0
- package/lib/Parser/CameraCalibrationParser.d.ts +32 -0
- package/lib/Parser/GDFParser.d.ts +24 -0
- package/lib/Parser/GTXParser.d.ts +28 -0
- package/lib/Parser/GeoJsonParser.d.ts +12 -0
- package/lib/Parser/GpxParser.d.ts +12 -0
- package/lib/Parser/ISGParser.d.ts +23 -0
- package/lib/Parser/KMLParser.d.ts +12 -0
- package/lib/Parser/LASParser.d.ts +61 -0
- package/lib/Parser/MapBoxUrlParser.d.ts +9 -0
- package/lib/Parser/PntsParser.d.ts +4 -0
- package/lib/Parser/Potree2BinParser.d.ts +8 -0
- package/lib/Parser/PotreeBinParser.d.ts +4 -0
- package/lib/Parser/PotreeCinParser.d.ts +4 -0
- package/lib/Parser/ShapefileParser.d.ts +25 -0
- package/lib/Parser/VectorTileParser.d.ts +34 -0
- package/lib/Parser/XbilParser.d.ts +18 -0
- package/lib/Parser/deprecated/LegacyGLTFLoader.d.ts +32 -0
- package/lib/Parser/iGLTFLoader.d.ts +104 -0
- package/lib/Process/3dTilesProcessing.d.ts +43 -0
- package/lib/Process/FeatureProcessing.d.ts +4 -0
- package/lib/Process/LayeredMaterialNodeProcessing.d.ts +3 -0
- package/lib/Process/LayeredMaterialNodeProcessing.js +12 -12
- package/lib/Process/ObjectRemovalHelper.d.ts +32 -0
- package/lib/Process/handlerNodeError.d.ts +1 -0
- package/lib/Provider/3dTilesProvider.d.ts +7 -0
- package/lib/Provider/DataSourceProvider.d.ts +4 -0
- package/lib/Provider/Fetcher.d.ts +101 -0
- package/lib/Provider/PointCloudProvider.d.ts +4 -0
- package/lib/Provider/TileProvider.d.ts +4 -0
- package/lib/Provider/URLBuilder.d.ts +28 -0
- package/lib/Renderer/Camera.d.ts +95 -0
- package/lib/Renderer/Color.d.ts +3 -0
- package/lib/Renderer/ColorLayersOrdering.d.ts +38 -0
- package/lib/Renderer/ColorLayersOrdering.js +2 -2
- package/lib/Renderer/CommonMaterial.d.ts +6 -0
- package/lib/Renderer/Label2DRenderer.d.ts +31 -0
- package/lib/Renderer/LayeredMaterial.d.ts +121 -0
- package/lib/Renderer/LayeredMaterial.js +221 -141
- package/lib/Renderer/OBB.d.ts +65 -0
- package/lib/Renderer/OrientedImageCamera.d.ts +36 -0
- package/lib/Renderer/OrientedImageMaterial.d.ts +68 -0
- package/lib/Renderer/PointsMaterial.d.ts +226 -0
- package/lib/Renderer/PointsMaterial.js +60 -22
- package/lib/Renderer/RasterTile.d.ts +53 -0
- package/lib/Renderer/RasterTile.js +8 -9
- package/lib/Renderer/RenderMode.d.ts +11 -0
- package/lib/Renderer/RenderMode.js +1 -0
- package/lib/Renderer/Shader/ShaderChunk.d.ts +78 -0
- package/lib/Renderer/Shader/ShaderUtils.d.ts +5 -0
- package/lib/Renderer/WebXR.d.ts +33 -0
- package/lib/Renderer/WebXR.js +128 -47
- package/lib/Renderer/c3DEngine.d.ts +55 -0
- package/lib/Renderer/c3DEngine.js +5 -1
- package/lib/Source/C3DTilesGoogleSource.d.ts +38 -0
- package/lib/Source/C3DTilesIonSource.d.ts +31 -0
- package/lib/Source/C3DTilesSource.d.ts +17 -0
- package/lib/Source/CopcSource.d.ts +79 -0
- package/lib/Source/EntwinePointTileSource.d.ts +40 -0
- package/lib/Source/EntwinePointTileSource.js +0 -5
- package/lib/Source/FileSource.d.ts +118 -0
- package/lib/Source/OGC3DTilesGoogleSource.d.ts +24 -0
- package/lib/Source/OGC3DTilesIonSource.d.ts +26 -0
- package/lib/Source/OGC3DTilesSource.d.ts +21 -0
- package/lib/Source/OrientedImageSource.d.ts +48 -0
- package/lib/Source/Potree2Source.d.ts +157 -0
- package/lib/Source/PotreeSource.d.ts +69 -0
- package/lib/Source/Source.d.ts +122 -0
- package/lib/Source/TMSSource.d.ts +77 -0
- package/lib/Source/VectorTilesSource.d.ts +56 -0
- package/lib/Source/WFSSource.d.ts +110 -0
- package/lib/Source/WMSSource.d.ts +85 -0
- package/lib/Source/WMTSSource.d.ts +65 -0
- package/lib/ThreeExtended/capabilities/WebGL.d.ts +9 -0
- package/lib/ThreeExtended/libs/ktx-parse.module.d.ts +274 -0
- package/lib/ThreeExtended/libs/motion-controllers.module.d.ts +64 -0
- package/lib/ThreeExtended/libs/motion-controllers.module.js +375 -0
- package/lib/ThreeExtended/libs/zstddec.module.d.ts +6 -0
- package/lib/ThreeExtended/loaders/DDSLoader.js +40 -1
- package/lib/ThreeExtended/loaders/DRACOLoader.d.ts +41 -0
- package/lib/ThreeExtended/loaders/GLTFLoader.d.ts +16 -0
- package/lib/ThreeExtended/loaders/GLTFLoader.js +22 -3
- package/lib/ThreeExtended/loaders/KTX2Loader.d.ts +116 -0
- package/lib/ThreeExtended/loaders/KTX2Loader.js +9 -2
- package/lib/ThreeExtended/math/ColorSpaces.d.ts +56 -0
- package/lib/ThreeExtended/utils/BufferGeometryUtils.d.ts +62 -0
- package/lib/ThreeExtended/utils/BufferGeometryUtils.js +2 -2
- package/lib/ThreeExtended/utils/WorkerPool.d.ts +19 -0
- package/lib/ThreeExtended/webxr/XRControllerModelFactory.d.ts +25 -0
- package/lib/ThreeExtended/webxr/XRControllerModelFactory.js +209 -0
- package/lib/Utils/CameraUtils.d.ts +132 -0
- package/lib/Utils/DEMUtils.d.ts +84 -0
- package/lib/Utils/DEMUtils.js +2 -2
- package/lib/Utils/FeaturesUtils.d.ts +17 -0
- package/lib/Utils/Gradients.d.ts +13 -0
- package/lib/Utils/ThreeUtils.d.ts +14 -0
- package/lib/Utils/placeObjectOnGround.d.ts +28 -0
- package/lib/global.d.js +0 -0
- package/package.json +18 -15
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
1
|
import Fetcher from "../Provider/Fetcher.js";
|
|
3
2
|
import PointCloudNode from "./PointCloudNode.js";
|
|
4
|
-
|
|
5
|
-
const position = new THREE.Vector3();
|
|
6
|
-
const translation = new THREE.Vector3();
|
|
7
|
-
function buildId(depth, x, y, z) {
|
|
3
|
+
function buildVoxelKey(depth, x, y, z) {
|
|
8
4
|
return `${depth}-${x}-${y}-${z}`;
|
|
9
5
|
}
|
|
10
6
|
|
|
@@ -20,13 +16,13 @@ function buildId(depth, x, y, z) {
|
|
|
20
16
|
* @property {number} x - The x coordinate of the node in the tree - see the
|
|
21
17
|
* [Entwine
|
|
22
18
|
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
23
|
-
* @property {number} y - The
|
|
19
|
+
* @property {number} y - The y coordinate of the node in the tree - see the
|
|
24
20
|
* [Entwine
|
|
25
21
|
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
26
|
-
* @property {number} z - The
|
|
22
|
+
* @property {number} z - The z coordinate of the node in the tree - see the
|
|
27
23
|
* [Entwine
|
|
28
24
|
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
29
|
-
* @property {string}
|
|
25
|
+
* @property {string} voxelKey - The id of the node, constituted of the four
|
|
30
26
|
* components: `depth-x-y-z`.
|
|
31
27
|
*/
|
|
32
28
|
class EntwinePointTileNode extends PointCloudNode {
|
|
@@ -41,10 +37,10 @@ class EntwinePointTileNode extends PointCloudNode {
|
|
|
41
37
|
* @param {number} x - The x coordinate of the node in the tree - see the
|
|
42
38
|
* [Entwine
|
|
43
39
|
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
44
|
-
* @param {number} y - The
|
|
40
|
+
* @param {number} y - The y coordinate of the node in the tree - see the
|
|
45
41
|
* [Entwine
|
|
46
42
|
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
47
|
-
* @param {number} z - The
|
|
43
|
+
* @param {number} z - The z coordinate of the node in the tree - see the
|
|
48
44
|
* [Entwine
|
|
49
45
|
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
50
46
|
* @param {EntwinePointTileLayer} layer - The layer the node is attached to.
|
|
@@ -60,40 +56,19 @@ class EntwinePointTileNode extends PointCloudNode {
|
|
|
60
56
|
this.x = x;
|
|
61
57
|
this.y = y;
|
|
62
58
|
this.z = z;
|
|
63
|
-
this.
|
|
64
|
-
this.url = `${this.layer.source.url}/ept-data/${this.
|
|
65
|
-
}
|
|
66
|
-
createChildAABB(node) {
|
|
67
|
-
// factor to apply, based on the depth difference (can be > 1)
|
|
68
|
-
const f = 2 ** (node.depth - this.depth);
|
|
69
|
-
|
|
70
|
-
// size of the child node bbox (Vector3), based on the size of the
|
|
71
|
-
// parent node, and divided by the factor
|
|
72
|
-
this.bbox.getSize(size).divideScalar(f);
|
|
73
|
-
|
|
74
|
-
// initialize the child node bbox at the location of the parent node bbox
|
|
75
|
-
node.bbox.min.copy(this.bbox.min);
|
|
76
|
-
|
|
77
|
-
// position of the parent node, if it was at the same depth than the
|
|
78
|
-
// child, found by multiplying the tree position by the factor
|
|
79
|
-
position.copy(this).multiplyScalar(f);
|
|
80
|
-
|
|
81
|
-
// difference in position between the two nodes, at child depth, and
|
|
82
|
-
// scale it using the size
|
|
83
|
-
translation.subVectors(node, position).multiply(size);
|
|
84
|
-
|
|
85
|
-
// apply the translation to the child node bbox
|
|
86
|
-
node.bbox.min.add(translation);
|
|
87
|
-
|
|
88
|
-
// use the size computed above to set the max
|
|
89
|
-
node.bbox.max.copy(node.bbox.min).add(size);
|
|
59
|
+
this.voxelKey = buildVoxelKey(depth, x, y, z);
|
|
60
|
+
this.url = `${this.layer.source.url}/ept-data/${this.voxelKey}.${this.layer.source.extension}`;
|
|
90
61
|
}
|
|
91
62
|
get octreeIsLoaded() {
|
|
92
63
|
return this.numPoints >= 0;
|
|
93
64
|
}
|
|
65
|
+
get id() {
|
|
66
|
+
return `${this.depth}${this.x}${this.y}${this.z}`;
|
|
67
|
+
}
|
|
94
68
|
loadOctree() {
|
|
95
|
-
|
|
96
|
-
|
|
69
|
+
const hierarchyUrl = `${this.layer.source.url}/ept-hierarchy/${this.voxelKey}.json`;
|
|
70
|
+
return Fetcher.json(hierarchyUrl, this.layer.source.networkOptions).then(hierarchy => {
|
|
71
|
+
this.numPoints = hierarchy[this.voxelKey];
|
|
97
72
|
const stack = [];
|
|
98
73
|
stack.push(this);
|
|
99
74
|
while (stack.length) {
|
|
@@ -114,8 +89,8 @@ class EntwinePointTileNode extends PointCloudNode {
|
|
|
114
89
|
});
|
|
115
90
|
}
|
|
116
91
|
findAndCreateChild(depth, x, y, z, hierarchy, stack) {
|
|
117
|
-
const
|
|
118
|
-
const numPoints = hierarchy[
|
|
92
|
+
const voxelKey = buildVoxelKey(depth, x, y, z);
|
|
93
|
+
const numPoints = hierarchy[voxelKey];
|
|
119
94
|
if (typeof numPoints == 'number') {
|
|
120
95
|
const child = new EntwinePointTileNode(depth, x, y, z, this.layer, numPoints);
|
|
121
96
|
this.add(child);
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
export namespace FEATURE_TYPES {
|
|
2
|
+
let POINT: number;
|
|
3
|
+
let LINE: number;
|
|
4
|
+
let POLYGON: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} FeatureBuildingOptions
|
|
8
|
+
* @property {string} crs - The CRS to convert the input coordinates to.
|
|
9
|
+
* @property {string} [structure='2d'] - data structure type : 2d or 3d.
|
|
10
|
+
* If the structure is 3d, the feature have 3 dimensions by vertices positions and
|
|
11
|
+
* a normal for each vertices.
|
|
12
|
+
* @property {Extent|boolean} [filteringExtent=undefined] - Optional filter to reject
|
|
13
|
+
* features outside of extent. Extent filtering is file extent if filteringExtent is true.
|
|
14
|
+
* @property {boolean} [buildExtent] - If true the geometry will
|
|
15
|
+
* have an extent property containing the area covered by the geometry.
|
|
16
|
+
* Default value is false if `structure` parameter is set to '3d', and true otherwise.
|
|
17
|
+
* True if the layer does not inherit from {@link GeometryLayer}.
|
|
18
|
+
* @property {string} forcedExtentCrs - force feature extent crs if buildExtent is true.
|
|
19
|
+
* @property {function} [filter] - Filter function to remove features
|
|
20
|
+
* @property {boolean} [mergeFeatures=true] - If true all geometries are merged by type and multi-type.
|
|
21
|
+
* @property {Style} style - The style to inherit when creating
|
|
22
|
+
* style for all new features.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* @property {Extent} extent - The 2D extent containing all the points
|
|
27
|
+
* composing the geometry.
|
|
28
|
+
* @property {Object[]} indices - Contains the indices that define the geometry.
|
|
29
|
+
* Objects stored in this array have two properties, an `offset` and a `count`.
|
|
30
|
+
* The offset is related to the overall number of vertices in the Feature.
|
|
31
|
+
*
|
|
32
|
+
* @property {Object} properties - Properties of the geometry. It can be
|
|
33
|
+
* anything specified in the GeoJSON under the `properties` property.
|
|
34
|
+
*/
|
|
35
|
+
export class FeatureGeometry {
|
|
36
|
+
/**
|
|
37
|
+
* @param {Feature} feature geometry
|
|
38
|
+
*/
|
|
39
|
+
constructor(feature: Feature);
|
|
40
|
+
indices: any[];
|
|
41
|
+
properties: {};
|
|
42
|
+
size: number;
|
|
43
|
+
extent: Extent | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Add a new marker to indicate the starting of sub geometry and extends the vertices buffer.
|
|
46
|
+
* Then you have to push new the coordinates of sub geometry.
|
|
47
|
+
* The sub geometry stored in indices, see constructor for more information.
|
|
48
|
+
* @param {number} count - count of vertices
|
|
49
|
+
* @param {Feature} feature - the feature containing the geometry
|
|
50
|
+
*/
|
|
51
|
+
startSubGeometry(count: number, feature: Feature): void;
|
|
52
|
+
/**
|
|
53
|
+
* After you have pushed new the coordinates of sub geometry without
|
|
54
|
+
* `startSubGeometry`, this function close sub geometry. The sub geometry
|
|
55
|
+
* stored in indices, see constructor for more information.
|
|
56
|
+
* @param {number} count count of vertices
|
|
57
|
+
* @param {Feature} feature - the feature containing the geometry
|
|
58
|
+
*/
|
|
59
|
+
closeSubGeometry(count: number, feature: Feature): void;
|
|
60
|
+
getLastSubGeometry(): any;
|
|
61
|
+
/**
|
|
62
|
+
* Push new coordinates in vertices buffer.
|
|
63
|
+
* @param {Feature} feature - the feature containing the geometry
|
|
64
|
+
* @param {Coordinates} coordIn The coordinates to push.
|
|
65
|
+
*/
|
|
66
|
+
pushCoordinates(feature: Feature, coordIn: Coordinates): void;
|
|
67
|
+
/**
|
|
68
|
+
* Push new values coordinates in vertices buffer without any transformation.
|
|
69
|
+
* No geographical conversion is made or the normal doesn't stored.
|
|
70
|
+
*
|
|
71
|
+
* @param {Feature} feature - the feature containing the geometry
|
|
72
|
+
* @param {Object} coordIn An object containing the coordinates values to push.
|
|
73
|
+
* @param {number} coordIn.x the x coordinate (in a local system).
|
|
74
|
+
* @param {number} coordIn.y the y coordinate (in a local system).
|
|
75
|
+
* @param {THREE.Vector3} [coordIn.normal] the normal on coordinates (only for `EPSG:4978` projection).
|
|
76
|
+
* @param {Coordinates} [coordProj] An optional argument containing the geodesic coordinates in EPSG:4326
|
|
77
|
+
* It allows the user to get access to the feature coordinates to set style.base_altitude.
|
|
78
|
+
*/
|
|
79
|
+
pushCoordinatesValues(feature: Feature, coordIn: {
|
|
80
|
+
x: number;
|
|
81
|
+
y: number;
|
|
82
|
+
normal?: THREE.Vector3 | undefined;
|
|
83
|
+
}, coordProj?: Coordinates, ...args: any[]): void;
|
|
84
|
+
/**
|
|
85
|
+
* update geometry extent with the last sub geometry extent.
|
|
86
|
+
*/
|
|
87
|
+
updateExtent(): void;
|
|
88
|
+
#private;
|
|
89
|
+
}
|
|
90
|
+
export default Feature;
|
|
91
|
+
/**
|
|
92
|
+
* An object regrouping a list of [features]{@link Feature} and the extent of this collection.
|
|
93
|
+
* **Warning**, the data (`extent` or `Coordinates`) can be stored in a local system.
|
|
94
|
+
* The local system center is the `center` property.
|
|
95
|
+
* To use `Feature` vertices or `FeatureCollection/Feature` extent in FeatureCollection.crs projection,
|
|
96
|
+
* it's necessary to transform `Coordinates` or `Extent` by `FeatureCollection.matrixWorld`.
|
|
97
|
+
*
|
|
98
|
+
* ```js
|
|
99
|
+
* // To have featureCollection extent in featureCollection.crs projection:
|
|
100
|
+
* featureCollection.extent.applyMatrix4(featureCollection.matrixWorld);
|
|
101
|
+
*
|
|
102
|
+
* // To have feature vertex in featureCollection.crs projection:
|
|
103
|
+
* const vertices = featureCollection.features[0].vertices;
|
|
104
|
+
* coord.crs = featureCollection.crs;
|
|
105
|
+
* coord.setFromArray(vertices)
|
|
106
|
+
* coord.applyMatrix4(featureCollection.matrixWorld);
|
|
107
|
+
*```
|
|
108
|
+
*
|
|
109
|
+
* @extends THREE.Object3D
|
|
110
|
+
*
|
|
111
|
+
* @property {Feature[]} features - The array of features composing the
|
|
112
|
+
* collection.
|
|
113
|
+
* @property {Extent?} extent - The 2D extent containing all the features
|
|
114
|
+
* composing the collection. The extent projection is the same local projection `FeatureCollection`.
|
|
115
|
+
* To transform `FeatureCollection.extent` to `FeatureCollection.crs` projection, the transformation matrix must be applied.
|
|
116
|
+
*
|
|
117
|
+
* **WARNING** if crs is `EPSG:4978` because the 3d geocentric system doesn't work with 2D `Extent`,
|
|
118
|
+
* The FeatureCollection.extent projection is the original projection.
|
|
119
|
+
* In this case, there isn't need to transform the extent.
|
|
120
|
+
*
|
|
121
|
+
* @property {string} crs - Geographic or Geocentric coordinates system.
|
|
122
|
+
* @property {boolean} isFeatureCollection - Used to check whether this is FeatureCollection.
|
|
123
|
+
* @property {number} size - The size structure, it's 3 for 3d and 2 for 2d.
|
|
124
|
+
* @property {Style} style - The collection style used to display the feature collection.
|
|
125
|
+
* @property {boolean} isInverted - This option is to be set to the
|
|
126
|
+
* correct value, true or false (default being false), if the computation of
|
|
127
|
+
* the coordinates needs to be inverted to same scheme as OSM, Google Maps
|
|
128
|
+
* or other system. See [this link](
|
|
129
|
+
* https://alastaira.wordpress.com/2011/07/06/converting-tms-tile-coordinates-to-googlebingosm-tile-coordinates)
|
|
130
|
+
* for more informations.
|
|
131
|
+
* @property {THREE.Matrix4} matrixWorldInverse - The matrix world inverse.
|
|
132
|
+
* @property {Coordinates} center - The local center coordinates in `EPSG:4326`.
|
|
133
|
+
* The local system is centred in this center.
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
export class FeatureCollection extends THREE.Object3D<THREE.Object3DEventMap> {
|
|
137
|
+
/**
|
|
138
|
+
* @param {FeatureBuildingOptions|Layer} options The building options .
|
|
139
|
+
*/
|
|
140
|
+
constructor(options: FeatureBuildingOptions | Layer);
|
|
141
|
+
isFeatureCollection: boolean;
|
|
142
|
+
crs: any;
|
|
143
|
+
features: any[];
|
|
144
|
+
mergeFeatures: any;
|
|
145
|
+
size: number;
|
|
146
|
+
filterExtent: any;
|
|
147
|
+
style: any;
|
|
148
|
+
isInverted: boolean;
|
|
149
|
+
matrixWorldInverse: THREE.Matrix4;
|
|
150
|
+
center: Coordinates;
|
|
151
|
+
extent: Extent | undefined;
|
|
152
|
+
normalMatrixInverse: THREE.Matrix3;
|
|
153
|
+
/**
|
|
154
|
+
* Apply the matrix World inverse on the coordinates.
|
|
155
|
+
* This method is used when the coordinates is pushed
|
|
156
|
+
* to transform it in local system.
|
|
157
|
+
*
|
|
158
|
+
* @param {Coordinates} coordinates The coordinates
|
|
159
|
+
* @returns {Coordinates} The coordinates in local system
|
|
160
|
+
*/
|
|
161
|
+
transformToLocalSystem(coordinates: Coordinates): Coordinates;
|
|
162
|
+
/**
|
|
163
|
+
* Update FeatureCollection extent with `extent` or all features extent if
|
|
164
|
+
* `extent` is `undefined`.
|
|
165
|
+
* @param {Extent} extent
|
|
166
|
+
*/
|
|
167
|
+
updateExtent(extent: Extent): void;
|
|
168
|
+
/**
|
|
169
|
+
* Updates the global transform of the object and its descendants.
|
|
170
|
+
*
|
|
171
|
+
* @param {boolean} force The force
|
|
172
|
+
*/
|
|
173
|
+
updateMatrixWorld(force: boolean): void;
|
|
174
|
+
/**
|
|
175
|
+
* Remove features that don't have {@link FeatureGeometry}.
|
|
176
|
+
*/
|
|
177
|
+
removeEmptyFeature(): void;
|
|
178
|
+
/**
|
|
179
|
+
* Push the `feature` in FeatureCollection.
|
|
180
|
+
* @param {Feature} feature
|
|
181
|
+
*/
|
|
182
|
+
pushFeature(feature: Feature): void;
|
|
183
|
+
requestFeature(type: any, callback: any): any;
|
|
184
|
+
/**
|
|
185
|
+
* Returns the Feature by type if `mergeFeatures` is `true` or returns the
|
|
186
|
+
* new instance of typed Feature.
|
|
187
|
+
*
|
|
188
|
+
* @param {string} type the type requested
|
|
189
|
+
* @returns {Feature}
|
|
190
|
+
*/
|
|
191
|
+
requestFeatureByType(type: string): Feature;
|
|
192
|
+
/**
|
|
193
|
+
* Returns the Feature by type if `mergeFeatures` is `true` or returns the
|
|
194
|
+
* new instance of typed Feature.
|
|
195
|
+
*
|
|
196
|
+
* @param {string} id the id requested
|
|
197
|
+
* @param {string} type the type requested
|
|
198
|
+
* @returns {Feature}
|
|
199
|
+
*/
|
|
200
|
+
requestFeatureById(id: string, type: string): Feature;
|
|
201
|
+
/**
|
|
202
|
+
* Add a new feature with references to all properties.
|
|
203
|
+
* It allows to have features with different styles
|
|
204
|
+
* without having to duplicate the geometry.
|
|
205
|
+
* @param {Feature} feature The feature to reference.
|
|
206
|
+
* @return {Feature} The new referenced feature
|
|
207
|
+
*/
|
|
208
|
+
newFeatureByReference(feature: Feature): Feature;
|
|
209
|
+
#private;
|
|
210
|
+
}
|
|
211
|
+
export type FeatureBuildingOptions = {
|
|
212
|
+
/**
|
|
213
|
+
* - The CRS to convert the input coordinates to.
|
|
214
|
+
*/
|
|
215
|
+
crs: string;
|
|
216
|
+
/**
|
|
217
|
+
* - data structure type : 2d or 3d.
|
|
218
|
+
* If the structure is 3d, the feature have 3 dimensions by vertices positions and
|
|
219
|
+
* a normal for each vertices.
|
|
220
|
+
*/
|
|
221
|
+
structure?: string | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* - Optional filter to reject
|
|
224
|
+
* features outside of extent. Extent filtering is file extent if filteringExtent is true.
|
|
225
|
+
*/
|
|
226
|
+
filteringExtent?: boolean | Extent | undefined;
|
|
227
|
+
/**
|
|
228
|
+
* - If true the geometry will
|
|
229
|
+
* have an extent property containing the area covered by the geometry.
|
|
230
|
+
* Default value is false if `structure` parameter is set to '3d', and true otherwise.
|
|
231
|
+
* True if the layer does not inherit from {@link GeometryLayer}.
|
|
232
|
+
*/
|
|
233
|
+
buildExtent?: boolean | undefined;
|
|
234
|
+
/**
|
|
235
|
+
* - force feature extent crs if buildExtent is true.
|
|
236
|
+
*/
|
|
237
|
+
forcedExtentCrs: string;
|
|
238
|
+
/**
|
|
239
|
+
* - Filter function to remove features
|
|
240
|
+
*/
|
|
241
|
+
filter?: Function | undefined;
|
|
242
|
+
/**
|
|
243
|
+
* - If true all geometries are merged by type and multi-type.
|
|
244
|
+
*/
|
|
245
|
+
mergeFeatures?: boolean | undefined;
|
|
246
|
+
/**
|
|
247
|
+
* - The style to inherit when creating
|
|
248
|
+
* style for all new features.
|
|
249
|
+
*/
|
|
250
|
+
style: Style;
|
|
251
|
+
};
|
|
252
|
+
import { Extent } from '@itowns/geographic';
|
|
253
|
+
/**
|
|
254
|
+
*
|
|
255
|
+
* This class improves and simplifies the construction and conversion of geographic data structures.
|
|
256
|
+
* It's an intermediary structure between geomatic formats and THREE objects.
|
|
257
|
+
*
|
|
258
|
+
* **Warning**, the data (`extent` or `Coordinates`) can be stored in a local system.
|
|
259
|
+
* To use vertices or extent in `Feature.crs` projection,
|
|
260
|
+
* it's necessary to transform `Coordinates` or `Extent` by `FeatureCollection.matrixWorld`.
|
|
261
|
+
*
|
|
262
|
+
* ```js
|
|
263
|
+
* // To have feature extent in featureCollection.crs projection:
|
|
264
|
+
* feature.extent.applyMatrix4(featureCollection.matrixWorld);
|
|
265
|
+
*
|
|
266
|
+
* // To have feature vertex in feature.crs projection:
|
|
267
|
+
* coord.crs = feature.crs;
|
|
268
|
+
* coord.setFromArray(feature.vertices)
|
|
269
|
+
* coord.applyMatrix4(featureCollection.matrixWorld);
|
|
270
|
+
*```
|
|
271
|
+
*
|
|
272
|
+
* @property {string} type - Geometry type, can be `point`, `line`, or
|
|
273
|
+
* `polygon`.
|
|
274
|
+
* @property {number[]} vertices - All the vertices of the Feature.
|
|
275
|
+
* @property {number[]} normals - All the normals of the Feature.
|
|
276
|
+
* @property {number} size - the number of values of the array that should be associated with a coordinates.
|
|
277
|
+
* The size is 3 with altitude and 2 without altitude.
|
|
278
|
+
* @property {boolean} hasRawElevationData - indicates if the geographic coordinates, from original source, has an elevation,
|
|
279
|
+
* the coordinates has a third coordinate.
|
|
280
|
+
* @property {string} crs - Geographic or Geocentric coordinates system.
|
|
281
|
+
* @property {FeatureGeometry[]} geometries - An array containing all {@link
|
|
282
|
+
* FeatureGeometry}.
|
|
283
|
+
* @property {Extent?} extent - The extent containing all the geometries
|
|
284
|
+
* composing the feature.
|
|
285
|
+
*/
|
|
286
|
+
declare class Feature {
|
|
287
|
+
/**
|
|
288
|
+
*
|
|
289
|
+
* @param {string} type type of Feature. It can be 'point', 'line' or 'polygon'.
|
|
290
|
+
* @param {FeatureCollection} collection Parent feature collection.
|
|
291
|
+
*/
|
|
292
|
+
constructor(type: string, collection: FeatureCollection);
|
|
293
|
+
type: string;
|
|
294
|
+
geometries: any[];
|
|
295
|
+
vertices: any[];
|
|
296
|
+
crs: any;
|
|
297
|
+
size: number;
|
|
298
|
+
normals: never[] | undefined;
|
|
299
|
+
hasRawElevationData: boolean;
|
|
300
|
+
transformToLocalSystem: (coordinates: Coordinates) => Coordinates;
|
|
301
|
+
extent: Extent | undefined;
|
|
302
|
+
useCrsOut: boolean | undefined;
|
|
303
|
+
_pos: number;
|
|
304
|
+
_pushValues: typeof push3DValues;
|
|
305
|
+
style: (properties: Object, featCtx: FeatureContext) => StyleOptions;
|
|
306
|
+
/**
|
|
307
|
+
* Instance a new {@link FeatureGeometry} and push in {@link Feature}.
|
|
308
|
+
* @returns {FeatureGeometry} the instancied geometry.
|
|
309
|
+
*/
|
|
310
|
+
bindNewGeometry(): FeatureGeometry;
|
|
311
|
+
/**
|
|
312
|
+
* Update {@link Extent} feature with {@link Extent} geometry
|
|
313
|
+
* @param {FeatureGeometry} geometry used to update Feature {@link Extent}
|
|
314
|
+
*/
|
|
315
|
+
updateExtent(geometry: FeatureGeometry): void;
|
|
316
|
+
/**
|
|
317
|
+
* @returns {number} the count of geometry.
|
|
318
|
+
*/
|
|
319
|
+
get geometryCount(): number;
|
|
320
|
+
}
|
|
321
|
+
import { Coordinates } from '@itowns/geographic';
|
|
322
|
+
import * as THREE from 'three';
|
|
323
|
+
declare function push3DValues(value0: any, value1: any, value2?: number): void;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export default GeoidGrid;
|
|
2
|
+
/**
|
|
3
|
+
* An instance of `GeoidGrid` allows accessing some geoid height grid data from geographic instances (like some
|
|
4
|
+
* {@link Coordinates}). The geoid height grid data must contain geoid height values for a set of geographic points
|
|
5
|
+
* regularly dispatched on a planar surface.
|
|
6
|
+
*
|
|
7
|
+
* @property {Extent} extent The geographic extent of the geoid height grid data.
|
|
8
|
+
* @property {THREE.Vector2} step The distance between two consecutive points of the geoid height grid. The
|
|
9
|
+
* `x` value stands for the distance along the West-East direction, and the
|
|
10
|
+
* `y` value stands for the distance along the South-North direction.
|
|
11
|
+
* @property {THREE.Vector2} dimensions The planar dimensions of the geoid height grid data extent.
|
|
12
|
+
* @property {THREE.Vector2} dataSize The number of values in the gridded data along the West-East direction (`x`
|
|
13
|
+
* axis) and the South-North direction (`y` axis).
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Create a set of gridded data.
|
|
17
|
+
* const data = [
|
|
18
|
+
* [1, 2, 3],
|
|
19
|
+
* [2, 3, 4],
|
|
20
|
+
* [3, 4, 5],
|
|
21
|
+
* ];
|
|
22
|
+
* // This set of data presents the following spatial distribution of geoid heights values :
|
|
23
|
+
* //
|
|
24
|
+
* // Latitudes ^
|
|
25
|
+
* // |
|
|
26
|
+
* // 41.0 | 3 4 5
|
|
27
|
+
* // 40.5 | 2 3 4
|
|
28
|
+
* // 40.0 | 1 2 3
|
|
29
|
+
* // |------------->
|
|
30
|
+
* // 1 2 3 Longitudes
|
|
31
|
+
*
|
|
32
|
+
* // Create a GeoidGrid allowing to access the gridded data.
|
|
33
|
+
* const geoidGrid = new GeoidGrid(
|
|
34
|
+
* new Extent('EPSG:4326', 1, 3, 40, 41),
|
|
35
|
+
* new THREE.Vector2(1, 0.5),
|
|
36
|
+
* (verticalIndex, horizontalIndex) => data[verticalIndex][horizontalIndex],
|
|
37
|
+
* );
|
|
38
|
+
*
|
|
39
|
+
* // Access a value of geoid height at some geographic coordinates.
|
|
40
|
+
* // The value is interpolated from the gridded data.
|
|
41
|
+
* const value = geoidGrid.getHeightAtCoordinates(
|
|
42
|
+
* new Coordinates('EPSG:4326', 1.5, 40.25)
|
|
43
|
+
* );
|
|
44
|
+
* // This should return 2.0, which is the result from the bi-linear
|
|
45
|
+
* // interpolation at the center of the `[[1, 2], [2, 3]]` subsection
|
|
46
|
+
* // of the grid data.
|
|
47
|
+
*/
|
|
48
|
+
declare class GeoidGrid {
|
|
49
|
+
/**
|
|
50
|
+
* @param {Extent} extent The geographic extent of the geoid height grid data.
|
|
51
|
+
* @param {THREE.Vector2} step The distance between two consecutive points of the geoid height grid. The
|
|
52
|
+
* `x` value stands for the distance along the West-East direction, and the
|
|
53
|
+
* `y` value stands for the distance along the South-North direction.
|
|
54
|
+
* @param {function} getData A method that allows reading a value in the geoid height grid from its
|
|
55
|
+
* vertical and horizontal indexes. The lower an index, the lower the
|
|
56
|
+
* coordinate on the corresponding axis - 0 being the index of the minimal
|
|
57
|
+
* coordinate of the gridded data on a given axis. In other words :
|
|
58
|
+
* - `getData(0, 0)` must return the geoid height value at the SOUTH-WEST
|
|
59
|
+
* corner of your data extent.
|
|
60
|
+
* - `getData(0, j)` must return a geoid height on the southern limit of your
|
|
61
|
+
* data extent.
|
|
62
|
+
* - `getData(i, 0)` must return a geoid height on the western limit of your
|
|
63
|
+
* data extent.
|
|
64
|
+
* - if your gridded data has dimensions (rowNumber, colNumber),
|
|
65
|
+
* `getData(rowNumber - 1, colNumber - 1)` must return the geoid height at
|
|
66
|
+
* the NORTH-EAST corner of your data extent.
|
|
67
|
+
*/
|
|
68
|
+
constructor(extent: Extent, step: THREE.Vector2, getData: Function);
|
|
69
|
+
extent: Extent;
|
|
70
|
+
step: THREE.Vector2;
|
|
71
|
+
dimensions: any;
|
|
72
|
+
dataSize: THREE.Vector2;
|
|
73
|
+
getData: Function;
|
|
74
|
+
/**
|
|
75
|
+
* Get the value of the geoid height at given geographic {@link Coordinates}. The geoid height value is
|
|
76
|
+
* bi-linearly interpolated from the gridded data accessed by the `GeoidGrid` instance.
|
|
77
|
+
*
|
|
78
|
+
* @param {Coordinates} coordinates Geographic coordinates to get the geoid height value at.
|
|
79
|
+
*
|
|
80
|
+
* @returns {number} The geoid height value at the given {@link Coordinates}, bi-interpolated from the gridded
|
|
81
|
+
* data accessed by the `GeoidGrid` instance.
|
|
82
|
+
*/
|
|
83
|
+
getHeightAtCoordinates(coordinates: Coordinates): number;
|
|
84
|
+
}
|
|
85
|
+
import * as THREE from 'three';
|
|
86
|
+
import { Coordinates } from '@itowns/geographic';
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export default Label;
|
|
2
|
+
/**
|
|
3
|
+
* An object that handles the display of a text and/or an icon, linked to a 3D
|
|
4
|
+
* position. The content of the `Label` is managed through a DOM object, in a
|
|
5
|
+
* `<div>` handled by the `Label2DRenderer`.
|
|
6
|
+
*
|
|
7
|
+
* @property {boolean} isLabel - Used to checkout whether this object is a
|
|
8
|
+
* Label. Default is true. You should not change this, as it is used internally
|
|
9
|
+
* for optimisation.
|
|
10
|
+
* @property {Element} content - The DOM object that contains the content of the
|
|
11
|
+
* label. The style and the position are applied on this object. All labels
|
|
12
|
+
* contain the `itowns-label` class, as well as a specific class related to the
|
|
13
|
+
* layer linked to it: `itowns-label-[layer-id]` (replace `[layer-id]` by the
|
|
14
|
+
* correct string).
|
|
15
|
+
* @property {THREE.Vector3} position - The position in the 3D world of the
|
|
16
|
+
* label.
|
|
17
|
+
* @property {number} padding - sets the padding area on all four sides of an element at once.
|
|
18
|
+
* @property {Coordinates} coordinates - The coordinates of the label.
|
|
19
|
+
* @property {number} order - Order of the label that will be read from the
|
|
20
|
+
* style. It helps sorting and prioritizing a Label during render.
|
|
21
|
+
*/
|
|
22
|
+
declare class Label extends THREE.Object3D<THREE.Object3DEventMap> {
|
|
23
|
+
/**
|
|
24
|
+
* @param {Element|string} content - The content; can be a
|
|
25
|
+
* string, with or without HTML tags in it, or it can be an Element.
|
|
26
|
+
* @param {Coordinates} coordinates - The world coordinates, where to place
|
|
27
|
+
* the Label.
|
|
28
|
+
* @param {Style} style - The style to apply to the content. Once the style
|
|
29
|
+
* is applied, it cannot be changed directly. However, if it really needed,
|
|
30
|
+
* it can be accessed through `label.content.style`, but it is highly
|
|
31
|
+
* discouraged to do so.
|
|
32
|
+
*/
|
|
33
|
+
constructor(content: (Element | string) | undefined, coordinates: Coordinates, style?: Style, ...args: any[]);
|
|
34
|
+
isLabel: boolean;
|
|
35
|
+
coordinates: Coordinates;
|
|
36
|
+
projectedPosition: {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
};
|
|
40
|
+
boundaries: {
|
|
41
|
+
left: number;
|
|
42
|
+
right: number;
|
|
43
|
+
top: number;
|
|
44
|
+
bottom: number;
|
|
45
|
+
};
|
|
46
|
+
content: Node;
|
|
47
|
+
anchor: any;
|
|
48
|
+
styleOffset: any;
|
|
49
|
+
icon: any;
|
|
50
|
+
iconOffset: {
|
|
51
|
+
left: number;
|
|
52
|
+
right: number;
|
|
53
|
+
top: number;
|
|
54
|
+
bottom: number;
|
|
55
|
+
};
|
|
56
|
+
zoom: {
|
|
57
|
+
min: any;
|
|
58
|
+
max: any;
|
|
59
|
+
};
|
|
60
|
+
order: any;
|
|
61
|
+
padding: number;
|
|
62
|
+
/**
|
|
63
|
+
* Moves a label on the screen, using screen coordinates. It updates the
|
|
64
|
+
* boundaries as it moves it.
|
|
65
|
+
*
|
|
66
|
+
* @param {number} x - X coordinates in pixels, from left.
|
|
67
|
+
* @param {number} y - Y coordinates in pixels, from top.
|
|
68
|
+
*/
|
|
69
|
+
updateProjectedPosition(x: number, y: number): void;
|
|
70
|
+
updateCSSPosition(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Updates the screen dimensions of the label, using
|
|
73
|
+
* `getBoundingClientRect`. It updates `width` and `height` property of the
|
|
74
|
+
* label, and the boundaries.
|
|
75
|
+
*/
|
|
76
|
+
initDimensions(): void;
|
|
77
|
+
offset: {
|
|
78
|
+
left: any;
|
|
79
|
+
top: any;
|
|
80
|
+
} | undefined;
|
|
81
|
+
update3dPosition(crs: any): void;
|
|
82
|
+
updateElevationFromLayer(layer: any, nodes: any): void;
|
|
83
|
+
updateHorizonCullingPoint(): void;
|
|
84
|
+
}
|
|
85
|
+
import * as THREE from 'three';
|
|
86
|
+
import { Coordinates } from '@itowns/geographic';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const RENDERING_PAUSED: 0;
|
|
2
|
+
export const RENDERING_SCHEDULED: 1;
|
|
3
|
+
export namespace MAIN_LOOP_EVENTS {
|
|
4
|
+
let UPDATE_START: string;
|
|
5
|
+
let BEFORE_CAMERA_UPDATE: string;
|
|
6
|
+
let AFTER_CAMERA_UPDATE: string;
|
|
7
|
+
let BEFORE_LAYER_UPDATE: string;
|
|
8
|
+
let AFTER_LAYER_UPDATE: string;
|
|
9
|
+
let BEFORE_RENDER: string;
|
|
10
|
+
let AFTER_RENDER: string;
|
|
11
|
+
let UPDATE_END: string;
|
|
12
|
+
}
|
|
13
|
+
export default MainLoop;
|
|
14
|
+
declare class MainLoop extends EventDispatcher<any> {
|
|
15
|
+
constructor(scheduler: any, engine: any);
|
|
16
|
+
renderingState: number;
|
|
17
|
+
scheduler: any;
|
|
18
|
+
gfxEngine: any;
|
|
19
|
+
scheduleViewUpdate(view: any, forceRedraw: any): void;
|
|
20
|
+
step(view: any, timestamp: any): void;
|
|
21
|
+
#private;
|
|
22
|
+
}
|
|
23
|
+
import { EventDispatcher } from 'three';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
function pickTilesAt(view: any, viewCoords: any, radius: any, layer: any, results?: any[]): any[];
|
|
3
|
+
function pickPointsAt(view: any, viewCoords: any, radius: any, layer: any, result?: any[]): any[] | undefined;
|
|
4
|
+
function pickObjectsAt(view: any, viewCoords: any, radius: any, object: any, target?: any[]): any[];
|
|
5
|
+
}
|
|
6
|
+
export default _default;
|
package/lib/Core/Picking.js
CHANGED
|
@@ -157,6 +157,10 @@ export default {
|
|
|
157
157
|
// disable picking mode
|
|
158
158
|
o.material.enablePicking(false);
|
|
159
159
|
|
|
160
|
+
// Skip if geometry is invalid or missing position attribute
|
|
161
|
+
if (!o.geometry || !o.geometry.attributes || !o.geometry.attributes.position) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
160
164
|
// if baseId matches objId, the clicked point belongs to `o`
|
|
161
165
|
for (let i = 0; i < candidates.length; i++) {
|
|
162
166
|
if (candidates[i].objId == o.baseId) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default PointCloudNode;
|
|
2
|
+
declare class PointCloudNode extends THREE.EventDispatcher<any> {
|
|
3
|
+
constructor(numPoints: number | undefined, layer: any);
|
|
4
|
+
numPoints: number;
|
|
5
|
+
layer: any;
|
|
6
|
+
children: any[];
|
|
7
|
+
bbox: THREE.Box3;
|
|
8
|
+
sse: number;
|
|
9
|
+
get pointSpacing(): number;
|
|
10
|
+
get id(): void;
|
|
11
|
+
add(node: any, indexChild: any): void;
|
|
12
|
+
createChildAABB(node: any): void;
|
|
13
|
+
load(): any;
|
|
14
|
+
findCommonAncestor(node: any): any;
|
|
15
|
+
}
|
|
16
|
+
import * as THREE from 'three';
|