See the guide documentation and samples for information about converting KmlViewpoints into viewpoints.
- Since:
- 100.4.0
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic KmlViewpoint
createCameraViewpoint
(Point point, double heading, double pitch, double roll, KmlAltitudeMode altitudeMode) Creates a KML viewpoint based on the provided camera location.static KmlViewpoint
createLookAtViewpoint
(Point point, double heading, double pitch, double range, KmlAltitudeMode altitudeMode) Creates a KML viewpoint based on the provided LookAt location.static KmlViewpoint
createWithViewpoint
(Viewpoint viewpoint) Creates a KML viewpoint from a Viewpoint.Gets the KML viewpoint's altitude mode, which determines how altitude values should be interpreted.double
Gets the KML viewpoint's heading in degrees.Gets the KML viewpoint's location.double
getPitch()
Gets the KML viewpoint's Pitch.double
getRange()
Gets the KML viewpoint's range, which only applies to LookAt viewpoints.double
getRoll()
Gets the KML viewpoint's rotation of the camera around the z-axis.getType()
Gets the KML viewpoint'sType
.
-
Method Details
-
createCameraViewpoint
public static KmlViewpoint createCameraViewpoint(Point point, double heading, double pitch, double roll, KmlAltitudeMode altitudeMode) Creates a KML viewpoint based on the provided camera location.A KML viewpoint defines either a stand alone camera independent of the point of interest being observed or a virtual camera in relation to the observed point of interest.
- Parameters:
point
- the location of cameraheading
- the heading in degreespitch
- the pitch in degreesroll
- the roll in degreesaltitudeMode
- a KmlAltitudeMode- Throws:
IllegalArgumentException
- if point is nullIllegalArgumentException
- if altitudeMode is null- Since:
- 100.6.0
-
createLookAtViewpoint
public static KmlViewpoint createLookAtViewpoint(Point point, double heading, double pitch, double range, KmlAltitudeMode altitudeMode) Creates a KML viewpoint based on the provided LookAt location.A KML viewpoint defines either a stand alone camera independent of the point of interest being observed or a virtual camera in relation to the observed point of interest.
- Parameters:
point
- the location of viewpointheading
- the heading in degreespitch
- the pitch in degreesrange
- the distance in meters from the point specified by geometry to the view look at position.altitudeMode
- a KmlAltitudeMode- Returns:
- a KmlViewpoint
- Throws:
IllegalArgumentException
- if point is nullIllegalArgumentException
- if range is negative numberIllegalArgumentException
- if altitudeMode is null- Since:
- 100.6.0
-
createWithViewpoint
Creates a KML viewpoint from a Viewpoint.The KML viewpoint defines either a look at point or a camera, whereas a
Viewpoint
must always have a look at point, and optionally also have a camera. AViewpoint
that has a camera will create a KML viewpoint of typeKmlViewpoint.Type.CAMERA
. AViewpoint
that has no camera will create a KML viewpoint of typeKmlViewpoint.Type.LOOK_AT
.- Parameters:
viewpoint
- a Viewpoint- Returns:
- a KmlViewpoint
- Throws:
IllegalArgumentException
- if viewpoint is null- Since:
- 100.6.0
-
getAltitudeMode
Gets the KML viewpoint's altitude mode, which determines how altitude values should be interpreted. The default isKmlAltitudeMode.RELATIVE_TO_GROUND
.- Returns:
- the KML viewpoint's altitude mode
- Since:
- 100.4.0
-
getHeading
public double getHeading()Gets the KML viewpoint's heading in degrees. Values range from 0 (North) to 360, with 90 being East.- Returns:
- the KML viewpoint's heading
- Since:
- 100.4.0
-
getLocation
Gets the KML viewpoint's location.For
KmlViewpoint.Type.LOOK_AT
viewpoints, this defines the position of an object for the camera to observe. See <LookAt> in Google's KML Reference, for more information. ForKmlViewpoint.Type.CAMERA
viewpoints, this defines the position of the camera directly. See <Camera> in Google's KML Reference, for more information.- Returns:
- the KML viewpoint's location.
- Since:
- 100.4.0
-
getRange
public double getRange()Gets the KML viewpoint's range, which only applies to LookAt viewpoints. Range is the distance in meters between thegetLocation()
and the camera.- Returns:
- the KML viewpoint's range
- Since:
- 100.4.0
-
getRoll
public double getRoll()Gets the KML viewpoint's rotation of the camera around the z-axis. Values range from -180 to 180 degrees.- Returns:
- the KML viewpoint's roll
- Since:
- 100.4.0
-
getPitch
public double getPitch()Gets the KML viewpoint's Pitch.The range of the pitch is from -180 to 180 degrees. A value of 0 indicates that the view is aimed straight down towards the earth (the default). A value of 90 indicates that the view is aimed toward the horizon. Values greater than 90 indicate that the view is pointed towards the sky.
Corresponds to the 'tilt' property from the KML specification.
- Returns:
- the KML viewpoint's pitch
- Since:
- 100.4.0
-
getType
Gets the KML viewpoint'sType
.CAMERA
viewpoints define the position of the camera directly.LOOK_AT
viewpoints define the position of the camera relative to a point of interest. See <Camera> in Google's KML Reference for details about KML viewpoint (abstractView) specification, including diagrams.- Returns:
- the KML viewpoint's type
- Since:
- 100.4.0
-