TrafficManager Class
Collapse the table of content
Expand the table of content

TrafficManager Class

Bing
 

Contains methods that display traffic information on the map.

Name

Definition

Description

TrafficManager

TrafficManager(map: Map)

Initializes a new instance of the TrafficManager class.

Name

Definition

Return Value

Description

hide

hide()

None

Hides all traffic data.

hideFlow

hideFlow()

None

Hides the traffic flow layer.

hideIncidents

hideIncidents()

None

Hides all traffic incidents.

hideLegend

hideLengend()

None

Hides the traffic legend.

show

show()

None

Displays all traffic data.

showFlow

showFlow()

None

Displays the traffic flow layer.

showIncidents

showIncidents()

None

Displays all traffic incidents.

showLegend

showLengend()

None

Displays the traffic legend.

<!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">

      var map = null;

      function GetMap()
      {  

         map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), {credentials: Bing Maps 
Key", center: new 
Microsoft.Maps.Location(47.5, -122.3), zoom: 9 });

         Microsoft.Maps.loadModule('Microsoft.Maps.Traffic', { callback: trafficModuleLoaded });

      }


      function trafficModuleLoaded()
      {
         var trafficManager = new Microsoft.Maps.Traffic.TrafficManager(map);
         trafficManager.show();
      }



      </script>
   </head>
   <body onload="GetMap();">
      <div id='mapDiv' style="position:relative; width:600px; height:600px;"></div> 
   </body>
</html>
Show:
© 2016 Microsoft