我试图使用 Bing 地图创建一个应用程序。我需要在其中添加两个参考库,
Microsoft.Maps.MapControl.Common.dll
Microsoft.Maps.MapControl.dll
我按照以下教程进行操作: http://www.codeguru.com/csharp/csharp/cs_misc/article.php/c18305__1/Working-with-Bing-Maps-in-Silverlight-and-Windows-Phone-7-Applications。 htm
但是当我从 Bing 地图安装 BingMapAppSDK 时,它没有这些 api。
它确实有库,
Microsoft.Maps.Core;
Microsoft.Maps.MapControl;
Microsoft.Maps.MapControl.Types;
Microsoft.Maps.Plugins;
但没有上面的库。因此,我无法使用 Bing 地图。
我正在使用 Visual Studio 2010 并创建 Silverlight 应用程序并安装 Silverlight 5。
请建议。
I was trying to create an app using Bing Map. in which i need to add two reference libraries
Microsoft.Maps.MapControl.Common.dll
Microsoft.Maps.MapControl.dll
I followed the tutorial from : http://www.codeguru.com/csharp/csharp/cs_misc/article.php/c18305__1/Working-with-Bing-Maps-in-Silverlight-and-Windows-Phone-7-Applications.htm
But when i installed BingMapAppSDK from Bing Maps it didn't have these api.
It does have libraries
Microsoft.Maps.Core;
Microsoft.Maps.MapControl;
Microsoft.Maps.MapControl.Types;
Microsoft.Maps.Plugins;
But not the above ones.. Due to this i am not able to use Bing Maps.
I am using Visual Studio 2010 and creating Silverlight app and Silverlight 5 is installed.
Please suggest.
发布评论
评论(3)
您必须添加服务参考。
1.右键单击“引用”,然后添加服务引用。
然后从此处复制您要使用的四个链接之一。
http://msdn.microsoft.com/en-us/library/cc966738.aspx
点击“开始”。
根据你的名字来命名。
现在尝试添加命名空间
就像
使用 ProjectName.GeocodeService 一样;
使用项目名称.ImageryService;
希望这有帮助。
You have To add a Service Reference.
1 . Right click on "reference" and then Add Service Reference.
then copy one of the four links from here which you want to use.
http://msdn.microsoft.com/en-us/library/cc966738.aspx
Click on go .
Name it according to you .
Now try to add namespaces
like
using ProjectName.GeocodeService;
using ProjectName.ImageryService;
Hope This helps.
不同的平台有不同的 Bing 地图 SDK,但令人困惑的是,它们确实共享相当相似的命名空间。从您的帖子中确实不清楚您要针对哪个平台...
请注意,还有用于 iOS、Android 和 WPF 开发以及传统 AJAX 控件的专用 Bing 地图 SDK。
There are different Bing Maps SDKs for different platforms although, confusingly, they do share rather similar namespaces. It's really unclear from your post which platform you're trying to target...
Note that there are also dedicated Bing Maps SDKs for iOS, Android, and WPF development, as well as the traditional AJAX control.
dll 的名称可以与它们提供的命名空间不同。如果我正确理解你的问题,那么你已经可以访问你需要的一切了。这四个库是您制作应用程序所需的库,而 dll 文件是您已经用来访问这些命名空间的库。
在您列出的示例链接中,他展示了如何通过执行以下操作来引用地图控件名称空间:
在这种情况下,程序集(dll 文件)和名称空间是相同的,但它们不必是这样,那就是为什么要单独指定它们。
从这里,只需添加地图控件即可。
The name of the dll's can be different from the namespaces they provide. If I understand your question correctly, you already have access to everything you need. The four libraries are what you need to make your apps, while the dll files are what you are already using to get access to those namespaces.
In the example link you listed, he shows how make a reference to the map control namespace by doing the following:
In this case, the assembly (dll file) and the namespace are the same, but they don't have to be and thats why they are specified separately.
From here, just add the map control.