uwp - UWP MapRouteFinder 抛出错误
问题描述
我正在尝试开始使用 UWP MapControl,但特别是 MapRouteFinder。我已经从https://docs.microsoft.com/en-us/windows/uwp/maps-and-location/routes-and-directions尝试了这段代码
// Get the route between the points.
MapRouteFinderResult routeResult =
await MapRouteFinder.GetDrivingRouteAsync(
new Geopoint(startLocation),
new Geopoint(endLocation),
MapRouteOptimization.Time,
MapRouteRestrictions.None);
不幸的是,我遇到了一个构建错误:
Severity Code Description Project File Line Suppression State
Error CS4036 'IAsyncOperation<MapRouteFinderResult>' does not contain a
definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a
first argument of type 'IAsyncOperation<MapRouteFinderResult>' could be found
(are you missing a using directive for 'System'?)
不确定“系统”缺少什么使用指令?方法。
解决方案
推荐阅读
- r - 如何从数组计算最大值?
- javascript - rss2json 不会获得我在 feed.xml 文件中放入的最新提要更新
- cassandra - 压缩 - TimeWindowCompactionStrategy Cassandra 3
- scala - 如何更改 StructType 的 StructField 中列的数据类型?
- javascript - 不明白我的“不必要的转义字符”错误来自哪里
- angular - 给定日期一年中的周数
- sql - 带有大小写检查空值的 SQL Server Where 子句
- oracle - 显示表空间详细信息的 Oracle 过程
- java - 将包含非 ASCII 字符的参数从 bash 传递到 Java 程序
- c# - 如何通过输入和输出绑定连接 Azure Functions 2.0 CosmosDB?