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

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

问题描述

我正在尝试在Windows Phone 7 Silverlight应用程序上使用bing maps控件,它显示此错误覆盖在地图上.

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/developers https://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天全站免登陆