FixedCameraBehavior (API Reference)
Class FixedCameraBehavior
- All Implemented Interfaces:
CameraBehavior
Use this class to follow the current location of the user: The camera will permanently look at the target location that was fed into the navigator instance. Since location updates happen in discrete intervals, locations in-between will be interpolated to achieve a smooth camera movement.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the currently set fixed bearing.doubleDeprecated.Will be removed in v4.28.0.doubleGets the currently set camera tilt with axis parallel to the ground.Gets the currently set normalized principal point to be used during navigation.getZoom()Gets the current camera's zoom configuration.voidsetCameraBearingInDegrees(Double value) Sets an optional fixed bearing value, from true North (0 degrees) in clockwise direction.voidsetCameraDistanceInMeters(double value) Deprecated.Will be removed in v4.28.0.voidsetCameraTiltInDegrees(double value) Sets camera tilt with axis parallel to the ground.voidSets a normalized principal point to be used during navigation.voidsetZoom(MapMeasure value) Sets the current camera's zoom configuration.
-
Constructor Details
-
FixedCameraBehavior
public FixedCameraBehavior()Creates a new instance of this class.
-
-
Method Details
-
getCameraDistanceInMeters
Deprecated.Will be removed in v4.28.0. Use
getZoom()instead.Gets the currently set camera distance to current location. The default value is 150 meters.
Camera distance to current location. The default value is 150 meters.
- Returns:
Camera distance in meters.
-
setCameraDistanceInMeters
Deprecated.Will be removed in v4.28.0. Use
getZoom()instead.Sets the camera distance to current location. The default value is 150 meters.
Camera distance to current location. The default value is 150 meters.
- Parameters:
value-Camera distance in meters.
-
getZoom
Gets the current camera's zoom configuration.
Camera zoom configuration. The default value is 150 meters.
- Returns:
Zoom configuration. The default value is 150 meters.
-
setZoom
Sets the current camera's zoom configuration.
Camera zoom configuration. The default value is 150 meters.
- Parameters:
value-Zoom configuration. The default value is 150 meters.
-
getCameraTiltInDegrees
public double getCameraTiltInDegrees()Gets the currently set camera tilt with axis parallel to the ground. The default value is 50 degrees.
The default value is 50 degrees.
- Returns:
Camera tilt with axis parallel to the ground.
-
setCameraTiltInDegrees
public void setCameraTiltInDegrees(double value) Sets camera tilt with axis parallel to the ground.
The default value is 50 degrees.
- Parameters:
value-Camera tilt with axis parallel to the ground.
-
getCameraBearingInDegrees
Gets the currently set fixed bearing.
Optional fixed bearing, from true North (0 degrees) in clockwise direction. The valid range is [0, 360]. If set, it will prevent the map from rotating to the direction of travel. For example, a value of zero results in "north up" mode. Defaults to
null, which means the camera derives the bearing from theLocation, so that it points to the direction of travel. If this property isnulland the device does not provide bearing, the last known value is used or zero otherwise.- Returns:
Camera bearing in degrees.
-
setCameraBearingInDegrees
Sets an optional fixed bearing value, from true North (0 degrees) in clockwise direction.
Optional fixed bearing, from true North (0 degrees) in clockwise direction. The valid range is [0, 360]. If set, it will prevent the map from rotating to the direction of travel. For example, a value of zero results in "north up" mode. Defaults to
null, which means the camera derives the bearing from theLocation, so that it points to the direction of travel. If this property isnulland the device does not provide bearing, the last known value is used or zero otherwise.- Parameters:
value-Camera bearing in degrees.
-
getNormalizedPrincipalPoint
Gets the currently set normalized principal point to be used during navigation.
Normalized principal point to be used during navigation. Defaults to (0.5, 0.775), which means the camera will use the position slightly at the bottom of the mapview.
- Specified by:
getNormalizedPrincipalPointin interfaceCameraBehavior- Returns:
The normalized principal point.
-
setNormalizedPrincipalPoint
Sets a normalized principal point to be used during navigation.
Normalized principal point to be used during navigation. Defaults to (0.5, 0.775), which means the camera will use the position slightly at the bottom of the mapview.
- Specified by:
setNormalizedPrincipalPointin interfaceCameraBehavior- Parameters:
value-The normalized principal point.
-