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.
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;
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.
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;
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.
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;
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.