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
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export default ColorLayer;
|
|
2
|
+
/**
|
|
3
|
+
* Fires when the visiblity of the layer has changed.
|
|
4
|
+
* @event ColorLayer#visible-property-changed
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Fires when the opacity of the layer has changed.
|
|
8
|
+
* @event ColorLayer#opacity-property-changed
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Fires when the sequence of the layer has changed, meaning that the order of
|
|
12
|
+
* the layer changed in the view it is attached to.
|
|
13
|
+
* @event ColorLayer#sequence-property-changed
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* @property {boolean} isColorLayer - Used to checkout whether this layer is a
|
|
17
|
+
* ColorLayer. Default is true. You should not change this, as it is used
|
|
18
|
+
* internally for optimisation.
|
|
19
|
+
* @property {StyleOptions|Style} style - style properties or a Style defined by the user,
|
|
20
|
+
* to apply to the layer features.
|
|
21
|
+
* @property {boolean} visible - property to display or to hide layer.
|
|
22
|
+
* @property {number} opacity - property to adjust transparency, opacity is between 0. and 1.
|
|
23
|
+
* @property {boolean} transparent - specify if the layer could be transparent.
|
|
24
|
+
* @property {boolean} noTextureParentOutsideLimit - don't parent texture if it's outside limit.
|
|
25
|
+
* @property {number} effect_type - type effect to apply on the raster color.
|
|
26
|
+
* If `effect_type` equals:
|
|
27
|
+
* * `0`: no effect.
|
|
28
|
+
* * `1`: light color to invisible effect: transparency effect is stronger for
|
|
29
|
+
* light colors (whose distance is closer to white). This effect can be
|
|
30
|
+
* amplified by `effect_parameter`.
|
|
31
|
+
* * `2`: white color to invisible effect: white color is considered as
|
|
32
|
+
* transparent.
|
|
33
|
+
* * `3`: custom shader effect: set `ShaderChunk.customBodyColorLayer` and
|
|
34
|
+
* `ShaderChunk.customHeaderColorLayer` to add your own glsl code in
|
|
35
|
+
* respectively the color layer function body and at top-level.
|
|
36
|
+
* @property {number} effect_parameter - value used as parameter of certain type
|
|
37
|
+
* of effects. If `effect_type` equals:
|
|
38
|
+
* * `0`: unused.
|
|
39
|
+
* * `1`: used to amplify the transparency effect.
|
|
40
|
+
* * `2`: unused.
|
|
41
|
+
* * `3`: could be used by your own glsl code.
|
|
42
|
+
*
|
|
43
|
+
* @extends RasterLayer
|
|
44
|
+
*/
|
|
45
|
+
declare class ColorLayer extends RasterLayer {
|
|
46
|
+
/**
|
|
47
|
+
* A simple layer, usually managing a texture to display on a view. For example,
|
|
48
|
+
* it can be an aerial view of the ground or a simple transparent layer with the
|
|
49
|
+
* roads displayed.
|
|
50
|
+
*
|
|
51
|
+
* @param {string} id - The id of the layer, that should be unique. It is
|
|
52
|
+
* not mandatory, but an error will be emitted if this layer is added a
|
|
53
|
+
* {@link View} that already has a layer going by that id.
|
|
54
|
+
* @param {Object} [config] - Optional configuration, all elements in it
|
|
55
|
+
* will be merged as is in the layer. For example, if the configuration
|
|
56
|
+
* contains three elements `name, protocol, extent`, these elements will be
|
|
57
|
+
* available using `layer.name` or something else depending on the property
|
|
58
|
+
* name.
|
|
59
|
+
* @param {Source} [config.source] - Description and options of the source.
|
|
60
|
+
* @param {number} [config.magFilter] - How the texture is sampled when a texel covers more than one pixel. [see](https://threejs.org/docs/?q=texture#api/en/textures/Texture.magFilter)
|
|
61
|
+
* @param {number} [config.minFilter] - How the texture is sampled when a texel covers less than one pixel. [see](https://threejs.org/docs/?q=texture#api/en/textures/Texture.minFilter)
|
|
62
|
+
* @param {number} [config.effect_type=0] - type effect to apply on raster color.
|
|
63
|
+
* if `effect_type` equals:
|
|
64
|
+
* * `0`: no special effect.
|
|
65
|
+
* * `1`: light color to invisible effect.
|
|
66
|
+
* * `2`: white color to invisible effect.
|
|
67
|
+
* * `3`: custom shader effect (defined `ShaderChunk.customBodyColorLayer` and `ShaderChunk.customHeaderColorLayer`).
|
|
68
|
+
* @param {number} [config.effect_parameter=1.0] - amount value used with effect applied on raster color.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* // Create a ColorLayer
|
|
72
|
+
* const color = new ColorLayer('roads', {
|
|
73
|
+
* source: new SourceWMTS({
|
|
74
|
+
* protocol: 'wmts',
|
|
75
|
+
* url: 'http://server.geo/wmts/....',
|
|
76
|
+
* format: 'image/png',
|
|
77
|
+
* name: 'nameService',
|
|
78
|
+
* tileMatrixSet: 'PM',
|
|
79
|
+
* }),
|
|
80
|
+
* transparent: true,
|
|
81
|
+
* opacity: 0.5,
|
|
82
|
+
* });
|
|
83
|
+
*
|
|
84
|
+
* // Add the layer
|
|
85
|
+
* view.addLayer(color);
|
|
86
|
+
*/
|
|
87
|
+
constructor(id: string, config?: {
|
|
88
|
+
source?: any;
|
|
89
|
+
magFilter?: number | undefined;
|
|
90
|
+
minFilter?: number | undefined;
|
|
91
|
+
effect_type?: number | undefined;
|
|
92
|
+
effect_parameter?: number | undefined;
|
|
93
|
+
});
|
|
94
|
+
/**
|
|
95
|
+
* @type {boolean}
|
|
96
|
+
* @readonly
|
|
97
|
+
*/
|
|
98
|
+
readonly isColorLayer: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* @type {boolean}
|
|
101
|
+
*/
|
|
102
|
+
visible: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* @type {number}
|
|
105
|
+
*/
|
|
106
|
+
opacity: number;
|
|
107
|
+
/**
|
|
108
|
+
* @type {number}
|
|
109
|
+
*/
|
|
110
|
+
sequence: number;
|
|
111
|
+
transparent: any;
|
|
112
|
+
noTextureParentOutsideLimit: any;
|
|
113
|
+
effect_type: number;
|
|
114
|
+
effect_parameter: number;
|
|
115
|
+
buildExtent: boolean;
|
|
116
|
+
structure: string;
|
|
117
|
+
/**
|
|
118
|
+
* Setup RasterColorTile added to TileMesh. This RasterColorTile handles
|
|
119
|
+
* the ColorLayer textures mapped on this TileMesh.
|
|
120
|
+
*
|
|
121
|
+
* @param {TileMesh} node The node to apply new RasterColorTile;
|
|
122
|
+
* @return {RasterColorTile} The raster color node added.
|
|
123
|
+
*/
|
|
124
|
+
setupRasterNode(node: TileMesh): RasterColorTile;
|
|
125
|
+
update(context: any, layer: any, node: any, parent: any): any;
|
|
126
|
+
}
|
|
127
|
+
import RasterLayer from '../Layer/RasterLayer';
|
|
128
|
+
import { RasterColorTile } from '../Renderer/RasterTile';
|
package/lib/Layer/ColorLayer.js
CHANGED
|
@@ -141,11 +141,11 @@ class ColorLayer extends RasterLayer {
|
|
|
141
141
|
* @return {RasterColorTile} The raster color node added.
|
|
142
142
|
*/
|
|
143
143
|
setupRasterNode(node) {
|
|
144
|
-
const
|
|
145
|
-
node.material.
|
|
144
|
+
const rasterColorTile = new RasterColorTile(this);
|
|
145
|
+
node.material.addColorTile(rasterColorTile);
|
|
146
146
|
// set up ColorLayer ordering.
|
|
147
|
-
node.material.
|
|
148
|
-
return
|
|
147
|
+
node.material.setColorTileIds(this.parent.colorLayersOrder);
|
|
148
|
+
return rasterColorTile;
|
|
149
149
|
}
|
|
150
150
|
update(context, layer, node, parent) {
|
|
151
151
|
return updateLayeredMaterialNodeImagery(context, this, node, parent);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export default CopcLayer;
|
|
2
|
+
/**
|
|
3
|
+
* A layer for [Cloud Optimised Point Cloud](https://copc.io) (COPC) datasets.
|
|
4
|
+
* See {@link PointCloudLayer} class for documentation on base properties.
|
|
5
|
+
*
|
|
6
|
+
* @extends {PointCloudLayer}
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Create a new COPC layer
|
|
10
|
+
* const copcSource = new CopcSource({
|
|
11
|
+
* url: 'https://s3.amazonaws.com/hobu-lidar/autzen-classified.copc.laz',
|
|
12
|
+
* crs: 'EPSG:4978',
|
|
13
|
+
* colorDepth: 16, // bit-depth of 'color' attribute (either 8 or 16 bits)
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* const copcLayer = new CopcLayer('COPC', {
|
|
17
|
+
* source: copcSource,
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* View.prototype.addLayer.call(view, copcLayer);
|
|
21
|
+
*/
|
|
22
|
+
declare class CopcLayer extends PointCloudLayer {
|
|
23
|
+
/**
|
|
24
|
+
* @param {string} id - Unique id of the layer.
|
|
25
|
+
* @param {Object} config - See {@link PointCloudLayer} for base pointcloud
|
|
26
|
+
* options.
|
|
27
|
+
*/
|
|
28
|
+
constructor(id: string, config: Object);
|
|
29
|
+
/**
|
|
30
|
+
* @type {boolean}
|
|
31
|
+
* @readonly
|
|
32
|
+
*/
|
|
33
|
+
readonly isCopcLayer: boolean;
|
|
34
|
+
whenReady: Promise<any>;
|
|
35
|
+
spacing: any;
|
|
36
|
+
minElevationRange: any;
|
|
37
|
+
maxElevationRange: any;
|
|
38
|
+
scale: THREE.Vector3;
|
|
39
|
+
offset: THREE.Vector3;
|
|
40
|
+
}
|
|
41
|
+
import PointCloudLayer from '../Layer/PointCloudLayer';
|
|
42
|
+
import * as THREE from 'three';
|
package/lib/Layer/CopcLayer.js
CHANGED
|
@@ -39,13 +39,13 @@ class CopcLayer extends PointCloudLayer {
|
|
|
39
39
|
const resolve = () => this;
|
|
40
40
|
this.whenReady = this.source.whenReady.then((/** @type {CopcSource} */source) => {
|
|
41
41
|
const {
|
|
42
|
-
cube
|
|
43
|
-
rootHierarchyPage
|
|
42
|
+
cube
|
|
44
43
|
} = source.info;
|
|
45
44
|
const {
|
|
46
45
|
pageOffset,
|
|
47
46
|
pageLength
|
|
48
|
-
} = rootHierarchyPage;
|
|
47
|
+
} = source.info.rootHierarchyPage;
|
|
48
|
+
this.spacing = source.info.spacing;
|
|
49
49
|
this.root = new CopcNode(0, 0, 0, 0, pageOffset, pageLength, this, -1);
|
|
50
50
|
this.root.bbox.min.fromArray(cube, 0);
|
|
51
51
|
this.root.bbox.max.fromArray(cube, 3);
|
|
@@ -56,8 +56,5 @@ class CopcLayer extends PointCloudLayer {
|
|
|
56
56
|
return this.root.loadOctree().then(resolve);
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
get spacing() {
|
|
60
|
-
return this.source.info.spacing;
|
|
61
|
-
}
|
|
62
59
|
}
|
|
63
60
|
export default CopcLayer;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export default ElevationLayer;
|
|
2
|
+
/**
|
|
3
|
+
* @property {boolean} isElevationLayer - Used to checkout whether this layer is
|
|
4
|
+
* an ElevationLayer. Default is true. You should not change this, as it is used
|
|
5
|
+
* internally for optimisation.
|
|
6
|
+
* @property {number} noDataValue - Used to specify a **null** or **no data value** in the elevation terrain.
|
|
7
|
+
* @property {number} [zmin] - Used to specify a minimum value for the elevation terrain (if the data goes lower, it will be clamped).
|
|
8
|
+
* @property {number} [zmax] - Used to specify a maximum value for the elevation terrain (if the data goes higher, it will be clamped)
|
|
9
|
+
* @property {number} scale - Used to apply a scale on the elevation value. It
|
|
10
|
+
* can be used for exageration of the elevation, like in [this
|
|
11
|
+
* example](https://www.itowns-project.org/itowns/examples/#plugins_pyramidal_tiff).
|
|
12
|
+
* @property {boolean} useColorTextureElevation - the elevation is computed with one color texture channel,
|
|
13
|
+
* `this.colorTextureElevationMaxZ` and `this.colorTextureElevationMinZ`.
|
|
14
|
+
*
|
|
15
|
+
* The formula is:
|
|
16
|
+
*
|
|
17
|
+
* ```js
|
|
18
|
+
* elevation = color.r * (this.colorTextureElevationMaxZ - this.colorTextureElevationMinZ) + this.colorTextureElevationMinZ
|
|
19
|
+
* ```
|
|
20
|
+
* @property {number} colorTextureElevationMinZ - elevation minimum in `useColorTextureElevation` mode.
|
|
21
|
+
* @property {number} colorTextureElevationMaxZ - elevation maximum in `useColorTextureElevation` mode.
|
|
22
|
+
*
|
|
23
|
+
* @extends RasterLayer
|
|
24
|
+
*/
|
|
25
|
+
declare class ElevationLayer extends RasterLayer {
|
|
26
|
+
/**
|
|
27
|
+
* A simple layer, managing an elevation texture to add some reliefs on the
|
|
28
|
+
* plane or globe view for example.
|
|
29
|
+
*
|
|
30
|
+
* @param {string} id - The id of the layer, that should be unique. It is
|
|
31
|
+
* not mandatory, but an error will be emitted if this layer is added a
|
|
32
|
+
* {@link View} that already has a layer going by that id.
|
|
33
|
+
* @param {Object} [config] - Optional configuration, all elements in it
|
|
34
|
+
* will be merged as is in the layer. For example, if the configuration
|
|
35
|
+
* contains three elements `name, protocol, extent`, these elements will be
|
|
36
|
+
* available using `layer.name` or something else depending on the property
|
|
37
|
+
* name.
|
|
38
|
+
* @param {number} [config.noDataValue] The value coding the noData in the data set
|
|
39
|
+
* @param {Object} [config.clampValues] - Optional information for clamping
|
|
40
|
+
* the elevation between a minimum and a maximum value
|
|
41
|
+
* @param {number} [config.clampValues.min] The minimum value to clamp the elevation
|
|
42
|
+
* @param {number} [config.clampValues.max] The maximum value to clamp the elevation
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // Create an ElevationLayer
|
|
46
|
+
* const elevation = new ElevationLayer('IGN_MNT', {
|
|
47
|
+
* source: new WMTSSource({
|
|
48
|
+
* "url": "https://data.geopf.fr/wmts?",
|
|
49
|
+
* "crs": "EPSG:4326",
|
|
50
|
+
* "format": "image/x-bil;bits=32",
|
|
51
|
+
* "name": "ELEVATION.ELEVATIONGRIDCOVERAGE",
|
|
52
|
+
* }),
|
|
53
|
+
* });
|
|
54
|
+
*
|
|
55
|
+
* // Add the layer
|
|
56
|
+
* view.addLayer(elevation);
|
|
57
|
+
*/
|
|
58
|
+
constructor(id: string, config?: {
|
|
59
|
+
noDataValue?: number | undefined;
|
|
60
|
+
clampValues?: {
|
|
61
|
+
min?: number | undefined;
|
|
62
|
+
max?: number | undefined;
|
|
63
|
+
} | undefined;
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* @type {boolean}
|
|
67
|
+
* @readonly
|
|
68
|
+
*/
|
|
69
|
+
readonly isElevationLayer: boolean;
|
|
70
|
+
noDataValue: number | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* @type {number | undefined}
|
|
73
|
+
*/
|
|
74
|
+
zmin: number | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* @type {number | undefined}
|
|
77
|
+
*/
|
|
78
|
+
zmax: number | undefined;
|
|
79
|
+
useRgbaTextureElevation: any;
|
|
80
|
+
useColorTextureElevation: any;
|
|
81
|
+
colorTextureElevationMinZ: any;
|
|
82
|
+
colorTextureElevationMaxZ: any;
|
|
83
|
+
bias: any;
|
|
84
|
+
mode: any;
|
|
85
|
+
/**
|
|
86
|
+
* Setup RasterElevationTile added to TileMesh. This RasterElevationTile handles
|
|
87
|
+
* the elevation texture to displace TileMesh vertices.
|
|
88
|
+
*
|
|
89
|
+
* @param {TileMesh} node The node to apply new RasterElevationTile;
|
|
90
|
+
* @return {RasterElevationTile} The raster elevation node added.
|
|
91
|
+
*/
|
|
92
|
+
setupRasterNode(node: TileMesh): RasterElevationTile;
|
|
93
|
+
update(context: any, layer: any, node: any, parent: any): any;
|
|
94
|
+
}
|
|
95
|
+
import RasterLayer from '../Layer/RasterLayer';
|
|
96
|
+
import { RasterElevationTile } from '../Renderer/RasterTile';
|
|
@@ -110,9 +110,9 @@ class ElevationLayer extends RasterLayer {
|
|
|
110
110
|
* @return {RasterElevationTile} The raster elevation node added.
|
|
111
111
|
*/
|
|
112
112
|
setupRasterNode(node) {
|
|
113
|
-
const rasterElevationNode = new RasterElevationTile(
|
|
114
|
-
node.material.
|
|
115
|
-
node.material.
|
|
113
|
+
const rasterElevationNode = new RasterElevationTile(this);
|
|
114
|
+
node.material.setElevationTile(rasterElevationNode);
|
|
115
|
+
node.material.setElevationTileId(this.id);
|
|
116
116
|
// bounding box initialisation
|
|
117
117
|
const updateBBox = () => node.setBBoxZ({
|
|
118
118
|
min: rasterElevationNode.min,
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export default EntwinePointTileLayer;
|
|
2
|
+
/**
|
|
3
|
+
* @property {boolean} isEntwinePointTileLayer - Used to checkout whether this
|
|
4
|
+
* layer is a EntwinePointTileLayer. Default is `true`. You should not change
|
|
5
|
+
* this, as it is used internally for optimisation.
|
|
6
|
+
*
|
|
7
|
+
* @extends PointCloudLayer
|
|
8
|
+
*/
|
|
9
|
+
declare class EntwinePointTileLayer extends PointCloudLayer {
|
|
10
|
+
/**
|
|
11
|
+
* Constructs a new instance of Entwine Point Tile layer.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Create a new point cloud layer
|
|
15
|
+
* const points = new EntwinePointTileLayer('EPT',
|
|
16
|
+
* {
|
|
17
|
+
* source: new EntwinePointTileSource({
|
|
18
|
+
* url: 'https://server.geo/ept-dataset',
|
|
19
|
+
* }
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* View.prototype.addLayer.call(view, points);
|
|
23
|
+
*
|
|
24
|
+
* @param {string} id - The id of the layer, that should be unique. It is
|
|
25
|
+
* not mandatory, but an error will be emitted if this layer is added a
|
|
26
|
+
* {@link View} that already has a layer going by that id.
|
|
27
|
+
* @param {Object} config - Configuration, all elements in it
|
|
28
|
+
* will be merged as is in the layer. For example, if the configuration
|
|
29
|
+
* contains three elements `name, protocol, extent`, these elements will be
|
|
30
|
+
* available using `layer.name` or something else depending on the property
|
|
31
|
+
* name. See the list of properties to know which one can be specified.
|
|
32
|
+
* @param {string} [config.crs='ESPG:4326'] - The CRS of the {@link View} this
|
|
33
|
+
* layer will be attached to. This is used to determine the extent of this
|
|
34
|
+
* layer. Default to `EPSG:4326`.
|
|
35
|
+
*/
|
|
36
|
+
constructor(id: string, config: {
|
|
37
|
+
crs?: string | undefined;
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* @type {boolean}
|
|
41
|
+
* @readonly
|
|
42
|
+
*/
|
|
43
|
+
readonly isEntwinePointTileLayer: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* @type {THREE.Vector3}
|
|
46
|
+
*/
|
|
47
|
+
scale: THREE.Vector3;
|
|
48
|
+
whenReady: Promise<any>;
|
|
49
|
+
spacing: number;
|
|
50
|
+
minElevationRange: any;
|
|
51
|
+
maxElevationRange: any;
|
|
52
|
+
extent: Extent;
|
|
53
|
+
}
|
|
54
|
+
import PointCloudLayer from '../Layer/PointCloudLayer';
|
|
55
|
+
import * as THREE from 'three';
|
|
56
|
+
import { Extent } from '@itowns/geographic';
|
|
@@ -55,6 +55,10 @@ class EntwinePointTileLayer extends PointCloudLayer {
|
|
|
55
55
|
this.scale = new THREE.Vector3(1, 1, 1);
|
|
56
56
|
const resolve = this.addInitializationStep();
|
|
57
57
|
this.whenReady = this.source.whenReady.then(() => {
|
|
58
|
+
// NOTE: this spacing is kinda arbitrary here, we take the width and
|
|
59
|
+
// length (height can be ignored), and we divide by the specified
|
|
60
|
+
// span in ept.json. This needs improvements.
|
|
61
|
+
this.spacing = (Math.abs(this.source.bounds[3] - this.source.bounds[0]) + Math.abs(this.source.bounds[4] - this.source.bounds[1])) / (2 * this.source.span);
|
|
58
62
|
this.root = new EntwinePointTileNode(0, 0, 0, 0, this, -1);
|
|
59
63
|
this.root.bbox.min.fromArray(this.source.boundsConforming, 0);
|
|
60
64
|
this.root.bbox.max.fromArray(this.source.boundsConforming, 3);
|
|
@@ -64,8 +68,5 @@ class EntwinePointTileLayer extends PointCloudLayer {
|
|
|
64
68
|
return this.root.loadOctree().then(resolve);
|
|
65
69
|
});
|
|
66
70
|
}
|
|
67
|
-
get spacing() {
|
|
68
|
-
return this.source.spacing;
|
|
69
|
-
}
|
|
70
71
|
}
|
|
71
72
|
export default EntwinePointTileLayer;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export default FeatureGeometryLayer;
|
|
2
|
+
/**
|
|
3
|
+
* `FeatureGeometryLayer` displays geographic vector data (geojson, kml...) in object 3D.
|
|
4
|
+
* `FeatureGeometryLayer` is a pre-configured `GeometryLayer` to load and convert vector data.
|
|
5
|
+
* In deed, `GeometryLayer` allows customizing data loading (`update` method)
|
|
6
|
+
* and their conversion (`convert` method),
|
|
7
|
+
*
|
|
8
|
+
* @property {boolean} isFeatureGeometryLayer - Used to checkout whether this layer is
|
|
9
|
+
* a FeatureGeometryLayer. Default is true. You should not change this, as it is used
|
|
10
|
+
* internally for optimisation.
|
|
11
|
+
*
|
|
12
|
+
* @extends GeometryLayer
|
|
13
|
+
*/
|
|
14
|
+
declare class FeatureGeometryLayer extends GeometryLayer {
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param {string} id - The id of the layer, that should be unique. It is
|
|
18
|
+
* not mandatory, but an error will be emitted if this layer is added a
|
|
19
|
+
* {@link View} that already has a layer going by that id.
|
|
20
|
+
* @param {Object} [options] - Optional configuration, all elements in it
|
|
21
|
+
* will be merged as is in the layer.
|
|
22
|
+
* @param {function} [options.batchId] - optional function to create batchId attribute.
|
|
23
|
+
* It is passed the feature property and the feature index.
|
|
24
|
+
* As the batchId is using an unsigned int structure on 32 bits, the batchId could be between 0 and 4,294,967,295.
|
|
25
|
+
* @param {THREE.Object3D} [options.object3d=new THREE.Group()] root object3d layer.
|
|
26
|
+
* @param {function} [options.onMeshCreated] this callback is called when the mesh is created. The callback parameters are the
|
|
27
|
+
* `mesh` and the `context`.
|
|
28
|
+
* @param {function} [options.filter] callback which filters the features of
|
|
29
|
+
* this layer. It takes an object with a `properties` property as argument
|
|
30
|
+
* and shall return a boolean.
|
|
31
|
+
* @param {boolean} [options.accurate=TRUE] If `accurate` is `true`, data are re-projected with maximum geographical accuracy.
|
|
32
|
+
* With `true`, `proj4` is used to transform data source.
|
|
33
|
+
*
|
|
34
|
+
* If `accurate` is `false`, re-projecting is faster but less accurate.
|
|
35
|
+
* With `false`, an affine transformation is used to transform data source.
|
|
36
|
+
* This method is an approximation. The error increases with the extent
|
|
37
|
+
* dimension of the object or queries.
|
|
38
|
+
*
|
|
39
|
+
* For example :
|
|
40
|
+
* * for a **100** meter dimension, there's a difference of **0.001** meter with the accurate method
|
|
41
|
+
* * for a **500** meter dimension, there's a difference of **0.05** meter with the accurate method
|
|
42
|
+
* * for a **20000** meter dimension, there's a difference of **40** meter with the accurate method
|
|
43
|
+
*
|
|
44
|
+
* **WARNING** If the source is `VectorTilesSource` then `accurate` is always false.
|
|
45
|
+
*/
|
|
46
|
+
constructor(id: string, options?: {
|
|
47
|
+
batchId?: Function | undefined;
|
|
48
|
+
object3d?: any;
|
|
49
|
+
onMeshCreated?: Function | undefined;
|
|
50
|
+
filter?: Function | undefined;
|
|
51
|
+
accurate?: boolean | undefined;
|
|
52
|
+
});
|
|
53
|
+
update: (context: any, layer: any, node: any) => any;
|
|
54
|
+
convert: Function;
|
|
55
|
+
onMeshCreated: Function | undefined;
|
|
56
|
+
isFeatureGeometryLayer: boolean;
|
|
57
|
+
accurate: boolean;
|
|
58
|
+
buildExtent: boolean;
|
|
59
|
+
filter: Function | undefined;
|
|
60
|
+
preUpdate(context: any, sources: any): void;
|
|
61
|
+
}
|
|
62
|
+
import GeometryLayer from '../Layer/GeometryLayer';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export function geoidLayerIsVisible(tilelayer: any): any;
|
|
2
|
+
export default GeoidLayer;
|
|
3
|
+
/**
|
|
4
|
+
* `GeoidLayer` is a specific `{@link Layer}` which supports geoid height data. When added to a `{@link View}`, it
|
|
5
|
+
* vertically translates each of the view's tiles by a proper geoid height value. For a given tile, the geoid height
|
|
6
|
+
* value used for translation is the geoid height computed at the center of the tile.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Create a GeoidLayer from a GTX geoid heights file.
|
|
10
|
+
* const geoidLayer = new GeoidLayer('geoid', {
|
|
11
|
+
* source: new FileSource({
|
|
12
|
+
* url: 'url-to-some-GTX-geoid-heights-file.gtx',
|
|
13
|
+
* crs: 'EPSG:4326',
|
|
14
|
+
* format: 'application/gtx',
|
|
15
|
+
* }),
|
|
16
|
+
* });
|
|
17
|
+
*/
|
|
18
|
+
declare class GeoidLayer extends Layer {
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new instance of `GeoidLayer`.
|
|
21
|
+
*
|
|
22
|
+
* @param {string} id An unique identifier for the layer.
|
|
23
|
+
* @param {Object} config The layer configuration. All elements in it will be merged as is in the
|
|
24
|
+
* layer. For example, if the configuration contains three elements `name,
|
|
25
|
+
* protocol, extent`, these elements will be available using `layer.name` or
|
|
26
|
+
* something else depending on the property name. Only `config.source`
|
|
27
|
+
* parameter is mandatory.
|
|
28
|
+
* @param {Object} config.source The source of the geoid data displayed by the `GeoidLayer`. It is mandatory
|
|
29
|
+
* that the source data for a `GeoidLayer` be parsed into a
|
|
30
|
+
* `{@link GeoidGrid}`. You can refer to `{@link GTXParser}`,
|
|
31
|
+
* `{@link GDFParser}` and `{@link ISGParser}` to see how three standard
|
|
32
|
+
* geoid height grid file formats are parsed into `{@link GeoidGrid}`.
|
|
33
|
+
*/
|
|
34
|
+
constructor(id: string, config?: {
|
|
35
|
+
source: Object;
|
|
36
|
+
});
|
|
37
|
+
isGeoidLayer: boolean;
|
|
38
|
+
updateNodeZ(node: any): void;
|
|
39
|
+
update(context: any, layer: any, node: any, parent: any): any;
|
|
40
|
+
}
|
|
41
|
+
import Layer from '../Layer/Layer';
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export default GeometryLayer;
|
|
2
|
+
/**
|
|
3
|
+
* Fires when the opacity of the layer has changed.
|
|
4
|
+
* @event GeometryLayer#opacity-property-changed
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @property {boolean} isGeometryLayer - Used to checkout whether this layer is
|
|
8
|
+
* a GeometryLayer. Default is true. You should not change this, as it is used
|
|
9
|
+
* internally for optimisation.
|
|
10
|
+
* @property {number} [zoom.max=Infinity] - this is the maximum zoom beyond which it'll be hidden.
|
|
11
|
+
* The `max` is constant and the value is `Infinity` because there's no maximum display level after which it is hidden.
|
|
12
|
+
* This property is used only if the layer is attached to {@link TiledGeometryLayer}.
|
|
13
|
+
* @property {number} [zoom.min=0] - this is the minimum zoom from which it'll be visible.
|
|
14
|
+
* This property is used only if the layer is attached to {@link TiledGeometryLayer}.
|
|
15
|
+
*/
|
|
16
|
+
declare class GeometryLayer extends Layer {
|
|
17
|
+
/**
|
|
18
|
+
* A layer usually managing a geometry to display on a view. For example, it
|
|
19
|
+
* can be a layer of buildings extruded from a a WFS stream.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} id - The id of the layer, that should be unique. It is
|
|
22
|
+
* not mandatory, but an error will be emitted if this layer is added a
|
|
23
|
+
* {@link View} that already has a layer going by that id.
|
|
24
|
+
* @param {THREE.Object3D} object3d - The object3D used to contain the
|
|
25
|
+
* geometry of the GeometryLayer. It is usually a `THREE.Group`, but it can
|
|
26
|
+
* be anything inheriting from a `THREE.Object3D`.
|
|
27
|
+
* @param {Object} [config] - Optional configuration, all elements in it
|
|
28
|
+
* will be merged as is in the layer. For example, if the configuration
|
|
29
|
+
* contains three elements `name, protocol, extent`, these elements will be
|
|
30
|
+
* available using `layer.name` or something else depending on the property
|
|
31
|
+
* name.
|
|
32
|
+
* @param {Source} config.source - Description and options of the source.
|
|
33
|
+
* @param {number} [config.cacheLifeTime=Infinity] - set life time value in cache.
|
|
34
|
+
* This value is used for [Cache]{@link Cache} expiration mechanism.
|
|
35
|
+
* @param {boolean} [config.visible]
|
|
36
|
+
*
|
|
37
|
+
* @throws {Error} `object3d` must be a valid `THREE.Object3d`.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* // Create a GeometryLayer
|
|
41
|
+
* const geometry = new GeometryLayer('buildings', new THREE.Object3D(), {
|
|
42
|
+
* source: {
|
|
43
|
+
* url: 'http://server.geo/wfs?',
|
|
44
|
+
* protocol: 'wfs',
|
|
45
|
+
* format: 'application/json'
|
|
46
|
+
* },
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* // Add the layer
|
|
50
|
+
* view.addLayer(geometry);
|
|
51
|
+
*/
|
|
52
|
+
constructor(id: string, object3d: THREE.Object3D, config?: {
|
|
53
|
+
source: Source;
|
|
54
|
+
cacheLifeTime?: number | undefined;
|
|
55
|
+
visible?: boolean | undefined;
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* @type {boolean}
|
|
59
|
+
* @readonly
|
|
60
|
+
*/
|
|
61
|
+
readonly isGeometryLayer: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* @type {THREE.Object3D}
|
|
64
|
+
* @readonly
|
|
65
|
+
*/
|
|
66
|
+
readonly object3d: THREE.Object3D;
|
|
67
|
+
/**
|
|
68
|
+
* @type {number}
|
|
69
|
+
*/
|
|
70
|
+
opacity: number;
|
|
71
|
+
/**
|
|
72
|
+
* @type {boolean}
|
|
73
|
+
*/
|
|
74
|
+
wireframe: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* @type {Layer[]}
|
|
77
|
+
*/
|
|
78
|
+
attachedLayers: Layer[];
|
|
79
|
+
set visible(value: any);
|
|
80
|
+
get visible(): any;
|
|
81
|
+
filteringExtent: boolean;
|
|
82
|
+
structure: string;
|
|
83
|
+
getObjectToUpdateForAttachedLayers(obj: any): {
|
|
84
|
+
element: any;
|
|
85
|
+
parent: any;
|
|
86
|
+
} | undefined;
|
|
87
|
+
postUpdate(): void;
|
|
88
|
+
culling(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Attach another layer to this one. Layers attached to a GeometryLayer will
|
|
91
|
+
* be available in `geometryLayer.attachedLayers`.
|
|
92
|
+
*
|
|
93
|
+
* @param {Layer} layer - The layer to attach, that must have an `update`
|
|
94
|
+
* method.
|
|
95
|
+
*/
|
|
96
|
+
attach(layer: Layer): void;
|
|
97
|
+
/**
|
|
98
|
+
* Detach a layer attached to this one. See {@link attach} to learn how to
|
|
99
|
+
* attach a layer.
|
|
100
|
+
*
|
|
101
|
+
* @param {Layer} layer - The layer to detach.
|
|
102
|
+
*
|
|
103
|
+
* @return {boolean} Confirmation of the detachment of the layer.
|
|
104
|
+
*/
|
|
105
|
+
detach(layer: Layer): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Picking method for this layer.
|
|
108
|
+
*
|
|
109
|
+
* @param {View} view - The view instance.
|
|
110
|
+
* @param {Object} coordinates - The coordinates to pick in the view. It
|
|
111
|
+
* should have at least `x` and `y` properties.
|
|
112
|
+
* @param {number} radius - Radius of the picking circle.
|
|
113
|
+
* @param {Array} target - target to push result.
|
|
114
|
+
*
|
|
115
|
+
* @return {Array} An array containing all targets picked under the
|
|
116
|
+
* specified coordinates.
|
|
117
|
+
*/
|
|
118
|
+
pickObjectsAt(view: View, coordinates: Object, radius?: number, target?: any[]): any[];
|
|
119
|
+
}
|
|
120
|
+
import Layer from '../Layer/Layer';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default class InfoLayer {
|
|
2
|
+
constructor(layer: any);
|
|
3
|
+
layer: any;
|
|
4
|
+
clear(): void;
|
|
5
|
+
update(): void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* InfoTiledGeometryLayer that provides some states layer informations. These
|
|
9
|
+
* informations are displayed tiles, displayed {@link ColorLayer} and {@link
|
|
10
|
+
* ElevationLayer} and extent of displayed tiles.
|
|
11
|
+
*
|
|
12
|
+
* @class InfoTiledGeometryLayer
|
|
13
|
+
*
|
|
14
|
+
* @property {object} displayed
|
|
15
|
+
* @property {Layer[]} displayed.layers - Displayed {@link ColorLayer} and {@link ElevationLayer}.
|
|
16
|
+
* @property {Extent} displayed.extent - {@link Extent} of displayed tiles.
|
|
17
|
+
* @property {Set} displayed.tiles - Set of displayed tiles.
|
|
18
|
+
*/
|
|
19
|
+
export class InfoTiledGeometryLayer extends InfoLayer {
|
|
20
|
+
displayed: {
|
|
21
|
+
tiles: Set<any>;
|
|
22
|
+
};
|
|
23
|
+
update(tile: any): void;
|
|
24
|
+
}
|
package/lib/Layer/InfoLayer.js
CHANGED
|
@@ -32,7 +32,7 @@ export class InfoTiledGeometryLayer extends InfoLayer {
|
|
|
32
32
|
let layers = [];
|
|
33
33
|
this.displayed.tiles.forEach(tile => {
|
|
34
34
|
const m = tile.material;
|
|
35
|
-
layers = [...new Set([...layers, ...m.
|
|
35
|
+
layers = [...new Set([...layers, ...m.colorTileIds.filter(id => m.getColorTile(id)), m.elevationTileId])];
|
|
36
36
|
});
|
|
37
37
|
return this.layer.attachedLayers.filter(l => layers.includes(l.id));
|
|
38
38
|
}
|