MapExtensions.TryOpenAsync Method

Definition

Overloads

TryOpenAsync(IMap, Location)

First checks if the installed map application can be opened, then opens the installed application to a specific location with launch options.

TryOpenAsync(IMap, Placemark)

First checks if the installed map application can be opened, then opens the installed application to a specific placemark with launch options.

TryOpenAsync(IMap, Location, MapLaunchOptions)

First checks if the installed map application can be opened, then open the installed application to a specific location with launch options.

TryOpenAsync(IMap, Double, Double)

First checks if the installed map application can be opened, then opens the installed application to a specific location with launch options.

TryOpenAsync(IMap, Location)

Source:
Map.shared.cs
Source:
Map.shared.cs

First checks if the installed map application can be opened, then opens the installed application to a specific location with launch options.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<bool> ^ TryOpenAsync(Microsoft::Maui::ApplicationModel::IMap ^ map, Microsoft::Maui::Devices::Sensors::Location ^ location);
public static System.Threading.Tasks.Task<bool> TryOpenAsync (this Microsoft.Maui.ApplicationModel.IMap map, Microsoft.Maui.Devices.Sensors.Location location);
static member TryOpenAsync : Microsoft.Maui.ApplicationModel.IMap * Microsoft.Maui.Devices.Sensors.Location -> System.Threading.Tasks.Task<bool>
<Extension()>
Public Function TryOpenAsync (map As IMap, location As Location) As Task(Of Boolean)

Parameters

map
IMap

The object this method is invoked on.

location
Location

Location to open in the map application.

Returns

true if the map application is opened, otherwise false.

Exceptions

Thrown when location is null.

Applies to

TryOpenAsync(IMap, Placemark)

Source:
Map.shared.cs
Source:
Map.shared.cs

First checks if the installed map application can be opened, then opens the installed application to a specific placemark with launch options.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<bool> ^ TryOpenAsync(Microsoft::Maui::ApplicationModel::IMap ^ map, Microsoft::Maui::Devices::Sensors::Placemark ^ placemark);
public static System.Threading.Tasks.Task<bool> TryOpenAsync (this Microsoft.Maui.ApplicationModel.IMap map, Microsoft.Maui.Devices.Sensors.Placemark placemark);
static member TryOpenAsync : Microsoft.Maui.ApplicationModel.IMap * Microsoft.Maui.Devices.Sensors.Placemark -> System.Threading.Tasks.Task<bool>
<Extension()>
Public Function TryOpenAsync (map As IMap, placemark As Placemark) As Task(Of Boolean)

Parameters

map
IMap

The object this method is invoked on.

placemark
Placemark

Placemark to open in the map application.

Returns

true if the map application is opened, otherwise false.

Applies to

TryOpenAsync(IMap, Location, MapLaunchOptions)

Source:
Map.shared.cs
Source:
Map.shared.cs

First checks if the installed map application can be opened, then open the installed application to a specific location with launch options.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<bool> ^ TryOpenAsync(Microsoft::Maui::ApplicationModel::IMap ^ map, Microsoft::Maui::Devices::Sensors::Location ^ location, Microsoft::Maui::ApplicationModel::MapLaunchOptions ^ options);
public static System.Threading.Tasks.Task<bool> TryOpenAsync (this Microsoft.Maui.ApplicationModel.IMap map, Microsoft.Maui.Devices.Sensors.Location location, Microsoft.Maui.ApplicationModel.MapLaunchOptions options);
static member TryOpenAsync : Microsoft.Maui.ApplicationModel.IMap * Microsoft.Maui.Devices.Sensors.Location * Microsoft.Maui.ApplicationModel.MapLaunchOptions -> System.Threading.Tasks.Task<bool>
<Extension()>
Public Function TryOpenAsync (map As IMap, location As Location, options As MapLaunchOptions) As Task(Of Boolean)

Parameters

map
IMap

The object this method is invoked on.

location
Location

Location to open in the map application.

options
MapLaunchOptions

Launch options to use.

Returns

true if the map application is opened, otherwise false.

Exceptions

Thrown when either location or options is null.

Applies to

TryOpenAsync(IMap, Double, Double)

Source:
Map.shared.cs
Source:
Map.shared.cs

First checks if the installed map application can be opened, then opens the installed application to a specific location with launch options.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<bool> ^ TryOpenAsync(Microsoft::Maui::ApplicationModel::IMap ^ map, double latitude, double longitude);
public static System.Threading.Tasks.Task<bool> TryOpenAsync (this Microsoft.Maui.ApplicationModel.IMap map, double latitude, double longitude);
static member TryOpenAsync : Microsoft.Maui.ApplicationModel.IMap * double * double -> System.Threading.Tasks.Task<bool>
<Extension()>
Public Function TryOpenAsync (map As IMap, latitude As Double, longitude As Double) As Task(Of Boolean)

Parameters

map
IMap

The object this method is invoked on.

latitude
Double

Target latitude.

longitude
Double

Target longitude.

Returns

true if the map application is opened, otherwise false.

Applies to