MapCamera
MapCamera
MapCamera
MapCamera
Class
Definition
Represents the position of a camera to define the view of a map.
public : sealed class MapCamera : DependencyObject, IMapCamerapublic sealed class MapCamera : DependencyObject, IMapCameraPublic NotInheritable Class MapCamera Inherits DependencyObject Implements IMapCamera// This API is not available in Javascript.
- Inheritance
-
MapCameraMapCameraMapCameraMapCamera
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Inherited Members
Inherited methods
Inherited properties
Remarks
The MapCamera class uses a position to define the view of a map in the same way that the position of a real camera determines it's view of the earth.
Constructors
MapCamera(Geopoint) MapCamera(Geopoint) MapCamera(Geopoint) MapCamera(Geopoint)
Creates a map camera, to define the view of a map based on location.
public : MapCamera(Geopoint location)public MapCamera(Geopoint location)Public Sub New(location As Geopoint)// This API is not available in Javascript.
Remarks
This constructor is equivalent to calling MapCamera(Geopoint, Double, Double, Double, Double) with the following default parameter values: headingInDegrees = 0 (North), pitchInDegrees = 0 (looking straight down), rollInDegrees = 0 (no tilt), and fieldOfViewInDegrees = 45.
MapCamera(Geopoint, Double) MapCamera(Geopoint, Double) MapCamera(Geopoint, Double) MapCamera(Geopoint, Double)
Creates a map camera, to define the view of a map based on location and heading.
public : MapCamera(Geopoint location, double headingInDegrees)public MapCamera(Geopoint location, Double headingInDegrees)Public Sub New(location As Geopoint, headingInDegrees As Double)// This API is not available in Javascript.
- headingInDegrees
- double Double Double Double
The directional heading of the camera in degrees, where 0 or 360 = North, 90 = East, 180 = South, and 270 = West. The default headingInDegrees value is 0.
Remarks
This constructor is equivalent to calling MapCamera(Geopoint, Double, Double, Double, Double) with the following default parameter values: pitchInDegrees = 0 (looking straight down), rollInDegrees = 0 (no tilt), and fieldOfViewInDegrees = 45.
Heading values greater than 360 degrees are normalized to their equivalent 0-360 degree value.
MapCamera(Geopoint, Double, Double) MapCamera(Geopoint, Double, Double) MapCamera(Geopoint, Double, Double) MapCamera(Geopoint, Double, Double)
Creates a map camera, to define the view of a map based on location, heading, and pitch.
public : MapCamera(Geopoint location, double headingInDegrees, double pitchInDegrees)public MapCamera(Geopoint location, Double headingInDegrees, Double pitchInDegrees)Public Sub New(location As Geopoint, headingInDegrees As Double, pitchInDegrees As Double)// This API is not available in Javascript.
- headingInDegrees
- double Double Double Double
The directional heading of the camera in degrees, where 0 or 360 = North, 90 = East, 180 = South, and 270 = West. The default headingInDegrees value is 0.
- pitchInDegrees
- double Double Double Double
The pitch of the map's camera in degrees, where 90 is looking out at the horizon (maximum) and 0 is looking straight down (minimum). The default pitchInDegrees value is 0.
Remarks
This constructor is equivalent to calling MapCamera(Geopoint, Double, Double, Double, Double) with the following default parameter values: rollInDegrees = 0 (no tilt), and fieldOfViewInDegrees = 45.
See additional comments in the MapCamera(Geopoint, Double, Double, Double, Double) overload.
The maximum and minimum values of pitch/tilt depend on the type of map view: 2D, 3D, or Streetside.
| Property | 2D range | 3D range | Streetside range |
|---|---|---|---|
| pitch/tilt | 0-75 | 0-90 | 0-180 |
Heading values greater than 360 degrees are normalized to their equivalent 0-360 degree value.
MapCamera(Geopoint, Double, Double, Double, Double) MapCamera(Geopoint, Double, Double, Double, Double) MapCamera(Geopoint, Double, Double, Double, Double) MapCamera(Geopoint, Double, Double, Double, Double)
Creates a map camera, to define the view of a map based on location, heading, pitch, roll, and field of view.
public : MapCamera(Geopoint location, double headingInDegrees, double pitchInDegrees, double rollInDegrees, double fieldOfViewInDegrees)public MapCamera(Geopoint location, Double headingInDegrees, Double pitchInDegrees, Double rollInDegrees, Double fieldOfViewInDegrees)Public Sub New(location As Geopoint, headingInDegrees As Double, pitchInDegrees As Double, rollInDegrees As Double, fieldOfViewInDegrees As Double)// This API is not available in Javascript.
- headingInDegrees
- double Double Double Double
The directional heading of the camera in degrees, where 0 or 360 = North, 90 = East, 180 = South, and 270 = West. The default headingInDegrees value is 0.
- pitchInDegrees
- double Double Double Double
The pitch of the map's camera in degrees, where 90 is looking out at the horizon (maximum) and 0 is looking straight down (minimum). The default pitchInDegrees value is 0.
- rollInDegrees
- double Double Double Double
The roll of the camera in degrees, where -90 is tilting to the left and +90 is tilting to the right. The default rollInDegrees value is 0.
- fieldOfViewInDegrees
- double Double Double Double
The horizontal angle of view that appears in the camera, in degrees. The default fieldOfViewInDegrees value is 45.0.
Remarks
Note
Adjusting Roll may interfere with normal gesture operations and leave the map in an inconsistent state. We do not recommend adjusting Roll without thoroughly testing your app.
The valid range of pitch differs between 2D, 3D, and Streetside map views. When switching from 3D to 2D for example, values that are acceptable in the current view may be out of range in the next view. If that’s the case, the current pitch value will be truncated to the nearest acceptable value in the next view.
When leaving a Streetside view, the map returns to the previous view settings. The Streetside pitch is not maintained outside of the Streetside experience.
The maximum and minimum values of pitch/tilt depend on the type of map view: 2D, 3D, or Streetside. The range for field of view is the same in all views.
| Property | 2D range | 3D range | Streetside range |
|---|---|---|---|
| pitch/tilt | 0-75 | 0-90 | 0-180 |
| field of view | 1-120 | 1-120 | 1-120 |
Heading values greater than 360 degrees are normalized to their equivalent 0-360 degree value.
Properties
FieldOfView FieldOfView FieldOfView FieldOfView
Gets or sets the vertical angle of view that appears in the camera, in degrees.
public : double FieldOfView { get; set; }public double FieldOfView { get; set; }Public ReadWrite Property FieldOfView As double// This API is not available in Javascript.
- Value
- double double double double
The vertical angle of view that appears in the camera, in degrees.
Remarks
The maximum and minimum values of field of view is the same in all views.
| Property | 2D range | 3D range | Streetside range |
|---|---|---|---|
| field of view | 1-120 | 1-120 | 1-120 |
Heading Heading Heading Heading
Gets or sets the directional heading of the camera in degrees, where 0 or 360 = North, 90 = East, 180 = South, and 270 = West.
public : double Heading { get; set; }public double Heading { get; set; }Public ReadWrite Property Heading As double// This API is not available in Javascript.
- Value
- double double double double
The directional heading of the camera in degrees, where 0 or 360 = North, 90 = East, 180 = South, and 270 = West.
Remarks
Heading values greater than 360 degrees are normalized to their equivalent 0-360 degree value.
Location Location Location Location
Gets or sets the location of the camera in the map.
public : Geopoint Location { get; set; }public Geopoint Location { get; set; }Public ReadWrite Property Location As Geopoint// This API is not available in Javascript.
Remarks
The following image demonstrates the location of the map's camera relative to the scene. This property corresponds to the MapCamera location.

Pitch Pitch Pitch Pitch
Gets or sets the pitch of the map's camera in degrees, where 90 is looking out at the horizon (maximum) and 0 is looking straight down (minimum).
public : double Pitch { get; set; }public double Pitch { get; set; }Public ReadWrite Property Pitch As double// This API is not available in Javascript.
- Value
- double double double double
The pitch of the map's camera in degrees, where 90 is looking out at the horizon (maximum) and 0 is looking straight down (minimum).
Remarks
For more information about pitch, see the remarks section of the MapCamera(Geopoint, Double, Double, Double, Double) overload.
The maximum and minimum values of pitch/tilt depend on the type of map view: 2D, 3D, or Streetside.
| Property | 2D range | 3D range | Streetside range |
|---|---|---|---|
| pitch/tilt | 0-75 | 0-90 | 0-180 |
Roll Roll Roll Roll
Gets or sets the roll of the camera in degrees, where -90 is tilting to the left and +90 is tilting to the right.
public : double Roll { get; set; }public double Roll { get; set; }Public ReadWrite Property Roll As double// This API is not available in Javascript.
- Value
- double double double double
The roll of the camera in degrees, where -90 is tilting to the left and +90 is tilting to the right.