Skip To Content ArcGIS for Developers Sign In Dashboard

Viewpoint Class

class Esri::ArcGISRuntime::Viewpoint

Base class for classes describing the user's viewpoint when viewing a map or scene. More...

Header: #include <Viewpoint>
Since: Esri::ArcGISRuntime 100.0
Inherits: Esri::ArcGISRuntime::JsonSerializable

This class was introduced in Esri::ArcGISRuntime 100.0.

Public Functions

Viewpoint(Esri::ArcGISRuntime::Viewpoint &&other)
Viewpoint(const Esri::ArcGISRuntime::Viewpoint &other)
Viewpoint(const Esri::ArcGISRuntime::Geometry &targetExtent, double rotation, const Esri::ArcGISRuntime::Camera &camera)
Viewpoint(const Esri::ArcGISRuntime::Geometry &targetExtent, double rotation)
Viewpoint(const Esri::ArcGISRuntime::Geometry &targetExtent, const Esri::ArcGISRuntime::Camera &camera)
Viewpoint(const Esri::ArcGISRuntime::Geometry &targetExtent)
Viewpoint(const Esri::ArcGISRuntime::Point &center, double scale, double rotation, const Esri::ArcGISRuntime::Camera &camera)
Viewpoint(const Esri::ArcGISRuntime::Point &center, double scale, double rotation)
Viewpoint(const Esri::ArcGISRuntime::Point &center, double scale, const Esri::ArcGISRuntime::Camera &camera)
Viewpoint(const Esri::ArcGISRuntime::Point &center, double scale)
Viewpoint(double latitude, double longitude, double scale, const Esri::ArcGISRuntime::Camera &camera)
Viewpoint(double latitude, double longitude, double scale)
Viewpoint()
Esri::ArcGISRuntime::Viewpoint &operator=(Esri::ArcGISRuntime::Viewpoint &&other)
Esri::ArcGISRuntime::Viewpoint &operator=(const Esri::ArcGISRuntime::Viewpoint &other)
virtual ~Viewpoint() override
Esri::ArcGISRuntime::Camera camera() const
bool isEmpty() const
double rotation() const
Esri::ArcGISRuntime::Geometry targetGeometry() const
double targetScale() const
Esri::ArcGISRuntime::ViewpointType viewpointType() const

Reimplemented Public Functions

virtual QString toJson() const override
virtual QJsonObject unknownJson() const override
virtual QJsonObject unsupportedJson() const override

Static Public Members

Esri::ArcGISRuntime::Viewpoint fromJson(const QString &json)

Detailed Description

Use a Viewpoint to specify how a users sees a 2D Map or 3D Scene displayed in a MapView or SceneView. The Viewpoint controls multiple aspects of the view such as extent, rotation, and with 3D viewing angle and field of view.

A Viewpoint contains two views

A Viewpoint object contains two views - one 2D and one 3D. A Viewpoint object stores the 3D view in a Camera member object. The 2D and 3D views need not view the same location. Viewpoints also contain 2D view information like scale, extent, and rotation, even when Camera information is not present. When a Viewpoint is passed from one SceneView to another, only the 3D information (if present) and time are used. When a SceneView tries to use a Viewpoint that has no Camera (such as a Viewpoint retrieved from a MapView) the SceneView approximates the 3D viewpoint information from the 2D viewpoint information.

Example:

Create a Viewpoint on a MapView based on an extent and zoom to the extent with animation:

constexpr double xMin = -12338668.348591767;
constexpr double yMin = 5546908.424239618;
constexpr double xMax = -12338247.594362013;
constexpr double yMax = 5547223.989911933;
constexpr int wkid = 102100;
Viewpoint vpSpring(Envelope(xMin, yMin, xMax, yMax, SpatialReference(wkid)));
constexpr float duration = 4.0f;
m_mapView->setViewpointAnimated(vpSpring, duration, AnimationCurve::EaseInOutCubic);

See also Camera, MapView, and SceneView.

Member Function Documentation

Viewpoint::Viewpoint(Esri::ArcGISRuntime::Viewpoint &&other)

Move constructor from other Viewpoint.

Viewpoint::Viewpoint(const Esri::ArcGISRuntime::Viewpoint &other)

Copy constructor from other Viewpoint.

Viewpoint::Viewpoint(const Esri::ArcGISRuntime::Geometry &targetExtent, double rotation, const Esri::ArcGISRuntime::Camera &camera)

A constructor that creates a Viewpoint with a bounding extent, rotation, and Camera.

  • targetExtent - The geometry to use as the visible area.
  • rotation - The rotation angle in degrees between 0 and 360.
  • camera - A Camera object that defines the observer for the scene.

Viewpoint::Viewpoint(const Esri::ArcGISRuntime::Geometry &targetExtent, double rotation)

A constructor that creates a Viewpoint with a bounding extent and rotation.

The spatial reference of the target geometry cannot be null.

  • targetExtent - The geometry to use as the visible area.
  • rotation - The rotation angle in degrees between 0 and 360.

Viewpoint::Viewpoint(const Esri::ArcGISRuntime::Geometry &targetExtent, const Esri::ArcGISRuntime::Camera &camera)

A constructor that creates a Viewpoint with a bounding extent and Camera.

The spatial reference will be that same as the extent. The spatial reference of the target geometry cannot be null.

  • targetExtent - The geometry to use as the visible area.
  • camera - A Camera object that defines the observer for the scene.

Viewpoint::Viewpoint(const Esri::ArcGISRuntime::Geometry &targetExtent)

A constructor that creates a Viewpoint with a bounding extent.

The spatial reference will be that same as the extent. The spatial reference of the target geometry cannot be null.

  • targetExtent - The geometry to use as the visible area.

Viewpoint::Viewpoint(const Esri::ArcGISRuntime::Point &center, double scale, double rotation, const Esri::ArcGISRuntime::Camera &camera)

A constructor that creates a Viewpoint with center point, scale, rotation, and Camera.

The spatial reference of the center point cannot be null.

  • center - The center of the visible area.
  • scale - The ratio between a distance on the map and the corresponding distance on the ground.
  • rotation - The rotation angle in degrees between0 and 360.
  • camera - A Camera object that defines the observer for the scene.

Viewpoint::Viewpoint(const Esri::ArcGISRuntime::Point &center, double scale, double rotation)

A constructor that creates a Viewpoint with center point, scale, and rotation.

The spatial reference of the center point cannot be null.

  • center - The center of the visible area.
  • scale - The ratio between a distance on the map and the corresponding distance on the ground.
  • rotation - The rotation angle in degrees between 0 and 360.

Viewpoint::Viewpoint(const Esri::ArcGISRuntime::Point &center, double scale, const Esri::ArcGISRuntime::Camera &camera)

A constructor that creates a Viewpoint with center point, scale, and Camera.

The spatial reference of the center point cannot be null.

  • center - The center of the visible area.
  • scale - The ratio between a distance on the map and the corresponding distance on the ground.
  • camera - A Camera object that defines the observer for the scene.

Viewpoint::Viewpoint(const Esri::ArcGISRuntime::Point &center, double scale)

A constructor that creates a Viewpoint with center point and scale.

The spatial reference of the center point cannot be null.

  • center - The center of the visible area.
  • scale - The ratio between a distance on the map and the corresponding distance on the ground.

Viewpoint::Viewpoint(double latitude, double longitude, double scale, const Esri::ArcGISRuntime::Camera &camera)

A constructor that creates a Viewpoint using a map center expressed as latitude and longitude, map scale, and camera.

The spatial reference for the defined point is WGS84.

  • 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.
  • camera - A Camera object that defines the observer for the scene.

Viewpoint::Viewpoint(double latitude, double longitude, double scale)

A constructor that creates a Viewpoint with latitude, longitude, and scale.

The spatial reference for the defined point is WGS84.

  • 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.

Viewpoint::Viewpoint()

Default constructor.

Esri::ArcGISRuntime::Viewpoint &Viewpoint::operator=(Esri::ArcGISRuntime::Viewpoint &&other)

Move operator from other Viewpoint.

Esri::ArcGISRuntime::Viewpoint &Viewpoint::operator=(const Esri::ArcGISRuntime::Viewpoint &other)

Assignment operator from other Viewpoint.

[override virtual] Viewpoint::~Viewpoint()

Destructor.

Esri::ArcGISRuntime::Camera Viewpoint::camera() const

Gets the viewpoint's Camera.

[static] Esri::ArcGISRuntime::Viewpoint Viewpoint::fromJson(const QString &json)

Creates a Viewpoint from its JSON representation.

Returns a Viewpoint created using the data in the json parameter.

See also JsonSerializable.

bool Viewpoint::isEmpty() const

Returns true if this Viewpoint is empty.

double Viewpoint::rotation() const

Gets the viewpoint rotation angle in degrees between 0 and 360.

Esri::ArcGISRuntime::Geometry Viewpoint::targetGeometry() const

Gets the viewpoint target geometry.

The spatial reference of the target geometry cannot be null.

double Viewpoint::targetScale() const

Gets the viewpoint target scale.

[override virtual] QString Viewpoint::toJson() const

Reimplements: JsonSerializable::toJson() const.

Returns this Viewpoint as its JSON representation.

See also JsonSerializable.

[override virtual] QJsonObject Viewpoint::unknownJson() const

Reimplements: JsonSerializable::unknownJson() const.

Gets the unknown JSON of this object.

See also JsonSerializable.

[override virtual] QJsonObject Viewpoint::unsupportedJson() const

Reimplements: JsonSerializable::unsupportedJson() const.

Gets the unsupported JSON of this object.

See also JsonSerializable.

Esri::ArcGISRuntime::ViewpointType Viewpoint::viewpointType() const

Gets the type of this Viewpoint.


Feedback on this topic?