PreferredRoads property

Returns or sets the degree to which travel on particular types of roads is preferred. Range is 0-1 (dislike to like). Read/write Double.

Applies to

Objects:  DriverProfile

Syntax

object.PreferredRoads(RoadClass)

Parameters

Part Description
object Required. An expression that returns a DriverProfile object.
RoadClass Required GeoRoadType. The type of road for which to set a preference.
GeoRoadType Value Description Version
geoRoadArterial
4
Arterial roads MapPoint North America
    Minor roads MapPoint Europe
geoRoadFerry
7
Automobile ferries MapPoint Europe
geoRoadInterstate
1
Interstates and limited-access highways MapPoint North America
    Motorways and limited-access highways MapPoint Europe
geoRoadLimitedAccess
2
Not available for use with the PreferredRoads property Not applicable
geoRoadOtherHighway
3
Other highways MapPoint North America
    Major roads MapPoint Europe
geoRoadStreet
5
Not available for use with PreferredRoads property Not applicable
geoRoadToll
6
Toll roads All

Remarks

To reset to MapPoint default values, use the ResetPreferredRoads method on the DriverProfile object.

Example

    Sub ChangeInterstatePreference()

  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   objRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)   objRoute.Waypoints.Add objMap.FindResults("Redmond, WA").Item(1)
  'Change preferred road setting for highways, route on these roads, and then calculate the route   objRoute.DriverProfile.PreferredRoads(geoRoadInterstate) = 0.2   objRoute.Waypoints.Item(1).SegmentPreferences = geoSegmentPreferred   objRoute.Calculate
  End Sub

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