0

如何删除 Bing 地图图例?

我不想要的

4

1 回答 1

2

If you are using the v7.0, you can hide the scalebar by setting the property showScalebar to false in the constructor of the map (in the mapOption parameter), see the MSDN:

http://msdn.microsoft.com/en-us/library/gg427603.aspx

And here is an example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
   <head>
      <title></title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

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

      <script type="text/javascript">

         function GetMap()
         {

            // Set the map and view options, setting the map style to Road and
            //    removing the user's ability to change the map style
            var mapOptions = {credentials:"Bing Maps Key",
                              height: 400,
                              width: 400,
                              showScalebar: false};

            // Initialize the map
            var map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), mapOptions); 

         }

      </script>
   </head>
   <body onload="GetMap();">
      <div id='mapDiv' style="position:relative;"></div>       
   </body>
</html>
于 2013-02-19T22:47:14.487 回答