GetDistanceTo Method
Collapse the table of content
Expand the table of content

GeoCoordinate.GetDistanceTo Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Returns the calculated distance, in meters, from the current GeoCoordinate to the provided GeoCoordinate.

Namespace:  System.Device.Location
Assembly:  System.Device (in System.Device.dll)

public double GetDistanceTo(
	GeoCoordinate other
)

Parameters

other
Type: System.Device.Location.GeoCoordinate
The GeoCoordinate used to calculate the distance from the current GeoCoordinate.

Return Value

Type: System.Double
Returns Double. The distance between the two geographic coordinates.

This method may throw one of the following exceptions.

ArgumentException

Latitude or longitude is not a number (NaN).

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2016 Microsoft