Bing maps with custom WMS service asp.net

2.8k Views Asked by At

I looking for a way to use a custom WMS service with bingmaps api 7.0 but im unable to find any good tutorials about it.

I have a simple javascript demo that displays bing maps.

<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
      <script type="text/javascript">
          var map = null;

          function GetMap() {
              // Initialize the map and set the view to a specific location
              map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), {
                  credentials: "YOUR_BING_MAPS_KEY",
                  center: new Microsoft.Maps.Location(47.6, -122.3),
                  zoom: 11
              });
              Microsoft.Maps.loadModule('Microsoft.Maps.VenueMaps', { callback: function () {
                  venueMapFactory = new Microsoft.Maps.VenueMaps.VenueMapFactory(map);
                  venueMapFactory.create({ venueMapId: 'bingmapsteam-bellevuesquare',
                      success: function (vm, args) { venueMap = vm; venueMap.show(); map.setView(venueMap.bestMapView); }
                  });
              } 
              });
          }
      </script>

But if I want to use this Nasa map insted of bings current map

http://neowms.sci.gsfc.nasa.gov/wms/wms?version=1.3.0&service=WMS&request=GetCapabilities

How can do a simple web application in ASP.NET where i can use diffrent sources? Is this even possible or should I use Sharpmap, gmaps.net or something else insted? Can anybody point me in the right direction?

1

There are 1 best solutions below

0
On

You can find a tutorial on using a WMS layer in Bing Maps at: http://alastaira.wordpress.com/2011/01/07/accessing-a-wms-tile-server-from-bing-maps-v7/

It basically consists on adding a custom tile layer to the map, which is served by a ASP.NET Handler, containing all the logic to convert from the Bing Maps quadkeys to the WMS logic.

Then, to make the base map not appear by default you need to initialize your Bing Maps with the following option:

mapTypeId: Microsoft.Maps.MapTypeId.mercator

Then all that will be shown is your WMS layer.