public final class

OrbitLocationCameraController

extends CameraController
java.lang.Object
   ↳ com.esri.arcgisruntime.mapping.view.CameraController
     ↳ com.esri.arcgisruntime.mapping.view.OrbitLocationCameraController

Class Overview

Represents a camera controller that restricts the scene view's camera to orbit a fixed location.

Interactions on the scene view will pivot the camera around a target location so the camera is always looking at the point. When active, setting the viewpoint on the scene view will be disabled.

Summary

Public Constructors
OrbitLocationCameraController(Point targetLocation, double cameraDistance)
Creates an orbit location camera controller given a target location, and distance from target.
OrbitLocationCameraController(Point targetLocation, Point cameraLocation)
Creates an orbit location camera controller given a target location and camera location.
Public Methods
void addCameraDistanceChangedListener(CameraDistanceChangedListener<OrbitLocationCameraController> listener)
Adds a listener for when distance between camera and target has changed.
void addCameraHeadingOffsetChangedListener(CameraHeadingOffsetChangedListener<OrbitLocationCameraController> listener)
Adds a listener for when camera heading offset has changed.
void addCameraPitchOffsetChangedListener(CameraPitchOffsetChangedListener<OrbitLocationCameraController> listener)
Adds a listener for when camera pitch offset has changed.
double getCameraDistance()
Gets the distance between the camera and the target.
double getCameraHeadingOffset()
Gets the camera heading offset.
double getCameraPitchOffset()
Gets the camera pitch offset.
double getMaxCameraDistance()
Gets the maximum distance between the camera and the target.
double getMaxCameraHeadingOffset()
Gets the maximum camera heading offset.
double getMaxCameraPitchOffset()
Gets the maximum camera pitch offset.
double getMinCameraDistance()
Gets the minimum distance between the camera and the target.
double getMinCameraHeadingOffset()
Gets the minimum camera heading offset.
double getMinCameraPitchOffset()
Gets the minimum camera pitch offset.
Point getTargetLocation()
Gets the target for the camera to look at and rotate around.
boolean isCameraDistanceInteractive()
Gets whether a zoom interaction can affect the camera distance.
boolean isCameraHeadingOffsetInteractive()
Gets whether a horizontal pan interaction can affect the camera heading offset.
boolean isCameraPitchOffsetInteractive()
Gets whether a vertical pan interaction can affect the camera pitch offset.
ListenableFuture<Boolean> moveCameraAsync(double deltaDistance, double deltaHeadingOffset, double deltaPitchOffset, float duration)
Moves the camera to a new offset position with the specified duration.
boolean removeCameraDistanceChangedListener(CameraDistanceChangedListener<OrbitLocationCameraController> listener)
Removes a camera distance changed listener.
boolean removeCameraHeadingOffsetChangedListener(CameraHeadingOffsetChangedListener<OrbitLocationCameraController> listener)
Removes a camera heading offset changed listener.
boolean removeCameraPitchOffsetChangedListener(CameraPitchOffsetChangedListener<OrbitLocationCameraController> listener)
Removes a camera pitch offset changed listener.
void setCameraDistance(double distance)
Sets the distance between the camera and the target.
void setCameraDistanceInteractive(boolean distanceInteractive)
Sets whether a zoom interaction can affect the camera distance.
void setCameraHeadingOffset(double headingOffset)
Sets the clockwise angle in the target symbol's horizontal plane starting directly behind the symbol.
void setCameraHeadingOffsetInteractive(boolean headingOffsetInteractive)
Sets whether a horizontal pan interaction can affect the camera heading offset.
void setCameraPitchOffset(double pitchOffset)
Sets anti-clockwise angle from the positive Z axis of the target's symbol to the symbol's horizontal plane.
void setCameraPitchOffsetInteractive(boolean pitchOffsetInteractive)
Sets whether a vertical pan interaction can affect the camera pitch offset.
void setMaxCameraDistance(double maxDistance)
Sets the maximum distance between the camera and the target.
void setMaxCameraHeadingOffset(double maxHeadingOffset)
Sets the maximum camera heading offset.
void setMaxCameraPitchOffset(double maxPitchOffset)
Sets the maximum camera pitch offset.
void setMinCameraDistance(double minDistance)
Sets the minimum distance between the camera and the target.
void setMinCameraHeadingOffset(double minHeadingOffset)
Sets the minimum camera heading offset.
void setMinCameraPitchOffset(double minPitchOffset)
Sets the minimum camera pitch offset.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public OrbitLocationCameraController (Point targetLocation, double cameraDistance)

Creates an orbit location camera controller given a target location, and distance from target.

Parameters
targetLocation target location to pivot the camera
cameraDistance distance between the camera and the target, in meters
Throws
IllegalArgumentException if targetLocation is null
IllegalArgumentException if cameraDistance is zero or less

public OrbitLocationCameraController (Point targetLocation, Point cameraLocation)

Creates an orbit location camera controller given a target location and camera location. The camera is placed at the given camera location and will point toward the target location.

Parameters
targetLocation target location to look at
cameraLocation location of the camera
Throws
IllegalArgumentException if targetLocation or cameraLocation are null

Public Methods

public void addCameraDistanceChangedListener (CameraDistanceChangedListener<OrbitLocationCameraController> listener)

Adds a listener for when distance between camera and target has changed.

Parameters
listener the listener
Throws
IllegalArgumentException if the listener is null

public void addCameraHeadingOffsetChangedListener (CameraHeadingOffsetChangedListener<OrbitLocationCameraController> listener)

Adds a listener for when camera heading offset has changed.

Parameters
listener the listener
Throws
IllegalArgumentException if the listener is null

public void addCameraPitchOffsetChangedListener (CameraPitchOffsetChangedListener<OrbitLocationCameraController> listener)

Adds a listener for when camera pitch offset has changed.

Parameters
listener the listener
Throws
IllegalArgumentException if the listener is null

public double getCameraDistance ()

Gets the distance between the camera and the target.

Returns
  • the distance between the camera and the target, in meters

public double getCameraHeadingOffset ()

Gets the camera heading offset. The default value is 0 degrees.

The return value can be different than what was set. See setCameraHeadingOffset(double) for details.

Returns
  • the camera heading offset, in degrees

public double getCameraPitchOffset ()

Gets the camera pitch offset. The default value is 45 degrees.

The value is clamped to minCameraPitchOffset and maxCameraPitchOffset.

Returns
  • the camera pitch offset, in degrees

public double getMaxCameraDistance ()

Gets the maximum distance between the camera and the target. Interactions and animations are limited by this. The default value is Double.MAX_VALUE meters.

Returns
  • the maximum distance between the camera and the target, in meters

public double getMaxCameraHeadingOffset ()

Gets the maximum camera heading offset. Interactions and animations are limited by this. The default value is 180 degrees.

Returns
  • the maximum camera heading offset, in degrees

public double getMaxCameraPitchOffset ()

Gets the maximum camera pitch offset. Interactions and animations are limited by this. The default value is 180 degrees.

Returns
  • the maximum camera pitch offset, in degrees

public double getMinCameraDistance ()

Gets the minimum distance between the camera and the target. Interactions and animations are limited by this. The default value is 0 meters.

Returns
  • the minimum distance between the camera and the target, in meters

public double getMinCameraHeadingOffset ()

Gets the minimum camera heading offset. Interactions and animations are limited by this. The default value is -180 degrees.

Returns
  • the minimum camera heading offset, in degrees

public double getMinCameraPitchOffset ()

Gets the minimum camera pitch offset. Interactions and animations are limited by this. The default value is 0 degrees.

Returns
  • the minimum camera pitch offset, in degrees

public Point getTargetLocation ()

Gets the target for the camera to look at and rotate around.

Returns
  • the target for the camera to look at and rotate around

public boolean isCameraDistanceInteractive ()

Gets whether a zoom interaction can affect the camera distance. The default value is true.

Returns
  • true if a zoom interaction affect the camera distance, otherwise false

public boolean isCameraHeadingOffsetInteractive ()

Gets whether a horizontal pan interaction can affect the camera heading offset. The default value is true.

Returns
  • true if a horizontal pan interaction affect the camera heading offset, otherwise false

public boolean isCameraPitchOffsetInteractive ()

Gets whether a vertical pan interaction can affect the camera pitch offset. The default value is true.

Returns
  • true if a vertical pan interaction affect the camera pitch offset, otherwise false

public ListenableFuture<Boolean> moveCameraAsync (double deltaDistance, double deltaHeadingOffset, double deltaPitchOffset, float duration)

Moves the camera to a new offset position with the specified duration.

Parameters
deltaDistance the change in distance to apply in the animation, in meters
deltaHeadingOffset the change in heading to apply in the animation, in degrees
deltaPitchOffset the change in pitch to apply in the animation, in degrees
duration the duration of the animation, in seconds
Returns
  • a Future used to check whether the animation completed successfully

public boolean removeCameraDistanceChangedListener (CameraDistanceChangedListener<OrbitLocationCameraController> listener)

Removes a camera distance changed listener.

Parameters
listener the listener
Returns
  • true if successful, otherwise false

public boolean removeCameraHeadingOffsetChangedListener (CameraHeadingOffsetChangedListener<OrbitLocationCameraController> listener)

Removes a camera heading offset changed listener.

Parameters
listener the listener
Returns
  • true if successful, otherwise false

public boolean removeCameraPitchOffsetChangedListener (CameraPitchOffsetChangedListener<OrbitLocationCameraController> listener)

Removes a camera pitch offset changed listener.

Parameters
listener the listener
Returns
  • true if successful, otherwise false

public void setCameraDistance (double distance)

Sets the distance between the camera and the target. The camera position is derived from this distance plus the camera offsets.

Parameters
distance distance between the camera and the target, in meters
Throws
IllegalArgumentException if distance is zero or less

public void setCameraDistanceInteractive (boolean distanceInteractive)

Sets whether a zoom interaction can affect the camera distance. The default value is true.

Parameters
distanceInteractive true to let a zoom interaction affect the camera distance, otherwise false

public void setCameraHeadingOffset (double headingOffset)

Sets the clockwise angle in the target symbol's horizontal plane starting directly behind the symbol. The default value is 0 degrees.

If the headingOffset is not between minCameraHeadingOffset and maxCameraHeadingOffset, it will be normalized as follows:

  1. if hedingOffset < minCameraHeadingOffset, then 360 will be added to headingOffset until the new value is above minCameraHeadingOffset. If the new value is less than maxCameraHeadingOffset, it will be used. Otherwise, the new value will be set to minCameraHeadingOffset.
  2. if hedingOffset > maxCameraHeadingOffset, then 360 will be subtracted from headingOffset until the new value is below maxCameraHeadingOffset. If the new value is greater than minCameraHeadingOffset, it will be used. Otherwise, the new value will be set to maxCameraHeadingOffset.

Parameters
headingOffset camera heading offset, in degrees

public void setCameraHeadingOffsetInteractive (boolean headingOffsetInteractive)

Sets whether a horizontal pan interaction can affect the camera heading offset. The default value is true.

Parameters
headingOffsetInteractive true to let a horizontal pan interaction affect the camera heading offset, otherwise false

public void setCameraPitchOffset (double pitchOffset)

Sets anti-clockwise angle from the positive Z axis of the target's symbol to the symbol's horizontal plane. The default value is 45 degrees.

The value will be clamped to minCameraPitchOffset and maxCameraPitchOffset.

Parameters
pitchOffset camera pitch offset, in degrees

public void setCameraPitchOffsetInteractive (boolean pitchOffsetInteractive)

Sets whether a vertical pan interaction can affect the camera pitch offset. The default value is true.

Parameters
pitchOffsetInteractive true to let a vertical pan interaction affect the camera pitch offset, otherwise false

public void setMaxCameraDistance (double maxDistance)

Sets the maximum distance between the camera and the target. Interactions and animations are limited by this. The default value is Double.MAX_VALUE meters.

Parameters
maxDistance the minimum distance from the camera to the target, in meters
Throws
IllegalArgumentException if maxDistance is negative

public void setMaxCameraHeadingOffset (double maxHeadingOffset)

Sets the maximum camera heading offset. Interactions and animations are limited by this. The default value is 180 degrees.

Parameters
maxHeadingOffset the maximum camera heading offset, in degrees

public void setMaxCameraPitchOffset (double maxPitchOffset)

Sets the maximum camera pitch offset. Interactions and animations are limited by this. The default value is 180 degrees.

Parameters
maxPitchOffset the maximum pitch offset, in degrees

public void setMinCameraDistance (double minDistance)

Sets the minimum distance between the camera and the target. Interactions and animations are limited by this. The default value is 0 meters.

Parameters
minDistance the minimum distance from the camera to the target, in meters
Throws
IllegalArgumentException if minDistance is negative

public void setMinCameraHeadingOffset (double minHeadingOffset)

Sets the minimum camera heading offset. Interactions and animations are limited by this. The default value is -180 degrees.

Parameters
minHeadingOffset the minimum heading offset, in degrees

public void setMinCameraPitchOffset (double minPitchOffset)

Sets the minimum camera pitch offset. Interactions and animations are limited by this. The default value is 0 degrees.

Parameters
minPitchOffset the minimum camera pitch offset, in degrees