Class Viewpoint
Inheritance
Namespace: Esri.ArcGISRuntime.Mapping
Assembly: Esri.ArcGISRuntime.dll
Syntax
[CreateFromString(MethodName = "Esri.ArcGISRuntime.CreateFromStringHelpers.CreateViewpointFromString")]
public class Viewpoint
Remarks
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 of this InitialViewpoint. If you add the map or scene to a GeoView, any change you make to the InitialViewpoint is ignored. To change the Viewpoint of a displayed map or scene, use view methods such as:
- SetViewpoint(Viewpoint) to instantly change the visible area with no animation.
- Esri.ArcGISRuntime.UI.Controls.MapView.SetViewpointAsync(Esri.ArcGISRuntime.Mapping.Viewpoint,System.Single,Esri.ArcGISRuntime.UI.AnimationCurve) to animate the display of the map to a viewpoint using the provided animation curve.
- SetViewpointCamera(Camera) to instantly move the perspective in 3D scenes.
To determine the current visible area, call Esri.ArcGISRuntime.UI.Controls.GeoView.GetCurrentViewpoint(ViewpointType). Make sure that any user-initiated or programmatic navigation is complete before getting the current Viewpoint by checking the value of IsNavigating.
Constructors
Name | Description |
---|---|
Viewpoint(Geometry) | Initializes a new instance of the Viewpoint class with a bounding extent. |
Viewpoint(Geometry, Camera) | Initializes a new instance of the Viewpoint class using a bounding extent and a Camera. |
Viewpoint(Geometry, Double) | Initializes a new instance of the Viewpoint class with a bounding extent and rotation. |
Viewpoint(Geometry, Double, Camera) | Initializes a new instance of the Viewpoint class with a bounding extent, rotation, and Camera. |
Viewpoint(MapPoint, Double) | Initializes a new instance of the Viewpoint class with center point and scale. |
Viewpoint(MapPoint, Double, Camera) | Initializes a new instance of the Viewpoint class with center point, scale, and Camera. |
Viewpoint(MapPoint, Double, Double) | Initializes a new instance of the Viewpoint class with center point, scale and rotation. |
Viewpoint(MapPoint, Double, Double, Camera) | Initializes a new instance of the Viewpoint class with center point, scale, rotation, and Camera. |
Viewpoint(Double, Double, Double) | Initializes a new instance of the Viewpoint class with latitude, longitude, and scale. |
Viewpoint(Double, Double, Double, Camera) | Initializes a new instance of the Viewpoint class with latitude, longitude, scale, and Camera. |
Properties
Name | Description |
---|---|
Camera | Gets the viewpoint's Camera, if it has one. |
Rotation | Gets the viewpoint rotation angle in degrees between 0 and 360. |
TargetGeometry | Gets the viewpoint target geometry, if the ViewpointType is BoundingGeometry. |
TargetScale | Gets the viewpoint's target scale, if the ViewpointType is CenterAndScale. |
ViewpointType | Gets the viewpoint's type. |
Methods
Name | Description |
---|---|
FromJson(String) | Creates a Viewpoint instance from JSON. |
ToJson() | Converts this instance to JSON. |
See Also
Applies to
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 200.5 |
.NET | 100.13 - 200.5 |
.NET Windows | 100.13 - 200.5 |
.NET Android | 200.0 - 200.5 |
.NET iOS | 200.0 - 200.5 |
.NET Framework | 100.0 - 200.5 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 200.5 |