MapControl.TrySetViewAsync Method

Definition

Overloads

TrySetViewAsync(Geopoint, IReference<Double>, IReference<Double>, IReference<Double>, MapAnimationKind)

Sets the view of the map displayed in the MapControl using the specified center, zoom level, heading, and pitch. The view change uses the specified animation.

TrySetViewAsync(Geopoint, IReference<Double>, IReference<Double>, IReference<Double>)

Sets the view of the map displayed in the MapControl using the specified center, zoom level, heading, and pitch.

TrySetViewAsync(Geopoint, IReference<Double>)

Sets the view of the map displayed in the MapControl using the specified center and zoom level.

TrySetViewAsync(Geopoint)

Sets the view of the map displayed in the MapControl using the specified center.

TrySetViewAsync(Geopoint, IReference<Double>, IReference<Double>, IReference<Double>, MapAnimationKind)

Sets the view of the map displayed in the MapControl using the specified center, zoom level, heading, and pitch. The view change uses the specified animation.

public:
 virtual IAsyncOperation<bool> ^ TrySetViewAsync(Geopoint ^ center, IReference<double> ^ zoomLevel, IReference<double> ^ heading, IReference<double> ^ desiredPitch, MapAnimationKind animation) = TrySetViewAsync;
/// [Windows.Foundation.Metadata.Overload("TrySetViewWithCenterZoomHeadingPitchAndAnimationAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<bool> TrySetViewAsync(Geopoint const& center, IReference<double> const& zoomLevel, IReference<double> const& heading, IReference<double> const& desiredPitch, MapAnimationKind const& animation);
[Windows.Foundation.Metadata.Overload("TrySetViewWithCenterZoomHeadingPitchAndAnimationAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<bool> TrySetViewAsync(Geopoint center, System.Nullable<double> zoomLevel, System.Nullable<double> heading, System.Nullable<double> desiredPitch, MapAnimationKind animation);
function trySetViewAsync(center, zoomLevel, heading, desiredPitch, animation)
Public Function TrySetViewAsync (center As Geopoint, zoomLevel As Nullable(Of Double), heading As Nullable(Of Double), desiredPitch As Nullable(Of Double), animation As MapAnimationKind) As IAsyncOperation(Of Boolean)

Parameters

center
Geopoint

The center to use in the view. For more info, see the Center property.

zoomLevel

IReference<Double>

Nullable<Double>

IReference<double>

The zoom level to use in the view. For more info, see the ZoomLevel property.

heading

IReference<Double>

Nullable<Double>

IReference<double>

The heading to use in the view. For more info, see the Heading property.

desiredPitch

IReference<Double>

Nullable<Double>

IReference<double>

The pitch to use in the view. For more info, see the DesiredPitch property.

animation
MapAnimationKind

The animation to use when changing the view. For more info, see MapAnimationKind.

Returns

true if the asynchronous operation succeeded; otherwise, false.

Attributes

Remarks

The valid range of pitch and zoom level 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.

Property2D range3D rangeStreetside range
pitch/tilt0-750-900-180
ZoomLevel1-201-2024-26

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

See also

Applies to

TrySetViewAsync(Geopoint, IReference<Double>, IReference<Double>, IReference<Double>)

Sets the view of the map displayed in the MapControl using the specified center, zoom level, heading, and pitch.

public:
 virtual IAsyncOperation<bool> ^ TrySetViewAsync(Geopoint ^ center, IReference<double> ^ zoomLevel, IReference<double> ^ heading, IReference<double> ^ desiredPitch) = TrySetViewAsync;
/// [Windows.Foundation.Metadata.Overload("TrySetViewWithCenterZoomHeadingAndPitchAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<bool> TrySetViewAsync(Geopoint const& center, IReference<double> const& zoomLevel, IReference<double> const& heading, IReference<double> const& desiredPitch);
[Windows.Foundation.Metadata.Overload("TrySetViewWithCenterZoomHeadingAndPitchAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<bool> TrySetViewAsync(Geopoint center, System.Nullable<double> zoomLevel, System.Nullable<double> heading, System.Nullable<double> desiredPitch);
function trySetViewAsync(center, zoomLevel, heading, desiredPitch)
Public Function TrySetViewAsync (center As Geopoint, zoomLevel As Nullable(Of Double), heading As Nullable(Of Double), desiredPitch As Nullable(Of Double)) As IAsyncOperation(Of Boolean)

Parameters

center
Geopoint

The center to use in the view. For more info, see the Center property.

zoomLevel

IReference<Double>

Nullable<Double>

IReference<double>

The zoom level to use in the view. For more info, see the ZoomLevel property.

heading

IReference<Double>

Nullable<Double>

IReference<double>

The heading to use in the view. For more info, see the Heading property.

desiredPitch

IReference<Double>

Nullable<Double>

IReference<double>

The pitch to use in the view. For more info, see the DesiredPitch property.

Returns

true if the asynchronous operation succeeded; otherwise, false.

Attributes

Remarks

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
ZoomLevel1-201-2024-26

For more information, see the TrySetViewAsync(Geopoint, IReference(Double), IReference(Double), IReference(Double), MapAnimationKind) overload.

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

See also

Applies to

TrySetViewAsync(Geopoint, IReference<Double>)

Sets the view of the map displayed in the MapControl using the specified center and zoom level.

public:
 virtual IAsyncOperation<bool> ^ TrySetViewAsync(Geopoint ^ center, IReference<double> ^ zoomLevel) = TrySetViewAsync;
/// [Windows.Foundation.Metadata.Overload("TrySetViewWithCenterAndZoomAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<bool> TrySetViewAsync(Geopoint const& center, IReference<double> const& zoomLevel);
[Windows.Foundation.Metadata.Overload("TrySetViewWithCenterAndZoomAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<bool> TrySetViewAsync(Geopoint center, System.Nullable<double> zoomLevel);
function trySetViewAsync(center, zoomLevel)
Public Function TrySetViewAsync (center As Geopoint, zoomLevel As Nullable(Of Double)) As IAsyncOperation(Of Boolean)

Parameters

center
Geopoint

The center to use in the view. For more info, see the Center property.

zoomLevel

IReference<Double>

Nullable<Double>

IReference<double>

The zoom level to use in the view. For more info, see the ZoomLevel property.

Returns

true if the asynchronous operation succeeded; otherwise, false.

Attributes

Remarks

The maximum and minimum values of ZoomLevel depend on the type of map view: 2D, 3D, or Streetside.

Property2D range3D rangeStreetside range
ZoomLevel1-201-2024-26

When leaving a Streetside view, the map returns to the previous view settings. The Streetside ZoomLevel is not maintained outside of the Streetside experience.

See also

Applies to

TrySetViewAsync(Geopoint)

Sets the view of the map displayed in the MapControl using the specified center.

public:
 virtual IAsyncOperation<bool> ^ TrySetViewAsync(Geopoint ^ center) = TrySetViewAsync;
/// [Windows.Foundation.Metadata.Overload("TrySetViewWithCenterAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<bool> TrySetViewAsync(Geopoint const& center);
[Windows.Foundation.Metadata.Overload("TrySetViewWithCenterAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<bool> TrySetViewAsync(Geopoint center);
function trySetViewAsync(center)
Public Function TrySetViewAsync (center As Geopoint) As IAsyncOperation(Of Boolean)

Parameters

center
Geopoint

The center to use in the view. For more info, see the Center property.

Returns

true if the asynchronous operation succeeded; otherwise, false.

Attributes

See also

Applies to