MapLocationFinderResult uwp c# 上的凭据无效 [英] Invalid Credentials on MapLocationFinderResult uwp c#

查看:22
本文介绍了MapLocationFinderResult uwp c# 上的凭据无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 MapLocationFinder 时遇到了一个奇怪的问题.

I am having a strange problem with the use of MapLocationFinder.

我正在使用 MapLocationFinder 根据字符串地址检索经度和纬度:

I am using MapLocationFinder to retrieve longitude and latitude based on string address:

string address = ""; // Any address here

var locFinderResult = await MapLocationFinder.FindLocationsAsync(address, new Geopoint(new BasicGeoposition()));

此后,我使用 Laucher 启动drive to"应用程序并获取导航地图:

After this, I use Laucher to start "drive to" application and get navigation map:

var geoPos = locFinderResult.Locations[0].Point.Position;

var url = $"ms-drive-to:?destination.latitude={geoPos.Latitude.ToString(CultureInfo.InvariantCulture)}&destination.longitude={geoPos.Longitude.ToString(CultureInfo.InvariantCulture)}&destination.name={address}";
var driveToUri = new Uri(url);

await Launcher.LaunchUriAsync(driveToUri);

直到最近,这在所有设备上都运行良好.我不需要任何令牌或任何东西,因为我没有在 XAML 中实现 Map 控件.但是,几天前我开始收到 locFinderResult 的InvalidCredentials"响应.它仍然只适用于一台设备.我从未使用过任何凭据,所以我不知道为什么它只适用于这个.

Up until recently this worked just fine on all devices. I was not required any token or anything, since I am not implementing Map control in XAML. However, a couple days ago I started receiving "InvalidCredentials" response for locFinderResult. It still works on only one device. I have never used any credentials so I don't know why it only works on this one.

有谁知道是什么导致了这个问题?

Does anyone knows what could cause this issue?

推荐答案

最近一段时间,Microsoft 似乎要求您从 Bing 地图开发人员中心获取密钥才能使用此功能.请参阅说明:https://docs.microsoft.com/en-us/windows/uwp/maps-and-location/authentication-key

It looks like from some recent time Microsoft requires you to get the key from the Bing Maps Developers Center to use this functionality. See, the instructions: https://docs.microsoft.com/en-us/windows/uwp/maps-and-location/authentication-key

这篇关于MapLocationFinderResult uwp c# 上的凭据无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆