With the Google Maps API V3 it’s very easy to make the built-in traffic overlay visible.
This is possible with the following code:
var options = {
zoom: myDefaultZoom,
center: new google.maps.LatLng(myLatitude, myLongitude),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById('map-container'), options);
var trafficLayer = new google.maps.TrafficLayer();
trafficLayer.setMap(map);
Too bad that there is no simple line of code to enable a built-in traffic toggle control (Buttons on the map are called controls). So I created the piece of code More >