Traffic

The Traffic layer displays an overlay that is color coded to indicate the flow of traffic on the roads.

Traffic Layer

Set the visibility of the traffic layer.

myMap.on('load', function() {
  myMap.setTrafficVisibility(true);
});

Get the visibility of the traffic layer.

const trafficVisible = myMap.isTrafficVisible();

Toggle the visibility of the traffic layer.

myMap.toggleTrafficVisibility();
Last updated September 9, 2021.