DistanceOfTravel

 

The DistanceOfTravel method creates a report of total travel distance between objects specified by primary IDs.

 

Syntax

object.DistanceOfTravel( pPIDS, AppendCoord, TraceJourney, DecimalDigits )

 

Parameter

Type

Description

pPIDS

Array of Variants

required; array of primary IDs

AppendCoord

Boolean

optional; append map coordinates after the primary ID name

TraceJourney

Boolean

optional; trace the journey on the map

DecimalDigits

Integer

optional; number of digits to the right of the decimal

 

Remarks

VB users can use ReDim to set the array size to the used size if necessary or use DistanceOfTravel2. See Coordinate Arrays for more information about creating arrays in MapViewer.

 

Example

This example loads a base map and traces the distance of travel between four locations.

 

'Load base map

Set BaseMap = Plot.CreateBaseMap(FileName:= mvApp.ApplicationFolder + _

"\Samples\co2010.gsb", AppendImage:= True)

 

'Create array for pPIDS

Dim Travel(3) As Variant

Travel(0) = "08031"

Travel(1) = "08045"

Travel(2) = "08001"

Travel(3) = "08125"

 

'Create a distance of travel report and trace the journey on the map

CurrentLayer.DistanceOfTravel(pPIDs:=Travel, AppendCoord:=True, _

TraceJourney:=True, DecimalDigits:=3)

 

Used by: Layer object