- All Implemented Interfaces:
JsonSerializable
GeoModel
that is displayed in a
GeoView
on a user's screen.
In a MapView
, the bounding extent of a geometry or the map's center
point and scale can define the map view's two-dimensional Viewpoint.
In a SceneView
, a Camera
represents the observer's position and perspective within three dimensions
and defines the scene view's three-dimensional Viewpoint. Each camera has the following properties:
- Geographic location on the surface (longitude and latitude).
- Altitude (height, in meters, above sea level).
- Heading (angle about the z axis the camera is rotated, in degrees).
- Pitch (angle the camera is rotated up or down, in degrees).
- Roll (angle the camera is rotated side-to-side, in degrees).
When you publish or save a map or scene, as a web map, web scene, mobile map package, or mobile scene
package, you define its initial Viewpoint. When you load a map or scene into your app, you can access and
change the value with GeoModel.setInitialViewpoint(Viewpoint)
. If you add the map or scene to a GeoView
, any
change you make with GeoModel.setInitialViewpoint(Viewpoint)
is ignored. To change the Viewpoint of a
displayed map or scene, use view methods such as:
-
GeoView.setViewpoint(Viewpoint)
to instantly change the visible area with no animation. -
MapView.setViewpointAsync(Viewpoint, float, AnimationCurve)
to animates the display of the map to a viewpoint using the provided animation curve. -
SceneView.setViewpointCamera(Camera)
to instantly moving the perspective in 3D scenes.
To determine the current visible area, call GeoView.getCurrentViewpoint(Type)
. Make sure
that any user-initiated or programmatic navigation is complete before getting the current Viewpoint
by calling GeoView.navigatingProperty()
.
- Since:
- 100.0.0
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionViewpoint
(double latitude, double longitude, double scale) Creates a Viewpoint with latitude, longitude, and scale.Creates a Viewpoint with latitude, longitude, scale andCamera
.Creates a viewpoint with a bounding extent.Creates a Viewpoint with a bounding extent and rotation.Creates a Viewpoint with a bounding extent, rotation, and aCamera
.Creates a viewpoint with a bounding extent and aCamera
.Creates a Viewpoint using a center point and scale.Creates a Viewpoint with center point, scale, and rotation.Creates a Viewpoint with center point, scale, rotation, andCamera
.Creates a Viewpoint with center point, scale, andCamera
. -
Method Summary
Modifier and TypeMethodDescriptionstatic Viewpoint
Creates a Viewpoint instance from a JSON string.Gets the viewpoint'sCamera
, if it has one.double
Gets the rotation angle of the viewpoint in degrees between 0 and 360.Gets the viewpoint target geometry, if thegetType()
isViewpoint.Type.BOUNDING_GEOMETRY
.double
Gets the viewpoint's target scale, if thegetType()
isViewpoint.Type.CENTER_AND_SCALE
.getType()
Gets the viewpoint's type.Gets unknown data from the source JSON.Gets unsupported data from the source JSON.toJson()
Serializes this object to a JSON string.
-
Constructor Details
-
Viewpoint
Creates a Viewpoint using a center point and scale.- Parameters:
center
- the center of the visible areascale
- the ratio between a distance on the map and the corresponding distance on the ground- Throws:
IllegalArgumentException
- if the specified center point is nullIllegalArgumentException
- if the specified scale is less than or equal to zero- Since:
- 100.0.0
-
Viewpoint
Creates a Viewpoint with center point, scale, andCamera
.- Parameters:
center
- the center of the visible areascale
- the ratio between a distance on the map and the corresponding distance on the groundcamera
- aCamera
object that defines the observer of the scene- Throws:
IllegalArgumentException
- if center is nullIllegalArgumentException
- if scale is out of rangeIllegalArgumentException
- if camera is null- Since:
- 100.0.0
-
Viewpoint
Creates a Viewpoint with center point, scale, and rotation. Scale factor must be greater than 0.- Parameters:
center
- the center of the visible areascale
- the ratio between a distance on the map and the corresponding distance on the groundrotation
- the rotation angle in degrees between 0 and 360- Throws:
IllegalArgumentException
- if the specified center point is null, if the specified scale is less than or equal to zero, or if the specified rotation is less than zero- Since:
- 100.0.0
-
Viewpoint
Creates a Viewpoint with center point, scale, rotation, andCamera
.- Parameters:
center
- the center point of the visible areascale
- the ratio between a distance on the map and the corresponding distance on the groundrotation
- the rotation angle in degrees between 0 and 360camera
- aCamera
object that defines the observer for the scene- Throws:
IllegalArgumentException
- if center is nullIllegalArgumentException
- if scale is out of rangeIllegalArgumentException
- if camera is null- Since:
- 100.0.0
-
Viewpoint
Creates a viewpoint with a bounding extent.- Parameters:
targetExtent
- the geometry to use as the visible area. The targetExtent parameter cannot be null.- Throws:
IllegalArgumentException
- if the targetExtent is null- Since:
- 100.0.0
-
Viewpoint
Creates a viewpoint with a bounding extent and aCamera
.- Parameters:
targetExtent
- the geometry to use as the visible area. The targetExtent parameter cannot be null.camera
- aCamera
object that defines the observer for the scene- Throws:
IllegalArgumentException
- if the targetExtent is nullIllegalArgumentException
- if the camera is null- Since:
- 100.0.0
-
Viewpoint
Creates a Viewpoint with a bounding extent and rotation.- Parameters:
targetExtent
- the geometry to use as the visible area. The targetExtent parameter cannot be null.rotation
- the rotation angle in degrees between 0 and 360- Throws:
IllegalArgumentException
- if the targetExtent is null or if the rotation is less than zero- Since:
- 100.0.0
-
Viewpoint
Creates a Viewpoint with a bounding extent, rotation, and aCamera
.- Parameters:
targetExtent
- the geometry to use as the visible area. The targetExtent parameter cannot be null.rotation
- the rotation angle in degrees between 0 and 360camera
- aCamera
object that defines the observer of the scene- Throws:
IllegalArgumentException
- if the targetExtent is nullIllegalArgumentException
- if the rotation is less than zeroIllegalArgumentException
- if the camera is null- Since:
- 100.0.0
- See Also:
-
Viewpoint
public Viewpoint(double latitude, double longitude, double scale) Creates a Viewpoint with latitude, longitude, and scale. The spatial reference for the defined point is WGS84.- Parameters:
latitude
- the latitude coordinate for the viewpoint. Negative values are south of the equator.longitude
- the longitude coordinate for the viewpoint. Negative values are west of the prime meridian.scale
- the ratio between a distance on the map and the corresponding distance on the ground- Throws:
IllegalArgumentException
- if the specified scale is less than or equal to zero- Since:
- 100.0.0
-
Viewpoint
Creates a Viewpoint with latitude, longitude, scale andCamera
. The spatial reference for the defined point is WGS84.- Parameters:
latitude
- the latitude coordinate for the viewpoint. Negative values are south of the equatorlongitude
- the longitude coordinate for the viewpoint. Negative values are west of the prime meridian.scale
- the scale the ratio between a distance on the map and the corresponding distance on the groundcamera
- aCamera
object that defines the observer for the scene- Throws:
IllegalArgumentException
- if camera is nullIllegalArgumentException
- if scale is out of range- Since:
- 100.0.0
-
-
Method Details
-
getRotation
public double getRotation()Gets the rotation angle of the viewpoint in degrees between 0 and 360.- Returns:
- the rotation value.
- Since:
- 100.0.0
-
getTargetGeometry
Gets the viewpoint target geometry, if thegetType()
isViewpoint.Type.BOUNDING_GEOMETRY
.- Returns:
- the geometry used by this viewpoint. The target geometry will have a non-null spatial reference.
- Since:
- 100.0.0
- See Also:
-
getTargetScale
public double getTargetScale()Gets the viewpoint's target scale, if thegetType()
isViewpoint.Type.CENTER_AND_SCALE
.- Returns:
- the target scale used for this viewpoint
- Since:
- 100.0.0
-
getCamera
Gets the viewpoint'sCamera
, if it has one.- Returns:
- the viewpoint's
Camera
- Since:
- 100.0.0
-
getType
Gets the viewpoint's type.This will be defined by a geometry or a
Point
geometry and scale.- Returns:
- the type of Viewpoint
- Since:
- 100.0.0
- See Also:
-
fromJson
Creates a Viewpoint instance from a JSON string.- Parameters:
json
- a JSON string that represents a Viewpoint- Returns:
- a Viewpoint instance
- Throws:
IllegalArgumentException
- if json is null or empty- Since:
- 100.0.0
-
toJson
Description copied from interface:JsonSerializable
Serializes this object to a JSON string. Note that unknown JSON is omitted from the serialized string.- Specified by:
toJson
in interfaceJsonSerializable
- Returns:
- a JSON string
-
getUnknownJson
Description copied from interface:JsonSerializable
Gets unknown data from the source JSON.Unknown JSON is a Map of values not defined in the ArcGIS specification used to create this object but found in the source JSON. If the object is written back to JSON, any unknown JSON data is not persisted. The ArcGIS specification may be for a web map, web scene, REST API, and so on.
- Specified by:
getUnknownJson
in interfaceJsonSerializable
- Returns:
- an unmodifiable Map containing unknown data from the source JSON
-
getUnsupportedJson
Description copied from interface:JsonSerializable
Gets unsupported data from the source JSON.Unsupported JSON is a Map of values defined in the ArcGIS specification used to create this object but not currently used in this API. If the object is written back to JSON, any unsupported JSON data is persisted. The ArcGIS specification may be from a web map, web scene, REST API, and so on.
- Specified by:
getUnsupportedJson
in interfaceJsonSerializable
- Returns:
- an unmodifiable Map containing unsupported data from the source JSON
-