flywave-mapview.mapviewutils
Home > @flywave/flywave-mapview > MapViewUtils
MapViewUtils namespace
MapView utilities: View transformations, camera setup, view bounds computation...
Signature:
export declare namespace MapViewUtils
Functions
Function | Description |
|---|---|
Calculates and returns the distance to the target point. | |
Calculates and returns the distance from the ground, which is needed to put the camera to this height, to see the size of the area that would be covered by one tile for the given zoom level. | |
Calculates the zoom level, which corresponds to the current distance from camera to lookAt point. Therefore the zoom level is a As an example for this, when you have a tile of zoom level 14 in front of the camera and you set the zoom level of the camera to 14, then you are able to see the whole tile in front of you. | |
constrainTargetAndDistanceToViewBounds(target, distance, mapView) | Constrains given camera target and distance to . |
Extracts yaw, pitch, and roll rotation in radians. - Yaw : Rotation around the vertical axis, counter-clockwise (as opposed to azimuth), starting north. - Pitch :Rotation around the horizontal axis. - Roll : Rotation around the view axis. | |
Extracts current camera tilt angle in radians. | |
extractSphericalCoordinatesFromLocation(mapView, object, location) | Gets the spherical coordinates in radian of the object to the coordinates of Note: this method can be used to get the direction that an object points to, when |
extractTiltAngleFromLocation(projection, object, location, tiltAxis) | Gets the tilt angle (in radians) of the object relative to the coordinates of Note: this method can be used to get the direction that an object points to, when |
getCameraCoordinatesFromTargetCoordinates(targetCoordinates, distance, yawDeg, pitchDeg, mapView) | |
Get perspective camera frustum planes distances. | |
getCameraRotationAtTarget(projection, target, yawDeg, pitchDeg, result) | Computes the rotation of the camera according to yaw and pitch in degrees. The computations hinge on the current **Note:** |
Calculate target (focus) point geo-coordinates for given camera. | |
Calculate target (focus) point world coordinates for given camera position and orientation. | |
Check if tiles or other content is currently being loaded. This method can be removed once FLYWAVE-7932 is implemented. | |
orbitAroundScreenPoint(mapView, offsetX, offsetY, deltaAzimuth, deltaTilt, maxTiltAngle) | Orbits the camera around a given point on the screen. |
Orbits the camera around a given point on the screen. | |
Pans the camera according to the projection. | |
The function doing a pan in the spherical space when MapView's active [[ProjectionType]] is spherical. In other words, the function that rotates the camera around the globe. | |
rayCastGeoCoordinates(mapView, pointOnScreenXinNDC, pointOnScreenYinNDC) | Casts a ray in NDC space from the current view of the camera and returns the intersection point of that ray against the map in geo coordinates. The return value can be |
rayCastWorldCoordinates(mapView, pointOnScreenXinNDC, pointOnScreenYinNDC, elevation) | Casts a ray in NDC space from the current map view and returns the intersection point of that ray wih the map in world space. |
rotate(mapView, deltaYawDeg, deltaPitchDeg, maxTiltAngleRad) | Rotates the camera by the given delta yaw and delta pitch. The pitch will be clamped to the maximum possible tilt to the new target, and under the horizon in sphere projection. |
Sets the rotation of the camera according to yaw and pitch in degrees. The computations hinge on the current projection and **Note:** | |
zoomOnTargetPosition(mapView, targetNDCx, targetNDCy, zoomLevel, maxTiltAngle) | Zooms and moves the map in such a way that the given target position remains at the same position after the zoom. |
Interfaces
Interface | Description |
|---|---|
The anti clockwise rotation of an object along the axes of its tangent space, with itself as origin. | |
Parameters for . |
Variables
Variable | Description |
|---|---|