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,455 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { setFromProperties };
|
|
3
|
+
export { setFromVectorTileLayer };
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
/**
|
|
7
|
+
* An object that can contain any properties (zoom, fill, stroke, point,
|
|
8
|
+
* text or/and icon) and sub properties of a Style.
|
|
9
|
+
* Used for the instanciation of a {@link Style}.
|
|
10
|
+
*/
|
|
11
|
+
export type StyleOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* - Level on which to display the feature
|
|
14
|
+
*/
|
|
15
|
+
zoom?: {
|
|
16
|
+
/**
|
|
17
|
+
* - max level
|
|
18
|
+
*/
|
|
19
|
+
max?: number | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* - min level
|
|
22
|
+
*/
|
|
23
|
+
min?: number | undefined;
|
|
24
|
+
} | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* - Fill style for polygons.
|
|
27
|
+
*/
|
|
28
|
+
fill?: {
|
|
29
|
+
/**
|
|
30
|
+
* - Defines the main fill color. Can be
|
|
31
|
+
* any [valid color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
32
|
+
* Default is no value, which means no fill.
|
|
33
|
+
* If the `Layer` is a `GeometryLayer` you can use `THREE.Color`.
|
|
34
|
+
*/
|
|
35
|
+
color?: string | Function | THREE.Color;
|
|
36
|
+
/**
|
|
37
|
+
* - Defines a pattern to fill the
|
|
38
|
+
* surface with. It can be an `Image` to use directly, an url to fetch the pattern or an object containing
|
|
39
|
+
* the url of the image to fetch and the transformation to apply.
|
|
40
|
+
* from. See [this example](http://www.itowns-project.org/itowns/examples/#source_file_geojson_raster)
|
|
41
|
+
* for how to use.
|
|
42
|
+
*/
|
|
43
|
+
pattern?: (new (width?: number, height?: number) => HTMLImageElement) | Canvas | string | Object | Function;
|
|
44
|
+
} | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* - The image or the url to fetch the pattern image
|
|
47
|
+
*/
|
|
48
|
+
source?: string | (new (width?: number, height?: number) => HTMLImageElement) | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* - The x, y, width and height (in pixel) of the sub image to use.
|
|
51
|
+
*/
|
|
52
|
+
cropValues?: Object | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* - Can be any
|
|
55
|
+
* [valid color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
56
|
+
* It will change the color of the white pixels of the source image.
|
|
57
|
+
*/
|
|
58
|
+
color?: THREE.Color;
|
|
59
|
+
/**
|
|
60
|
+
* - The opacity of the color or of the
|
|
61
|
+
* pattern. Can be between `0.0` and `1.0`. Default is `1.0`.
|
|
62
|
+
* For a `GeometryLayer`, this opacity property isn't used.
|
|
63
|
+
*/
|
|
64
|
+
opacity?: number | Function | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* - `GeometryLayer` style option, defines altitude
|
|
67
|
+
* for each coordinate.
|
|
68
|
+
* If `base_altitude` is `undefined`, the original altitude is kept, and if it doesn't exist
|
|
69
|
+
* then the altitude value is set to 0.
|
|
70
|
+
*/
|
|
71
|
+
base_altitude?: number | Function | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* - `GeometryLayer` style option, if defined,
|
|
74
|
+
* polygons will be extruded by the specified amount
|
|
75
|
+
*/
|
|
76
|
+
extrusion_height?: number | Function | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* - Lines and polygons edges.
|
|
79
|
+
*/
|
|
80
|
+
stroke?: {
|
|
81
|
+
/**
|
|
82
|
+
* The color of the line. Can be any [valid
|
|
83
|
+
* color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
84
|
+
* Default is no value, which means no stroke.
|
|
85
|
+
* If the `Layer` is a `GeometryLayer` you can use `THREE.Color`.
|
|
86
|
+
*/
|
|
87
|
+
color?: string | Function | THREE.Color;
|
|
88
|
+
/**
|
|
89
|
+
* - The opacity of the line. Can be between
|
|
90
|
+
* `0.0` and `1.0`. Default is `1.0`.
|
|
91
|
+
* For a `GeometryLayer`, this opacity property isn't used.
|
|
92
|
+
*/
|
|
93
|
+
opacity?: number | Function | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* - The width of the line. Default is `1.0`.
|
|
96
|
+
*/
|
|
97
|
+
width?: number | Function | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* - `GeometryLayer` style option, defines altitude
|
|
100
|
+
* for each coordinate.
|
|
101
|
+
* If `base_altitude` is `undefined`, the original altitude is kept, and if it doesn't exist
|
|
102
|
+
* then the altitude value is set to 0.
|
|
103
|
+
*/
|
|
104
|
+
base_altitude?: number | Function | undefined;
|
|
105
|
+
} | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* - Point style.
|
|
108
|
+
*/
|
|
109
|
+
point?: {
|
|
110
|
+
/**
|
|
111
|
+
* - The color of the point. Can be any [valid
|
|
112
|
+
* color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
113
|
+
* Default is no value, which means points won't be displayed.
|
|
114
|
+
*/
|
|
115
|
+
color?: string | Function | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* - The radius of the point, in pixel. Default
|
|
118
|
+
* is `2.0`.
|
|
119
|
+
*/
|
|
120
|
+
radius?: number | Function | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* - The color of the border of the point. Can be
|
|
123
|
+
* any [valid color
|
|
124
|
+
* string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
125
|
+
* Not supported for a `GeometryLayer`.
|
|
126
|
+
*/
|
|
127
|
+
line?: string | Function | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* - The width of the border, in pixel. Default
|
|
130
|
+
* is `0.0` (no border).
|
|
131
|
+
*/
|
|
132
|
+
width?: number | Function | undefined;
|
|
133
|
+
/**
|
|
134
|
+
* - The opacity of the point. Can be between
|
|
135
|
+
* `0.0` and `1.0`. Default is `1.0`.
|
|
136
|
+
* Not supported for `GeometryLayer`.
|
|
137
|
+
*/
|
|
138
|
+
opacity?: number | Function | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* - `GeometryLayer` style option, defines altitude
|
|
141
|
+
* for each coordinate.
|
|
142
|
+
* If `base_altitude` is `undefined`, the original altitude is kept, and if it doesn't exist
|
|
143
|
+
* then the altitude value is set to 0.
|
|
144
|
+
*/
|
|
145
|
+
base_altitude?: number | Function | undefined;
|
|
146
|
+
/**
|
|
147
|
+
* - 3D model to instantiate at each point position.
|
|
148
|
+
*/
|
|
149
|
+
model?: Object | undefined;
|
|
150
|
+
} | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* - All things {@link Label} related. (Supported for Points features, not yet
|
|
153
|
+
* for Lines and Polygons features.)
|
|
154
|
+
*/
|
|
155
|
+
text?: {
|
|
156
|
+
/**
|
|
157
|
+
* - A string representing a property key of
|
|
158
|
+
* a `FeatureGeometry` enclosed in brackets, that will be replaced by the value of the
|
|
159
|
+
* property for each geometry. For example, if each geometry contains a `name` property,
|
|
160
|
+
* `text.field` can be set to `{name}`. Default is no value, indicating that no
|
|
161
|
+
* text will be displayed.
|
|
162
|
+
*
|
|
163
|
+
* It's also possible to create more complex expressions. For example, you can combine
|
|
164
|
+
* text that will always be displayed (e.g. `foo`) and variable properties (e.g. `{bar}`)
|
|
165
|
+
* like the following: `foo {bar}`. You can also use multiple variables in one field.
|
|
166
|
+
* Let's say for instance that you have two properties latin name and local name of a
|
|
167
|
+
* place, you can write something like `{name_latin} - {name_local}` which can result
|
|
168
|
+
* in `Marrakesh - مراكش` for example.
|
|
169
|
+
*/
|
|
170
|
+
field?: string | Function | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* - The color of the text. Can be any [valid
|
|
173
|
+
* color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
174
|
+
* Default is `#000000`.
|
|
175
|
+
*/
|
|
176
|
+
color?: string | Function | undefined;
|
|
177
|
+
/**
|
|
178
|
+
* - The anchor of the text compared to its
|
|
179
|
+
* position (see {@link Label} for the position). Can be one of the following values: `top`,
|
|
180
|
+
* `left`, `bottom`, `right`, `center`, `top-left`, `top-right`, `bottom-left`
|
|
181
|
+
* or `bottom-right`. Default is `center`.
|
|
182
|
+
*
|
|
183
|
+
* It can also be defined as an Array of two numbers. Each number defines an offset (in
|
|
184
|
+
* fraction of the label width and height) between the label position and the top-left
|
|
185
|
+
* corner of the text. The first value is the horizontal offset, and the second is the
|
|
186
|
+
* vertical offset. For example, `[-0.5, -0.5]` will be equivalent to `center`.
|
|
187
|
+
*/
|
|
188
|
+
anchor?: string | Function | number[] | undefined;
|
|
189
|
+
/**
|
|
190
|
+
* - The offset of the text, depending on its
|
|
191
|
+
* anchor, in pixels. First value is from `left`, second is from `top`. Default
|
|
192
|
+
* is `[0, 0]`.
|
|
193
|
+
*/
|
|
194
|
+
offset?: Function | any[] | undefined;
|
|
195
|
+
/**
|
|
196
|
+
* - The padding outside the text, in pixels.
|
|
197
|
+
* Default is `2`.
|
|
198
|
+
*/
|
|
199
|
+
padding?: number | Function | undefined;
|
|
200
|
+
/**
|
|
201
|
+
* - The size of the font, in pixels. Default is
|
|
202
|
+
* `16`.
|
|
203
|
+
*/
|
|
204
|
+
size?: number | Function | undefined;
|
|
205
|
+
/**
|
|
206
|
+
* - The maximum width, in pixels, before the text
|
|
207
|
+
* is wrapped, because the string is too long. Default is `10`.
|
|
208
|
+
*/
|
|
209
|
+
wrap?: number | Function | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* - The spacing between the letters, in `em`.
|
|
212
|
+
* Default is `0`.
|
|
213
|
+
*/
|
|
214
|
+
spacing?: number | Function | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* - A value corresponding to the [CSS
|
|
217
|
+
* property
|
|
218
|
+
* `text-transform`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform).
|
|
219
|
+
* Default is `none`.
|
|
220
|
+
*/
|
|
221
|
+
transform?: string | Function | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* - A value corresponding to the [CSS property
|
|
224
|
+
* `text-align`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align).
|
|
225
|
+
* Default is `center`.
|
|
226
|
+
*/
|
|
227
|
+
justify?: string | Function | undefined;
|
|
228
|
+
/**
|
|
229
|
+
* - The opacity of the text. Can be between
|
|
230
|
+
* `0.0` and `1.0`. Default is `1.0`.
|
|
231
|
+
*/
|
|
232
|
+
opacity?: number | Function | undefined;
|
|
233
|
+
/**
|
|
234
|
+
* - A list (as an array of string) of font family
|
|
235
|
+
* names, prioritized in the order it is set. Default is `Open Sans Regular,
|
|
236
|
+
* Arial Unicode MS Regular, sans-serif`.
|
|
237
|
+
*/
|
|
238
|
+
font?: Function | any[] | undefined;
|
|
239
|
+
/**
|
|
240
|
+
* - The color of the halo. Can be any [valid
|
|
241
|
+
* color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
242
|
+
* Default is `#000000`.
|
|
243
|
+
*/
|
|
244
|
+
haloColor?: string | Function | undefined;
|
|
245
|
+
/**
|
|
246
|
+
* - The width of the halo, in pixels.
|
|
247
|
+
* Default is `0`.
|
|
248
|
+
*/
|
|
249
|
+
haloWidth?: number | Function | undefined;
|
|
250
|
+
/**
|
|
251
|
+
* - The blur value of the halo, in pixels.
|
|
252
|
+
* Default is `0`.
|
|
253
|
+
*/
|
|
254
|
+
haloBlur?: number | Function | undefined;
|
|
255
|
+
} | undefined;
|
|
256
|
+
/**
|
|
257
|
+
* - Defines the appearance of icons attached to label.
|
|
258
|
+
*/
|
|
259
|
+
icon?: {
|
|
260
|
+
/**
|
|
261
|
+
* - The url of the icons' image file.
|
|
262
|
+
*/
|
|
263
|
+
source?: string | undefined;
|
|
264
|
+
/**
|
|
265
|
+
* - The id of the icons' sub-image in a vector tile data set.
|
|
266
|
+
*/
|
|
267
|
+
id?: string | undefined;
|
|
268
|
+
/**
|
|
269
|
+
* - the x, y, width and height (in pixel) of the sub image to use.
|
|
270
|
+
*/
|
|
271
|
+
cropValues?: string | undefined;
|
|
272
|
+
/**
|
|
273
|
+
* - The anchor of the icon compared to the label position.
|
|
274
|
+
* Can be `left`, `bottom`, `right`, `center`, `top-left`, `top-right`, `bottom-left`
|
|
275
|
+
* or `bottom-right`. Default is `center`.
|
|
276
|
+
*/
|
|
277
|
+
anchor?: string | undefined;
|
|
278
|
+
/**
|
|
279
|
+
* - If the icon's image is passed with `icon.source` and/or
|
|
280
|
+
* `icon.id`, its size when displayed on screen is multiplied by `icon.size`. Default is `1`.
|
|
281
|
+
*/
|
|
282
|
+
size?: number | undefined;
|
|
283
|
+
/**
|
|
284
|
+
* - The color of the icon. Can be any [valid
|
|
285
|
+
* color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
286
|
+
* It will change the color of the white pixels of the icon source image.
|
|
287
|
+
*/
|
|
288
|
+
color?: string | Function | undefined;
|
|
289
|
+
/**
|
|
290
|
+
* - The opacity of the icon. Can be between
|
|
291
|
+
* `0.0` and `1.0`. Default is `1.0`.
|
|
292
|
+
*/
|
|
293
|
+
opacity?: number | Function | undefined;
|
|
294
|
+
} | undefined;
|
|
295
|
+
};
|
|
296
|
+
/**
|
|
297
|
+
* An object that can contain any properties (zoom, fill, stroke, point,
|
|
298
|
+
* text or/and icon) and sub properties of a Style.
|
|
299
|
+
* Used for the instanciation of a {@link Style}.
|
|
300
|
+
*
|
|
301
|
+
* @typedef {Object} StyleOptions
|
|
302
|
+
*
|
|
303
|
+
* @property {Object} [zoom] - Level on which to display the feature
|
|
304
|
+
* @property {Number} [zoom.max] - max level
|
|
305
|
+
* @property {Number} [zoom.min] - min level
|
|
306
|
+
*
|
|
307
|
+
* @property {Object} [fill] - Fill style for polygons.
|
|
308
|
+
* @property {String|Function|THREE.Color} [fill.color] - Defines the main fill color. Can be
|
|
309
|
+
* any [valid color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
310
|
+
* Default is no value, which means no fill.
|
|
311
|
+
* If the `Layer` is a `GeometryLayer` you can use `THREE.Color`.
|
|
312
|
+
* @property {Image|Canvas|String|Object|Function} [fill.pattern] - Defines a pattern to fill the
|
|
313
|
+
* surface with. It can be an `Image` to use directly, an url to fetch the pattern or an object containing
|
|
314
|
+
* the url of the image to fetch and the transformation to apply.
|
|
315
|
+
* from. See [this example](http://www.itowns-project.org/itowns/examples/#source_file_geojson_raster)
|
|
316
|
+
* for how to use.
|
|
317
|
+
* @property {Image|String} [fill.pattern.source] - The image or the url to fetch the pattern image
|
|
318
|
+
* @property {Object} [fill.pattern.cropValues] - The x, y, width and height (in pixel) of the sub image to use.
|
|
319
|
+
* @property {THREE.Color} [fill.pattern.color] - Can be any
|
|
320
|
+
* [valid color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
321
|
+
* It will change the color of the white pixels of the source image.
|
|
322
|
+
* @property {Number|Function} [fill.opacity] - The opacity of the color or of the
|
|
323
|
+
* pattern. Can be between `0.0` and `1.0`. Default is `1.0`.
|
|
324
|
+
* For a `GeometryLayer`, this opacity property isn't used.
|
|
325
|
+
* @property {Number|Function} [fill.base_altitude] - `GeometryLayer` style option, defines altitude
|
|
326
|
+
* for each coordinate.
|
|
327
|
+
* If `base_altitude` is `undefined`, the original altitude is kept, and if it doesn't exist
|
|
328
|
+
* then the altitude value is set to 0.
|
|
329
|
+
* @property {Number|Function} [fill.extrusion_height] - `GeometryLayer` style option, if defined,
|
|
330
|
+
* polygons will be extruded by the specified amount
|
|
331
|
+
*
|
|
332
|
+
* @property {Object} [stroke] - Lines and polygons edges.
|
|
333
|
+
* @property {String|Function|THREE.Color} [stroke.color] The color of the line. Can be any [valid
|
|
334
|
+
* color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
335
|
+
* Default is no value, which means no stroke.
|
|
336
|
+
* If the `Layer` is a `GeometryLayer` you can use `THREE.Color`.
|
|
337
|
+
* @property {Number|Function} [stroke.opacity] - The opacity of the line. Can be between
|
|
338
|
+
* `0.0` and `1.0`. Default is `1.0`.
|
|
339
|
+
* For a `GeometryLayer`, this opacity property isn't used.
|
|
340
|
+
* @property {Number|Function} [stroke.width] - The width of the line. Default is `1.0`.
|
|
341
|
+
* @property {Number|Function} [stroke.base_altitude] - `GeometryLayer` style option, defines altitude
|
|
342
|
+
* for each coordinate.
|
|
343
|
+
* If `base_altitude` is `undefined`, the original altitude is kept, and if it doesn't exist
|
|
344
|
+
* then the altitude value is set to 0.
|
|
345
|
+
*
|
|
346
|
+
* @property {Object} [point] - Point style.
|
|
347
|
+
* @property {String|Function} [point.color] - The color of the point. Can be any [valid
|
|
348
|
+
* color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
349
|
+
* Default is no value, which means points won't be displayed.
|
|
350
|
+
* @property {Number|Function} [point.radius] - The radius of the point, in pixel. Default
|
|
351
|
+
* is `2.0`.
|
|
352
|
+
* @property {String|Function} [point.line] - The color of the border of the point. Can be
|
|
353
|
+
* any [valid color
|
|
354
|
+
* string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
355
|
+
* Not supported for a `GeometryLayer`.
|
|
356
|
+
* @property {Number|Function} [point.width] - The width of the border, in pixel. Default
|
|
357
|
+
* is `0.0` (no border).
|
|
358
|
+
* @property {Number|Function} [point.opacity] - The opacity of the point. Can be between
|
|
359
|
+
* `0.0` and `1.0`. Default is `1.0`.
|
|
360
|
+
* Not supported for `GeometryLayer`.
|
|
361
|
+
* @property {Number|Function} [point.base_altitude] - `GeometryLayer` style option, defines altitude
|
|
362
|
+
* for each coordinate.
|
|
363
|
+
* If `base_altitude` is `undefined`, the original altitude is kept, and if it doesn't exist
|
|
364
|
+
* then the altitude value is set to 0.
|
|
365
|
+
* @property {Object} [point.model] - 3D model to instantiate at each point position.
|
|
366
|
+
*
|
|
367
|
+
* @property {Object} [text] - All things {@link Label} related. (Supported for Points features, not yet
|
|
368
|
+
* for Lines and Polygons features.)
|
|
369
|
+
* @property {String|Function} [text.field] - A string representing a property key of
|
|
370
|
+
* a `FeatureGeometry` enclosed in brackets, that will be replaced by the value of the
|
|
371
|
+
* property for each geometry. For example, if each geometry contains a `name` property,
|
|
372
|
+
* `text.field` can be set to `{name}`. Default is no value, indicating that no
|
|
373
|
+
* text will be displayed.
|
|
374
|
+
*
|
|
375
|
+
* It's also possible to create more complex expressions. For example, you can combine
|
|
376
|
+
* text that will always be displayed (e.g. `foo`) and variable properties (e.g. `{bar}`)
|
|
377
|
+
* like the following: `foo {bar}`. You can also use multiple variables in one field.
|
|
378
|
+
* Let's say for instance that you have two properties latin name and local name of a
|
|
379
|
+
* place, you can write something like `{name_latin} - {name_local}` which can result
|
|
380
|
+
* in `Marrakesh - مراكش` for example.
|
|
381
|
+
* @property {String|Function} [text.color] - The color of the text. Can be any [valid
|
|
382
|
+
* color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
383
|
+
* Default is `#000000`.
|
|
384
|
+
* @property {String|Number[]|Function} [text.anchor] - The anchor of the text compared to its
|
|
385
|
+
* position (see {@link Label} for the position). Can be one of the following values: `top`,
|
|
386
|
+
* `left`, `bottom`, `right`, `center`, `top-left`, `top-right`, `bottom-left`
|
|
387
|
+
* or `bottom-right`. Default is `center`.
|
|
388
|
+
*
|
|
389
|
+
* It can also be defined as an Array of two numbers. Each number defines an offset (in
|
|
390
|
+
* fraction of the label width and height) between the label position and the top-left
|
|
391
|
+
* corner of the text. The first value is the horizontal offset, and the second is the
|
|
392
|
+
* vertical offset. For example, `[-0.5, -0.5]` will be equivalent to `center`.
|
|
393
|
+
* @property {Array|Function} [text.offset] - The offset of the text, depending on its
|
|
394
|
+
* anchor, in pixels. First value is from `left`, second is from `top`. Default
|
|
395
|
+
* is `[0, 0]`.
|
|
396
|
+
* @property {Number|Function} [text.padding] - The padding outside the text, in pixels.
|
|
397
|
+
* Default is `2`.
|
|
398
|
+
* @property {Number|Function} [text.size] - The size of the font, in pixels. Default is
|
|
399
|
+
* `16`.
|
|
400
|
+
* @property {Number|Function} [text.wrap] - The maximum width, in pixels, before the text
|
|
401
|
+
* is wrapped, because the string is too long. Default is `10`.
|
|
402
|
+
* @property {Number|Function} [text.spacing] - The spacing between the letters, in `em`.
|
|
403
|
+
* Default is `0`.
|
|
404
|
+
* @property {String|Function} [text.transform] - A value corresponding to the [CSS
|
|
405
|
+
* property
|
|
406
|
+
* `text-transform`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform).
|
|
407
|
+
* Default is `none`.
|
|
408
|
+
* @property {String|Function} [text.justify] - A value corresponding to the [CSS property
|
|
409
|
+
* `text-align`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align).
|
|
410
|
+
* Default is `center`.
|
|
411
|
+
* @property {Number|Function} [text.opacity] - The opacity of the text. Can be between
|
|
412
|
+
* `0.0` and `1.0`. Default is `1.0`.
|
|
413
|
+
* @property {Array|Function} [text.font] - A list (as an array of string) of font family
|
|
414
|
+
* names, prioritized in the order it is set. Default is `Open Sans Regular,
|
|
415
|
+
* Arial Unicode MS Regular, sans-serif`.
|
|
416
|
+
* @property {String|Function} [text.haloColor] - The color of the halo. Can be any [valid
|
|
417
|
+
* color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
418
|
+
* Default is `#000000`.
|
|
419
|
+
* @property {Number|Function} [text.haloWidth] - The width of the halo, in pixels.
|
|
420
|
+
* Default is `0`.
|
|
421
|
+
* @property {Number|Function} [text.haloBlur] - The blur value of the halo, in pixels.
|
|
422
|
+
* Default is `0`.
|
|
423
|
+
*
|
|
424
|
+
* @property {Object} [icon] - Defines the appearance of icons attached to label.
|
|
425
|
+
* @property {String} [icon.source] - The url of the icons' image file.
|
|
426
|
+
* @property {String} [icon.id] - The id of the icons' sub-image in a vector tile data set.
|
|
427
|
+
* @property {String} [icon.cropValues] - the x, y, width and height (in pixel) of the sub image to use.
|
|
428
|
+
* @property {String} [icon.anchor] - The anchor of the icon compared to the label position.
|
|
429
|
+
* Can be `left`, `bottom`, `right`, `center`, `top-left`, `top-right`, `bottom-left`
|
|
430
|
+
* or `bottom-right`. Default is `center`.
|
|
431
|
+
* @property {Number} [icon.size] - If the icon's image is passed with `icon.source` and/or
|
|
432
|
+
* `icon.id`, its size when displayed on screen is multiplied by `icon.size`. Default is `1`.
|
|
433
|
+
* @property {String|Function} [icon.color] - The color of the icon. Can be any [valid
|
|
434
|
+
* color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
435
|
+
* It will change the color of the white pixels of the icon source image.
|
|
436
|
+
* @property {Number|Function} [icon.opacity] - The opacity of the icon. Can be between
|
|
437
|
+
* `0.0` and `1.0`. Default is `1.0`.
|
|
438
|
+
*/
|
|
439
|
+
/**
|
|
440
|
+
* generate a StyleOptions from (geojson-like) properties.
|
|
441
|
+
* @param {Object} properties (geojson-like) properties.
|
|
442
|
+
* @param {FeatureContext} featCtx the context of the feature
|
|
443
|
+
*
|
|
444
|
+
* @returns {StyleOptions} containing all properties for itowns.Style
|
|
445
|
+
*/
|
|
446
|
+
declare function setFromProperties(properties: Object, featCtx: FeatureContext): StyleOptions;
|
|
447
|
+
/**
|
|
448
|
+
* generate a StyleOptions from vector tile layer properties.
|
|
449
|
+
* @param {Object} layer vector tile layer.
|
|
450
|
+
* @param {Object} sprites vector tile layer.
|
|
451
|
+
* @param {Boolean} [symbolToCircle=false]
|
|
452
|
+
*
|
|
453
|
+
* @returns {StyleOptions} containing all properties for itowns.Style
|
|
454
|
+
*/
|
|
455
|
+
declare function setFromVectorTileLayer(layer: Object, sprites: Object, symbolToCircle?: boolean): StyleOptions;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export function isLogDepthBufferSupported(): boolean;
|
|
3
|
+
export { isFirefox };
|
|
4
|
+
export function getMaxTextureUnitsCount(): number;
|
|
5
|
+
export function getMaxTextureSize(): number;
|
|
6
|
+
export function updateCapabilities(renderer: any): void;
|
|
7
|
+
}
|
|
8
|
+
export default _default;
|
|
9
|
+
declare function isFirefox(): boolean | "";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { Extent } from '@itowns/geographic';
|
|
3
|
+
declare class Tile {
|
|
4
|
+
readonly isTile: true;
|
|
5
|
+
crs: string;
|
|
6
|
+
zoom: number;
|
|
7
|
+
row: number;
|
|
8
|
+
col: number;
|
|
9
|
+
/**
|
|
10
|
+
* A tile is a geographical bounding rectangle uniquely defined by its zoom,
|
|
11
|
+
* row and column.
|
|
12
|
+
*
|
|
13
|
+
* @param crs - projection of limit values.
|
|
14
|
+
* @param zoom - `zoom` value. Default is 0.
|
|
15
|
+
* @param row - `row` value. Default is 0.
|
|
16
|
+
* @param col - `column` value. Default is 0.
|
|
17
|
+
*/
|
|
18
|
+
constructor(crs: string, zoom?: number, row?: number, col?: number);
|
|
19
|
+
/**
|
|
20
|
+
* Returns a new tile with the same bounds and crs as this one.
|
|
21
|
+
*/
|
|
22
|
+
clone(): Tile;
|
|
23
|
+
/**
|
|
24
|
+
* Converts this tile to the specified extent.
|
|
25
|
+
* @param crs - target's projection.
|
|
26
|
+
* @param target - The target to store the projected extent. If this not
|
|
27
|
+
* provided a new extent will be created.
|
|
28
|
+
*/
|
|
29
|
+
toExtent(crs: string, target?: Extent): Extent;
|
|
30
|
+
/**
|
|
31
|
+
* Checks whether another tile is inside this tile.
|
|
32
|
+
*
|
|
33
|
+
* @param extent - the tile to check.
|
|
34
|
+
*/
|
|
35
|
+
isInside(tile: Tile): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the translation and scale to transform this tile to the input
|
|
38
|
+
* tile.
|
|
39
|
+
*
|
|
40
|
+
* @param tile - the input tile.
|
|
41
|
+
* @param target - copy the result to target.
|
|
42
|
+
*/
|
|
43
|
+
offsetToParent(tile: Tile, target?: THREE.Vector4): THREE.Vector4;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the parent tile at the given level.
|
|
46
|
+
*
|
|
47
|
+
* @param levelParent - the level of the parent tile.
|
|
48
|
+
*/
|
|
49
|
+
tiledExtentParent(levelParent: number): Tile;
|
|
50
|
+
/**
|
|
51
|
+
* Sets zoom, row and column values.
|
|
52
|
+
*
|
|
53
|
+
* @param zoom - zoom value.
|
|
54
|
+
* @param row - row value.
|
|
55
|
+
* @param col - column value.
|
|
56
|
+
*/
|
|
57
|
+
set(zoom?: number, row?: number, col?: number): this;
|
|
58
|
+
/**
|
|
59
|
+
* Copies the passed tile to this tile.
|
|
60
|
+
* @param tile - tile to copy.
|
|
61
|
+
*/
|
|
62
|
+
copy(tile: Tile): this;
|
|
63
|
+
/**
|
|
64
|
+
* Return values of tile in string, separated by the separator input.
|
|
65
|
+
* @param separator - string separator
|
|
66
|
+
*/
|
|
67
|
+
toString(separator?: string): string;
|
|
68
|
+
}
|
|
69
|
+
export declare function tiledCovering(e: Extent, tms: string): Tile[];
|
|
70
|
+
export default Tile;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { Extent } from '@itowns/geographic';
|
|
3
|
+
export declare const globalExtentTMS: Map<string, Extent>;
|
|
4
|
+
export declare const schemeTiles: Map<string, THREE.Vector2>;
|
|
5
|
+
export declare function getInfoTms(crs: string): {
|
|
6
|
+
epsg: string;
|
|
7
|
+
globalExtent: Extent;
|
|
8
|
+
globalDimension: THREE.Vector2;
|
|
9
|
+
sTs: THREE.Vector2;
|
|
10
|
+
isInverted: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function getCountTiles(crs: string, zoom: number): THREE.Vector2;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { GpuBufferAttributes, TileBuilder, TileBuilderParams } from '../Core/Prefab/TileBuilder';
|
|
3
|
+
import { Extent } from '@itowns/geographic';
|
|
4
|
+
import { LRUCache } from 'lru-cache';
|
|
5
|
+
import OBB from '../Renderer/OBB';
|
|
6
|
+
export declare class TileGeometry extends THREE.BufferGeometry {
|
|
7
|
+
/** Oriented Bounding Box of the tile geometry. */
|
|
8
|
+
OBB: OBB | null;
|
|
9
|
+
/** Ground area covered by this tile geometry. */
|
|
10
|
+
extent: Extent;
|
|
11
|
+
/** Resolution of the tile geometry in segments per side. */
|
|
12
|
+
segments: number;
|
|
13
|
+
/**
|
|
14
|
+
* [TileGeometry] instances are shared between tiles. Since a geometry
|
|
15
|
+
* handles its own GPU resource, it needs a reference counter to dispose of
|
|
16
|
+
* that resource only when it is discarded by every single owner of a
|
|
17
|
+
* reference to the geometry.
|
|
18
|
+
*/
|
|
19
|
+
private _refCount;
|
|
20
|
+
constructor(builder: TileBuilder<TileBuilderParams>, params: TileBuilderParams, bufferAttributes?: GpuBufferAttributes);
|
|
21
|
+
/**
|
|
22
|
+
* Enables or disables skirt rendering.
|
|
23
|
+
*
|
|
24
|
+
* @param toggle - Whether to hide the skirt; true hides, false shows.
|
|
25
|
+
*/
|
|
26
|
+
set hideSkirt(toggle: boolean);
|
|
27
|
+
/**
|
|
28
|
+
* Initialize reference count for this geometry if it is currently null.
|
|
29
|
+
*
|
|
30
|
+
* @param cacheTile - The [Cache] used to store this geometry.
|
|
31
|
+
* @param keys - The [south, level, epsg] key of this geometry.
|
|
32
|
+
*/
|
|
33
|
+
initRefCount(cacheTile: LRUCache<string, Promise<TileGeometry>>, key: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* Increase reference count.
|
|
36
|
+
*
|
|
37
|
+
* @throws If reference count has not been initialized.
|
|
38
|
+
*/
|
|
39
|
+
increaseRefCount(): void;
|
|
40
|
+
/**
|
|
41
|
+
* The current reference count of this [TileGeometry] if it has been
|
|
42
|
+
* initialized.
|
|
43
|
+
*/
|
|
44
|
+
get refCount(): number | undefined;
|
|
45
|
+
dispose(): void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export default TileMesh;
|
|
2
|
+
/**
|
|
3
|
+
* A TileMesh is a THREE.Mesh with a geometricError and an OBB
|
|
4
|
+
* The objectId property of the material is the with the id of the TileMesh
|
|
5
|
+
* @param {TileGeometry} geometry - the tile geometry
|
|
6
|
+
* @param {THREE.Material} material - a THREE.Material compatible with THREE.Mesh
|
|
7
|
+
* @param {Layer} layer - the layer the tile is added to
|
|
8
|
+
* @param {Extent} extent - the tile extent
|
|
9
|
+
* @param {?number} level - the tile level (default = 0)
|
|
10
|
+
*/
|
|
11
|
+
declare class TileMesh extends THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap> {
|
|
12
|
+
constructor(geometry: any, material: any, layer: any, extent: any, level?: number);
|
|
13
|
+
layer: any;
|
|
14
|
+
extent: any;
|
|
15
|
+
level: number;
|
|
16
|
+
obb: any;
|
|
17
|
+
boundingSphere: THREE.Sphere;
|
|
18
|
+
rotationAutoUpdate: boolean;
|
|
19
|
+
layerUpdateState: {};
|
|
20
|
+
isTileMesh: boolean;
|
|
21
|
+
geoidHeight: number;
|
|
22
|
+
link: {};
|
|
23
|
+
/**
|
|
24
|
+
* If specified, update the min and max elevation of the OBB
|
|
25
|
+
* and updates accordingly the bounding sphere and the geometric error
|
|
26
|
+
*
|
|
27
|
+
* @param {Object} elevation
|
|
28
|
+
* @param {number} [elevation.min]
|
|
29
|
+
* @param {number} [elevation.max]
|
|
30
|
+
* @param {number} [elevation.scale]
|
|
31
|
+
*/
|
|
32
|
+
setBBoxZ(elevation: {
|
|
33
|
+
min?: number | undefined;
|
|
34
|
+
max?: number | undefined;
|
|
35
|
+
scale?: number | undefined;
|
|
36
|
+
}): void;
|
|
37
|
+
getExtentsByProjection(crs: any): any;
|
|
38
|
+
/**
|
|
39
|
+
* Search for a common ancestor between this tile and another one. It goes
|
|
40
|
+
* through parents on each side until one is found.
|
|
41
|
+
*
|
|
42
|
+
* @param {TileMesh} tile
|
|
43
|
+
*
|
|
44
|
+
* @return {TileMesh} the resulting common ancestor
|
|
45
|
+
*/
|
|
46
|
+
findCommonAncestor(tile: TileMesh): TileMesh;
|
|
47
|
+
onBeforeRender(): void;
|
|
48
|
+
#private;
|
|
49
|
+
}
|
|
50
|
+
import * as THREE from 'three';
|
package/lib/Core/TileMesh.js
CHANGED
|
@@ -24,7 +24,7 @@ class TileMesh extends THREE.Mesh {
|
|
|
24
24
|
this.extent = extent;
|
|
25
25
|
this.extent.zoom = level;
|
|
26
26
|
this.level = level;
|
|
27
|
-
this.material.objectId
|
|
27
|
+
this.material.setUniform('objectId', this.id);
|
|
28
28
|
this.obb = this.geometry.OBB.clone();
|
|
29
29
|
this.boundingSphere = new THREE.Sphere();
|
|
30
30
|
this.obb.box3D.getBoundingSphere(this.boundingSphere);
|
|
@@ -100,9 +100,7 @@ class TileMesh extends THREE.Mesh {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
onBeforeRender() {
|
|
103
|
-
|
|
104
|
-
this.material.updateLayersUniforms();
|
|
105
|
-
}
|
|
103
|
+
this.material.updateLayersUniforms();
|
|
106
104
|
}
|
|
107
105
|
}
|
|
108
106
|
export default TileMesh;
|