Class KmlTourController

java.lang.Object
com.esri.arcgisruntime.ogc.kml.KmlTourController

public final class KmlTourController extends Object
Controls the execution of a KML tour on a SceneView.

Use it to play, pause or reset a KmlTour, and play sound cues or show/hide balloon popup as specified in a KML tour.

Since:
100.5.0
  • Constructor Details

    • KmlTourController

      public KmlTourController()
      Constructs a KmlTourController.
      Since:
      100.5.0
  • Method Details

    • getTour

      public KmlTour getTour()
      Gets the KML tour associated with the controller.
      Returns:
      the KmlTour object
      Since:
      100.5.0
    • setTour

      public void setTour(KmlTour kmlTour)
      Sets the KML tour on the controller and initializes it.

      The KmlTour status becomes KmlTourStatus.INITIALIZED after it is set to a controller. To play the tour, the KmlLayer that the KmlTour is obtained from needs to be visible on a SceneView. If a new KmlTour is set on the controller while a previous KML Tour is playing, the previous execution is aborted and its status goes back to KmlTourStatus.NOT_INITIALIZED.

      Parameters:
      kmlTour - the KML tour, or null to reset the controller
      Since:
      100.5.0
      See Also:
    • getTotalDuration

      public double getTotalDuration()
      Gets the total duration of the KML tour.
      Returns:
      the total duration in seconds, or zero if the tour is null
      Since:
      100.5.0
    • getCurrentPosition

      public double getCurrentPosition()
      Gets the current position of the KML tour.
      Returns:
      the current position of the tour in seconds
      Since:
      100.6.0
    • play

      public void play()
      Starts or resumes playing of the KML tour, which may include audio contents.
      Since:
      100.5.0
    • pause

      public void pause()
      Pauses the execution of the KML tour.
      Since:
      100.5.0
    • reset

      public void reset()
      Resets the execution of the KML tour to the beginning.

      Use this to reset the tour to the beginning, which includes resetting any KML content to its original state before the tour was played.

      Since:
      100.5.0
    • addTotalDurationChangedListener

      public void addTotalDurationChangedListener(KmlTourTotalDurationChangedListener listener)
      Adds a total duration changed listener to the controller.
      Parameters:
      listener - the listener
      Throws:
      IllegalArgumentException - if listener is null
      Since:
      100.5.0
    • removeTotalDurationChangedListener

      public boolean removeTotalDurationChangedListener(KmlTourTotalDurationChangedListener listener)
      Removes a total duration changed listener from the controller.
      Parameters:
      listener - the listener
      Returns:
      true, if successful
      Since:
      100.5.0
    • addCurrentPositionChangedListener

      public void addCurrentPositionChangedListener(KmlTourCurrentPositionChangedListener listener)
      Adds a current position changed listener to the controller.
      Parameters:
      listener - the listener
      Throws:
      IllegalArgumentException - if listener is null
      Since:
      100.6.0
    • removeCurrentPositionChangedListener

      public boolean removeCurrentPositionChangedListener(KmlTourCurrentPositionChangedListener listener)
      Removes a current position changed listener from the controller.
      Parameters:
      listener - the listener
      Returns:
      true, if successful
      Since:
      100.14.0