Using Microsoft Bing Maps


AspMap allows you to add a street or satellite map from Microsoft Bing Maps as a background layer of your Map control. 


Your use of the Microsoft Bing Maps API is subject to the terms of a legal agreement between you and Microsoft, corp.
Please read the MICROSOFT BING MAPS PLATFORM API TERMS OF USE for more information.


The following conditions take place when a BingMapsLayer object is added as a background layer:

  1. The coordinate system of the Map control will be set to PCS_PopularVisualisationMercator (this is the native coordinate system of Bing Maps);

  2. 19 zoom levels from Bing Maps will be added to the ZoomLevels collection of the Map control;

  3. The FullExtent property of the Map control will be set to the full extent of Bing Maps;

  4. You have to explicitly or implicitly (via a .prj file for your shapefiles) specify the coordinate system for each layer added to the Map control.


It is highly recommended to place the Map control inside an ASP.NET AJAX UpdatePanel to avoid initializing the Bing Maps engine on each postback.


The following sample code demonstrates how to add a satellite map from Bing Maps:

Imports AspMap
Imports AspMap.Web
Imports AspMap.Web.Extensions

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
' A Bing Maps API key can be obtained at

Dim bm As BingMapsLayer = New BingMapsLayer("<Bing Maps API key>")
bm.MapType = BingMapsType.Aerial
map.BackgroundLayer = bm

' set the transparency of the main map image to display other layers over the satellite map
map.ImageFormat = ImageFormat.Png
map.ImageOpacity = 0.4

End Sub

See the BingMapsApp.aspx sample in the AJAX samples.





© 2018 VDS Technologies
Converted from CHM to HTML with chm2web Standard 2.85 (unicode)