User Tools

Site Tools


map_suite_desktop_for_wpf_how_to_use_bingmaps

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
map_suite_desktop_for_wpf_how_to_use_bingmaps [2018/03/29 21:40]
cloudhu
map_suite_desktop_for_wpf_how_to_use_bingmaps [2018/03/30 16:42]
cloudhu
Line 1: Line 1:
-====== Map Suite Desktop (WPF) How to Use Bing Maps ======+====== ​How to Use Bing Maps in Map Suite Desktop (WPF) Edition======
  
 This guide helps you to create a bing maps key and apply it in Map Suite. ​ This guide helps you to create a bing maps key and apply it in Map Suite. ​
  
  
-Basically, there are two types of bing maps key. One is Basic Key, and the other one is Bing Maps Enterprise Key. ( see pic1 below ) +Basically, there are two types of bing maps key. One is Basic Key, and the other one is Bing Maps Enterprise Key. ( see picture 1 below ) 
  
-{{:​bingmapkeys.png?​850|}} +{{:​bingmapkeys.png?​850|picture 1}}
-<​pic1>​+
  
  
-=== How to Create a Basic Key === 
  
-  ​- Go to [[https://​www.bingmapsportal.com/​|the Bing Maps Dev Center]].+=== How to Create a Basic Key ( Notice: This key is only for developing/​testing purpose. )  === 
 + 
 +  ​- Go to the [[https://​www.bingmapsportal.com/​|Bing Maps Dev Center]].
   - Log in with your Microsoft account. ( Note: If you do not have one, create one then log in. )    - Log in with your Microsoft account. ( Note: If you do not have one, create one then log in. ) 
   - Click My Account and select My keys.    - Click My Account and select My keys. 
Line 25: Line 25:
  
  
-=== How to use Bing Maps Key in Map Suite Desktop === +=== How to Use Bing Maps Key in Map Suite Desktop ​Edition ​===
  
 +The BingMapsTileOverlay will work after assigning your Bing Maps Key to the property BingMapsOverlay.ApplicationId. Here below is how to do that in a sample. ​
  
-  - Download [[source code link will be in here|Sample Source Code]] and open it in Visual Studio +  - Download [[source code link will be in here|Sample Source Code]] and open it in Visual Studio. 
-  - Open the app.config file. +  - Open MainWindow.xaml.cs and replace ​the value in the appropriate field. ( see the code sample below ) 
-  - Place the key to the appropriate field. (see pic2 above)+  - Restore NuGet Packages, build and run the sample. ​
  
-{{:​applybingkey.png?​850|}} 
-<​pic2>​ 
  
 === Code Usage === === Code Usage ===
Line 41: Line 39:
     BingMapsTileOverlay bingMapsOverlay = new BingMapsTileOverlay();​     BingMapsTileOverlay bingMapsOverlay = new BingMapsTileOverlay();​
     bingMapsOverlay.MapStyle = BingMapsMapType.AerialWithLabels;​     bingMapsOverlay.MapStyle = BingMapsMapType.AerialWithLabels;​
-    bingMapsOverlay.ApplicationId = System.Configuration.ConfigurationManager.AppSettings["BingMapKey"];+    bingMapsOverlay.ApplicationId = "Place Bing Maps Key Here";
     wpfMap1.Overlays.Add(bingMapsOverlay);​     wpfMap1.Overlays.Add(bingMapsOverlay);​
-    ​ 
-    // Set the BingMapsKey in app.config file.  
-    <​appSettings>​ 
-      <add key="​BingMapsKey"​ value="​Place Your Bing Maps Key Here" /> 
-    </​appSettings>​ 
  
 \\ \\
map_suite_desktop_for_wpf_how_to_use_bingmaps.txt · Last modified: 2018/03/30 21:30 by cloudhu