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. |
||||||||||||||||||||||||||||||||||||||||||||
|
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.