CracLock
CracLock

Reputation: 663

Unable to add reference to Bing Maps?

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.

Upvotes: 0

Views: 4165

Answers (3)

Sonu
Sonu

Reputation: 132

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

  1. Click on go .

  2. Name it according to you .

  3. Now try to add namespaces like

using ProjectName.GeocodeService;

using ProjectName.ImageryService;

Hope This helps.

Upvotes: 2

Bryan Watts
Bryan Watts

Reputation: 1425

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:

xmlns:m="clr-namespace:Microsoft.Maps.MapControl; assembly=Microsoft.Maps.MapControl"

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.

<m:Map CredentialsProvider="Your_Credentials" />

Upvotes: 0

Alastair Aitchison
Alastair Aitchison

Reputation: 3532

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.

Upvotes: 1

Related Questions