MapRoute 类

定义

表示要在两个或多个航点之间移动的路径。

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
继承
Object Platform::Object IInspectable MapRoute
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

调用 MapRouteFinder 类的方法时,通过 MapRouteFinderResultRoute 属性返回 MapRoute 对象。

若要在 MapControl 上显示 MapRoute,请使用 MapRoute 构造 MapRouteView,并将 MapRouteView 添加到 MapControlRoutes 集合中。

通用 Windows 应用必须先进行身份验证,然后才能使用 Windows.Services.Maps 命名空间中的 MapControl 和地图服务。 若要对应用进行身份验证,必须指定地图身份验证密钥。

请参阅 请求映射身份验证密钥

版本历史记录

Windows 版本 SDK 版本 增值
1703 15063 DurationWithoutTraffic
1703 15063 TrafficCongestion
1709 16299 IsScenic

属性

BoundingBox

获取包含路由的边界框。

DurationWithoutTraffic

获取在没有流量的情况下遍历路由所需的估计时间。

EstimatedDuration

获取遍历路由所需的估计时间。

HasBlockedRoads

获取一个值,该值指示已从“最佳”路线修改路线以避免道路受阻。

IsScenic

获取一个值,该值指示 MapRoute 是否基于风景道路。

IsTrafficBased

获取一个值,该值指示 MapRoute 是否基于流量。

Legs

获取与路线关联的航段列表。

LengthInMeters

获取路线的长度(以米为单位)。

Path

获取路由的路径。

TrafficCongestion

获取地图路线上的交通拥堵程度。

ViolatedRestrictions

获取一个值,该值指示路由是否违反了任何限制。

适用于

另请参阅