MapControl.TryZoomInAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public:
virtual IAsyncOperation<bool> ^ TryZoomInAsync() = TryZoomInAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<bool> TryZoomInAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<bool> TryZoomInAsync();
function tryZoomInAsync()
Public Function TryZoomInAsync () As IAsyncOperation(Of Boolean)
Returns
Contains the results of the operation: true if the operation completed successfully; otherwise, false.
- Attributes
Remarks
Warning
We don't recommend changing ZoomLevel with 3D views. When the MapControl's view is not looking "straight-down," changes in ZoomLevel can lead to unpredictable behavior.
ZoomLevel is intended for 2D views. To implement a "zoom" effect with 3D views, use the MapControl's TrySetSceneAsync method to move the camera closer. Start by setting a closer Location on a MapCamera object. Next, create a new MapScene by passing that MapCamera to CreateFromCamera. Finally, initiate the zoom by passing the new MapScene to TrySetSceneAsync. You can zoom in immediately or specify MapAnimationKind to create an animated "fly in".
The maximum and minimum values of ZoomLevel, which are reported by the MaxZoomLevel and MinZoomLevel properties, depend on the type of map view: 2D, 3D, or Streetside.
Property | 2D range | 3D range | Streetside range |
---|---|---|---|
ZoomLevel | 1-20 | 1-20 | 24-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.
Consider this method when you want to replace the default UI control with your own.