- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我是 XAML 编程的新手,我正在使用 MapControl 在 Windows Phone 8.1 模拟器上申请学校作为作业。
昨天我想画一条路线并按照这个教程http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn631250.aspx ,而且效果很好。今天我再次运行它,但它一直给我错误消息 'InvalidCredentials' 和 routeResult.Status。我不知道为什么会出现此错误。
这是我使用的代码:
public async void SetRouteDirectionsBreda()
{
string beginLocation = "Willemstraat 17 Breda";
string endLocation = "Reigerstraat 2 Breda";
MapLocationFinderResult result = await MapLocationFinder.FindLocationsAsync(beginLocation, map.Center);
MapLocation begin = result.Locations.First();
result = await MapLocationFinder.FindLocationsAsync(endLocation, map.Center);
MapLocation end = result.Locations.First();
List<Geopoint> waypoints = new List<Geopoint>();
waypoints.Add(begin.Point);
// Adding more waypoints later
waypoints.Add(end.Point);
MapRouteFinderResult routeResult = await MapRouteFinder.GetWalkingRouteFromWaypointsAsync(waypoints);
Debug.WriteLine(routeResult.Status); // DEBUG
if (routeResult.Status == MapRouteFinderStatus.Success)
{
MapRouteView viewOfRoute = new MapRouteView(routeResult.Route);
viewOfRoute.RouteColor = Colors.Blue;
viewOfRoute.OutlineColor = Colors.Black;
map.Routes.Add(viewOfRoute);
await map.TrySetViewBoundsAsync(routeResult.Route.BoundingBox, null, MapAnimationKind.Bow);
}
else
{
throw new Exception(routeResult.Status.ToString());
}
}
最佳答案
您应该在 xaml 页面中添加您的 map 服务 token ,并将您的应用程序 ID 添加到包 list 中。
关于将 mapservicetoken 添加到您的应用程序,您需要了解的所有信息都可以在下面的链接中找到。 http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn741528.aspx
关于c# - Windows Phone 8.1 应用程序中的 routeResult.Status 不断给出无效凭据错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27757642/
如果这不是一个错误,那就是另一个错误。如果不是那样的话,那就是别的东西了。我觉得我的项目已经改变了很多,现在只是试图解决代码签名问题,结果一切都搞砸了。我严格按照说明进行操作,但出现错误,例如当前的“
我不确定是否有一些我不知道的内置变量或规则,或者 make 是否有问题,或者我只是疯了。 对于我的一个项目,我有一个如下的 makefile: CC=g++ CFLAGS=-O3 `libpng-co
我有大约 10 个 div,它们必须不断翻转,每个 div 延迟 3 秒 这个 codrops 链接的最后一个效果是我正在寻找的,但无需单击 div http://tympanus.net/Devel
我如何使用 jQuery 持续运行 PHP 脚本并每秒获取响应,以及将鼠标上的少量数据发送到同一脚本? 我真的必须添加一些随机扩展才能让这么简单的计时器工作吗? 最佳答案 To iterate is
JBoss 4.x EJB 3.0 我见过如下代码(大大简化): @Stateless @TransactionAttribute(TransactionAttributeType.NOT_SUPPO
使用 PHPStorm,我试图忽略每次尝试进行 git 提交时 pop 的 workspace.xml。 我的 .gitignore 看起来像: /.idea/ .idea/workspace.xml
我是一名优秀的程序员,十分优秀!