Share via


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.

GeoRoadTypeValueDescriptionVersion
geoRoadArterial4Arterial roadsMapPoint North America
Minor roadsMapPoint Europe
geoRoadFerry7Automobile ferriesMapPoint Europe
geoRoadInterstate1Interstates and limited-access highwaysMapPoint North America
Motorways and limited-access highwaysMapPoint Europe
geoRoadLimitedAccess2Not available for use with the PreferredRoads propertyNot applicable
geoRoadOtherHighway3Other highwaysMapPoint North America
Major roadsMapPoint Europe
geoRoadStreet5Not available for use withNot applicable PreferredRoads propertyNot applicable
geoRoadToll6Toll roadsAll

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.