Class MapNavigator.LookFromAction

java.lang.Object
com.luciad.maps.MapNavigator.LookFromAction
All Implemented Interfaces:
AutoCloseable
Enclosing class:
MapNavigator

public static final class MapNavigator.LookFromAction extends Object implements AutoCloseable
Class that allows you to build a look-from action and apply it, either directly or using an animation.

A look-from action moves the camera to a given eye position and orientation. This can for example be used to fly the camera to a known viewpoint, such as a panorama location.

Looking from works by:

Note that the navigation constraints also apply to this action. For example, to move the camera close to the ground, lower the minimum altitude of the above constraint.

Since:
2026.1
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • eye

      @NotNull public MapNavigator.LookFromAction eye(@NotNull Point eyePosition)
      Sets the eye position to move the camera to.

      The position can be defined in any reference.

      This parameter is mandatory. Not setting it will cause LookFromAction#lookFrom to throw an exception.

      Parameters:
      eyePosition - the eye position to move the camera to
      Returns:
      this
    • yaw

      @NotNull public MapNavigator.LookFromAction yaw(@NotNull Azimuth yaw)
      Sets the yaw angle of the camera at the target eye position.

      This parameter is optional. The default is 0.

      Parameters:
      yaw - the yaw angle of the camera at the target eye position
      Returns:
      this
    • pitch

      @NotNull public MapNavigator.LookFromAction pitch(double pitch)
      Sets the pitch angle of the camera at the target eye position.

      Pitch is defined as the camera's tilt angle. A value of 0 points the camera towards the horizon (i.e. horizontally); -90 points straight down towards the ground and +90 points straight up.

      This parameter is optional. The default is 0.

      Parameters:
      pitch - the pitch angle of the camera at the target eye position, expressed in degrees
      Returns:
      this
    • roll

      @NotNull public MapNavigator.LookFromAction roll(double roll)
      Sets the roll angle of the camera at the target eye position.

      Roll is a rotation around the camera's forward direction. Negative angles bank the camera left; positive angles bank the camera right.

      This parameter is optional. The default is 0.

      Parameters:
      roll - the roll angle of the camera at the target eye position, expressed in degrees
      Returns:
      this
    • animate

      @NotNull public MapNavigator.LookFromAction animate(boolean animated)
      Specifies if the action should use an animation.
      Parameters:
      animated - if this action should use an animation. The default is false.
      Returns:
      this
    • duration

      @NotNull public MapNavigator.LookFromAction duration(@NotNull Duration duration)
      Specifies the duration of the animation.

      This parameter is only used if animate(bool) is called with true as argument.

      Parameters:
      duration - the duration of the animation in milliseconds. The default is 2000 (=2 seconds)
      Returns:
      this
    • lookFrom

      public void lookFrom() throws IllegalStateException
      Applies the look-from action.

      If no camera path towards the eye position can be determined, for example because the eye position cannot be transformed to the map reference, this method has no effect.

      Throws:
      IllegalStateException - if the action is not built correctly, for example if mandatory parameters are missing.