Skip to main content

Traffic

The Traffic layer displays an overlay that is color coded to indicate the flow of traffic on the roads. Traffic is only visible at zoom levels greater than 9. The higher the zoom level the more zoomed in you are on the map.

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 November 23, 2021.