ShortestPath

 

The ShortestPath method creates the shortest path from the specified point objects.

 

Syntax

object.ShortestPath( pPIDS, StartPID, AppendCoord, TraceJourney, DecimalDigits )

 

Parameter

Type

Description

pPIDS

Array of Variants

required; array of primary IDs

StartPID

String

required; starting primary ID

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 ShortestPath2. See Coordinate Arrays for more information about creating arrays in MapViewer.

 

Example

    'ShortestPath

    'Create an array of PIDs

    Dim pidsArray(3) As Variant

    pidsArray(0) = "CO" : pidsArray(1) = "IL" : pidsArray(2) = "GA" : pidsArray(3) = "NY"

  

    'Create the shortest path given the points in the array starting with the point whose PID is "CO"

    CurrentLayer.ShortestPath(pPIDS:=pidsArray, StartPID:="CO", TraceJourney:=True)

 

Used by: Layer object