WP7 Bing 地图“无效凭据"错误 [英] WP7 Bing Maps 'Invalid Credentials' Error

查看:10
本文介绍了WP7 Bing 地图“无效凭据"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Windows Phone 7 silverlight 应用程序上使用 bing 地图控件,它显示此错误叠加在地图上.

I'm trying to use a bing maps control on a windows phone 7 silverlight application and it shows this error overlaid on the map.

无效的凭据,注册一个开发者帐号

Invalid Credentials, Sign up for a Developer Account

我尝试使用来自这两个站点的应用 ID:http://www.bing.com/developershttps://www.bingmapsportal.com/

I've tried using app IDs from these two sites: http://www.bing.com/developers, and https://www.bingmapsportal.com/

我做错了吗?是否有一些我遗漏的帐户设置?作为参考,以下是我定义控件并与之交互的方式:

am I doing something wrong? is there some account setting that I'm missing? For reference, here's how I'm defining the control and interacting with it:

<my:Map x:Name="MyMap" CredentialsProvider="<<myAppId>>"  />

在后面的代码中:

var vm = this.DataContext as ItemViewModel;
Pushpin pushpin = new Pushpin();
Location location = new Location()
{
    Latitude = vm.Latitude,
    Longitude = vm.Longitude
};
pushpin.Location = location;

MyMap.ZoomLevel = 15;
MyMap.Center = location;
MyMap.Children.Add(pushpin);

推荐答案

转到 http://bingmapsportal.com 和使用您的 Windows Live ID 登录.登录后,点击左侧菜单中的创建或查看密钥.如果您还没有,请通过输入名称、URL 并选择类型(移动)来创建应用程序.创建应用程序后,复制长字符串并将其作为 CredentialsProvider 属性的值粘贴到 XAML 中.

Go to http://bingmapsportal.com and sign in with your Windows Live ID. Once signed in, click Create or view keys in the menu on the left. If you haven't already, create an application by entering the name, URL, and selecting a type (Mobile). Once you've got your application created, copy the long string of characters and paste it into your XAML as the value of the CredentialsProvider attribute.

<my:Map CredentialsProvider="NOTREALVF7QTW-LZfG0p7-RhSPeGvlfx3fdtgR-Gk_SB-wfF8kCj2J7nI57wjIna" />

这篇关于WP7 Bing 地图“无效凭据"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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