Map​Route Map​Route Map​Route Class

Definition

Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

Prerelease. Represents a path to be traveled between two or more waypoints.

public : sealed class MapRoute : IMapRoute, IMapRoute2, IMapRoute3public sealed class MapRoute : IMapRoute, IMapRoute2, IMapRoute3Public NotInheritable Class MapRoute Implements IMapRoute, IMapRoute2, IMapRoute3
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

A MapRoute object is returned through the Route property of the MapRouteFinderResult when you call the methods of the MapRouteFinder class.

To display a MapRoute on a MapControl, construct a MapRouteView with the MapRoute and add the MapRouteView to the Routes collection of the MapControl.

Your Universal Windows app must be authenticated before it can use the MapControl and map services in the Windows.Services.Maps namespace. To authenticate your app, you must specify a maps authentication key.

See Request a maps authentication key.

Properties

BoundingBox BoundingBox BoundingBox

Gets the bounding box that contains the route.

public : GeoboundingBox BoundingBox { get; }public GeoboundingBox BoundingBox { get; }Public ReadOnly Property BoundingBox As GeoboundingBox
Value
GeoboundingBox GeoboundingBox GeoboundingBox

The bounding box that contains the route.

Attributes

Remarks

If you want to display this bounding box in the MapControl, use one of the overloads of the TrySetViewAsync method that accepts a GeoboundingBox as input.

See Also

DurationWithoutTraffic DurationWithoutTraffic DurationWithoutTraffic

Gets the estimated time required to traverse the route without traffic.

public : TimeSpan DurationWithoutTraffic { get; }public TimeSpan DurationWithoutTraffic { get; }Public ReadOnly Property DurationWithoutTraffic As TimeSpan
Value
TimeSpan TimeSpan TimeSpan

The estimated time required to traverse the route without traffic.

Attributes
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

EstimatedDuration EstimatedDuration EstimatedDuration

Gets the estimated time required to traverse the route.

public : TimeSpan EstimatedDuration { get; }public TimeSpan EstimatedDuration { get; }Public ReadOnly Property EstimatedDuration As TimeSpan
Value
TimeSpan TimeSpan TimeSpan

The estimated time required to traverse the route.

Attributes
See Also

HasBlockedRoads HasBlockedRoads HasBlockedRoads

Gets a value that indicates the route has been modified from the "best" route to avoid blocked roads.

public : PlatForm::Boolean HasBlockedRoads { get; }public bool HasBlockedRoads { get; }Public ReadOnly Property HasBlockedRoads As bool
Value
PlatForm::Boolean bool bool

true if the route has been modified to avoid blocked roads; otherwise, false.

Attributes

IsScenic IsScenic IsScenic

Prerelease. Gets a value that indicates whether the MapRoute is based on scenic roads.

public : PlatForm::Boolean IsScenic { get; }public bool IsScenic { get; }Public ReadOnly Property IsScenic As bool
Value
PlatForm::Boolean bool bool

true if the MapRoute is based on scenic roads; otherwise, false.

Attributes
Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16225.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

IsTrafficBased IsTrafficBased IsTrafficBased

Gets a value indicating whether the MapRoute is based on traffic.

public : PlatForm::Boolean IsTrafficBased { get; }public bool IsTrafficBased { get; }Public ReadOnly Property IsTrafficBased As bool
Value
PlatForm::Boolean bool bool

true if the MapRoute is based on traffic; otherwise, false.

Attributes
See Also

Legs Legs Legs

Gets the list of legs associated with the route.

public : IVectorView<MapRouteLeg> Legs { get; }public IReadOnlyList<MapRouteLeg> Legs { get; }Public ReadOnly Property Legs As IReadOnlyList<MapRouteLeg>
Value
IVectorView<MapRouteLeg> IReadOnlyList<MapRouteLeg> IReadOnlyList<MapRouteLeg>

The list of legs associated with the route. This property returns a collection of MapRouteLeg objects.

Attributes
See Also

LengthInMeters LengthInMeters LengthInMeters

Gets the length of the route in meters.

public : double LengthInMeters { get; }public double LengthInMeters { get; }Public ReadOnly Property LengthInMeters As double
Value
double double double

The length of the route in meters.

Attributes
See Also

Path Path Path

Gets the path of the route.

public : Geopath Path { get; }public Geopath Path { get; }Public ReadOnly Property Path As Geopath
Value
Geopath Geopath Geopath

The path of the route.

Attributes
See Also

TrafficCongestion TrafficCongestion TrafficCongestion

Gets the level of traffic congestion along a map route.

public : TrafficCongestion TrafficCongestion { get; }public TrafficCongestion TrafficCongestion { get; }Public ReadOnly Property TrafficCongestion As TrafficCongestion
Value
TrafficCongestion TrafficCongestion TrafficCongestion

The level of traffic congestion along a map route.

Attributes
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

ViolatedRestrictions ViolatedRestrictions ViolatedRestrictions

Gets a value that indicates if any restrictions have been violated by the route.

public : MapRouteRestrictions ViolatedRestrictions { get; }public MapRouteRestrictions ViolatedRestrictions { get; }Public ReadOnly Property ViolatedRestrictions As MapRouteRestrictions
Attributes

See Also