traffic layer

Add a traffic layer to a map.

function initialize() {
  var myLatlng = new google.maps.LatLng(34.04924594193164, -118.24104309082031);
  var mapOptions = {
    zoom: 13,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }

  var map = new google.maps.Map(document.getElementById(\'map-canvas\'), mapOptions);

  var trafficLayer = new google.maps.TrafficLayer();
  trafficLayer.setMap(map);
}

google.maps.event.addDomListener(window, \'load\', initialize);