TrafficLayer component renders a real-time traffic layer on the map, showing current traffic conditions with color-coded roads.
Import
Props
Configuration options for the traffic layer.
Callback invoked when the traffic layer instance is loaded and ready.Parameters:
trafficLayer: The Google Maps TrafficLayer instance
Callback invoked when the traffic layer is unmounted and removed from the map.Parameters:
trafficLayer: The Google Maps TrafficLayer instance being unmounted
Component Variants
This component is available in two variants:TrafficLayer- The default memoized componentTrafficLayerF- The functional component variant (same implementation)
Usage Example
Notes
- The traffic layer automatically updates to show real-time traffic conditions
- The component returns
nulland does not render any DOM elements - The traffic layer is automatically removed when the component unmounts