VEMap.LoadTraffic Method

You are not viewing the latest version of the AJAX control. Bing Maps AJAX V7 is the recommended JavaScript control for Bing Maps. If you need this documentation, it is available in as a CHM or PDF download.

Loads the traffic map.



Parameter Description


Whether to show the traffic flow

The traffic map is only available at zoom levels from 9 through 14, inclusively.

All use of traffic data is restricted to customers who have received explicit permission and instructions about traffic from Microsoft. For more information on terms for use of traffic, contact the Bing Maps Licensing Team.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

      <script type="text/javascript" src=""></script>

      <script type="text/javascript">
         var map = null;
         var Location = new VELatLong(47.64, -122.23);

         function GetMap()
            map = new VEMap('myMap');
            map.LoadMap(Location, 9);

         function ShowTraffic()
            map.SetTrafficLegendText("The traffic legend");

         function ClearTraffic()
   <body onload="GetMap();" style="font-family:Arial">
      <div id='myMap' style="position:relative; width:600px; height:400px;"></div>
      <input id="showtraffic"  type="button" value="Show Traffic"  onclick="ShowTraffic();"/>
      <input id="cleartraffic" type="button" value="Clear Traffic" onclick="ClearTraffic();"/>