Udostępnij za pośrednictwem


MapCamera Constructors

Definition

Overloads

MapCamera(Geopoint)

Creates a map camera, to define the view of a map based on location.

MapCamera(Geopoint, Double)

Creates a map camera, to define the view of a map based on location and heading.

MapCamera(Geopoint, Double, Double)

Creates a map camera, to define the view of a map based on location, heading, and pitch.

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.

MapCamera(Geopoint)

Creates a map camera, to define the view of a map based on location.

public:
 MapCamera(Geopoint ^ location);
 MapCamera(Geopoint const& location);
public MapCamera(Geopoint location);
function MapCamera(location)
Public Sub New (location As Geopoint)

Parameters

location
Geopoint

The location of the camera in the map.

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.

See also

Applies to

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);
 MapCamera(Geopoint const& location, double const& headingInDegrees);
public MapCamera(Geopoint location, double headingInDegrees);
function MapCamera(location, headingInDegrees)
Public Sub New (location As Geopoint, headingInDegrees As Double)

Parameters

location
Geopoint

The location of the camera in the map.

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

See also

Applies to

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);
 MapCamera(Geopoint const& location, double const& headingInDegrees, double const& pitchInDegrees);
public MapCamera(Geopoint location, double headingInDegrees, double pitchInDegrees);
function MapCamera(location, headingInDegrees, pitchInDegrees)
Public Sub New (location As Geopoint, headingInDegrees As Double, pitchInDegrees As Double)

Parameters

location
Geopoint

The location of the camera in the map.

headingInDegrees
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

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.

Property2D range3D rangeStreetside range
pitch/tilt0-750-900-180

Heading values greater than 360 degrees are normalized to their equivalent 0-360 degree value.

See also

Applies to

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);
 MapCamera(Geopoint const& location, double const& headingInDegrees, double const& pitchInDegrees, double const& rollInDegrees, double const& fieldOfViewInDegrees);
public MapCamera(Geopoint location, double headingInDegrees, double pitchInDegrees, double rollInDegrees, double fieldOfViewInDegrees);
function MapCamera(location, headingInDegrees, pitchInDegrees, rollInDegrees, fieldOfViewInDegrees)
Public Sub New (location As Geopoint, headingInDegrees As Double, pitchInDegrees As Double, rollInDegrees As Double, fieldOfViewInDegrees As Double)

Parameters

location
Geopoint

The location of the camera in the map.

headingInDegrees
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

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

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

The horizontal angle of view that appears in the camera, in degrees. The default fieldOfViewInDegrees value is 45.0.

Note

In Windows 10, version 1803, you can override the default value by passing NAN as the input. This will recalculate the field of view based on aspect ratio of the view. However, if you pass NAN as the input on Windows 10, version 1709 and earlier, the operating system will likely throw an exception.

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.

Property2D range3D rangeStreetside range
pitch/tilt0-750-900-180
field of view1-1201-1201-120

Heading values greater than 360 degrees are normalized to their equivalent 0-360 degree value.

See also

Applies to