diff --git a/typescript/packages/subsurface-viewer/src/components/Map.tsx b/typescript/packages/subsurface-viewer/src/components/Map.tsx index 889ddda81..1cb862432 100644 --- a/typescript/packages/subsurface-viewer/src/components/Map.tsx +++ b/typescript/packages/subsurface-viewer/src/components/Map.tsx @@ -194,13 +194,57 @@ export interface ViewsType { * Camera view state. */ export interface ViewStateType { + /** + * Camera target position. + */ target: Point2D | Point3D | undefined; - zoom: number | Point2D | BoundingBox3D | undefined; + /** + * Zoom level or bounding box to fit in the view. + * - When a number: Represents the zoom level of the camera. + * - When a tuple [number, number]: Represents independent zoom levels along the horizontal and vertical axes. + * - When a BoundingBox3D: Represents the camera position computed to fit (zoom in) the entire box. + */ + zoom: number | [number, number] | BoundingBox3D | undefined; + /** + * Rotation around the X axis in degrees. Only for 3D view. + */ rotationX: number; + /** + * Rotation around the orbit in degrees. Only for 3D view. + */ rotationOrbit: number; + /** + * Minimum zoom level. + * Constrains how far out the user can zoom. Lower values allow viewing a larger area. + */ minZoom?: number; + /** + * Maximum zoom level. + * Constrains how far in the user can zoom. Higher values allow closer inspection. + */ maxZoom?: number; + /** + * Animation transition duration in milliseconds. + */ transitionDuration?: number; + /** + * Viewport width in pixels. + */ + width?: number; + /** + * Viewport height in pixels. + */ + height?: number; + /** + * Minimum rotation around the X axis in degrees. Only for 3D view. + * Constrains the minimum tilt angle of the camera (e.g., 0° = horizontal view). + */ + minRotationX?: number; + /** + * Maximum rotation around the X axis in degrees. Only for 3D view. + * Constrains the maximum tilt angle of the camera (e.g., 90° = top-down view). + */ + maxRotationX?: number; } interface MarginsType {