itowns 2.45.1 → 2.45.2-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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 +67 -0
- package/lib/Core/CopcNode.js +50 -69
- package/lib/Core/Deprecated/Undeprecator.d.ts +6 -0
- package/lib/Core/EntwinePointTileNode.d.ts +58 -0
- package/lib/Core/EntwinePointTileNode.js +6 -34
- 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 +14 -0
- package/lib/Core/PointCloudNode.js +28 -0
- package/lib/Core/Potree2Node.d.ts +11 -0
- package/lib/Core/Potree2Node.js +3 -57
- package/lib/Core/Potree2PointAttributes.d.ts +97 -0
- package/lib/Core/PotreeNode.d.ts +13 -0
- package/lib/Core/PotreeNode.js +17 -17
- 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 +1 -1
- package/lib/Layer/Potree2Layer.d.ts +56 -0
- 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,90 @@
|
|
|
1
|
+
export default FirstPersonControls;
|
|
2
|
+
declare class FirstPersonControls extends THREE.EventDispatcher<any> {
|
|
3
|
+
/**
|
|
4
|
+
* @param {View} view
|
|
5
|
+
* @param {object} options
|
|
6
|
+
* @param {boolean} options.focusOnClick - whether or not to focus the renderer domElement on click
|
|
7
|
+
* @param {boolean} options.focusOnMouseOver - whether or not to focus when the mouse is over the domElement
|
|
8
|
+
* @param {boolean} options.moveSpeed - if > 0, pressing the arrow keys will move the camera
|
|
9
|
+
* @param {number} options.verticalFOV - define the max visible vertical angle of the scene in degrees (default 180)
|
|
10
|
+
* @param {number} options.panoramaRatio - alternative way to specify the max vertical angle when using a panorama.
|
|
11
|
+
* You can specify the panorama width/height ratio and the verticalFOV will be computed automatically
|
|
12
|
+
* @param {boolean} options.disableEventListeners - if true, the controls will not self listen to mouse/key events.
|
|
13
|
+
* You'll have to manually forward the events to the appropriate functions: onMouseDown, onMouseMove, onMouseUp,
|
|
14
|
+
* onKeyUp, onKeyDown and onMouseWheel.
|
|
15
|
+
*/
|
|
16
|
+
constructor(view: View, options?: {
|
|
17
|
+
focusOnClick: boolean;
|
|
18
|
+
focusOnMouseOver: boolean;
|
|
19
|
+
moveSpeed: boolean;
|
|
20
|
+
verticalFOV: number;
|
|
21
|
+
panoramaRatio: number;
|
|
22
|
+
disableEventListeners: boolean;
|
|
23
|
+
});
|
|
24
|
+
isFirstPersonControls: boolean;
|
|
25
|
+
camera: any;
|
|
26
|
+
view: View;
|
|
27
|
+
moves: Set<any>;
|
|
28
|
+
options: {
|
|
29
|
+
focusOnClick: boolean;
|
|
30
|
+
focusOnMouseOver: boolean;
|
|
31
|
+
moveSpeed: boolean;
|
|
32
|
+
verticalFOV: number;
|
|
33
|
+
panoramaRatio: number;
|
|
34
|
+
disableEventListeners: boolean;
|
|
35
|
+
};
|
|
36
|
+
_isMouseDown: boolean;
|
|
37
|
+
_onMouseDownMouseX: number;
|
|
38
|
+
_onMouseDownMouseY: number;
|
|
39
|
+
_state: {
|
|
40
|
+
rotateX: number;
|
|
41
|
+
rotateY: number;
|
|
42
|
+
snapshot(): {
|
|
43
|
+
rotateX: number;
|
|
44
|
+
rotateY: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
eventListeners: boolean;
|
|
48
|
+
_onMouseDown: ((event: any) => void) | undefined;
|
|
49
|
+
_onMouseMove: ((event: any) => void) | undefined;
|
|
50
|
+
_onMouseUp: (() => void) | undefined;
|
|
51
|
+
_onMouseWheel: ((event: any) => void) | undefined;
|
|
52
|
+
_onKeyUp: ((e: any) => void) | undefined;
|
|
53
|
+
_onKeyDown: ((e: any) => void) | undefined;
|
|
54
|
+
_onContextMenu: ((event: any) => void) | undefined;
|
|
55
|
+
_onFocus: () => any;
|
|
56
|
+
focusOnMouseOver: boolean;
|
|
57
|
+
focusOnClick: boolean;
|
|
58
|
+
moveCameraVertical: typeof moveCameraVerticalGlobe;
|
|
59
|
+
isUserInteracting(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Resets the controls internal state to match the camera' state.
|
|
62
|
+
* This must be called when manually modifying the camera's position or rotation.
|
|
63
|
+
* @param {boolean} preserveRotationOnX - if true, the look up/down rotation will
|
|
64
|
+
* not be copied from the camera
|
|
65
|
+
*/
|
|
66
|
+
reset(preserveRotationOnX?: boolean): void;
|
|
67
|
+
/**
|
|
68
|
+
* Updates the camera position / rotation based on occured input events.
|
|
69
|
+
* This is done automatically when needed but can also be done if needed.
|
|
70
|
+
* @param {number} dt - ellpased time since last update in seconds
|
|
71
|
+
* @param {boolean} updateLoopRestarted - true if itowns' update loop just restarted
|
|
72
|
+
* @param {boolean} force - set to true if you want to force the update, even if it
|
|
73
|
+
* appears unneeded.
|
|
74
|
+
*/
|
|
75
|
+
update(dt: number, updateLoopRestarted: boolean, force: boolean): void;
|
|
76
|
+
onMouseDown(event: any): void;
|
|
77
|
+
_stateOnMouseDown: {
|
|
78
|
+
rotateX: number;
|
|
79
|
+
rotateY: number;
|
|
80
|
+
} | undefined;
|
|
81
|
+
onMouseUp(): void;
|
|
82
|
+
onMouseMove(event: any): void;
|
|
83
|
+
onMouseWheel(event: any): void;
|
|
84
|
+
onKeyUp(e: any): void;
|
|
85
|
+
onKeyDown(e: any): void;
|
|
86
|
+
onContextMenu(event: any): void;
|
|
87
|
+
dispose(): void;
|
|
88
|
+
}
|
|
89
|
+
import * as THREE from 'three';
|
|
90
|
+
declare function moveCameraVerticalGlobe(value: any): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export default FlyControls;
|
|
2
|
+
/**
|
|
3
|
+
* First-Person controls (at least a possible declination of it).
|
|
4
|
+
*
|
|
5
|
+
* Bindings:
|
|
6
|
+
* - up + down keys: forward/backward
|
|
7
|
+
* - left + right keys: strafing movements
|
|
8
|
+
* - PageUp + PageDown: roll movement
|
|
9
|
+
* - mouse click+drag: pitch and yaw movements (as looking at a panorama, not as in FPS games for instance)
|
|
10
|
+
*/
|
|
11
|
+
declare class FlyControls extends THREE.EventDispatcher<any> {
|
|
12
|
+
/**
|
|
13
|
+
* @param {View} view
|
|
14
|
+
* @param {object} options
|
|
15
|
+
* @param {boolean} options.focusOnClick - whether or not to focus the renderer domElement on click
|
|
16
|
+
* @param {boolean} options.focusOnMouseOver - whether or not to focus when the mouse is over the domElement
|
|
17
|
+
*/
|
|
18
|
+
constructor(view: View, options?: {
|
|
19
|
+
focusOnClick: boolean;
|
|
20
|
+
focusOnMouseOver: boolean;
|
|
21
|
+
});
|
|
22
|
+
view: View;
|
|
23
|
+
options: {
|
|
24
|
+
focusOnClick: boolean;
|
|
25
|
+
focusOnMouseOver: boolean;
|
|
26
|
+
};
|
|
27
|
+
_camera3D: any;
|
|
28
|
+
moves: Set<any>;
|
|
29
|
+
moveSpeed: number;
|
|
30
|
+
_onMouseDownMouseX: number;
|
|
31
|
+
_onMouseDownMouseY: number;
|
|
32
|
+
_isMouseDown: boolean;
|
|
33
|
+
isUserInteracting(): boolean;
|
|
34
|
+
update(dt: any, updateLoopRestarted: any): void;
|
|
35
|
+
}
|
|
36
|
+
import * as THREE from 'three';
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
export namespace CONTROL_EVENTS {
|
|
2
|
+
let PAN_CHANGED: string;
|
|
3
|
+
let ORIENTATION_CHANGED: string;
|
|
4
|
+
let RANGE_CHANGED: string;
|
|
5
|
+
let CAMERA_TARGET_CHANGED: string;
|
|
6
|
+
}
|
|
7
|
+
export default GlobeControls;
|
|
8
|
+
/**
|
|
9
|
+
* GlobeControls is a camera controller
|
|
10
|
+
*
|
|
11
|
+
* @class GlobeControls
|
|
12
|
+
* @param {GlobeView} view the view where the control will be used
|
|
13
|
+
* @param {CameraTransformOptions|Extent} placement the {@link CameraTransformOptions} to apply to view's camera
|
|
14
|
+
* or the extent it must display at initialisation, see {@link CameraTransformOptions} in {@link CameraUtils}.
|
|
15
|
+
* @param {object} [options] An object with one or more configuration properties. Any property of GlobeControls
|
|
16
|
+
* can be passed in this object.
|
|
17
|
+
* @property {number} zoomFactor The factor the scale is multiplied by when dollying (zooming) in or
|
|
18
|
+
* divided by when dollying out. Default is 1.1.
|
|
19
|
+
* @property {number} rotateSpeed Speed camera rotation in orbit and panoramic mode. Default is 0.25.
|
|
20
|
+
* @property {number} minDistance Minimum distance between ground and camera in meters (Perspective Camera only).
|
|
21
|
+
* Default is 250.
|
|
22
|
+
* @property {number} maxDistance Maximum distance between ground and camera in meters
|
|
23
|
+
* (Perspective Camera only). Default is ellipsoid radius * 8.
|
|
24
|
+
* @property {number} minZoom How far you can zoom in, in meters (Orthographic Camera only). Default is 0.
|
|
25
|
+
* @property {number} maxZoom How far you can zoom out, in meters (Orthographic Camera only). Default
|
|
26
|
+
* is Infinity.
|
|
27
|
+
* @property {number} keyPanSpeed Number of pixels moved per push on array key. Default is 7.
|
|
28
|
+
* @property {number} minPolarAngle Minimum vertical orbit angle (in degrees). Default is 0.5.
|
|
29
|
+
* @property {number} maxPolarAngle Maximum vertical orbit angle (in degrees). Default is 86.
|
|
30
|
+
* @property {number} minAzimuthAngle Minimum horizontal orbit angle (in degrees). If modified,
|
|
31
|
+
* should be in [-180,0]. Default is -Infinity.
|
|
32
|
+
* @property {number} maxAzimuthAngle Maximum horizontal orbit angle (in degrees). If modified,
|
|
33
|
+
* should be in [0,180]. Default is Infinity.
|
|
34
|
+
* @property {boolean} handleCollision Handle collision between camera and ground or not, i.e. whether
|
|
35
|
+
* you can zoom underground or not. Default is true.
|
|
36
|
+
* @property {boolean} enableDamping Enable damping or not (simulates the lag that a real camera
|
|
37
|
+
* operator introduces while operating a heavy physical camera). Default is true.
|
|
38
|
+
* @property {boolean} dampingMoveFactor the damping move factor. Default is 0.25.
|
|
39
|
+
* @property {StateControl~State} stateControl redefining which controls state is triggered by the keyboard/mouse
|
|
40
|
+
* event (For example, rewrite the PAN movement to be triggered with the 'left' mouseButton instead of 'right').
|
|
41
|
+
*/
|
|
42
|
+
declare class GlobeControls extends THREE.EventDispatcher<any> {
|
|
43
|
+
constructor(view: any, placement: any, options?: {});
|
|
44
|
+
player: AnimationPlayer;
|
|
45
|
+
view: any;
|
|
46
|
+
camera: any;
|
|
47
|
+
states: StateControl;
|
|
48
|
+
zoomFactor: any;
|
|
49
|
+
minDistance: any;
|
|
50
|
+
maxDistance: any;
|
|
51
|
+
minZoom: any;
|
|
52
|
+
maxZoom: any;
|
|
53
|
+
rotateSpeed: any;
|
|
54
|
+
keyPanSpeed: any;
|
|
55
|
+
minPolarAngle: number;
|
|
56
|
+
maxPolarAngle: number;
|
|
57
|
+
minAzimuthAngle: number;
|
|
58
|
+
maxAzimuthAngle: number;
|
|
59
|
+
handleCollision: any;
|
|
60
|
+
minDistanceCollision: number;
|
|
61
|
+
enableDamping: boolean;
|
|
62
|
+
dampingMoveFactor: any;
|
|
63
|
+
startEvent: {
|
|
64
|
+
type: string;
|
|
65
|
+
};
|
|
66
|
+
endEvent: {
|
|
67
|
+
type: string;
|
|
68
|
+
};
|
|
69
|
+
updateHelper: (position: any, helper: any) => void;
|
|
70
|
+
_onEndingMove: (() => void) | (() => void) | null;
|
|
71
|
+
_onTravel: (event: any) => Promise<any> | undefined;
|
|
72
|
+
_onTouchStart: (event: any) => void;
|
|
73
|
+
_onTouchEnd: () => void;
|
|
74
|
+
_onTouchMove: (event: any) => void;
|
|
75
|
+
_onStateChange: (event: any) => void;
|
|
76
|
+
_onRotation: (event: any) => void;
|
|
77
|
+
_onDrag: (event: any) => void;
|
|
78
|
+
_onDolly: (event: any) => void;
|
|
79
|
+
_onPan: (event: any) => void;
|
|
80
|
+
_onPanoramic: (event: any) => void;
|
|
81
|
+
_onZoom: (event: any) => Promise<any> | undefined;
|
|
82
|
+
get zoomInScale(): any;
|
|
83
|
+
get zoomOutScale(): number;
|
|
84
|
+
get isPaused(): boolean;
|
|
85
|
+
onEndingMove(current: any): void;
|
|
86
|
+
rotateLeft(angle?: number): void;
|
|
87
|
+
rotateUp(angle?: number): void;
|
|
88
|
+
panLeft(distance: any): void;
|
|
89
|
+
panUp(distance: any): void;
|
|
90
|
+
mouseToPan(deltaX: any, deltaY: any): void;
|
|
91
|
+
dolly(delta: any): void;
|
|
92
|
+
getMinDistanceCameraBoundingSphereObbsUp(tile: any): void;
|
|
93
|
+
update(state?: any): void;
|
|
94
|
+
onStateChange(event: any): void;
|
|
95
|
+
handleRotation(event: any): void;
|
|
96
|
+
handleDrag(event: any): void;
|
|
97
|
+
handleDolly(event: any): void;
|
|
98
|
+
handlePan(event: any): void;
|
|
99
|
+
handlePanoramic(event: any): void;
|
|
100
|
+
handleEndMovement(event?: {}): void;
|
|
101
|
+
updateTarget(): void;
|
|
102
|
+
handlingEvent(current: any): void;
|
|
103
|
+
travel(event: any): Promise<any> | undefined;
|
|
104
|
+
handleZoom(event: any): Promise<any> | undefined;
|
|
105
|
+
onTouchStart(event: any): void;
|
|
106
|
+
state: any;
|
|
107
|
+
onTouchMove(event: any): void;
|
|
108
|
+
onTouchEnd(): void;
|
|
109
|
+
dispose(): void;
|
|
110
|
+
/**
|
|
111
|
+
* Changes the tilt of the current camera, in degrees.
|
|
112
|
+
* @param {number} tilt
|
|
113
|
+
* @param {boolean} isAnimated
|
|
114
|
+
* @return {Promise<void>}
|
|
115
|
+
*/
|
|
116
|
+
setTilt(tilt: number, isAnimated: boolean): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Changes the heading of the current camera, in degrees.
|
|
119
|
+
* @param {number} heading
|
|
120
|
+
* @param {boolean} isAnimated
|
|
121
|
+
* @return {Promise<void>}
|
|
122
|
+
*/
|
|
123
|
+
setHeading(heading: number, isAnimated: boolean): Promise<void>;
|
|
124
|
+
/**
|
|
125
|
+
* Sets the "range": the distance in meters between the camera and the current central point on the screen.
|
|
126
|
+
* @param {number} range
|
|
127
|
+
* @param {boolean} isAnimated
|
|
128
|
+
* @return {Promise<void>}
|
|
129
|
+
*/
|
|
130
|
+
setRange(range: number, isAnimated: boolean): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Returns the {@linkcode Coordinates} of the globe point targeted by the camera in EPSG:4978 projection. See {@linkcode Coordinates} for conversion
|
|
133
|
+
* @return {THREE.Vector3} position
|
|
134
|
+
*/
|
|
135
|
+
getCameraTargetPosition(): THREE.Vector3;
|
|
136
|
+
/**
|
|
137
|
+
* Returns the "range": the distance in meters between the camera and the current central point on the screen.
|
|
138
|
+
* @param {THREE.Vector3} [position] - The position to consider as picked on
|
|
139
|
+
* the ground.
|
|
140
|
+
* @return {number} number
|
|
141
|
+
*/
|
|
142
|
+
getRange(position?: THREE.Vector3): number;
|
|
143
|
+
/**
|
|
144
|
+
* Returns the tilt of the current camera in degrees.
|
|
145
|
+
* @param {THREE.Vector3} [position] - The position to consider as picked on
|
|
146
|
+
* the ground.
|
|
147
|
+
* @return {number} The angle of the rotation in degrees.
|
|
148
|
+
*/
|
|
149
|
+
getTilt(position?: THREE.Vector3): number;
|
|
150
|
+
/**
|
|
151
|
+
* Returns the heading of the current camera in degrees.
|
|
152
|
+
* @param {THREE.Vector3} [position] - The position to consider as picked on
|
|
153
|
+
* the ground.
|
|
154
|
+
* @return {number} The angle of the rotation in degrees.
|
|
155
|
+
*/
|
|
156
|
+
getHeading(position?: THREE.Vector3): number;
|
|
157
|
+
/**
|
|
158
|
+
* Displaces the central point to a specific amount of pixels from its current position.
|
|
159
|
+
* The view flies to the desired coordinate, i.e.is not teleported instantly. Note : The results can be strange in some cases, if ever possible, when e.g.the camera looks horizontally or if the displaced center would not pick the ground once displaced.
|
|
160
|
+
* @param {vector} pVector The vector
|
|
161
|
+
* @return {Promise}
|
|
162
|
+
*/
|
|
163
|
+
pan(pVector: vector): Promise<any>;
|
|
164
|
+
/**
|
|
165
|
+
* Returns the orientation angles of the current camera, in degrees.
|
|
166
|
+
* @return {Array<number>}
|
|
167
|
+
*/
|
|
168
|
+
getCameraOrientation(): Array<number>;
|
|
169
|
+
/**
|
|
170
|
+
* Returns the camera location projected on the ground in lat,lon. See {@linkcode Coordinates} for conversion.
|
|
171
|
+
* @return {Coordinates} position
|
|
172
|
+
*/
|
|
173
|
+
getCameraCoordinate(): Coordinates;
|
|
174
|
+
/**
|
|
175
|
+
* Returns the {@linkcode Coordinates} of the central point on screen in lat,lon. See {@linkcode Coordinates} for conversion.
|
|
176
|
+
* @return {Coordinates} coordinate
|
|
177
|
+
*/
|
|
178
|
+
getLookAtCoordinate(): Coordinates;
|
|
179
|
+
/**
|
|
180
|
+
* Sets the animation enabled.
|
|
181
|
+
* @param {boolean} enable enable
|
|
182
|
+
*/
|
|
183
|
+
setAnimationEnabled(enable: boolean): void;
|
|
184
|
+
/**
|
|
185
|
+
* Determines if animation enabled.
|
|
186
|
+
* @return {boolean} True if animation enabled, False otherwise.
|
|
187
|
+
*/
|
|
188
|
+
isAnimationEnabled(): boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Returns the actual zoom. The zoom will always be between the [getMinZoom(), getMaxZoom()].
|
|
191
|
+
* @return {number} The zoom .
|
|
192
|
+
*/
|
|
193
|
+
getZoom(): number;
|
|
194
|
+
/**
|
|
195
|
+
* Sets the current zoom, which is an index in the logical scales predefined for the application.
|
|
196
|
+
* The higher the zoom, the closer to the ground.
|
|
197
|
+
* The zoom is always in the [getMinZoom(), getMaxZoom()] range.
|
|
198
|
+
* @param {number} zoom The zoom
|
|
199
|
+
* @param {boolean} isAnimated Indicates if animated
|
|
200
|
+
* @return {Promise}
|
|
201
|
+
*/
|
|
202
|
+
setZoom(zoom: number, isAnimated: boolean): Promise<any>;
|
|
203
|
+
/**
|
|
204
|
+
* Return the current zoom scale at the central point of the view.
|
|
205
|
+
* This function compute the scale of a map
|
|
206
|
+
* @param {number} pitch Screen pitch, in millimeters ; 0.28 by default
|
|
207
|
+
* @return {number} The zoom scale.
|
|
208
|
+
*
|
|
209
|
+
* @deprecated Use View#getScale instead.
|
|
210
|
+
*/
|
|
211
|
+
getScale(pitch: number): number;
|
|
212
|
+
/**
|
|
213
|
+
* To convert the projection in meters on the globe of a number of pixels of screen
|
|
214
|
+
* @param {number} pixels count pixels to project
|
|
215
|
+
* @param {number} pixelPitch Screen pixel pitch, in millimeters (default = 0.28 mm / standard pixel size of 0.28 millimeters as defined by the OGC)
|
|
216
|
+
* @return {number} projection in meters on globe
|
|
217
|
+
*
|
|
218
|
+
* @deprecated Use `View#getPixelsToMeters` instead.
|
|
219
|
+
*/
|
|
220
|
+
pixelsToMeters(pixels: number, pixelPitch?: number): number;
|
|
221
|
+
/**
|
|
222
|
+
* To convert the projection a number of horizontal pixels of screen to longitude degree WGS84 on the globe
|
|
223
|
+
* @param {number} pixels count pixels to project
|
|
224
|
+
* @param {number} pixelPitch Screen pixel pitch, in millimeters (default = 0.28 mm / standard pixel size of 0.28 millimeters as defined by the OGC)
|
|
225
|
+
* @return {number} projection in degree on globe
|
|
226
|
+
*
|
|
227
|
+
* @deprecated Use `View#getPixelsToMeters` and `GlobeControls#metersToDegrees`
|
|
228
|
+
* instead.
|
|
229
|
+
*/
|
|
230
|
+
pixelsToDegrees(pixels: number, pixelPitch?: number): number;
|
|
231
|
+
/**
|
|
232
|
+
* Projection on screen in pixels of length in meter on globe
|
|
233
|
+
* @param {number} value Length in meter on globe
|
|
234
|
+
* @param {number} pixelPitch Screen pixel pitch, in millimeters (default = 0.28 mm / standard pixel size of 0.28 millimeters as defined by the OGC)
|
|
235
|
+
* @return {number} projection in pixels on screen
|
|
236
|
+
*
|
|
237
|
+
* @deprecated Use `View#getMetersToPixels` instead.
|
|
238
|
+
*/
|
|
239
|
+
metersToPixels(value: number, pixelPitch?: number): number;
|
|
240
|
+
/**
|
|
241
|
+
* Changes the zoom of the central point of screen so that screen acts as a map with a specified scale.
|
|
242
|
+
* The view flies to the desired zoom scale;
|
|
243
|
+
* @param {number} scale The scale
|
|
244
|
+
* @param {number} pitch The pitch
|
|
245
|
+
* @param {boolean} isAnimated Indicates if animated
|
|
246
|
+
* @return {Promise}
|
|
247
|
+
*/
|
|
248
|
+
setScale(scale: number, pitch: number, isAnimated: boolean): Promise<any>;
|
|
249
|
+
/**
|
|
250
|
+
* Changes the center of the scene on screen to the specified in lat, lon. See {@linkcode Coordinates} for conversion.
|
|
251
|
+
* This function allows to change the central position, the zoom, the range, the scale and the camera orientation at the same time.
|
|
252
|
+
* The zoom has to be between the [getMinZoom(), getMaxZoom()].
|
|
253
|
+
* Zoom parameter is ignored if range is set
|
|
254
|
+
* The tilt's interval is between 4 and 89.5 degree
|
|
255
|
+
*
|
|
256
|
+
* @param {CameraUtils~CameraTransformOptions|Extent} [params] - camera transformation to apply
|
|
257
|
+
* @param {number} [params.zoom] - zoom
|
|
258
|
+
* @param {number} [params.scale] - scale
|
|
259
|
+
* @param {boolean} [isAnimated] - Indicates if animated
|
|
260
|
+
* @return {Promise} A promise that resolves when transformation is complete
|
|
261
|
+
*/
|
|
262
|
+
lookAtCoordinate(params?: {}, isAnimated?: boolean): Promise<any>;
|
|
263
|
+
/**
|
|
264
|
+
* Pick a position on the globe at the given position in lat,lon. See {@linkcode Coordinates} for conversion.
|
|
265
|
+
* @param {Vector2} windowCoords - window coordinates
|
|
266
|
+
* @param {number=} y - The y-position inside the Globe element.
|
|
267
|
+
* @return {Coordinates} position
|
|
268
|
+
*/
|
|
269
|
+
pickGeoPosition(windowCoords: Vector2): Coordinates;
|
|
270
|
+
}
|
|
271
|
+
import * as THREE from 'three';
|
|
272
|
+
import AnimationPlayer from '../Core/AnimationPlayer';
|
|
273
|
+
import StateControl from '../Controls/StateControl';
|
|
274
|
+
import { Coordinates } from '@itowns/geographic';
|