Share via


TimeFlexibility property

Returns or sets the amount of time to extend travel beyond the end of the driving day in order to reach the next stop. Time is in fractional days; for example, one hour equals 1/24 (or .041666) of a day. Maximum time allowed is 2 hours. Read/write Double.

Applies to

Objects: DriverProfile

Syntax

object.TimeFlexibility

Properties

Part

Description

Object

Required. An expression that returns a DriverProfile object.

Remarks

  • You can use the GeoTimeConstants constants when setting the TimeFlexibility property. For example, a flexibility time of one hour can be set as "1 * geoOneHour".

  • To return or set the time to stop driving each day, use the EndTime property of the DriverProfile object.

Example

  Sub RouteDailyTimeFlexibility()

  Dim objApp As New MapPoint.Application
  Dim objMap As MapPoint.Map
  Dim objRoute As MapPoint.Route

  'Set up the application
  Set objMap = objApp.ActiveMap
  Set objRoute = objMap.ActiveRoute
  objApp.Visible = True
  objApp.UserControl = True

  'Add route stops and calculate the route
  objRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)
  objRoute.Waypoints.Add objMap.FindResults("Spokane, WA").Item(1)
  objRoute.Calculate

  'Find out the current time flexibility
  MsgBox "Current route flexibility in minutes: " _
    + CStr(objRoute.DriverProfile.TimeFlexibility / geoOneMinute)

  End Sub
 

Note   This sample code is specific for use in MapPoint North America; it is for illustration purposes only.