Skip to main content
Table of Contents

TTMSFNCCustomGoogleMaps.AddDirections Method

Adds an address-based directions request to the map.

API unit family: TMSFNCGoogleMaps Declaring type: TTMSFNCCustomGoogleMaps

Overloads

Overload 1

Adds an address-based directions request to the map.

FMX.TMSFNCGoogleMaps.hppPascalC++
function AddDirections(AOrigin, ADestination: string; AShowMarkers: Boolean = True; AShowPolyline: Boolean = True; AStrokeColor: TTMSFNCGraphicsColor = gcBlue; AStrokeWidth: Integer = 2; AStrokeOpacity: Single = 1; ATravelMode: TTMSFNCGoogleMapsDirectionsTravelMode = dtmDriving; AAvoidTolls: Boolean = False; AWayPoints: TStringList = nil; AOptimizeWayPoints: Boolean = False): TTMSFNCGoogleMapsDirectionsItem; overload;
TTMSFNCGoogleMapsDirectionsItem* __fastcall AddDirections(System::UnicodeString AOrigin, System::UnicodeString ADestination, bool AShowMarkers = true, bool AShowPolyline = true, TTMSFNCGraphicsColor AStrokeColor = (System::Uitypes::TAlphaColor)(0xff0000ff), int AStrokeWidth = 0x2, float AStrokeOpacity = 1.000000E+00f, TTMSFNCGoogleMapsDirectionsTravelMode ATravelMode = (TTMSFNCGoogleMapsDirectionsTravelMode)(0x0), bool AAvoidTolls = false, System::Classes::TStringList* AWayPoints = (System::Classes::TStringList*)(0x0), bool AOptimizeWayPoints = false)/* overload */;

Parameters

Name Description
AOrigin Origin address or place text.
ADestination Destination address or place text.
AShowMarkers When True, markers are shown for the directions request.
AShowPolyline When True, the route polyline is shown.
AStrokeColor Stroke color used for the route line.
AStrokeWidth Stroke width used for the route line.
AStrokeOpacity Stroke opacity used for the route line.
ATravelMode Travel mode used for the directions request.
AAvoidTolls When True, toll roads are avoided.
AWayPoints Optional waypoint coordinates used by the operation.
AOptimizeWayPoints When True, waypoint order may be optimized.

Returns

The resulting google maps directions item instance.

Overload 2

Adds a coordinate-based directions request to the map.

FMX.TMSFNCGoogleMaps.hppPascalC++
function AddDirections(AOriginCoordinate, ADestinationCoordinate: TTMSFNCMapsCoordinateRec; AShowMarkers: Boolean = True; AShowPolyline: Boolean = True; AStrokeColor: TTMSFNCGraphicsColor = gcBlue; AStrokeWidth: Integer = 2; AStrokeOpacity: Single = 1; ATravelMode: TTMSFNCGoogleMapsDirectionsTravelMode = dtmDriving): TTMSFNCGoogleMapsDirectionsItem; overload;
TTMSFNCGoogleMapsDirectionsItem* __fastcall AddDirections(const TTMSFNCMapsCoordinateRec &AOriginCoordinate, const TTMSFNCMapsCoordinateRec &ADestinationCoordinate, bool AShowMarkers = true, bool AShowPolyline = true, TTMSFNCGraphicsColor AStrokeColor = (System::Uitypes::TAlphaColor)(0xff0000ff), int AStrokeWidth = 0x2, float AStrokeOpacity = 1.000000E+00f, TTMSFNCGoogleMapsDirectionsTravelMode ATravelMode = (TTMSFNCGoogleMapsDirectionsTravelMode)(0x0))/* overload */;

Parameters

Name Description
AOriginCoordinate Origin coordinate.
ADestinationCoordinate Destination coordinate.
AShowMarkers When True, markers are shown for the directions request.
AShowPolyline When True, the route polyline is shown.
AStrokeColor Stroke color used for the route line.
AStrokeWidth Stroke width used for the route line.
AStrokeOpacity Stroke opacity used for the route line.
ATravelMode Travel mode used for the directions request.

Returns

The resulting google maps directions item instance.

Overload 3

Adds a directions request from numeric coordinates.

FMX.TMSFNCGoogleMaps.hppPascalC++
function AddDirections(AOriginLatitude, AOriginLongitude, ADestinationLatitude, ADestinationLongitude: Double; AShowMarkers: Boolean = True; AShowPolyline: Boolean = True; AStrokeColor: TTMSFNCGraphicsColor = gcBlue; AStrokeWidth: Integer = 2; AStrokeOpacity: Single = 1; ATravelMode: TTMSFNCGoogleMapsDirectionsTravelMode = dtmDriving): TTMSFNCGoogleMapsDirectionsItem; overload;
TTMSFNCGoogleMapsDirectionsItem* __fastcall AddDirections(double AOriginLatitude, double AOriginLongitude, double ADestinationLatitude, double ADestinationLongitude, bool AShowMarkers = true, bool AShowPolyline = true, TTMSFNCGraphicsColor AStrokeColor = (System::Uitypes::TAlphaColor)(0xff0000ff), int AStrokeWidth = 0x2, float AStrokeOpacity = 1.000000E+00f, TTMSFNCGoogleMapsDirectionsTravelMode ATravelMode = (TTMSFNCGoogleMapsDirectionsTravelMode)(0x0))/* overload */;

Parameters

Name Description
AOriginLatitude Origin latitude in decimal degrees.
AOriginLongitude Origin longitude in decimal degrees.
ADestinationLatitude Destination latitude in decimal degrees.
ADestinationLongitude Destination longitude in decimal degrees.
AShowMarkers When True, markers are shown for the directions request.
AShowPolyline When True, the route polyline is shown.
AStrokeColor Stroke color used for the route line.
AStrokeWidth Stroke width used for the route line.
AStrokeOpacity Stroke opacity used for the route line.
ATravelMode Travel mode used for the directions request.

Returns

The resulting google maps directions item instance.