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

[Contains prerelease APIs.]
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// This API is not available in Javascript.
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 BoundingBox

Gets the bounding box that contains the route.

public : GeoboundingBox BoundingBox { get; }public GeoboundingBox BoundingBox { get; }Public ReadOnly Property BoundingBox As GeoboundingBox// This API is not available in Javascript.
Value
GeoboundingBox GeoboundingBox GeoboundingBox GeoboundingBox

The bounding box that contains the route.

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 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// This API is not available in Javascript.
Value
TimeSpan TimeSpan TimeSpan TimeSpan

The estimated time required to traverse the route without traffic.

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 EstimatedDuration

Gets the estimated time required to traverse the route.

public : TimeSpan EstimatedDuration { get; }public TimeSpan EstimatedDuration { get; }Public ReadOnly Property EstimatedDuration As TimeSpan// This API is not available in Javascript.
Value
TimeSpan TimeSpan TimeSpan TimeSpan

The estimated time required to traverse the route.

See Also

HasBlockedRoads 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// This API is not available in Javascript.
Value
PlatForm::Boolean bool bool bool

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

IsScenic 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// This API is not available in Javascript.
Value
PlatForm::Boolean bool bool bool

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

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

IsTrafficBased 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// This API is not available in Javascript.
Value
PlatForm::Boolean bool bool bool

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

See Also

Legs 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>// This API is not available in Javascript.
Value
IVectorView<MapRouteLeg> IReadOnlyList<MapRouteLeg> IReadOnlyList<MapRouteLeg> IReadOnlyList<MapRouteLeg>

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

See Also

LengthInMeters 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// This API is not available in Javascript.
Value
double double double double

The length of the route in meters.

See Also

Path Path Path Path

Gets the path of the route.

public : Geopath Path { get; }public Geopath Path { get; }Public ReadOnly Property Path As Geopath// This API is not available in Javascript.
Value
Geopath Geopath Geopath Geopath

The path of the route.

See Also

TrafficCongestion 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// This API is not available in Javascript.
Value
TrafficCongestion TrafficCongestion TrafficCongestion TrafficCongestion

The level of traffic congestion along a map route.

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 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// This API is not available in Javascript.

See Also