Location.CalculateDistance 方法

定义

重载

CalculateDistance(Location, Location, DistanceUnits)

计算两个位置之间的距离。

CalculateDistance(Location, Double, Double, DistanceUnits)

计算两个位置之间的距离。

CalculateDistance(Double, Double, Location, DistanceUnits)

计算两个位置之间的距离。

CalculateDistance(Double, Double, Double, Double, DistanceUnits)

计算两个 Location 实例之间的距离。

CalculateDistance(Location, Location, DistanceUnits)

Source:
Location.shared.cs
Source:
Location.shared.cs

计算两个位置之间的距离。

public:
 static double CalculateDistance(Microsoft::Maui::Devices::Sensors::Location ^ locationStart, Microsoft::Maui::Devices::Sensors::Location ^ locationEnd, Microsoft::Maui::Devices::Sensors::DistanceUnits units);
public static double CalculateDistance (Microsoft.Maui.Devices.Sensors.Location locationStart, Microsoft.Maui.Devices.Sensors.Location locationEnd, Microsoft.Maui.Devices.Sensors.DistanceUnits units);
static member CalculateDistance : Microsoft.Maui.Devices.Sensors.Location * Microsoft.Maui.Devices.Sensors.Location * Microsoft.Maui.Devices.Sensors.DistanceUnits -> double
Public Shared Function CalculateDistance (locationStart As Location, locationEnd As Location, units As DistanceUnits) As Double

参数

locationStart
Location

开始位置。

locationEnd
Location

结束位置。

units
DistanceUnits

返回结果距离的单位。

返回

所选单位中两个位置之间的距离。

适用于

CalculateDistance(Location, Double, Double, DistanceUnits)

Source:
Location.shared.cs
Source:
Location.shared.cs

计算两个位置之间的距离。

public:
 static double CalculateDistance(Microsoft::Maui::Devices::Sensors::Location ^ locationStart, double latitudeEnd, double longitudeEnd, Microsoft::Maui::Devices::Sensors::DistanceUnits units);
public static double CalculateDistance (Microsoft.Maui.Devices.Sensors.Location locationStart, double latitudeEnd, double longitudeEnd, Microsoft.Maui.Devices.Sensors.DistanceUnits units);
static member CalculateDistance : Microsoft.Maui.Devices.Sensors.Location * double * double * Microsoft.Maui.Devices.Sensors.DistanceUnits -> double
Public Shared Function CalculateDistance (locationStart As Location, latitudeEnd As Double, longitudeEnd As Double, units As DistanceUnits) As Double

参数

locationStart
Location

开始位置。

latitudeEnd
Double

结束位置的纬度坐标。

longitudeEnd
Double

结束位置的经度坐标。

units
DistanceUnits

返回结果距离的单位。

返回

所选单位中两个位置之间的距离。

适用于

CalculateDistance(Double, Double, Location, DistanceUnits)

Source:
Location.shared.cs
Source:
Location.shared.cs

计算两个位置之间的距离。

public:
 static double CalculateDistance(double latitudeStart, double longitudeStart, Microsoft::Maui::Devices::Sensors::Location ^ locationEnd, Microsoft::Maui::Devices::Sensors::DistanceUnits units);
public static double CalculateDistance (double latitudeStart, double longitudeStart, Microsoft.Maui.Devices.Sensors.Location locationEnd, Microsoft.Maui.Devices.Sensors.DistanceUnits units);
static member CalculateDistance : double * double * Microsoft.Maui.Devices.Sensors.Location * Microsoft.Maui.Devices.Sensors.DistanceUnits -> double
Public Shared Function CalculateDistance (latitudeStart As Double, longitudeStart As Double, locationEnd As Location, units As DistanceUnits) As Double

参数

latitudeStart
Double

起始位置的纬度坐标。

longitudeStart
Double

起始位置的经度坐标。

locationEnd
Location

结束位置。

units
DistanceUnits

返回结果距离的单位。

返回

所选单位中两个位置之间的距离。

适用于

CalculateDistance(Double, Double, Double, Double, DistanceUnits)

Source:
Location.shared.cs
Source:
Location.shared.cs

计算两个 Location 实例之间的距离。

public:
 static double CalculateDistance(double latitudeStart, double longitudeStart, double latitudeEnd, double longitudeEnd, Microsoft::Maui::Devices::Sensors::DistanceUnits units);
public static double CalculateDistance (double latitudeStart, double longitudeStart, double latitudeEnd, double longitudeEnd, Microsoft.Maui.Devices.Sensors.DistanceUnits units);
static member CalculateDistance : double * double * double * double * Microsoft.Maui.Devices.Sensors.DistanceUnits -> double
Public Shared Function CalculateDistance (latitudeStart As Double, longitudeStart As Double, latitudeEnd As Double, longitudeEnd As Double, units As DistanceUnits) As Double

参数

latitudeStart
Double

起始位置的纬度坐标。

longitudeStart
Double

起始位置的经度坐标。

latitudeEnd
Double

结束位置的纬度坐标。

longitudeEnd
Double

结束位置的经度坐标。

units
DistanceUnits

返回结果距离的单位。

返回

所选单位中两个位置之间的距离。

适用于