MapRoute Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a path to be traveled between two or more waypoints.
public ref class MapRoute sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class MapRoute final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class MapRoute
Public NotInheritable Class MapRoute
- Inheritance
- Attributes
Windows requirements
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
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.
Important
Bing Maps for Enterprise service retirement
The UWP MapControl and map services from the Windows.Services.Maps namespaces rely on Bing Maps. Bing Maps for Enterprise is deprecated and will be retired, at which point the MapControl and services will no longer receive data.
For more information, see the Bing Maps Developer Center and Bing Maps documentation.
Your 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.
Version history
Windows version | SDK version | Value added |
---|---|---|
1703 | 15063 | DurationWithoutTraffic |
1703 | 15063 | TrafficCongestion |
1709 | 16299 | IsScenic |
Properties
BoundingBox |
Gets the bounding box that contains the route. |
DurationWithoutTraffic |
Gets the estimated time required to traverse the route without traffic. |
EstimatedDuration |
Gets the estimated time required to traverse the route. |
HasBlockedRoads |
Gets a value that indicates the route has been modified from the "best" route to avoid blocked roads. |
IsScenic |
Gets a value that indicates whether the MapRoute is based on scenic roads. |
IsTrafficBased |
Gets a value indicating whether the MapRoute is based on traffic. |
Legs |
Gets the list of legs associated with the route. |
LengthInMeters |
Gets the length of the route in meters. |
Path |
Gets the path of the route. |
TrafficCongestion |
Gets the level of traffic congestion along a map route. |
ViolatedRestrictions |
Gets a value that indicates if any restrictions have been violated by the route. |