Calculates the closest LatLng on a great circle segment from a given location.

Namespace: Reimers.Google.Map.Accessories
Assembly: Reimers.Google.Map (in Reimers.Google.Map.dll) Version: 5.3.95.699 (5.3.95.699)

Syntax

C#
public static ICoordinates ClosestPointOnLine(
	ICoordinates point,
	ICoordinates lineStart,
	ICoordinates lineEnd,
	bool flatEarth
)

Parameters

point
Type: Reimers.Core.Maps..::..ICoordinates
The given location.
lineStart
Type: Reimers.Core.Maps..::..ICoordinates
The start of the line segment.
lineEnd
Type: Reimers.Core.Maps..::..ICoordinates
The end of the line segment.
flatEarth
Type: System..::..Boolean
A Boolean value indicating whether the calculation should be based on a flat earth.

Return Value

A LatLng.

Remarks

Flat Earth calculations give higher precision for calculations over shorter distances.

See Also