Distance from the camera in clip space (range: [0, 1]).
Camera applying the perspective projection.
Calculates and returns the distance to the target point.
Necessary subset of MapView properties to compute the distance.
The zoom level to get the equivalent height to.
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.
Instance of MapView.
Calculates the zoom level, which corresponds to the current distance from
camera to lookAt point.
Therefore the zoom level is a float
and not an int
. The height of the camera can be in
between zoom levels. By setting the zoom level, you change the height position of the camera
in away that the field of view of the camera should be able to cover one tile for the given
zoom level.
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.
Subset of necessary MapView properties.
The distance in meters, which are scene units in MapView.
Distance from the camera (range: [0, 1]).
Camera applying the perspective projection.
Constrains given camera target and distance to {@link MapView.maxBounds}.
The camera target.
The camera distance.
The map view whose maximum bounds will be used as constraints.
constrained target and distance, or the unchanged input arguments if the view does not have maximum bounds set.
Extracts yaw, pitch, and roll rotation in radians.
The [[THREE.Object3D]] instance to extract the rotations from.
Extracts current camera tilt angle in radians.
The [[Camera]] in use.
The {@link @here/harp-geoutils#Projection} used to convert between geo and world coordinates.
Gets the spherical coordinates in radian of the object to the coordinates of point
.
Note: this method can be used to get the direction that an object points to, when location
is the target of that object, by adding PI to it. Otherwise it only returns the spherical
coordinates of object
in the tangent space of location
.
The MapView instance to consider.
The object to get the coordinates from.
The reference point.
Gets the tilt angle (in radians) of the object relative to the coordinates of location
.
Note: this method can be used to get the direction that an object points to, when location
is the target of that object, by adding PI to it. Otherwise it only returns the tilt angle
(in radians) of object
in the tangent space of location
.
The {@link @here/harp-geoutils#Projection} used when converting from geo to world coordinates.
The object to get the coordinates from.
The reference point.
Optional axis used to define the rotation about which the object's tilt occurs, the direction vector to the location from the camera is projected on the plane with the given angle.
Get perspective camera frustum planes distances.
all plane distances in helper object.
Returns the {@link @here/harp-geoutils#GeoCoordinates} of the camera, given its target coordinates on the map and its zoom, yaw and pitch.
Coordinates of the center of the view.
Distance to the target in meters.
Camera yaw in degrees.
Camera pitch in degrees.
Active MapView, needed to get the camera fov and map projection.
Optional output vector.
Camera position in world space.
Computes the rotation of the camera according to yaw and pitch in degrees. The computations
hinge on the current projection
and target
, because yaw and pitch are defined in
tangent space of the target point.
Note: yaw == 0 && pitch == 0
will north up the map and you will look downwards onto the
map.
Current projection.
The camera target.
Yaw in degrees, counter-clockwise (as opposed to azimuth), starting north.
Pitch in degrees.
Calculate target (focus) point geo-coordinates for given camera.
The camera looking on target point.
The geo-projection used.
Optional elevation above (or below) sea level measured in world units.
The world space projection.
The camera whose target will be computed.
If provided, elevation at the camera position will be used.
The target, the distance to it and a boolean flag set to false in case an elevation provider was passed but the elevation was not available yet.
Calculate target (focus) point world coordinates for given camera position and orientation.
The camera looking on target point.
The geo-projection used.
Optional elevation above (or below) sea level in world units.
Check if tiles or other content is currently being loaded.
This method can be removed once HARP-7932 is implemented.
true
if MapView has visible tiles or other content that is being loaded.
Orbits the camera around a given point on the screen.
The MapView instance to manipulate.
Orbit point in NDC space.
Orbit point in NDC space.
Delta azimuth in radians.
Delta tilt in radians.
The maximum tilt between the camera and its target in radian.
Orbits the camera around a given point on the screen.
The MapView instance to manipulate.
Pans the camera according to the projection.
Instance of MapView.
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.
MapView instance.
Start vector representing the scene position of a geolocation.
End vector representing the scene position of a geolocation.
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 null
when
the raycast is above the horizon.
Instance of MapView.
Intersection geo coordinates, or null
if raycast is above the horizon.
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.
Instance of MapView.
X coordinate in NDC space.
Y coordinate in NDC space.
Optional param used to offset the ground plane. Used when wanting to pan based on a plane at some altitude. Necessary for example when panning with terrain.
Intersection coordinates, or null
if raycast failed.
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.
The MapView instance in use.
Delta yaw in degrees.
Delta pitch in degrees.
Max tilt angle in radians.
Sets the rotation of the camera according to yaw and pitch in degrees. The computations hinge
on the current projection and geoCenter
, because yaw and pitch are defined in tangent
space. In particular, MapView#geoCenter
needs to be set before calling setRotation
.
Note: yaw == 0 && pitch == 0
will north up the map and you will look downwards onto the
map.
Instance of MapView.
Yaw in degrees, counter-clockwise (as opposed to azimuth), starting north.
Pitch in degrees.
Zooms and moves the map in such a way that the given target position remains at the same position after the zoom.
Instance of MapView.
Target x position in NDC space.
Target y position in NDC space.
The desired zoom level.
The maximum tilt angle to comply by, in globe projection, in radian.
false
if requested zoom cannot be achieved due to the map view's maximum bounds
MapView.geoMaxBounds,true
otherwise.
Generated using TypeDoc
MapView utilities: View transformations, camera setup, view bounds computation...